@Test(groups = {"unit"}) public void shouldGetCurrentMicros() throws Exception { AtomicLong numSameMs = new AtomicLong(); for (int i = 0; i < 2000; i++) { long timeOne = CqlStructuredDataSupport.getCurrentMicros(); long timeTwo = CqlStructuredDataSupport.getCurrentMicros(); assertTrue(timeOne < timeTwo); if ((timeOne / 1000L) == (timeTwo / 1000L)) { numSameMs.incrementAndGet(); } } System.out.println("number of times ms resolution conflict resolved=" + numSameMs.get()); }
public static long getCurrentMicros() { Optional<Long> currentMicros; do { currentMicros = tryGetCurrentMicros(); } while (!currentMicros.isPresent()); return currentMicros.get(); }
CqlStructuredDataSupport implements StructuredDataSupport<K> { public static long getCurrentMicros() { Optional<Long> currentMicros; do { currentMicros = tryGetCurrentMicros(); } while (!currentMicros.isPresent()); return currentMicros.get(); } }
CqlStructuredDataSupport implements StructuredDataSupport<K> { public static long getCurrentMicros() { Optional<Long> currentMicros; do { currentMicros = tryGetCurrentMicros(); } while (!currentMicros.isPresent()); return currentMicros.get(); } CqlStructuredDataSupport(String tableName, ConsistencyLevel defaultConsistencyLevel, Session session);  CqlStructuredDataSupport(String tableName,
                                    String partitionKeyColumnName,
                                    String pathColumnName,
                                    String valueColumnName,
                                    ConsistencyLevel defaultConsistencyLevel,
                                    Session session); }
CqlStructuredDataSupport implements StructuredDataSupport<K> { public static long getCurrentMicros() { Optional<Long> currentMicros; do { currentMicros = tryGetCurrentMicros(); } while (!currentMicros.isPresent()); return currentMicros.get(); } CqlStructuredDataSupport(String tableName, ConsistencyLevel defaultConsistencyLevel, Session session);  CqlStructuredDataSupport(String tableName,
                                    String partitionKeyColumnName,
                                    String pathColumnName,
                                    String valueColumnName,
                                    ConsistencyLevel defaultConsistencyLevel,
                                    Session session); @Override BatchContext beginBatch(); @Override void applyBatch(BatchContext batchContext); @Override T readFromPath(K rowKey, Path path, TypeReference<T> type); @Override void writeToPath(K rowKey, Path path, Object value); @Override void writeToPath(K rowKey,
                            Path path,
                            Object structuredValue,
                            BatchContext batchContext); @Override void deletePath(K rowKey, Path path); @Override void deletePath(K rowKey, Path path, BatchContext batchContext); @Override Path createPath(String... elements); static long getCurrentMicros(); }
CqlStructuredDataSupport implements StructuredDataSupport<K> { public static long getCurrentMicros() { Optional<Long> currentMicros; do { currentMicros = tryGetCurrentMicros(); } while (!currentMicros.isPresent()); return currentMicros.get(); } CqlStructuredDataSupport(String tableName, ConsistencyLevel defaultConsistencyLevel, Session session);  CqlStructuredDataSupport(String tableName,
                                    String partitionKeyColumnName,
                                    String pathColumnName,
                                    String valueColumnName,
                                    ConsistencyLevel defaultConsistencyLevel,
                                    Session session); @Override BatchContext beginBatch(); @Override void applyBatch(BatchContext batchContext); @Override T readFromPath(K rowKey, Path path, TypeReference<T> type); @Override void writeToPath(K rowKey, Path path, Object value); @Override void writeToPath(K rowKey,
                            Path path,
                            Object structuredValue,
                            BatchContext batchContext); @Override void deletePath(K rowKey, Path path); @Override void deletePath(K rowKey, Path path, BatchContext batchContext); @Override Path createPath(String... elements); static long getCurrentMicros();  }