public abstract class AdminResource extends PulsarWebResource
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.pulsar.common.naming.NamespaceName |
namespaceName |
static String |
PARTITIONED_TOPIC_PATH_ZNODE |
static String |
POLICIES_READONLY_FLAG_PATH |
protected org.apache.pulsar.common.naming.TopicName |
topicName |
httpRequest, NOT_IMPLEMENTED, servletContext, uri| Constructor and Description |
|---|
AdminResource() |
| Modifier and Type | Method and Description |
|---|---|
protected BookKeeper |
bookKeeper() |
protected void |
checkArgument(boolean b,
String errorMessage) |
protected boolean |
checkBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota quota,
org.apache.pulsar.common.policies.data.RetentionPolicies retention) |
protected void |
checkNotNull(Object o,
String errorMessage) |
static <T> T |
checkNotNull(T reference) |
protected CompletableFuture<Boolean> |
checkTopicExistsAsync(org.apache.pulsar.common.naming.TopicName topicName)
Check the exists topics contains the given topic.
|
protected void |
checkTopicLevelPolicyEnable() |
protected Set<String> |
clusters() |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
dispatchRate() |
protected String |
domain()
Get the domain of the topic (whether it's persistent or non-persistent).
|
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata |
fetchPartitionedTopicMetadata(PulsarService pulsar,
org.apache.pulsar.common.naming.TopicName topicName) |
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata |
fetchPartitionedTopicMetadataCheckAllowAutoCreation(PulsarService pulsar,
org.apache.pulsar.common.naming.TopicName topicName) |
protected org.apache.pulsar.common.policies.data.Policies |
getNamespacePolicies(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected org.apache.pulsar.common.policies.data.Policies |
getNamespacePolicies(String property,
String cluster,
String namespace) |
protected CompletableFuture<org.apache.pulsar.common.policies.data.Policies> |
getNamespacePoliciesAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected Set<String> |
getNamespaceReplicatedClusters(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
protected List<String> |
getPartitionedTopicList(org.apache.pulsar.common.naming.TopicDomain topicDomain) |
protected org.apache.pulsar.common.partition.PartitionedTopicMetadata |
getPartitionedTopicMetadata(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation) |
protected CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> |
getPartitionedTopicMetadataAsync(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation) |
protected List<String> |
getTopicPartitionList(org.apache.pulsar.common.naming.TopicDomain topicDomain) |
protected CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> |
getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName) |
protected void |
internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly) |
protected boolean |
isLeaderBroker() |
protected boolean |
isNamespaceReplicated(org.apache.pulsar.common.naming.NamespaceName namespaceName) |
static com.fasterxml.jackson.databind.ObjectMapper |
jsonMapper() |
protected LocalZooKeeperCacheService |
localCacheService() |
protected ZooKeeper |
localZk() |
protected ZooKeeperCache |
localZkCache() |
protected void |
localZKCreate(String path,
byte[] content) |
protected void |
mergeNamespaceWithDefaults(org.apache.pulsar.common.policies.data.Policies policies,
String namespace,
String namespacePath) |
protected org.apache.pulsar.common.policies.data.BacklogQuota |
namespaceBacklogQuota(String namespace,
String namespacePath,
org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
replicatorDispatchRate() |
protected void |
resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable throwable) |
protected void |
setServletContext(javax.servlet.ServletContext servletContext) |
protected org.apache.pulsar.common.policies.data.SubscribeRate |
subscribeRate() |
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl |
subscriptionDispatchRate() |
protected CompletableFuture<Void> |
tryCreatePartitionsAsync(int numPartitions) |
protected void |
validateAdminAccessForTenant(String property)
Checks that the http client role has admin access to the specified tenant.
|
protected void |
validateBundleOwnership(String property,
String cluster,
String namespace,
boolean authoritative,
boolean readOnly,
NamespaceBundle bundle) |
protected void |
validateClusterExists(String cluster) |
protected void |
validateGlobalNamespaceOwnership(String property,
String namespace) |
protected void |
validateNamespaceName(String property,
String namespace) |
protected void |
validateNamespaceName(String property,
String cluster,
String namespace)
Deprecated.
|
protected void |
validatePartitionedTopicMetadata(String tenant,
String namespace,
String encodedTopic) |
protected void |
validatePartitionedTopicName(String tenant,
String namespace,
String encodedTopic) |
protected void |
validatePersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies persistence) |
void |
validatePoliciesReadOnlyAccess()
Checks whether the broker is allowed to do read-write operations based on the existence of a node in
configuration metadata-store.
|
void |
validateSuperUserAccess()
Checks whether the user has Pulsar Super-User access to the system.
|
protected void |
validateTopicName(String property,
String namespace,
String encodedTopic) |
protected void |
validateTopicName(String property,
String cluster,
String namespace,
String encodedTopic)
Deprecated.
|
canUpdateCluster, checkAuthorization, checkLocalOrGetPeerReplicationCluster, clientAppId, clientAuthData, clusterResources, config, deleteRecursive, dynamicConfigurationResources, getClusterDataIfDifferentCluster, getListOfNamespaces, getListOfResourcegroups, getLocalPolicies, getPulsarResources, hasActiveNamespace, hasSuperUserAccess, isBundleOwnedByAnyBroker, isClientAuthenticated, isLeaderBroker, isRequestHttps, joinPath, listSubTreeBFS, namespaceIsolationPolicies, namespaceResources, originalPrincipal, path, pulsar, resourceGroupResources, setPulsar, splitPath, tenantResources, validateAdminAccessForTenant, validateBrokerName, validateBundleOwnership, validateClusterForTenant, validateClusterOwnership, validateGlobalNamespaceOwnership, validateGlobalNamespaceOwnershipAsync, validateNamespaceBundleOwnership, validateNamespaceBundleRange, validateNamespaceOperation, validateNamespacePolicyOperation, validateTenantOperation, validateTopicOperation, validateTopicOperation, validateTopicOwnership, validateTopicOwnershipAsync, validateTopicPolicyOperationpublic static final String POLICIES_READONLY_FLAG_PATH
public static final String PARTITIONED_TOPIC_PATH_ZNODE
protected org.apache.pulsar.common.naming.NamespaceName namespaceName
protected org.apache.pulsar.common.naming.TopicName topicName
protected BookKeeper bookKeeper()
protected ZooKeeper localZk()
protected ZooKeeperCache localZkCache()
protected LocalZooKeeperCacheService localCacheService()
protected void localZKCreate(String path, byte[] content) throws Exception
Exceptionprotected String domain()
public void validateSuperUserAccess()
PulsarWebResourcevalidateSuperUserAccess in class PulsarWebResourceprotected void validateAdminAccessForTenant(String property)
PulsarWebResourcevalidateAdminAccessForTenant in class PulsarWebResourceproperty - the tenant idprotected void validateBundleOwnership(String property, String cluster, String namespace, boolean authoritative, boolean readOnly, NamespaceBundle bundle)
validateBundleOwnership in class PulsarWebResourceprotected boolean isLeaderBroker()
isLeaderBroker in class PulsarWebResourcepublic void validatePoliciesReadOnlyAccess()
validatePoliciesReadOnlyAccess in class PulsarWebResourcejavax.ws.rs.WebApplicationException - if broker has a read only access if broker is not connected to the configuration metadata-storeprotected CompletableFuture<Void> tryCreatePartitionsAsync(int numPartitions)
protected void validateGlobalNamespaceOwnership(String property, String namespace)
@Deprecated protected void validateNamespaceName(String property, String cluster, String namespace)
protected void validateTopicName(String property, String namespace, String encodedTopic)
protected void validatePartitionedTopicName(String tenant, String namespace, String encodedTopic)
protected void validatePartitionedTopicMetadata(String tenant, String namespace, String encodedTopic)
@Deprecated protected void validateTopicName(String property, String cluster, String namespace, String encodedTopic)
protected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected CompletableFuture<org.apache.pulsar.common.policies.data.Policies> getNamespacePoliciesAsync(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected void mergeNamespaceWithDefaults(org.apache.pulsar.common.policies.data.Policies policies,
String namespace,
String namespacePath)
protected org.apache.pulsar.common.policies.data.BacklogQuota namespaceBacklogQuota(String namespace, String namespacePath, org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType)
protected CompletableFuture<Optional<org.apache.pulsar.common.policies.data.TopicPolicies>> getTopicPoliciesAsyncWithRetry(org.apache.pulsar.common.naming.TopicName topicName)
protected boolean checkBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota quota,
org.apache.pulsar.common.policies.data.RetentionPolicies retention)
protected void checkTopicLevelPolicyEnable()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl dispatchRate()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl subscriptionDispatchRate()
protected org.apache.pulsar.common.policies.data.impl.DispatchRateImpl replicatorDispatchRate()
protected org.apache.pulsar.common.policies.data.SubscribeRate subscribeRate()
public static com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
protected void setServletContext(javax.servlet.ServletContext servletContext)
protected CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadataAsync(org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, boolean checkAllowAutoCreation)
protected org.apache.pulsar.common.partition.PartitionedTopicMetadata getPartitionedTopicMetadata(org.apache.pulsar.common.naming.TopicName topicName,
boolean authoritative,
boolean checkAllowAutoCreation)
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadata(PulsarService pulsar, org.apache.pulsar.common.naming.TopicName topicName)
protected static org.apache.pulsar.common.partition.PartitionedTopicMetadata fetchPartitionedTopicMetadataCheckAllowAutoCreation(PulsarService pulsar, org.apache.pulsar.common.naming.TopicName topicName)
protected void validateClusterExists(String cluster)
validateClusterExists in class PulsarWebResourceprotected org.apache.pulsar.common.policies.data.Policies getNamespacePolicies(String property, String cluster, String namespace)
protected boolean isNamespaceReplicated(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected Set<String> getNamespaceReplicatedClusters(org.apache.pulsar.common.naming.NamespaceName namespaceName)
protected List<String> getPartitionedTopicList(org.apache.pulsar.common.naming.TopicDomain topicDomain)
protected List<String> getTopicPartitionList(org.apache.pulsar.common.naming.TopicDomain topicDomain)
protected void internalCreatePartitionedTopic(javax.ws.rs.container.AsyncResponse asyncResponse,
int numPartitions,
boolean createLocalTopicOnly)
protected CompletableFuture<Boolean> checkTopicExistsAsync(org.apache.pulsar.common.naming.TopicName topicName)
topicName - given topic nameprotected void resumeAsyncResponseExceptionally(javax.ws.rs.container.AsyncResponse asyncResponse,
Throwable throwable)
@CanIgnoreReturnValue public static <T> T checkNotNull(T reference)
protected void checkArgument(boolean b,
String errorMessage)
protected void validatePersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies persistence)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.