@Override void testSetup(CassandraKeyValueService kvs) { kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_1, PtBytes.toBytes("old_value")), TIMESTAMP - 1); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_1, CONTENTS), TIMESTAMP); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_2, CONTENTS), TIMESTAMP); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_2_1, CONTENTS), TIMESTAMP); }
@Override void testSetup(CassandraKeyValueService kvs) { kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_1, PtBytes.toBytes("old_value")), TIMESTAMP - 1); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_1, CONTENTS), TIMESTAMP); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_1_2, CONTENTS), TIMESTAMP); kvs.put(TEST_TABLE, ImmutableMap.of(CELL_2_1, CONTENTS), TIMESTAMP); }
@Test public void canPut() { getTestKvs().put(TEST_TABLE, ImmutableMap.of(CELL_1_1, CONTENTS), TIMESTAMP); assertLatestValueInCell(CELL_1_1, VALUE); }
@Test public void putThrows() { assertThrowsAtlasDbDependencyExceptionAndDoesNotChangeCassandraSchema(() -> getTestKvs().put(TEST_TABLE, ImmutableMap.of(CELL_1_1, CONTENTS), TIMESTAMP)); }
private void setupTwoReadableBoundsInKv() { backupRunner.backupExistingTimestamp(); byte[] rowAndColumnNameBytes = PtBytes.toBytes(CassandraTimestampUtils.ROW_AND_COLUMN_NAME); kv.put(AtlasDbConstants.TIMESTAMP_TABLE, ImmutableMap.of(Cell.create(rowAndColumnNameBytes, rowAndColumnNameBytes), PtBytes.toBytes(0L)), Long.MAX_VALUE - 1); } }