Search in sources :

Example 6 with TableRetryPolicy

use of org.apache.samza.table.retry.TableRetryPolicy in project samza by apache.

the class TestRemoteTableDescriptor method testTableRetryPolicyToConfig.

@Test
public void testTableRetryPolicyToConfig() {
    Map<String, String> tableConfig = new RemoteTableDescriptor("1").withReadFunction(createMockTableReadFunction()).withReadRetryPolicy(new TableRetryPolicy()).withRateLimiterDisabled().toConfig(new MapConfig());
    Assert.assertEquals(tableConfig.get("tables.1.io.read.retry.policy.TableRetryPolicy"), "{\"exponentialFactor\":0.0,\"backoffType\":\"NONE\",\"retryPredicate\":{}}");
}
Also used : TableRetryPolicy(org.apache.samza.table.retry.TableRetryPolicy) RemoteTableDescriptor(org.apache.samza.table.descriptors.RemoteTableDescriptor) Mockito.anyString(org.mockito.Mockito.anyString) MapConfig(org.apache.samza.config.MapConfig) Test(org.junit.Test)

Aggregations

TableRetryPolicy (org.apache.samza.table.retry.TableRetryPolicy)6 RemoteTableDescriptor (org.apache.samza.table.descriptors.RemoteTableDescriptor)5 MapConfig (org.apache.samza.config.MapConfig)4 Test (org.junit.Test)4 Mockito.anyString (org.mockito.Mockito.anyString)4 RateLimiter (org.apache.samza.util.RateLimiter)3 Map (java.util.Map)2 ExecutorService (java.util.concurrent.ExecutorService)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)2 JavaTableConfig (org.apache.samza.config.JavaTableConfig)2 TablePart (org.apache.samza.table.remote.TablePart)2 TableRateLimiter (org.apache.samza.table.remote.TableRateLimiter)2 CreditFunction (org.apache.samza.table.remote.TableRateLimiter.CreditFunction)2 TableReadFunction (org.apache.samza.table.remote.TableReadFunction)2 TableWriteFunction (org.apache.samza.table.remote.TableWriteFunction)2 EmbeddedTaggedRateLimiter (org.apache.samza.util.EmbeddedTaggedRateLimiter)2 Preconditions (com.google.common.base.Preconditions)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1