@Override @NotNull public String getInstanceId() { return clusterable.getInstanceId(); }
@Override @Nullable public String getVisibilityToken() { return clusterable.getVisibilityToken(); }
@Override public boolean isVisible(@NotNull String visibilityToken, long maxWaitMillis) throws InterruptedException { return clusterable.isVisible(visibilityToken, maxWaitMillis); } }
/** * convenience method wrapping logic around {@link AtomicReference} * * @return */ private String getInstanceId() { Clusterable c = clusterSupplier.get(); if (c == null) { return null; } else { return c.getInstanceId(); } }
/** * convenience method wrapping logic around {@link AtomicReference} * * @return */ private String getInstanceId() { Clusterable c = clusterSupplier.get(); if (c == null) { return null; } else { return c.getInstanceId(); } }
/** * convenience method wrapping logic around {@link AtomicReference} * * @return */ private String getInstanceId() { Clusterable c = clusterSupplier.get(); if (c == null) { return null; } else { return c.getInstanceId(); } }
public void migrate() throws IOException, CommitFailedException { if (isTargetInitialized()) { LOG.info("The target is already initialized, no need to copy the seed mount"); } else if (targetNodeStore instanceof Clusterable) { Clusterable dns = (Clusterable) targetNodeStore; String clusterId = dns.getInstanceId(); LOG.info("The target isn't initialized and the cluster id = {}.", clusterId); if (CLUSTER_ID.equals(clusterId)) { LOG.info("This cluster id {} is configured to initialized the repository.", CLUSTER_ID); doMigrate(); } else { LOG.info("Waiting until the repository is initialized by instance {}.", CLUSTER_ID); waitForInitialization(); } } else { LOG.info("Initializing the default mount."); doMigrate(); } }
p = builder.getProperty(PREFIX_PROP_REVISION + CLUSTER_1.getInstanceId()); assertNotNull(p); assertEquals(1, p.getValue(LONG).longValue()); p = builder.getProperty(PREFIX_PROP_COUNTER + CLUSTER_1.getInstanceId()); assertNotNull(p); assertEquals(1, p.getValue(LONG).longValue()); assertCounterNodeState( builder, ImmutableSet.of(PREFIX_PROP_COUNTER + CLUSTER_1.getInstanceId(), PREFIX_PROP_REVISION + CLUSTER_1.getInstanceId()), 1);
p = builder.getProperty(PREFIX_PROP_REVISION + CLUSTER_1.getInstanceId()); assertNotNull(p); assertEquals(1, p.getValue(LONG).longValue()); p = builder.getProperty(PREFIX_PROP_COUNTER + CLUSTER_1.getInstanceId()); assertNotNull(p); assertEquals(1, p.getValue(LONG).longValue()); assertCounterNodeState( builder, ImmutableSet.of(PREFIX_PROP_COUNTER + CLUSTER_1.getInstanceId(), PREFIX_PROP_REVISION + CLUSTER_1.getInstanceId()), 1);