for (Hint task : tasks) {
counterHints.updateCounterWithFlush();
SynchronizingStorageEngine store =
storeRegistry.get(task.getHintKey().
getStoreName());
SyncMessage bsm = getMessage(store);
KeyedValues kv =
TProtocolUtil.
getTKeyedValues(task.getHintKey().getKey(),
task.getValues());
bsm.getSyncValue().addToValues(kv);
}
Iterable<Node> nodes = getClusterConfig().getNodes();
short localDomainId =
getClusterConfig().getNode().getDomainId();
short localNodeId =
getClusterConfig().getNode().getNodeId();
for (Node n : nodes) {
if (localNodeId == n.getNodeId())
continue;
for (SyncMessage bsm : messages.values()) {
SyncValueMessage svm = bsm.getSyncValue();
if (svm.getStore().getScope().
equals(org.sdnplatform.sync.thrift.
Scope.LOCAL) &&
n.getDomainId() != localDomainId) {
// This message is only for local domain
continue;
}
svm.getHeader().
setTransactionId(rpcService.
getTransactionId());
counterSentValues.updateCounterWithFlush(bsm.getSyncValue().
getValuesSize());
rpcService.writeToNode(n.getNodeId(), bsm);
}
}
tasks.clear();