Search in sources :

Example 1 with BacklogQuotaType

use of com.yahoo.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType in project pulsar by yahoo.

the class AdminApiTest method backlogQuotas.

@Test
public void backlogQuotas() throws Exception {
    assertEquals(admin.namespaces().getBacklogQuotaMap("prop-xyz/use/ns1"), Maps.newTreeMap());
    Map<BacklogQuotaType, BacklogQuota> quotaMap = admin.namespaces().getBacklogQuotaMap("prop-xyz/use/ns1");
    assertEquals(quotaMap.size(), 0);
    assertEquals(quotaMap.get(BacklogQuotaType.destination_storage), null);
    admin.namespaces().setBacklogQuota("prop-xyz/use/ns1", new BacklogQuota(1 * 1024 * 1024 * 1024, RetentionPolicy.producer_exception));
    quotaMap = admin.namespaces().getBacklogQuotaMap("prop-xyz/use/ns1");
    assertEquals(quotaMap.size(), 1);
    assertEquals(quotaMap.get(BacklogQuotaType.destination_storage), new BacklogQuota(1 * 1024 * 1024 * 1024, RetentionPolicy.producer_exception));
    admin.namespaces().removeBacklogQuota("prop-xyz/use/ns1");
    quotaMap = admin.namespaces().getBacklogQuotaMap("prop-xyz/use/ns1");
    assertEquals(quotaMap.size(), 0);
    assertEquals(quotaMap.get(BacklogQuotaType.destination_storage), null);
}
Also used : BacklogQuotaType(com.yahoo.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType) BacklogQuota(com.yahoo.pulsar.common.policies.data.BacklogQuota) Test(org.testng.annotations.Test) MockedPulsarServiceBaseTest(com.yahoo.pulsar.broker.auth.MockedPulsarServiceBaseTest)

Aggregations

MockedPulsarServiceBaseTest (com.yahoo.pulsar.broker.auth.MockedPulsarServiceBaseTest)1 BacklogQuota (com.yahoo.pulsar.common.policies.data.BacklogQuota)1 BacklogQuotaType (com.yahoo.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType)1 Test (org.testng.annotations.Test)1