Source:
public void start() throws ReplicationException { try { for (String mountPath : partitionGroupedByMountPath.keySet()) { readFromFileAndPersist(mountPath); } logger.info("Number of intra DC replica threads: " + replicationConfig.replicationNumOfIntraDCReplicaThreads); logger.info("Number of intra DC nodes to replicate from: " + replicasToReplicateIntraDC.size()); assignReplicasToThreads(replicasToReplicateIntraDC, replicationConfig.replicationNumOfIntraDCReplicaThreads, replicationIntraDCThreads, "Intra DC"); logger.info("Number of inter DC replica threads: " + replicationConfig.replicationNumOfInterDCReplicaThreads); logger.info("Number of inter DC nodes to replicate from: " + replicasToReplicateInterDC.size()); assignReplicasToThreads(replicasToReplicateInterDC, replicationConfig.replicationNumOfInterDCReplicaThreads, replicationInterDCThreads, "Inter DC"); for (ReplicaThread thread : replicationIntraDCThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting intra DC replica thread " + thread.getName()); replicaThread.start(); } for (ReplicaThread thread : replicationInterDCThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting inter DC replica thread " + thread.getName()); replicaThread.start(); } this.scheduler.schedule("replica token persistor", persistor, replicationConfig.replicationTokenFlushDelaySeconds, replicationConfig.replicationTokenFlushIntervalSeconds, TimeUnit.SECONDS); } catch (IOException e) { logger.error("IO error while starting replication"); } }

Target:
public void start() throws ReplicationException { try { for (String mountPath : partitionGroupedByMountPath.keySet()) { readFromFileAndPersistIfNecessary(mountPath); } logger.info("Number of intra DC replica threads: " + replicationConfig.replicationNumOfIntraDCReplicaThreads); logger.info("Number of intra DC nodes to replicate from: " + replicasToReplicateIntraDC.size()); assignReplicasToThreads(replicasToReplicateIntraDC, replicationConfig.replicationNumOfIntraDCReplicaThreads, replicationIntraDCThreads, "Intra DC"); logger.info("Number of inter DC replica threads: " + replicationConfig.replicationNumOfInterDCReplicaThreads); logger.info("Number of inter DC nodes to replicate from: " + replicasToReplicateInterDC.size()); assignReplicasToThreads(replicasToReplicateInterDC, replicationConfig.replicationNumOfInterDCReplicaThreads, replicationInterDCThreads, "Inter DC"); for (ReplicaThread thread : replicationIntraDCThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting intra DC replica thread " + thread.getName()); replicaThread.start(); } for (ReplicaThread thread : replicationInterDCThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting inter DC replica thread " + thread.getName()); replicaThread.start(); } this.scheduler.schedule("replica token persistor", persistor, replicationConfig.replicationTokenFlushDelaySeconds, replicationConfig.replicationTokenFlushIntervalSeconds, TimeUnit.SECONDS); } catch (IOException e) { logger.error("IO error while starting replication"); } }