public static PersistentTimestampService create(ErrorCheckingTimestampBoundStore store) { return create(store, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }
@Override public TimestampService createTimestampService( KeyValueService rawKvs, Optional<TableReference> timestampTable, boolean initializeAsync) { if (initializeAsync) { log.warn("Asynchronous initialization not implemented, will initialize synchronousy."); } Preconditions.checkArgument(rawKvs instanceof ConnectionManagerAwareDbKvs, "DbAtlasDbFactory expects a raw kvs of type ConnectionManagerAwareDbKvs, found %s", rawKvs.getClass()); ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return PersistentTimestampServiceImpl.create(createTimestampBoundStore(timestampTable, dbkvs)); }
public static PersistentTimestampService create(TimestampBoundStore store) { return create(new ErrorCheckingTimestampBoundStore(store), AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }
public static PersistentTimestampService create(TimestampBoundStore store, boolean initializeAsync) { return create(new ErrorCheckingTimestampBoundStore(store), initializeAsync); }
@Override public TimestampService createTimestampService( KeyValueService rawKvs, Optional<TableReference> timestampTable, boolean initializeAsync) { Preconditions.checkArgument(!timestampTable.isPresent() || timestampTable.get().equals(AtlasDbConstants.TIMESTAMP_TABLE), "***ERROR:This can cause severe data corruption.***\nUnexpected timestamp table found: %s" + "\nThis can happen if you configure the timelock server to use Cassandra KVS for timestamp" + " persistence, which is unsupported.\nWe recommend using the default paxos timestamp" + " persistence. However, if you are need to persist the timestamp service state in the" + " database, please specify a valid DbKvs config in the timestampBoundPersister block." + "\nNote that if the service has already been running, you will have to migrate the timestamp" + " table to Postgres/Oracle and rename it to %s.", timestampTable.map(TableReference::getQualifiedName).orElse("unknown table"), AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE); AtlasDbVersion.ensureVersionReported(); Preconditions.checkArgument(rawKvs instanceof CassandraKeyValueService, "TimestampService must be created from an instance of" + " CassandraKeyValueService, found %s", rawKvs.getClass()); return PersistentTimestampServiceImpl.create( CassandraTimestampBoundStore.create((CassandraKeyValueService) rawKvs, initializeAsync), initializeAsync); }
@Override public TimestampService createTimestampService( KeyValueService rawKvs, Optional<TableReference> timestampTable, boolean initializeAsync) { if (initializeAsync) { log.warn("Asynchronous initialization not implemented, will initialize synchronousy."); } Preconditions.checkArgument(!timestampTable.isPresent() || timestampTable.get().equals(AtlasDbConstants.TIMESTAMP_TABLE), "***ERROR:This can cause severe data corruption.***\nUnexpected timestamp table found: " + timestampTable.map(TableReference::getQualifiedName).orElse("unknown table") + "\nThis can happen if you configure the timelock server to use JDBC KVS for timestamp" + " persistence, which is unsupported.\nWe recommend using the default paxos timestamp" + " persistence. However, if you are need to persist the timestamp service state in the" + " database, please specify a valid DbKvs config in the timestampBoundPersister block." + "\nNote that if the service has already been running, you will have to migrate the timestamp" + " table to Postgres/Oracle and rename it to %s.", AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE); AtlasDbVersion.ensureVersionReported(); return PersistentTimestampServiceImpl.create(JdbcTimestampBoundStore.create((JdbcKeyValueService) rawKvs)); } }
private PersistentTimestampService getSingletonTimestampService() { if (timestampBoundStore == null || persistentTimestampService == null) { timestampBoundStore = new InMemoryTimestampBoundStore(); persistentTimestampService = PersistentTimestampServiceImpl.create(timestampBoundStore); } return persistentTimestampService; }
private ManagedTimestampService createManagedPaxosTimestampService( PaxosProposer proposer, String client, List<PaxosAcceptor> acceptors, List<PaxosLearner> learners) { // TODO (jkong): live reload ping TimestampBoundStore boundStore = instrument(TimestampBoundStore.class, new PaxosTimestampBoundStore( proposer, paxosResource.getPaxosLearner(client), ImmutableList.copyOf(acceptors), ImmutableList.copyOf(learners), paxosRuntime.get().maximumWaitBeforeProposalMs()), client); PersistentTimestampService persistentTimestampService = PersistentTimestampServiceImpl.create(boundStore); return new DelegatingManagedTimestampService(persistentTimestampService, persistentTimestampService); }
public static PersistentTimestampService create(ErrorCheckingTimestampBoundStore store) { return create(store, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }
public static PersistentTimestampService create(TimestampBoundStore store) { return create(new ErrorCheckingTimestampBoundStore(store), AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }
public static PersistentTimestampService create(TimestampBoundStore store, boolean initializeAsync) { return create(new ErrorCheckingTimestampBoundStore(store), initializeAsync); }
@Override public TimestampService createTimestampService( KeyValueService rawKvs, Optional<TableReference> timestampTable, boolean initializeAsync) { if (initializeAsync) { log.warn("Asynchronous initialization not implemented, will initialize synchronousy."); } Preconditions.checkArgument(rawKvs instanceof ConnectionManagerAwareDbKvs, "DbAtlasDbFactory expects a raw kvs of type ConnectionManagerAwareDbKvs, found %s", rawKvs.getClass()); ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return PersistentTimestampServiceImpl.create(createTimestampBoundStore(timestampTable, dbkvs)); }
@Override public TimestampService createTimestampService( KeyValueService rawKvs, Optional<TableReference> timestampTable, boolean initializeAsync) { Preconditions.checkArgument(!timestampTable.isPresent() || timestampTable.get().equals(AtlasDbConstants.TIMESTAMP_TABLE), "***ERROR:This can cause severe data corruption.***\nUnexpected timestamp table found: %s" + "\nThis can happen if you configure the timelock server to use Cassandra KVS for timestamp" + " persistence, which is unsupported.\nWe recommend using the default paxos timestamp" + " persistence. However, if you are need to persist the timestamp service state in the" + " database, please specify a valid DbKvs config in the timestampBoundPersister block." + "\nNote that if the service has already been running, you will have to migrate the timestamp" + " table to Postgres/Oracle and rename it to %s.", timestampTable.map(TableReference::getQualifiedName).orElse("unknown table"), AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE); AtlasDbVersion.ensureVersionReported(); Preconditions.checkArgument(rawKvs instanceof CassandraKeyValueService, "TimestampService must be created from an instance of" + " CassandraKeyValueService, found %s", rawKvs.getClass()); return PersistentTimestampServiceImpl.create( CassandraTimestampBoundStore.create((CassandraKeyValueService) rawKvs, initializeAsync), initializeAsync); }