Search in sources :

Example 1 with OffloadProcessStatus

use of org.apache.pulsar.client.admin.OffloadProcessStatus in project pulsar by apache.

the class TopicsImpl method offloadStatusAsync.

@Override
public CompletableFuture<OffloadProcessStatus> offloadStatusAsync(String topic) {
    TopicName tn = validateTopic(topic);
    WebTarget path = topicPath(tn, "offload");
    final CompletableFuture<OffloadProcessStatus> future = new CompletableFuture<>();
    asyncGetRequest(path, new InvocationCallback<OffloadProcessStatus>() {

        @Override
        public void completed(OffloadProcessStatus offloadProcessStatus) {
            future.complete(offloadProcessStatus);
        }

        @Override
        public void failed(Throwable throwable) {
            future.completeExceptionally(getApiException(throwable.getCause()));
        }
    });
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) WebTarget(javax.ws.rs.client.WebTarget) OffloadProcessStatus(org.apache.pulsar.client.admin.OffloadProcessStatus) TopicName(org.apache.pulsar.common.naming.TopicName)

Example 2 with OffloadProcessStatus

use of org.apache.pulsar.client.admin.OffloadProcessStatus in project incubator-pulsar by apache.

the class TopicsImpl method offloadStatusAsync.

@Override
public CompletableFuture<OffloadProcessStatus> offloadStatusAsync(String topic) {
    TopicName tn = validateTopic(topic);
    WebTarget path = topicPath(tn, "offload");
    final CompletableFuture<OffloadProcessStatus> future = new CompletableFuture<>();
    asyncGetRequest(path, new InvocationCallback<OffloadProcessStatus>() {

        @Override
        public void completed(OffloadProcessStatus offloadProcessStatus) {
            future.complete(offloadProcessStatus);
        }

        @Override
        public void failed(Throwable throwable) {
            future.completeExceptionally(getApiException(throwable.getCause()));
        }
    });
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) WebTarget(javax.ws.rs.client.WebTarget) OffloadProcessStatus(org.apache.pulsar.client.admin.OffloadProcessStatus) TopicName(org.apache.pulsar.common.naming.TopicName)

Example 3 with OffloadProcessStatus

use of org.apache.pulsar.client.admin.OffloadProcessStatus in project pulsar by yahoo.

the class TopicsImpl method offloadStatusAsync.

@Override
public CompletableFuture<OffloadProcessStatus> offloadStatusAsync(String topic) {
    TopicName tn = validateTopic(topic);
    WebTarget path = topicPath(tn, "offload");
    final CompletableFuture<OffloadProcessStatus> future = new CompletableFuture<>();
    asyncGetRequest(path, new InvocationCallback<OffloadProcessStatus>() {

        @Override
        public void completed(OffloadProcessStatus offloadProcessStatus) {
            future.complete(offloadProcessStatus);
        }

        @Override
        public void failed(Throwable throwable) {
            future.completeExceptionally(getApiException(throwable.getCause()));
        }
    });
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) WebTarget(javax.ws.rs.client.WebTarget) OffloadProcessStatus(org.apache.pulsar.client.admin.OffloadProcessStatus) TopicName(org.apache.pulsar.common.naming.TopicName)

Aggregations

CompletableFuture (java.util.concurrent.CompletableFuture)3 WebTarget (javax.ws.rs.client.WebTarget)3 OffloadProcessStatus (org.apache.pulsar.client.admin.OffloadProcessStatus)3 TopicName (org.apache.pulsar.common.naming.TopicName)3