Search in sources :

Example 11 with ColumnMetadataDescription

use of com.palantir.atlasdb.table.description.ColumnMetadataDescription 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 12 with ColumnMetadataDescription

use of com.palantir.atlasdb.table.description.ColumnMetadataDescription 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 13 with ColumnMetadataDescription

use of com.palantir.atlasdb.table.description.ColumnMetadataDescription 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

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