use of com.palantir.atlasdb.table.description.Schema in project atlasdb by palantir.
the class TransactionManagersInitializer method tryInitialize.
@Override
@Idempotent
public synchronized void tryInitialize() {
TransactionTables.createTables(keyValueService);
for (Schema schema : schemas) {
Schemas.createTablesAndIndexes(schema, keyValueService);
schemaMetadataService.putSchemaMetadata(schema.getName(), schema.getSchemaMetadata());
}
// Prime the key value service with logging information.
// TODO (jkong): Needs to be changed if/when we support dynamic table creation.
LoggingArgs.hydrate(keyValueService.getMetadataForTables());
}
use of com.palantir.atlasdb.table.description.Schema in project atlasdb by palantir.
the class BenchmarksSchema method generateSchema.
private static Schema generateSchema() {
Schema schema = new Schema("Benchmarks", BenchmarksSchema.class.getPackage().getName() + ".generated", NAMESPACE, OptionalType.JAVA8);
createTables(schema);
schema.validate();
return schema;
}
use of com.palantir.atlasdb.table.description.Schema in project atlasdb by palantir.
the class KeyValueServiceModule method provideWrappedKeyValueService.
@Provides
@Singleton
@Named("kvs")
public KeyValueService provideWrappedKeyValueService(@Named("rawKvs") KeyValueService rawKvs, TimestampService tss, ServicesConfig config) {
KvsProfilingLogger.setSlowLogThresholdMillis(config.atlasDbConfig().getKvsSlowLogThresholdMillis());
KeyValueService kvs = ProfilingKeyValueService.create(rawKvs);
kvs = TracingKeyValueService.create(kvs);
kvs = AtlasDbMetrics.instrument(KeyValueService.class, kvs);
kvs = ValidatingQueryRewritingKeyValueService.create(kvs);
SweepConfig sweepConfig = config.atlasDbRuntimeConfig().sweep();
kvs = SweepStatsKeyValueService.create(kvs, tss, sweepConfig::writeThreshold, sweepConfig::writeSizeThreshold);
TransactionTables.createTables(kvs);
ImmutableSet<Schema> schemas = ImmutableSet.<Schema>builder().add(SweepSchema.INSTANCE.getLatestSchema()).add(CompactSchema.INSTANCE.getLatestSchema()).addAll(config.schemas()).build();
for (Schema schema : schemas) {
Schemas.createTablesAndIndexes(schema, kvs);
}
return kvs;
}
use of com.palantir.atlasdb.table.description.Schema in project atlasdb by palantir.
the class TodoSchema method generateSchema.
private static Schema generateSchema() {
Schema schema = new Schema(TodoSchema.class.getSimpleName(), TodoSchema.class.getPackage().getName() + ".generated", Namespace.DEFAULT_NAMESPACE, OptionalType.JAVA8);
schema.addTableDefinition(TODO_TABLE, new TableDefinition() {
{
rowName();
rowComponent("id", ValueType.FIXED_LONG);
columns();
column(TEXT_COLUMN, "t", ValueType.STRING);
}
});
return schema;
}
use of com.palantir.atlasdb.table.description.Schema in project atlasdb by palantir.
the class StreamTestSchema method generateSchema.
private static Schema generateSchema() {
Schema schema = new Schema("StreamTest", StreamTestSchema.class.getPackage().getName() + ".generated", Namespace.DEFAULT_NAMESPACE, OptionalType.JAVA8);
schema.addTableDefinition("blobs", new TableDefinition() {
{
javaTableName("KeyValue");
rangeScanAllowed();
rowName();
rowComponent("key", ValueType.STRING);
columns();
column("streamId", "s", ValueType.VAR_LONG);
}
});
schema.addStreamStoreDefinition(new StreamStoreDefinitionBuilder("blob", "Value", ValueType.VAR_LONG).inMemoryThreshold(1024 * 1024).tableNameLogSafety(TableMetadataPersistence.LogSafety.SAFE).build());
return schema;
}
Aggregations