Search in sources :

Example 1 with StreamTestWithHashStreamMetadataRow

use of com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow in project atlasdb by palantir.

the class StreamTest method getStreamMetadata.

private StreamMetadata getStreamMetadata(long id) {
    return txManager.runTaskReadOnly(t -> {
        StreamTestWithHashStreamMetadataTable table = StreamTestTableFactory.of().getStreamTestWithHashStreamMetadataTable(t);
        StreamTestWithHashStreamMetadataRow row = StreamTestWithHashStreamMetadataRow.of(id);
        return table.getRow(row).get().getMetadata();
    });
}
Also used : StreamTestWithHashStreamMetadataTable(com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable) StreamTestWithHashStreamMetadataRow(com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow)

Example 2 with StreamTestWithHashStreamMetadataRow

use of com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow in project atlasdb by palantir.

the class StreamTest method testStreamStoreWithHashMetadataRowPersistToBytesAndHydrateSucceeds.

@Test
public void testStreamStoreWithHashMetadataRowPersistToBytesAndHydrateSucceeds() {
    StreamTestWithHashStreamMetadataRow row = StreamTestWithHashStreamMetadataRow.of(5L);
    byte[] persistedRow = row.persistToBytes();
    StreamTestWithHashStreamMetadataRow hydratedRow = StreamTestWithHashStreamMetadataRow.BYTES_HYDRATOR.hydrateFromBytes(persistedRow);
    assertEquals(row, hydratedRow);
}
Also used : StreamTestWithHashStreamMetadataRow(com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow) Test(org.junit.Test)

Aggregations

StreamTestWithHashStreamMetadataRow (com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow)2 StreamTestWithHashStreamMetadataTable (com.palantir.atlasdb.schema.stream.generated.StreamTestWithHashStreamMetadataTable)1 Test (org.junit.Test)1