use of org.apache.samza.serializers.IntegerSerde in project samza by apache.
the class TestRocksDbTableDescriptor method testRocksDbConfig.
@Test
public void testRocksDbConfig() {
Map tableConfig = new RocksDbTableDescriptor<Integer, String>(TABLE_ID, KVSerde.of(new IntegerSerde(), new StringSerde())).withBlockSize(1).withCacheSize(2).withCompactionStyle("fifo").withCompressionType("snappy").withMaxLogFileSize(3).withNumLogFilesToKeep(4).withNumWriteBuffers(5).withObjectCacheSize(6).withTtl(7).withWriteBatchSize(8).withWriteBufferSize(9).withMaxOpenFiles(10).withMaxFileOpeningThreads(11).withConfig("abc", "xyz").toConfig(createJobConfig());
Assert.assertEquals(16, tableConfig.size());
assertEquals("1", RocksDbTableDescriptor.ROCKSDB_BLOCK_SIZE_BYTES, tableConfig);
assertEquals("2", RocksDbTableDescriptor.CONTAINER_CACHE_SIZE_BYTES, tableConfig);
assertEquals("3", RocksDbTableDescriptor.ROCKSDB_MAX_LOG_FILE_SIZE_BYTES, tableConfig);
assertEquals("4", RocksDbTableDescriptor.ROCKSDB_KEEP_LOG_FILE_NUM, tableConfig);
assertEquals("5", RocksDbTableDescriptor.ROCKSDB_NUM_WRITE_BUFFERS, tableConfig);
assertEquals("6", RocksDbTableDescriptor.OBJECT_CACHE_SIZE, tableConfig);
assertEquals("7", RocksDbTableDescriptor.ROCKSDB_TTL_MS, tableConfig);
assertEquals("8", RocksDbTableDescriptor.WRITE_BATCH_SIZE, tableConfig);
assertEquals("9", RocksDbTableDescriptor.CONTAINER_WRITE_BUFFER_SIZE_BYTES, tableConfig);
assertEquals("10", RocksDbTableDescriptor.ROCKSDB_MAX_OPEN_FILES, tableConfig);
assertEquals("11", RocksDbTableDescriptor.ROCKSDB_MAX_FILE_OPENING_THREADS, tableConfig);
assertEquals("snappy", RocksDbTableDescriptor.ROCKSDB_COMPRESSION, tableConfig);
assertEquals("fifo", RocksDbTableDescriptor.ROCKSDB_COMPACTION_STYLE, tableConfig);
Assert.assertFalse(tableConfig.containsKey(String.format(StorageConfig.CHANGELOG_STREAM, TABLE_ID)));
Assert.assertFalse(tableConfig.containsKey(String.format(StorageConfig.CHANGELOG_REPLICATION_FACTOR, TABLE_ID)));
Assert.assertEquals("xyz", tableConfig.get("abc"));
}
use of org.apache.samza.serializers.IntegerSerde in project samza by apache.
the class TestExpandingInputDescriptor method testISDObjectsWithOverrides.
@Test
public void testISDObjectsWithOverrides() {
ExampleExpandingSystemDescriptor expandingSystem = new ExampleExpandingSystemDescriptor("expandingSystem");
IntegerSerde streamSerde = new IntegerSerde();
ExampleExpandingInputDescriptor<Long> expandingISD = expandingSystem.getInputDescriptor("input-stream", streamSerde);
assertEquals(streamSerde, expandingISD.getSerde());
assertEquals(expandingSystem.getTransformer().get(), expandingISD.getTransformer().get());
}
use of org.apache.samza.serializers.IntegerSerde in project samza by apache.
the class TestTransformingInputDescriptor method testISDObjectsWithOverrides.
@Test
public void testISDObjectsWithOverrides() {
ExampleTransformingSystemDescriptor imeTransformingSystem = new ExampleTransformingSystemDescriptor("imeTransformingSystem");
IntegerSerde streamSerde = new IntegerSerde();
ExampleTransformingInputDescriptor<Long> overridingISD = imeTransformingSystem.getInputDescriptor("input-stream", streamSerde);
assertEquals(streamSerde, overridingISD.getSerde());
assertEquals(imeTransformingSystem.getTransformer().get(), overridingISD.getTransformer().get());
}
use of org.apache.samza.serializers.IntegerSerde in project samza by apache.
the class TestTransformingInputDescriptor method testAPIUsage.
@Test
public void testAPIUsage() {
// does not assert anything, but acts as a compile-time check on expected descriptor type parameters
// and validates that the method calls can be chained.
ExampleTransformingSystemDescriptor imeTransformingSystem = new ExampleTransformingSystemDescriptor("imeTransformingSystem").withSystemConfigs(Collections.emptyMap());
ExampleTransformingInputDescriptor<Long> input1 = imeTransformingSystem.getInputDescriptor("input1", new IntegerSerde());
ExampleTransformingOutputDescriptor<Integer> output1 = imeTransformingSystem.getOutputDescriptor("output1", new IntegerSerde());
input1.shouldBootstrap().withOffsetDefault(SystemStreamMetadata.OffsetType.NEWEST).withPriority(1).shouldResetOffset().withStreamConfigs(Collections.emptyMap());
output1.withStreamConfigs(Collections.emptyMap());
}
use of org.apache.samza.serializers.IntegerSerde in project samza by apache.
the class TestGenericInputDescriptor method testAPIUsage.
@Test
public void testAPIUsage() {
// does not assert anything, but acts as a compile-time check on expected descriptor type parameters
// and validates that the method calls can be chained.
GenericSystemDescriptor mySystem = new GenericSystemDescriptor("input-system", "factory.class.name").withSystemConfigs(Collections.emptyMap()).withDefaultStreamConfigs(Collections.emptyMap());
GenericInputDescriptor<Integer> input1 = mySystem.getInputDescriptor("input1", new IntegerSerde());
GenericOutputDescriptor<Integer> output1 = mySystem.getOutputDescriptor("output1", new IntegerSerde());
input1.withPhysicalName("input-1").shouldBootstrap().withOffsetDefault(SystemStreamMetadata.OffsetType.NEWEST).withPriority(1).shouldResetOffset().isBounded().shouldDeleteCommittedMessages().withStreamConfigs(Collections.emptyMap());
output1.withPhysicalName("output-1").withStreamConfigs(Collections.emptyMap());
}
Aggregations