use of org.apache.samza.config.MapConfig in project samza by apache.
the class TestBaseTableDescriptor method testCustomConfig.
@Test
public void testCustomConfig() {
Map tableConfig = createTableDescriptor(TABLE_ID).withConfig("abc", "xyz").toConfig(new MapConfig());
Assert.assertEquals(2, tableConfig.size());
Assert.assertEquals("xyz", tableConfig.get("abc"));
}
use of org.apache.samza.config.MapConfig in project samza by apache.
the class TestBaseTableDescriptor method testProviderFactoryConfig.
@Test
public void testProviderFactoryConfig() {
Map tableConfig = createTableDescriptor(TABLE_ID).toConfig(new MapConfig());
Assert.assertEquals(1, tableConfig.size());
assertEquals("my.factory", "provider.factory", TABLE_ID, tableConfig);
}
use of org.apache.samza.config.MapConfig in project samza by apache.
the class TestRemoteTableDescriptor method testReadWriteRateLimitToConfig.
@Test
public void testReadWriteRateLimitToConfig() {
Map<String, String> tableConfig = new RemoteTableDescriptor("1").withReadFunction(createMockTableReadFunction()).withReadRetryPolicy(new TableRetryPolicy()).withWriteRateLimit(1000).withReadRateLimit(2000).toConfig(new MapConfig());
Assert.assertEquals(String.valueOf(2000), tableConfig.get("tables.1.io.read.credits"));
Assert.assertEquals(String.valueOf(1000), tableConfig.get("tables.1.io.write.credits"));
}
use of org.apache.samza.config.MapConfig in project samza by apache.
the class TestRemoteTableDescriptor method testSerializeNullReadFunction.
@Test(expected = IllegalArgumentException.class)
public void testSerializeNullReadFunction() {
RemoteTableDescriptor desc = new RemoteTableDescriptor("1");
Map<String, String> tableConfig = desc.toConfig(new MapConfig());
Assert.assertTrue(tableConfig.containsKey(RemoteTableDescriptor.READ_FN));
}
use of org.apache.samza.config.MapConfig in project samza by apache.
the class TestRemoteTableDescriptor method testTablePartToConfigDefault.
@Test
public void testTablePartToConfigDefault() {
TableReadFunction readFn = createMockTableReadFunction();
when(readFn.toConfig(any(), any())).thenReturn(createConfigPair(1));
Map<String, String> tableConfig = new RemoteTableDescriptor("1").withReadFunction(readFn).withReadRateLimit(100).toConfig(new MapConfig());
verify(readFn, times(1)).toConfig(any(), any());
Assert.assertEquals("v1", tableConfig.get("tables.1.io.read.func.k1"));
}
Aggregations