use of org.apache.pulsar.common.policies.data.OffloadedReadPriority in project pulsar by apache.
the class AdminApiOffloadTest method testOffloadPolicies.
@Test
public void testOffloadPolicies() throws Exception {
String namespaceName = "prop-xyz/ns1";
String driver = "aws-s3";
String region = "test-region";
String bucket = "test-bucket";
String endpoint = "test-endpoint";
long offloadThresholdInBytes = 0;
long offloadDeletionLagInMillis = 100L;
OffloadedReadPriority priority = OffloadedReadPriority.TIERED_STORAGE_FIRST;
OffloadPolicies offload1 = OffloadPoliciesImpl.create(driver, region, bucket, endpoint, null, null, null, null, 100, 100, offloadThresholdInBytes, offloadDeletionLagInMillis, priority);
admin.namespaces().setOffloadPolicies(namespaceName, offload1);
OffloadPolicies offload2 = admin.namespaces().getOffloadPolicies(namespaceName);
assertEquals(offload1, offload2);
admin.namespaces().removeOffloadPolicies(namespaceName);
OffloadPolicies offload3 = admin.namespaces().getOffloadPolicies(namespaceName);
assertNull(offload3);
}
Aggregations