protected ConnectionAddressProvider createConnectionAddressProvider(final PreparedComponentsFromL2Connection connComp) { final ConnectionInfoConfig connectionInfoItem = connComp.createConnectionInfoConfigItem(); final ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); final ConnectionAddressProvider cap = new ConnectionAddressProvider(connectionInfo); return cap; }
protected ConnectionAddressProvider createConnectionAddressProvider(final PreparedComponentsFromL2Connection connComp) { final ConnectionInfoConfig connectionInfoItem = connComp.createConnectionInfoConfigItem(); final ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); final ConnectionAddressProvider cap = new ConnectionAddressProvider(connectionInfo); return cap; }
protected ConnectionAddressProvider createConnectionAddressProvider(final PreparedComponentsFromL2Connection connComp) { final ConnectionInfoConfig connectionInfoItem = connComp.createConnectionInfoConfigItem(); final ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); final ConnectionAddressProvider cap = new ConnectionAddressProvider(connectionInfo); return cap; }
private boolean isImmediate() { // XXX: Race condition here --> we can start the non-immediate shutdown procedure becuase we think the channel is // open, but it can die before we start (or in the middle of) flushing the local work if (channel.isConnected()) { return false; } // If we've connected to a persistent server, we should try to flush if (handshakeManager.serverIsPersistent()) { return false; } // If we think there is more than one server out there, we should try to flush ConnectionInfoConfig connectionInfoItem = this.connectionComponents.createConnectionInfoConfigItem(); ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); return connectionInfo.length == 1; }
public static ObjectCreationStrategy getObjectCreationStrategy( PreparedComponentsFromL2Connection connectionComponents, OrderedGroupIDs groupIDs, ClientIDProvider cidProvider) { ConnectionInfoConfig[] groupConfigItems = connectionComponents.createConnectionInfoConfigItemByGroup(); Map serverGroups = new HashMap<String, GroupID>(); for (ConnectionInfoConfig groupConfigItem : groupConfigItems) { ConnectionInfo[] connectionInfo = groupConfigItem.getConnectionInfos(); serverGroups.put(connectionInfo[0].getGroupName(), new GroupID(connectionInfo[0].getGroupId())); } if (creationStrategy.toLowerCase().equals("round-robin")) { return new RoundRobinObjectCreationStrategy(groupIDs.getGroupIDs(), cidProvider); } else if (creationStrategy.toLowerCase().equals("group-affinity")) { return new GroupAffinityObjectCreationStrategy(serverGroups); } else { throw new AssertionError("UnSupported Object Creation Strategy - " + creationStrategy + " : Allowed : round-robin/group-affinity"); } }
private boolean isImmediate() { // XXX: Race condition here --> we can start the non-immediate shutdown procedure becuase we think the channel is // open, but it can die before we start (or in the middle of) flushing the local work if (channel.isConnected()) { return false; } // If we've connected to a persistent server, we should try to flush if (handshakeManager.serverIsPersistent()) { return false; } // If we think there is more than one server out there, we should try to flush ConnectionInfoConfig connectionInfoItem = this.connectionComponents.createConnectionInfoConfigItem(); ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); return connectionInfo.length == 1; }
private boolean isImmediate() { // XXX: Race condition here --> we can start the non-immediate shutdown procedure becuase we think the channel is // open, but it can die before we start (or in the middle of) flushing the local work if (channel.isConnected()) { return false; } // If we've connected to a persistent server, we should try to flush if (handshakeManager.serverIsPersistent()) { return false; } // If we think there is more than one server out there, we should try to flush ConnectionInfoConfig connectionInfoItem = this.connectionComponents.createConnectionInfoConfigItem(); ConnectionInfo[] connectionInfo = connectionInfoItem.getConnectionInfos(); return connectionInfo.length == 1; }
public static ObjectCreationStrategy getObjectCreationStrategy( PreparedComponentsFromL2Connection connectionComponents, OrderedGroupIDs groupIDs, ClientIDProvider cidProvider) { ConnectionInfoConfig[] groupConfigItems = connectionComponents.createConnectionInfoConfigItemByGroup(); Map serverGroups = new HashMap<String, GroupID>(); for (ConnectionInfoConfig groupConfigItem : groupConfigItems) { ConnectionInfo[] connectionInfo = groupConfigItem.getConnectionInfos(); serverGroups.put(connectionInfo[0].getGroupName(), new GroupID(connectionInfo[0].getGroupId())); } if (creationStrategy.toLowerCase().equals("round-robin")) { return new RoundRobinObjectCreationStrategy(groupIDs.getGroupIDs(), cidProvider); } else if (creationStrategy.toLowerCase().equals("group-affinity")) { return new GroupAffinityObjectCreationStrategy(serverGroups); } else { throw new AssertionError("UnSupported Object Creation Strategy - " + creationStrategy + " : Allowed : round-robin/group-affinity"); } }
private static ConnectionInfo[] getConnectionsFromL1Config(final L1ConfigurationSetupManager configSetupManager) { L2Data[] l2s = null; // synchronized here as same issue of MNK-1984. ArrayIndexOutOfBoundsException in multi threaded environment due to // apache bug https://issues.apache.org/jira/browse/XMLBEANS-328 synchronized (configSetupManager) { l2s = configSetupManager.l2Config().l2Data(); } // clean groupID which is supported to get from L2. for (L2Data l2 : l2s) { l2.setGroupId(0); } ConnectionInfoConfig connectInfo = new ConnectionInfoConfig(l2s, configSetupManager.getSecurityInfo()); return connectInfo.getConnectionInfos(); }
private static ConnectionInfo[] getConnectionsFromL1Config(final L1ConfigurationSetupManager configSetupManager) { L2Data[] l2s = null; // synchronized here as same issue of MNK-1984. ArrayIndexOutOfBoundsException in multi threaded environment due to // apache bug https://issues.apache.org/jira/browse/XMLBEANS-328 synchronized (configSetupManager) { l2s = configSetupManager.l2Config().l2Data(); } // clean groupID which is supported to get from L2. for (L2Data l2 : l2s) { l2.setGroupId(0); } ConnectionInfoConfig connectInfo = new ConnectionInfoConfig(l2s, configSetupManager.getSecurityInfo()); return connectInfo.getConnectionInfos(); }
private static ConnectionInfo[] getConnectionsFromL1Config(final L1ConfigurationSetupManager configSetupManager) { L2Data[] l2s = null; // synchronized here as same issue of MNK-1984. ArrayIndexOutOfBoundsException in multi threaded environment due to // apache bug https://issues.apache.org/jira/browse/XMLBEANS-328 synchronized (configSetupManager) { l2s = configSetupManager.l2Config().l2Data(); } // clean groupID which is supported to get from L2. for (L2Data l2 : l2s) { l2.setGroupId(0); } ConnectionInfoConfig connectInfo = new ConnectionInfoConfig(l2s, configSetupManager.getSecurityInfo()); return connectInfo.getConnectionInfos(); }
HashSet<ConnectionInfo> connInfoFromL1 = new HashSet<ConnectionInfo>(); for (int i = 0; i < connectionInfoItems.length; i++) { ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); for (int j = 0; j < connectionInfo.length; j++) { ConnectionInfo connectionIn = new ConnectionInfo(getIpAddressOfServer(connectionInfo[j].getHostname()),
HashSet<ConnectionInfo> connInfoFromL1 = new HashSet<ConnectionInfo>(); for (int i = 0; i < connectionInfoItems.length; i++) { ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); for (int j = 0; j < connectionInfo.length; j++) { ConnectionInfo connectionIn = new ConnectionInfo(getIpAddressOfServer(connectionInfo[j].getHostname()),
HashSet<ConnectionInfo> connInfoFromL1 = new HashSet<ConnectionInfo>(); for (int i = 0; i < connectionInfoItems.length; i++) { ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); for (int j = 0; j < connectionInfo.length; j++) { ConnectionInfo connectionIn = new ConnectionInfo(getIpAddressOfServer(connectionInfo[j].getHostname()),
@Override public void reloadConfiguration() throws ConfigurationSetupException { L1ConfigurationSetupManager newConfig = getClientConfigHelper().reloadServersConfiguration(); PreparedComponentsFromL2Connection connComp = new PreparedComponentsFromL2Connection(newConfig, securityManager); ConnectionInfoConfig[] connectionInfoItems = connComp.createConnectionInfoConfigItemByGroup(); ConnectionAddressProvider[] addrProviders = new ConnectionAddressProvider[connectionInfoItems.length]; for (int i = 0; i < connectionInfoItems.length; ++i) { ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); addrProviders[i] = new ConnectionAddressProvider(connectionInfo); } getClientConfigHelper().validateGroupInfo(securityManager); for (ClusterTopologyChangedListener listener : listeners) { listener.serversUpdated(addrProviders); } }
@Override public void reloadConfiguration() throws ConfigurationSetupException { L1ConfigurationSetupManager newConfig = getClientConfigHelper().reloadServersConfiguration(); PreparedComponentsFromL2Connection connComp = new PreparedComponentsFromL2Connection(newConfig, securityManager); ConnectionInfoConfig[] connectionInfoItems = connComp.createConnectionInfoConfigItemByGroup(); ConnectionAddressProvider[] addrProviders = new ConnectionAddressProvider[connectionInfoItems.length]; for (int i = 0; i < connectionInfoItems.length; ++i) { ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); addrProviders[i] = new ConnectionAddressProvider(connectionInfo); } getClientConfigHelper().validateGroupInfo(securityManager); for (ClusterTopologyChangedListener listener : listeners) { listener.serversUpdated(addrProviders); } }
@Override public DSOClientMessageChannel createDSOClientMessageChannel(final CommunicationsManager commMgr, final PreparedComponentsFromL2Connection connComp, final SessionProvider sessionProvider, final int maxReconnectTries, final int socketConnectTimeout, final TCClient client) { final ConnectionInfoConfig[] connectionInfoItems = connComp.createConnectionInfoConfigItemByGroup(); final ConnectionAddressProvider[] addrProviders = new ConnectionAddressProvider[connectionInfoItems.length]; for (int i = 0; i < connectionInfoItems.length; ++i) { final ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); addrProviders[i] = new ConnectionAddressProvider(connectionInfo); client.addServerConfigurationChangedListeners(addrProviders[i]); } this.clientGroupMessageChannel = this.clientGroupCommunicationsManager .createClientGroupChannel(sessionProvider, maxReconnectTries, socketConnectTimeout, addrProviders); initialize(this.clientGroupMessageChannel.getCoordinatorGroupID(), this.clientGroupMessageChannel.getOrderedGroupIDs()); return new DSOClientGroupMessageChannelImpl(this.clientGroupMessageChannel, this.clientGroupMessageChannel .getOrderedGroupIDs().getGroupIDs()); }
ConnectionInfoConfig[] connectionInfoItems = connectionComponents.createConnectionInfoConfigItemByGroup(); for (int stripeNumber = 0; stripeNumber < connectionInfoItems.length; stripeNumber++) { ConnectionInfo[] connectionInfo = connectionInfoItems[stripeNumber].getConnectionInfos(); boolean foundCompactibleActive = false; boolean activeDown = false;
ConnectionInfoConfig[] connectionInfoItems = connectionComponents.createConnectionInfoConfigItemByGroup(); for (int stripeNumber = 0; stripeNumber < connectionInfoItems.length; stripeNumber++) { ConnectionInfo[] connectionInfo = connectionInfoItems[stripeNumber].getConnectionInfos(); boolean foundCompatibleActive = false; boolean activeDown = false;
@Override public DSOClientMessageChannel createDSOClientMessageChannel(final CommunicationsManager commMgr, final PreparedComponentsFromL2Connection connComp, final SessionProvider sessionProvider, final int maxReconnectTries, final int socketConnectTimeout, final TCClient client) { final ConnectionInfoConfig[] connectionInfoItems = connComp.createConnectionInfoConfigItemByGroup(); final ConnectionAddressProvider[] addrProviders = new ConnectionAddressProvider[connectionInfoItems.length]; for (int i = 0; i < connectionInfoItems.length; ++i) { final ConnectionInfo[] connectionInfo = connectionInfoItems[i].getConnectionInfos(); addrProviders[i] = new ConnectionAddressProvider(connectionInfo); client.addServerConfigurationChangedListeners(addrProviders[i]); } this.clientGroupMessageChannel = this.clientGroupCommunicationsManager .createClientGroupChannel(sessionProvider, maxReconnectTries, socketConnectTimeout, addrProviders); initialize(this.clientGroupMessageChannel.getCoordinatorGroupID(), this.clientGroupMessageChannel.getOrderedGroupIDs()); return new DSOClientGroupMessageChannelImpl(this.clientGroupMessageChannel, this.clientGroupMessageChannel .getOrderedGroupIDs().getGroupIDs()); }