Skip to content

Commit

Permalink
0000870: Do not attempt to route data if a node does not have an iden…
Browse files Browse the repository at this point in the history
…tity
  • Loading branch information
chenson42 committed Oct 23, 2012
1 parent 92749f4 commit e756f0d
Showing 1 changed file with 19 additions and 17 deletions.
Expand Up @@ -136,23 +136,25 @@ public synchronized void stop() {
*/
synchronized public long routeData(boolean force) {
long dataCount = -1l;
if (force || engine.getClusterService().lock(ClusterConstants.ROUTE)) {
try {
engine.getOutgoingBatchService().updateAbandonedRoutingBatches();
insertInitialLoadEvents();
long ts = System.currentTimeMillis();
IDataToRouteGapDetector gapDetector = new DataGapDetector(engine.getDataService(),
parameterService, symmetricDialect, this);
gapDetector.beforeRouting();
dataCount = routeDataForEachChannel();
gapDetector.afterRouting();
ts = System.currentTimeMillis() - ts;
if (dataCount > 0 || ts > Constants.LONG_OPERATION_THRESHOLD) {
log.info("Routed {} data events in {} ms", dataCount, ts);
}
} finally {
if (!force) {
engine.getClusterService().unlock(ClusterConstants.ROUTE);
if (engine.getNodeService().findIdentity() != null) {
if (force || engine.getClusterService().lock(ClusterConstants.ROUTE)) {
try {
engine.getOutgoingBatchService().updateAbandonedRoutingBatches();
insertInitialLoadEvents();
long ts = System.currentTimeMillis();
IDataToRouteGapDetector gapDetector = new DataGapDetector(
engine.getDataService(), parameterService, symmetricDialect, this);
gapDetector.beforeRouting();
dataCount = routeDataForEachChannel();
gapDetector.afterRouting();
ts = System.currentTimeMillis() - ts;
if (dataCount > 0 || ts > Constants.LONG_OPERATION_THRESHOLD) {
log.info("Routed {} data events in {} ms", dataCount, ts);
}
} finally {
if (!force) {
engine.getClusterService().unlock(ClusterConstants.ROUTE);
}
}
}
}
Expand Down

0 comments on commit e756f0d

Please sign in to comment.