use of org.apache.pulsar.common.naming.TopicName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method resetCursorAsync.
@Override
public CompletableFuture<Void> resetCursorAsync(String topic, String subName, long timestamp) {
TopicName tn = validateTopic(topic);
String encodedSubName = Codec.encode(subName);
WebTarget path = topicPath(tn, "subscription", encodedSubName, "resetcursor", String.valueOf(timestamp));
return asyncPostRequest(path, Entity.entity("", MediaType.APPLICATION_JSON));
}
use of org.apache.pulsar.common.naming.TopicName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method skipAllMessagesAsync.
@Override
public CompletableFuture<Void> skipAllMessagesAsync(String topic, String subName) {
TopicName tn = validateTopic(topic);
String encodedSubName = Codec.encode(subName);
WebTarget path = topicPath(tn, "subscription", encodedSubName, "skip_all");
return asyncPostRequest(path, Entity.entity("", MediaType.APPLICATION_JSON));
}
use of org.apache.pulsar.common.naming.TopicName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method resetCursor.
@Override
public void resetCursor(String topic, String subName, long timestamp) throws PulsarAdminException {
try {
TopicName tn = validateTopic(topic);
String encodedSubName = Codec.encode(subName);
WebTarget path = topicPath(tn, "subscription", encodedSubName, "resetcursor", String.valueOf(timestamp));
request(path).post(Entity.entity("", MediaType.APPLICATION_JSON), ErrorData.class);
} catch (Exception e) {
throw getApiException(e);
}
}
use of org.apache.pulsar.common.naming.TopicName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method resetCursorAsync.
@Override
public CompletableFuture<Void> resetCursorAsync(String topic, String subName, MessageId messageId) {
TopicName tn = validateTopic(topic);
String encodedSubName = Codec.encode(subName);
final WebTarget path = topicPath(tn, "subscription", encodedSubName, "resetcursor");
return asyncPostRequest(path, Entity.entity(messageId, MediaType.APPLICATION_JSON));
}
use of org.apache.pulsar.common.naming.TopicName in project incubator-pulsar by apache.
the class PersistentTopicsImpl method createPartitionedTopicAsync.
@Override
public CompletableFuture<Void> createPartitionedTopicAsync(String topic, int numPartitions) {
checkArgument(numPartitions > 1, "Number of partitions should be more than 1");
TopicName tn = validateTopic(topic);
WebTarget path = topicPath(tn, "partitions");
return asyncPutRequest(path, Entity.entity(numPartitions, MediaType.APPLICATION_JSON));
}
Aggregations