Search in sources :

Example 36 with TableReference

use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.

the class StreamTableTypeTest method isStreamStoreValueTableReturnsFalseForOtherStreamStoreTableTypes.

@Test
public void isStreamStoreValueTableReturnsFalseForOtherStreamStoreTableTypes() {
    List<StreamTableType> streamTypes = Lists.newArrayList(StreamTableType.METADATA, StreamTableType.INDEX, StreamTableType.HASH);
    for (StreamTableType streamType : streamTypes) {
        String tableName = streamType.getTableName(TEST_TABLE);
        TableReference tableReference = TableReference.create(TEST_NAMESPACE, tableName);
        assertFalse(StreamTableType.isStreamStoreValueTable(tableReference));
    }
}
Also used : TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) Test(org.junit.Test)

Example 37 with TableReference

use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.

the class StreamTableTypeTest method isStreamStoreValueTableReturnsTrueForTableWithNamespace.

@Test
public void isStreamStoreValueTableReturnsTrueForTableWithNamespace() {
    String tableName = StreamTableType.VALUE.getTableName(TEST_TABLE);
    TableReference tableReference = TableReference.create(TEST_NAMESPACE, tableName);
    assertTrue(StreamTableType.isStreamStoreValueTable(tableReference));
}
Also used : TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) Test(org.junit.Test)

Example 38 with TableReference

use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.

the class StreamTableTypeTest method isStreamStoreValueTableReturnsFalseForTestTable.

@Test
public void isStreamStoreValueTableReturnsFalseForTestTable() {
    TableReference tableReference = TableReference.createWithEmptyNamespace(TEST_TABLE);
    assertFalse(StreamTableType.isStreamStoreValueTable(tableReference));
}
Also used : TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) Test(org.junit.Test)

Example 39 with TableReference

use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.

the class SchemaTest method testLongTableNameLengthFailsNamespace.

@Test
public void testLongTableNameLengthFailsNamespace() throws IOException {
    // If namespace is non-empty, internal table name length is |namespace| + |tableName| + 2
    Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.DEFAULT_NAMESPACE);
    String longTableName = String.join("", Collections.nCopies(40, "x"));
    TableReference tableRef = TableReference.create(Namespace.DEFAULT_NAMESPACE, longTableName);
    List<CharacterLimitType> kvsList = new ArrayList<CharacterLimitType>();
    kvsList.add(CharacterLimitType.CASSANDRA);
    assertThatThrownBy(() -> schema.addTableDefinition(longTableName, getSimpleTableDefinition(tableRef))).isInstanceOf(IllegalArgumentException.class).hasMessage(getErrorMessage(longTableName, kvsList));
}
Also used : TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) ArrayList(java.util.ArrayList) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 40 with TableReference

use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.

the class SchemaTest method testLongTableNameLengthFailsBoth.

@Test
public void testLongTableNameLengthFailsBoth() throws IOException {
    Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE);
    String longTableName = String.join("", Collections.nCopies(1000, "x"));
    TableReference tableRef = TableReference.createWithEmptyNamespace(longTableName);
    List<CharacterLimitType> kvsList = new ArrayList<CharacterLimitType>();
    kvsList.add(CharacterLimitType.CASSANDRA);
    kvsList.add(CharacterLimitType.POSTGRES);
    assertThatThrownBy(() -> schema.addTableDefinition(longTableName, getSimpleTableDefinition(tableRef))).isInstanceOf(IllegalArgumentException.class).hasMessage(getErrorMessage(longTableName, kvsList));
}
Also used : TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) ArrayList(java.util.ArrayList) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

TableReference (com.palantir.atlasdb.keyvalue.api.TableReference)112 Cell (com.palantir.atlasdb.keyvalue.api.Cell)41 Test (org.junit.Test)41 Map (java.util.Map)17 ImmutableMap (com.google.common.collect.ImmutableMap)13 Multimap (com.google.common.collect.Multimap)13 Entry (java.util.Map.Entry)13 Set (java.util.Set)13 RowResult (com.palantir.atlasdb.keyvalue.api.RowResult)12 Value (com.palantir.atlasdb.keyvalue.api.Value)12 Collection (java.util.Collection)12 List (java.util.List)12 ImmutableSet (com.google.common.collect.ImmutableSet)11 KeyValueService (com.palantir.atlasdb.keyvalue.api.KeyValueService)11 RangeRequest (com.palantir.atlasdb.keyvalue.api.RangeRequest)11 SortedMap (java.util.SortedMap)11 Lists (com.google.common.collect.Lists)10 AtlasDbConstants (com.palantir.atlasdb.AtlasDbConstants)10 Sets (com.google.common.collect.Sets)9 InsufficientConsistencyException (com.palantir.atlasdb.keyvalue.api.InsufficientConsistencyException)9