Package org.apache.pulsar.broker.lookup
Class TopicLookupBase
java.lang.Object
org.apache.pulsar.broker.web.PulsarWebResource
org.apache.pulsar.broker.lookup.TopicLookupBase
- Direct Known Subclasses:
TopicLookup,TopicLookup
-
Field Summary
Fields inherited from class org.apache.pulsar.broker.web.PulsarWebResource
httpRequest, servletContext, uri -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.pulsar.common.naming.TopicNamegetTopicName(String topicDomain, String tenant, String namespace, String encodedTopic) protected org.apache.pulsar.common.naming.TopicNamegetTopicName(String topicDomain, String tenant, String cluster, String namespace, String encodedTopic) protected StringinternalGetNamespaceBundle(org.apache.pulsar.common.naming.TopicName topicName) protected CompletableFuture<org.apache.pulsar.common.lookup.data.LookupData>internalLookupTopicAsync(org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String listenerName) static CompletableFuture<io.netty.buffer.ByteBuf>lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId) Lookup broker-service address for a given namespace-bundle which contains given topic.static CompletableFuture<io.netty.buffer.ByteBuf>lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId, String advertisedListenerName) Lookup broker-service address for a given namespace-bundle which contains given topic.Methods inherited from class org.apache.pulsar.broker.web.PulsarWebResource
bookieResources, canUpdateCluster, checkAuthorizationAsync, checkLocalOrGetPeerReplicationCluster, checkLocalOrGetPeerReplicationCluster, clientAppId, clientAuthData, clusterResources, config, dynamicConfigurationResources, getClusterDataIfDifferentCluster, getLocalPolicies, getPulsarResources, hasActiveNamespace, hasSuperUserAccess, isBundleOwnedByAnyBroker, isClientAuthenticated, isLeaderBroker, isLeaderBroker, isRequestHttps, jsonMapper, namespaceIsolationPolicies, namespaceResources, originalPrincipal, pulsar, resourceGroupResources, resumeAsyncResponseExceptionally, setPulsar, splitPath, sync, tenantResources, topicResources, validateAdminAccessForTenant, validateAdminAccessForTenant, validateAdminAccessForTenantAsync, validateAdminAccessForTenantAsync, validateBrokerName, validateBundleOwnership, validateBundleOwnership, validateBundleOwnershipAsync, validateClusterExists, validateClusterForTenant, validateClusterForTenantAsync, validateClusterOwnership, validateClusterOwnershipAsync, validateGlobalNamespaceOwnership, validateGlobalNamespaceOwnershipAsync, validateNamespaceBundleOwnership, validateNamespaceBundleOwnershipAsync, validateNamespaceBundleRange, validateNamespaceOperation, validateNamespaceOperationAsync, validateNamespacePolicyOperation, validateNamespacePolicyOperationAsync, validatePeerClusterConflict, validatePeerClusterConflictAsync, validatePoliciesReadOnlyAccess, validatePoliciesReadOnlyAccessAsync, validateSuperUserAccess, validateSuperUserAccessAsync, validateTenantOperation, validateTenantOperationAsync, validateTopicOperation, validateTopicOperation, validateTopicOperationAsync, validateTopicOperationAsync, validateTopicOwnership, validateTopicOwnershipAsync, validateTopicPolicyOperation, validateTopicPolicyOperationAsync
-
Constructor Details
-
TopicLookupBase
public TopicLookupBase()
-
-
Method Details
-
internalLookupTopicAsync
protected CompletableFuture<org.apache.pulsar.common.lookup.data.LookupData> internalLookupTopicAsync(org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String listenerName) -
internalGetNamespaceBundle
-
lookupTopicAsync
public static CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId) Lookup broker-service address for a given namespace-bundle which contains given topic. a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives lookup-request and if it's not a leader then current broker redirects request to leader by returning leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the namespace-bundle then it owns a bundle and returns success(connect) response to client.- Parameters:
pulsarService-topicName-authoritative-clientAppId-requestId-- Returns:
-
lookupTopicAsync
public static CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId, String advertisedListenerName) Lookup broker-service address for a given namespace-bundle which contains given topic. a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives lookup-request and if it's not a leader then current broker redirects request to leader by returning leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the namespace-bundle then it owns a bundle and returns success(connect) response to client.- Parameters:
pulsarService-topicName-authoritative-clientAppId-requestId-advertisedListenerName-- Returns:
-
getTopicName
-
getTopicName
-