if (node.getStatus() == ODistributedServerNodeRemote.STATUS.CONNECTED)
node.sendConfiguration(iDatabaseName);
}
// UPDATE ALL THE CLIENTS
OChannelBinary ch;
for (OClientConnection c : OClientConnectionManager.instance().getConnections()) {
if (c.protocol.getChannel() instanceof OChannelBinary) {
ch = (OChannelBinary) c.protocol.getChannel();
OLogManager.instance().info(this, "Sending distributed configuration for database '%s' to the connected client %s...",
iDatabaseName, ch.socket.getRemoteSocketAddress());
try {
ch.acquireExclusiveLock();
try {
ch.writeByte(OChannelBinaryProtocol.PUSH_DATA);
ch.writeInt(Integer.MIN_VALUE);
ch.writeByte(OChannelDistributedProtocol.PUSH_DISTRIBUTED_CONFIG);
ch.writeBytes(clusterDbConfigurations.get(iDatabaseName).toStream());
} catch (IOException e) {
e.printStackTrace();
} finally {
ch.releaseExclusiveLock();
}
} catch (InterruptedException e1) {
OLogManager.instance().warn(this, "[broadcastClusterConfiguration] Timeout on sending configuration to remote node %s",
ch.socket.getRemoteSocketAddress());
}