@Test(timeout = (RETRY_INTERVAL_MILLIS) - 1) public void testSyncedFromStart() throws UnknownHostException { givenLocalStateOrder(currentEndpointState); givenRemoteStateOrder(currentEndpointState); assertThat(schemaHelper.areSchemasAligned(10 * RETRY_INTERVAL_MILLIS)).isTrue(); }
boolean areSchemasAligned(long schemaAlignmentDelayMillis) { LOG.info("Waiting for schema to align in cluster"); int delayMillis = 0; while (areLiveNodesWaitingOnSchemaUpdate()) { if (delayMillis >= schemaAlignmentDelayMillis) { return false; } delayMillis += retryIntervalMillis; try { Thread.sleep(retryIntervalMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } return true; }
SchemaHelper { boolean areSchemasAligned(long schemaAlignmentDelayMillis) { LOG.info("Waiting for schema to align in cluster"); int delayMillis = 0; while (areLiveNodesWaitingOnSchemaUpdate()) { if (delayMillis >= schemaAlignmentDelayMillis) { return false; } delayMillis += retryIntervalMillis; try { Thread.sleep(retryIntervalMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } return true; } }
SchemaHelper { boolean areSchemasAligned(long schemaAlignmentDelayMillis) { LOG.info("Waiting for schema to align in cluster"); int delayMillis = 0; while (areLiveNodesWaitingOnSchemaUpdate()) { if (delayMillis >= schemaAlignmentDelayMillis) { return false; } delayMillis += retryIntervalMillis; try { Thread.sleep(retryIntervalMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } return true; } SchemaHelper(); @VisibleForTesting  SchemaHelper(InetAddress localAddress, Gossiper gossiper, long retryIntervalMillis); }
SchemaHelper { boolean areSchemasAligned(long schemaAlignmentDelayMillis) { LOG.info("Waiting for schema to align in cluster"); int delayMillis = 0; while (areLiveNodesWaitingOnSchemaUpdate()) { if (delayMillis >= schemaAlignmentDelayMillis) { return false; } delayMillis += retryIntervalMillis; try { Thread.sleep(retryIntervalMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } return true; } SchemaHelper(); @VisibleForTesting  SchemaHelper(InetAddress localAddress, Gossiper gossiper, long retryIntervalMillis);  }
SchemaHelper { boolean areSchemasAligned(long schemaAlignmentDelayMillis) { LOG.info("Waiting for schema to align in cluster"); int delayMillis = 0; while (areLiveNodesWaitingOnSchemaUpdate()) { if (delayMillis >= schemaAlignmentDelayMillis) { return false; } delayMillis += retryIntervalMillis; try { Thread.sleep(retryIntervalMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } return true; } SchemaHelper(); @VisibleForTesting  SchemaHelper(InetAddress localAddress, Gossiper gossiper, long retryIntervalMillis);   }