public class NonPersistentTopicsImpl extends BaseResource implements NonPersistentTopics
auth, readTimeoutMs| Constructor and Description |
|---|
NonPersistentTopicsImpl(javax.ws.rs.client.WebTarget web,
org.apache.pulsar.client.api.Authentication auth,
long readTimeoutMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
createPartitionedTopic(String topic,
int numPartitions)
Create a partitioned topic.
|
CompletableFuture<Void> |
createPartitionedTopicAsync(String topic,
int numPartitions)
Create a partitioned topic asynchronously.
|
org.apache.pulsar.common.policies.data.PersistentTopicInternalStats |
getInternalStats(String topic)
Get the internal stats for the topic.
|
CompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats> |
getInternalStatsAsync(String topic)
Get the internal stats for the topic asynchronously.
|
List<String> |
getList(String namespace)
Get list of topics exist into given namespace.
|
CompletableFuture<List<String>> |
getListAsync(String namespace)
Get list of topics exist into given namespace asynchronously.
|
List<String> |
getListInBundle(String namespace,
String bundleRange)
Get list of topics exist into given bundle.
|
CompletableFuture<List<String>> |
getListInBundleAsync(String namespace,
String bundleRange)
Get list of topics exist into given bundle asynchronously.
|
org.apache.pulsar.common.partition.PartitionedTopicMetadata |
getPartitionedTopicMetadata(String topic)
Get metadata of a partitioned topic.
|
CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> |
getPartitionedTopicMetadataAsync(String topic)
Get metadata of a partitioned topic asynchronously.
|
org.apache.pulsar.common.policies.data.NonPersistentTopicStats |
getStats(String topic)
Get the stats for the topic.
|
CompletableFuture<org.apache.pulsar.common.policies.data.NonPersistentTopicStats> |
getStatsAsync(String topic)
Get the stats for the topic asynchronously.
|
void |
unload(String topic)
Unload a topic.
|
CompletableFuture<Void> |
unloadAsync(String topic)
Unload a topic asynchronously.
|
asyncDeleteRequest, asyncGetRequest, asyncPostRequest, asyncPutRequest, getApiException, getApiException, request, requestAsyncpublic NonPersistentTopicsImpl(javax.ws.rs.client.WebTarget web,
org.apache.pulsar.client.api.Authentication auth,
long readTimeoutMs)
public void createPartitionedTopic(String topic, int numPartitions) throws PulsarAdminException
NonPersistentTopicscreatePartitionedTopic in interface NonPersistentTopicstopic - Topic namenumPartitions - Number of partitions to create of the topicPulsarAdminExceptionpublic CompletableFuture<Void> createPartitionedTopicAsync(String topic, int numPartitions)
NonPersistentTopicscreatePartitionedTopicAsync in interface NonPersistentTopicstopic - Topic namenumPartitions - Number of partitions to create of the topicpublic org.apache.pulsar.common.partition.PartitionedTopicMetadata getPartitionedTopicMetadata(String topic) throws PulsarAdminException
NonPersistentTopicsgetPartitionedTopicMetadata in interface NonPersistentTopicstopic - Topic namePulsarAdminExceptionpublic CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadataAsync(String topic)
NonPersistentTopicsgetPartitionedTopicMetadataAsync in interface NonPersistentTopicstopic - Topic namepublic org.apache.pulsar.common.policies.data.NonPersistentTopicStats getStats(String topic) throws PulsarAdminException
NonPersistentTopics
{
"msgRateIn" : 100.0, // Total rate of messages published on the topic. msg/s
"msgThroughputIn" : 10240.0, // Total throughput of messages published on the topic. byte/s
"msgRateOut" : 100.0, // Total rate of messages delivered on the topic. msg/s
"msgThroughputOut" : 10240.0, // Total throughput of messages delivered on the topic. byte/s
"averageMsgSize" : 1024.0, // Average size of published messages. bytes
"publishers" : [ // List of publishes on this topic with their stats
{
"producerId" : 10 // producer id
"address" : 10.4.1.23:3425 // IP and port for this producer
"connectedSince" : 2014-11-21 23:54:46 // Timestamp of this published connection
"msgRateIn" : 100.0, // Total rate of messages published by this producer. msg/s
"msgThroughputIn" : 10240.0, // Total throughput of messages published by this producer. byte/s
"averageMsgSize" : 1024.0, // Average size of published messages by this producer. bytes
},
],
"subscriptions" : { // Map of subscriptions on this topic
"sub1" : {
"msgRateOut" : 100.0, // Total rate of messages delivered on this subscription. msg/s
"msgThroughputOut" : 10240.0, // Total throughput delivered on this subscription. bytes/s
"msgBacklog" : 0, // Number of messages in the subscriotion backlog
"type" : Exclusive // Whether the subscription is exclusive or shared
"consumers" [ // List of consumers on this subscription
{
"id" : 5 // Consumer id
"address" : 10.4.1.23:3425 // IP and port for this consumer
"connectedSince" : 2014-11-21 23:54:46 // Timestamp of this consumer connection
"msgRateOut" : 100.0, // Total rate of messages delivered to this consumer. msg/s
"msgThroughputOut" : 10240.0, // Total throughput delivered to this consumer. bytes/s
}
],
},
"replication" : { // Replication statistics
"cluster_1" : { // Cluster name in the context of from-cluster or to-cluster
"msgRateIn" : 100.0, // Total rate of messages received from this remote cluster. msg/s
"msgThroughputIn" : 10240.0, // Total throughput received from this remote cluster. bytes/s
"msgRateOut" : 100.0, // Total rate of messages delivered to the replication-subscriber. msg/s
"msgThroughputOut" : 10240.0, // Total throughput delivered to the replication-subscriber. bytes/s
"connected" : true, // Whether the replication-subscriber is currently connected locally
},
"cluster_2" : {
"msgRateIn" : 100.0,
"msgThroughputIn" : 10240.0,
"msgRateOut" : 100.0,
"msghroughputOut" : 10240.0,
"connected" : true,
}
},
}
All the rates are computed over a 1 minute window and are relative the last completed 1 minute period.getStats in interface NonPersistentTopicstopic - Topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<org.apache.pulsar.common.policies.data.NonPersistentTopicStats> getStatsAsync(String topic)
NonPersistentTopicsgetStatsAsync in interface NonPersistentTopicstopic - Topic namepublic org.apache.pulsar.common.policies.data.PersistentTopicInternalStats getInternalStats(String topic) throws PulsarAdminException
NonPersistentTopicsgetInternalStats in interface NonPersistentTopicstopic - Topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats> getInternalStatsAsync(String topic)
NonPersistentTopicsgetInternalStatsAsync in interface NonPersistentTopicstopic - Topic Namepublic void unload(String topic) throws PulsarAdminException
NonPersistentTopicsunload in interface NonPersistentTopicstopic - Topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> unloadAsync(String topic)
NonPersistentTopicsunloadAsync in interface NonPersistentTopicstopic - Topic namepublic List<String> getListInBundle(String namespace, String bundleRange) throws PulsarAdminException
NonPersistentTopicsgetListInBundle in interface NonPersistentTopicsPulsarAdminExceptionpublic CompletableFuture<List<String>> getListInBundleAsync(String namespace, String bundleRange)
NonPersistentTopicsgetListInBundleAsync in interface NonPersistentTopicspublic List<String> getList(String namespace) throws PulsarAdminException
NonPersistentTopicsgetList in interface NonPersistentTopicsPulsarAdminExceptionpublic CompletableFuture<List<String>> getListAsync(String namespace)
NonPersistentTopicsgetListAsync in interface NonPersistentTopicsCopyright © 2017–2021 Apache Software Foundation. All rights reserved.