/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using UDP discovery to lookup cluster */ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration groupConfiguration) { this(new Topology(null), useHA, groupConfiguration, null); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
/** * Create a ServerLocatorImpl using a static list of live servers * * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); if (useHA) { // We only set the owner at where the Topology was created. // For that reason we can't set it at the main constructor topology.setOwner(this); } }
@Test public void testReceiveNotificationsWhenOtherNodesAreStartedAndStopped() throws Throwable { startServers(0); ServerLocator locator = createHAServerLocator(); locator.getTopology().setOwner("testReceive"); final List<String> nodes = Collections.synchronizedList(new ArrayList<String>()); final CountDownLatch upLatch = new CountDownLatch(5); final CountDownLatch downLatch = new CountDownLatch(4); locator.addClusterTopologyListener(new LatchListener(upLatch, nodes, downLatch)); ClientSessionFactory sf = createSessionFactory(locator); startServers(1, 4, 3, 2); String[] nodeIDs = getNodeIDs(0, 1, 2, 3, 4); Assert.assertTrue("Was not notified that all servers are UP", upLatch.await(10, SECONDS)); checkContains(new int[]{0, 1, 4, 3, 2}, nodeIDs, nodes); waitForClusterConnections(0, 4); waitForClusterConnections(1, 4); waitForClusterConnections(2, 4); waitForClusterConnections(3, 4); waitForClusterConnections(4, 4); stopServers(2, 3, 1, 4); Assert.assertTrue("Was not notified that all servers are DOWN", downLatch.await(10, SECONDS)); checkContains(new int[]{0}, nodeIDs, nodes); sf.close(); locator.close(); stopServers(0); }
topology.setOwner("testMultipleFailovers");