Search in sources :

Example 6 with NameMetadataDescription

use of com.palantir.atlasdb.table.description.NameMetadataDescription in project atlasdb by palantir.

the class TableMetadataDeserializer method deserializeDynamicCol.

private ColumnMetadataDescription deserializeDynamicCol(JsonNode node) {
    NameMetadataDescription col = deserializeRowish(node.get("column"));
    ColumnValueDescription val = deserializeValue(node.get("value"));
    DynamicColumnDescription dynamicCol = new DynamicColumnDescription(col, val);
    return new ColumnMetadataDescription(dynamicCol);
}
Also used : NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) DynamicColumnDescription(com.palantir.atlasdb.table.description.DynamicColumnDescription) ColumnValueDescription(com.palantir.atlasdb.table.description.ColumnValueDescription)

Example 7 with NameMetadataDescription

use of com.palantir.atlasdb.table.description.NameMetadataDescription in project atlasdb by palantir.

the class TransactionTestSetup method setUp.

@Before
public void setUp() throws Exception {
    lockService = LockServiceImpl.create(LockServerOptions.builder().isStandaloneServer(false).build());
    lockClient = LockClient.of("test_client");
    keyValueService = getKeyValueService();
    keyValueService.createTables(ImmutableMap.of(TEST_TABLE_THOROUGH, new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.RETRY_ON_WRITE_WRITE, TableMetadataPersistence.CachePriority.WARM, true, 4, true, TableMetadataPersistence.SweepStrategy.THOROUGH, false, TableMetadataPersistence.LogSafety.UNSAFE).persistToBytes(), TEST_TABLE, new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.RETRY_ON_WRITE_WRITE, TableMetadataPersistence.CachePriority.WARM, true, 4, true, TableMetadataPersistence.SweepStrategy.NOTHING, false, TableMetadataPersistence.LogSafety.UNSAFE).persistToBytes(), TransactionConstants.TRANSACTION_TABLE, TransactionConstants.TRANSACTION_TABLE_METADATA.persistToBytes()));
    keyValueService.truncateTables(ImmutableSet.of(TEST_TABLE, TransactionConstants.TRANSACTION_TABLE));
    timestampService = new InMemoryTimestampService();
    transactionService = TransactionServices.createTransactionService(keyValueService);
    conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService);
    sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);
    txMgr = getManager();
}
Also used : TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) Before(org.junit.Before)

Example 8 with NameMetadataDescription

use of com.palantir.atlasdb.table.description.NameMetadataDescription in project atlasdb by palantir.

the class OneNodeDownMetadataTest method putMetadataForTablesThrows.

@Test
public void putMetadataForTablesThrows() {
    TableMetadata newTableMetadata = new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.IGNORE_ALL);
    assertThatThrownBy(() -> OneNodeDownTestSuite.kvs.putMetadataForTables(ImmutableMap.of(OneNodeDownTestSuite.TEST_TABLE, newTableMetadata.persistToBytes()))).isExactlyInstanceOf(AtlasDbDependencyException.class).hasCauseInstanceOf(IllegalStateException.class).hasStackTraceContaining("At schema version UNREACHABLE");
    canGetMetadataForTable();
}
Also used : TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) Test(org.junit.Test)

Example 9 with NameMetadataDescription

use of com.palantir.atlasdb.table.description.NameMetadataDescription in project atlasdb by palantir.

the class OneNodeDownMetadataTest method putMetadataForTableThrows.

@Test
public void putMetadataForTableThrows() {
    TableMetadata newTableMetadata = new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.IGNORE_ALL);
    assertThatThrownBy(() -> OneNodeDownTestSuite.kvs.putMetadataForTable(OneNodeDownTestSuite.TEST_TABLE, newTableMetadata.persistToBytes())).isExactlyInstanceOf(AtlasDbDependencyException.class).hasCauseInstanceOf(IllegalStateException.class).hasStackTraceContaining("At schema version UNREACHABLE");
    canGetMetadataForTable();
}
Also used : TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) Test(org.junit.Test)

Aggregations

NameMetadataDescription (com.palantir.atlasdb.table.description.NameMetadataDescription)9 ColumnMetadataDescription (com.palantir.atlasdb.table.description.ColumnMetadataDescription)7 TableMetadata (com.palantir.atlasdb.table.description.TableMetadata)5 DynamicColumnDescription (com.palantir.atlasdb.table.description.DynamicColumnDescription)3 NamedColumnDescription (com.palantir.atlasdb.table.description.NamedColumnDescription)3 Test (org.junit.Test)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 TableReference (com.palantir.atlasdb.keyvalue.api.TableReference)1 ColumnValueDescription (com.palantir.atlasdb.table.description.ColumnValueDescription)1 NameComponentDescription (com.palantir.atlasdb.table.description.NameComponentDescription)1 InMemoryTimestampService (com.palantir.timestamp.InMemoryTimestampService)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1