name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
pulsar_ResourceGroupService_getPublishRateLimiters_rdh | // Visibility for testing.
protected BytesAndMessagesCount getPublishRateLimiters(String rgName) throws PulsarAdminException {
ResourceGroup rg = this.getResourceGroupInternal(rgName);
if (rg == null) {
throw new PulsarAdminException("Resource group does not exist: " + rgName);
}
return rg.g... | 3.26 |
pulsar_ResourceGroupService_registerTenant_rdh | /**
* Registers a tenant as a user of a resource group.
*
* @param resourceGroupName
* @param tenantName
* @throws if
* the RG does not exist, or if the NS already references the RG.
*/
public void registerTenant(String resourceGroupName, String tenantName) throws PulsarAdminException {
ResourceGroup rg = ... | 3.26 |
pulsar_ResourceGroupService_getRGUsage_rdh | // Visibility for testing.
protected BytesAndMessagesCount getRGUsage(String rgName, ResourceGroupMonitoringClass monClass, ResourceGroupUsageStatsType statsType) throws PulsarAdminException {
final ResourceGroup rg = this.getResourceGroupInternal(rgName);if (rg != null) {
switch (statsType) {
d... | 3.26 |
pulsar_ResourceGroupService_getRgTenantUnRegistersCount_rdh | // Visibility for testing.
protected static double getRgTenantUnRegistersCount(String rgName) {return rgTenantUnRegisters.labels(rgName).get();
} | 3.26 |
pulsar_ResourceGroupService_resourceGroupUpdate_rdh | /**
* Update RG.
*
* @throws if
* RG with that name does not exist.
*/
public void resourceGroupUpdate(String rgName, ResourceGroup rgConfig) throws PulsarAdminException {if (rgConfig == null) {
throw new IllegalArgumentException("ResourceGroupUpdate: Invalid null ResourceGroup config");
}
Resour... | 3.26 |
pulsar_ResourceGroupService_getRgLocalUsageByteCount_rdh | // Visibility for testing.
protected static double getRgLocalUsageByteCount(String rgName, String monClassName) {
return rgLocalUsageBytes.labels(rgName, monClassName).get();
} | 3.26 |
pulsar_ResourceGroupService_getRgLocalUsageMessageCount_rdh | // Visibility for testing.
protected static double getRgLocalUsageMessageCount(String rgName, String monClassName) {
return rgLocalUsageMessages.labels(rgName, monClassName).get();
} | 3.26 |
pulsar_ResourceGroupService_getRgQuotaCalculationTime_rdh | // Visibility for testing.
protected static Value getRgQuotaCalculationTime() {
return rgQuotaCalculationLatency.get();
} | 3.26 |
pulsar_ResourceGroupService_calculateQuotaForAllResourceGroups_rdh | // Periodically calculate the updated quota for all RGs in the background,
// from the reports received from other brokers.
// [Visibility for unit testing.]
protected void calculateQuotaForAllResourceGroups() {
// Calculate the quota for the next window for this RG, based on the observed usage.
final Summary.Timer quo... | 3.26 |
pulsar_ResourceGroupService_getResourceGroupInternal_rdh | /**
* Get the RG with the given name. For internal operations only.
*/
private ResourceGroup getResourceGroupInternal(String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Invalid null resource group name: " + resourceGroupName);
}
return resourceGroupsM... | 3.26 |
pulsar_ResourceGroupService_getRgNamespaceUnRegistersCount_rdh | // Visibility for testing.
protected static double getRgNamespaceUnRegistersCount(String rgName) {
return rgNamespaceUnRegisters.labels(rgName).get();
} | 3.26 |
pulsar_ResourceGroupService_aggregateResourceGroupLocalUsages_rdh | // Periodically aggregate the usage from all topics known to the BrokerService.
// Visibility for unit testing.
protected void aggregateResourceGroupLocalUsages() {
final Summary.Timer aggrUsageTimer = rgUsageAggregationLatency.startTimer();
BrokerService bs = this.pulsar.getBrokerService();
Map<String, TopicStatsImp... | 3.26 |
pulsar_ResourceGroupService_unRegisterTenant_rdh | /**
* UnRegisters a tenant from a resource group.
*
* @param resourceGroupName
* @param tenantName
* @throws if
* the RG does not exist, or if the tenant does not references the RG yet.
*/
public void unRegisterTenant(String resourceGroupName, String tenantName) throws PulsarAdminException {
ResourceGroup ... | 3.26 |
pulsar_ResourceGroupService_resourceGroupGet_rdh | /**
* Get a copy of the RG with the given name.
*/
public ResourceGroup resourceGroupGet(String resourceGroupName) {
ResourceGroup retrievedRG = this.getResourceGroupInternal(resourceGroupName);
if (retrievedRG == null) {
return null;
}
// Return a copy.
return new ResourceGroup(retrievedR... | 3.26 |
pulsar_ResourceGroupService_getRgTenantRegistersCount_rdh | // Visibility for testing.
protected static double getRgTenantRegistersCount(String rgName)
{
return rgTenantRegisters.labels(rgName).get();
} | 3.26 |
pulsar_ResourceGroupService_resourceGroupCreate_rdh | /**
* Create RG, with non-default functions for resource-usage transport-manager.
*
* @throws if
* RG with that name already exists (even if the resource usage handlers are different).
*/
public void resourceGroupCreate(String rgName, ResourceGroup rgConfig, ResourceUsagePublisher rgPublisher, ResourceUsageCons... | 3.26 |
pulsar_ResourceGroupService_getRgUpdatesCount_rdh | // Visibility for testing.
protected static double getRgUpdatesCount(String rgName) {
return rgUpdates.labels(rgName).get();
} | 3.26 |
pulsar_TimeAverageBrokerData_reset_rdh | /**
* Reuse this TimeAverageBrokerData using new data.
*
* @param bundles
* The bundles belonging to the broker.
* @param data
* Map from bundle names to the data for that bundle.
* @param defaultStats
* The stats to use when a bundle belonging to this broker is not found in the bundle data map.
*/ publi... | 3.26 |
pulsar_TransactionImpl_registerProducedTopic_rdh | // register the topics that will be modified by this transaction
public CompletableFuture<Void> registerProducedTopic(String topic) {
CompletableFuture<Void> completableFuture = new CompletableFuture<>();
if (checkIfOpen(completableFuture)) {
synchronized(this) {
// we need to issue the re... | 3.26 |
pulsar_TransactionImpl_registerAckedTopic_rdh | // register the topics that will be modified by this transaction
public CompletableFuture<Void> registerAckedTopic(String topic, String subscription) {
CompletableFuture<Void> completableFuture = new CompletableFuture<>();
if (checkIfOpen(completableFuture)) {
synchronized(this) {
// we nee... | 3.26 |
pulsar_PulsarConnectorConfig_getManagedLedgerOffloadMaxThreads_rdh | // --- Ledger Offloading ---
public int getManagedLedgerOffloadMaxThreads() {
return this.managedLedgerOffloadMaxThreads;
} | 3.26 |
pulsar_PulsarConnectorConfig_getZookeeperUri_rdh | /**
*
* @deprecated use {@link #getMetadataUrl()}
*/
@Deprecated
@NotNull
public String getZookeeperUri() {
return getMetadataUrl();
} | 3.26 |
pulsar_PulsarConnectorConfig_setZookeeperUri_rdh | /**
*
* @deprecated use {@link #setMetadataUrl(String)}
*/
@Deprecated
@Config("pulsar.zookeeper-uri")
public PulsarConnectorConfig setZookeeperUri(String zookeeperUri) {
if (hasMetadataUrl) {
return this;
}
this.metadataUrl = zookeeperUri;
return this;
} | 3.26 |
pulsar_PulsarConnectorConfig_getBookkeeperThrottleValue_rdh | // --- Bookkeeper Config ---
public int getBookkeeperThrottleValue() {
return bookkeeperThrottleValue;
} | 3.26 |
pulsar_PulsarConnectorConfig_m3_rdh | // --- Nar extraction config
public String m3() {
return narExtractionDirectory;} | 3.26 |
pulsar_PulsarConnectorConfig_getAuthPlugin_rdh | // --- Authentication ---
public String getAuthPlugin() {
return this.authPluginClassName;
} | 3.26 |
pulsar_CmdProduce_updateConfig_rdh | /**
* Set Pulsar client configuration.
*/
public void updateConfig(ClientBuilder newBuilder, Authentication authentication, String serviceURL) {
this.clientBuilder = newBuilder;
this.authentication = authentication;
this.serviceURL = serviceURL;
} | 3.26 |
pulsar_CmdProduce_run_rdh | /**
* Run the producer.
*
* @return 0 for success, < 0 otherwise
* @throws Exception
*/
public int run() throws PulsarClientException {
if (mainOptions.siz... | 3.26 |
pulsar_FunctionRecord_from_rdh | /**
* Creates a builder for a Record from a Function Context.
* The builder is initialized with the output topic from the Context and with the topicName, key, eventTime,
* properties, partitionId, partitionIndex and recordSequence from the Context input Record.
* It doesn't initialize a Message at the moment.
*
*... | 3.26 |
pulsar_AuthenticationDataTls_hasDataForTls_rdh | /* TLS */
@Override
public boolean hasDataForTls() {
return true;
} | 3.26 |
pulsar_JavaInstanceRunnable_setup_rdh | /**
* NOTE: this method should be called in the instance thread, in order to make class loading work.
*/
private synchronized void setup() throws Exception {
this.instanceCache = InstanceCache.getInstanceCache();
if (this.collectorRegistry == null) {
this.collectorRegistry = FunctionCollectorRegistr... | 3.26 |
pulsar_JavaInstanceRunnable_close_rdh | /**
* NOTE: this method is be synchronized because it is potentially called by two different places
* one inside the run/finally clause and one inside the ThreadRuntime::stop.
*/
@Override
public synchronized void close() {
isInitialized = false;
if (stats != null) {
stats.close();
sta... | 3.26 |
pulsar_JavaInstanceRunnable_interpolateSecretsIntoConfigs_rdh | /**
* Recursively interpolate configured secrets into the config map by calling
* {@link SecretsProvider#interpolateSecretForValue(String)}.
*
* @param secretsProvider
* - the secrets provider that will convert secret's values into config values.
* @param configs
* - the connector configuration map, which wi... | 3.26 |
pulsar_JavaInstanceRunnable_run_rdh | /**
* The core logic that initialize the instance thread and executes the function.
*/
@Override
public void run() {
try {
setup();
Thread v5 = Thread.currentThread();
Consumer<Throwable> asyncErrorHandler = throwable -> v5.interrupt();
AsyncResultConsumer asyncResultConsumer = t... | 3.26 |
pulsar_LookupProxyHandler_getBrokerServiceUrl_rdh | /**
* Get default broker service url or discovery an available broker.
*/
private String getBrokerServiceUrl(long clientRequestId) {
if (StringUtils.isNotBlank(brokerServiceURL)) {return brokerServiceURL;
}
ServiceLookupData availableBroker;
try {
availableBroker = discoveryProvider.nextBroker();
} catch (Exception e... | 3.26 |
pulsar_LookupProxyHandler_handlePartitionMetadataResponse_rdh | /**
* Always get partition metadata from broker service.
*/
private void handlePartitionMetadataResponse(CommandPartitionedTopicMetadata partitionMetadata, long clientRequestId) {
TopicName topicName = TopicName.get(partitionMetadata.getTopic());
String serviceUrl = getBrokerServiceUrl(clientRequestId);
if
(serviceU... | 3.26 |
pulsar_LinuxInfoUtils_m0_rdh | /**
* Get paths of all usable physical nic.
*
* @return All usable physical nic paths.
*/
public static List<String> m0() {
try (Stream<Path> stream = Files.list(Paths.get(NIC_PATH)))
{
return stream.filter(LinuxInfoUtils::isPhysicalNic).filter(LinuxInfoUtils::isUsable).map(path -> path.getFileName().toString(... | 3.26 |
pulsar_LinuxInfoUtils_isPhysicalNic_rdh | /**
* Determine whether the VM has physical nic.
*
* @param nicPath
* Nic path
* @return whether The VM has physical nic.
*/
private static boolean isPhysicalNic(Path nicPath) {try {
if (nicPath.toString().contains("/virtual/")) {
return false;
}
// Check the type to make sure it's ethernet (type "1")
Strin... | 3.26 |
pulsar_LinuxInfoUtils_getTotalNicLimit_rdh | /**
* Get all physical nic limit.
*
* @param nics
* All nic path
* @param bitRateUnit
* Bit rate unit
* @return Total nic limit
*/
public static double getTotalNicLimit(List<String> nics, BitRateUnit bitRateUnit) {
return bitRateUnit.convert(nics.stream().mapToDouble(nicPath -> {
try {
return re... | 3.26 |
pulsar_LinuxInfoUtils_isLinux_rdh | /**
* Determine whether the OS is the linux kernel.
*
* @return Whether the OS is the linux kernel
*/
public static boolean isLinux() {
return SystemUtils.IS_OS_LINUX;
} | 3.26 |
pulsar_LinuxInfoUtils_getTotalCpuLimit_rdh | /**
* Get total cpu limit.
*
* @param isCGroupsEnabled
* Whether CGroup is enabled
* @return Total cpu limit
*/
public static double getTotalCpuLimit(boolean isCGroupsEnabled) {
if (isCGroupsEnabled) {
try {
long quota;
long period;
if (((metrics != null) && (getC... | 3.26 |
pulsar_LinuxInfoUtils_isCGroupEnabled_rdh | /**
* Determine whether the OS enable CG Group.
*/
public static boolean isCGroupEnabled() {
try {
if
(metrics == null) {
return Files.exists(Paths.get(f0));
}
String provider = ((String) (getMetricsProviderMethod.invoke(metrics)));
log.info("[LinuxInfo] The ... | 3.26 |
pulsar_LinuxInfoUtils_checkHasNicSpeeds_rdh | /**
* Check this VM has nic speed.
*
* @return Whether the VM has nic speed
*/
public static boolean checkHasNicSpeeds() {
List<String> physicalNICs = m0();
if (CollectionUtils.isEmpty(physicalNICs)) {
return false;
}
double totalNicLimit = getTotalNicLimit(physicalNICs, BitRateUnit.Kilobit);
return totalNicLim... | 3.26 |
pulsar_LinuxInfoUtils_getTotalNicUsage_rdh | /**
* Get all physical nic usage.
*
* @param nics
* All nic path
* @param type
* Nic's usage type: transport, receive
* @param bitRateUnit
* Bit rate unit
* @return Total nic usage
*/
public static double getTotalNicUsage(List<String> nics, NICUsageType type, BitRateUnit bitRateUnit) {
return bitRateUn... | 3.26 |
pulsar_LinuxInfoUtils_getCpuUsageForCGroup_rdh | /**
* Get CGroup cpu usage.
*
* @return Cpu usage
*/
public static long getCpuUsageForCGroup() {
try {
if
((metrics != null) && (getCpuUsageMethod != null)) {
return ((long) (getCpuUsageMethod.invoke(metrics)));
}
return readLongFromFile(Paths.get(f0));
} catch ... | 3.26 |
pulsar_LinuxInfoUtils_getCpuUsageForEntireHost_rdh | /**
* Reads first line of /proc/stat to get total cpu usage.
*
* <pre>
* cpu user nice system idle iowait irq softirq steal guest guest_nice
* cpu 317808 128 58637 2503692 7634 0 13472 0 0 0
* </pre>
* <p>
* Line is split in "words", filtering the first. The sum of all numbers giv... | 3.26 |
pulsar_LinuxInfoUtils_isUsable_rdh | /**
* Determine whether nic is usable.
*
* @param nicPath
* Nic path
* @return whether nic is usable.
*/
private static boolean isUsable(Path nicPath)
{
try {String operstate = readTrimStringFromFile(nicPath.resolve("operstate"));
Operstate operState = Operstate.valueOf(operstate.toUpperCase(Locale.ROOT));
... | 3.26 |
pulsar_PulsarClientImplementationBinding_getBytes_rdh | /**
* Retrieves ByteBuffer data into byte[].
*
* @param byteBuffer
* @return */
static byte[]
getBytes(ByteBuffer byteBuffer) {
if (byteBuffer == null) {
return null;
}
if
((byteBuffer.hasArray() && (byteBuffer.arrayOffset() == 0)) && (byteBuffer.array().length == byteBuffer.remaining())) {
retur... | 3.26 |
pulsar_CmdConsume_run_rdh | /**
* Run the consume command.
*
* @return 0 for success, < 0 otherwise
*/
public int run()
throws PulsarClientException, IOException {
if (mainOptions.size() != 1) {
throw new ParameterException("Please provide one and only one topic name.");
}
if ((this.subscriptionName == null) || this.subs... | 3.26 |
pulsar_ProxyConnection_doAuthentication_rdh | // According to auth result, send newConnected or newAuthChallenge command.
private void doAuthentication(AuthData clientData) throws Exception {
authState.authenticateAsync(clientData).whenCompleteAsync((authChallenge, throwable) -> {
if (throwable == null) {
authChallengeSuccessCallback(authC... | 3.26 |
pulsar_ProxyConnection_spliceNIC2NIC_rdh | /**
* Use splice to zero-copy of NIC to NIC.
*
* @param inboundChannel
* input channel
* @param outboundChannel
* output channel
*/
protected static ChannelPromise spliceNIC2NIC(EpollSocketChannel inboundChannel, EpollSocketChannel outboundChannel, int spliceLength) {
ChannelPromise promise = inboundChan... | 3.26 |
pulsar_ProxyConnection_getValidClientAuthData_rdh | /**
* Thread-safe method to retrieve unexpired client auth data. Due to inherent race conditions,
* the auth data may expire before it is used.
*/
CompletableFuture<AuthData> getValidClientAuthData() {
final CompletableFuture<AuthData> clientAuthDataFuture = new CompletableFuture<>();
ctx().executor().execut... | 3.26 |
pulsar_ProxyConnection_authChallengeSuccessCallback_rdh | // Always run in this class's event loop.
protected void authChallengeSuccessCallback(AuthData authChallenge) {
try {
// authentication has completed, will send newConnected command.
if (authChallenge == null) {
clientAuthRole = authState.getAuthRole();
if (LOG.isDebugEnable... | 3.26 |
pulsar_ProtocolHandlers_protocol_rdh | /**
* Return the handler for the provided <tt>protocol</tt>.
*
* @param protocol
* the protocol to use
* @return the protocol handler to handle the provided protocol
*/
public ProtocolHandler protocol(String protocol) {
ProtocolHandlerWithClassLoader h = handlers.get(protocol);
if (null == h) {
... | 3.26 |
pulsar_ProtocolHandlers_load_rdh | /**
* Load the protocol handlers for the given <tt>protocol</tt> list.
*
* @param conf
* the pulsar broker service configuration
* @return the collection of protocol handlers
*/
public static ProtocolHandlers load(ServiceConfiguration conf) throws IOException {
ProtocolHandlerDefinitions definitions = Proto... | 3.26 |
pulsar_GrowablePriorityLongPairQueue_removeIf_rdh | /**
* Removes all of the elements of this collection that satisfy the given predicate.
*
* @param filter
* a predicate which returns {@code true} for elements to be removed
* @return number of removed values
*/
public synchronized int removeIf(LongPairPredicate filter) {
int removedValues = 0;
int inde... | 3.26 |
pulsar_GrowablePriorityLongPairQueue_remove_rdh | /**
* Removes min element from the heap.
*
* @return */
public LongPair remove() {
return removeAt(0);} | 3.26 |
pulsar_GrowablePriorityLongPairQueue_items_rdh | /**
*
* @return a new list of keys with max provided numberOfItems (makes a copy)
*/
public Set<LongPair> items(int numberOfItems) {
Set<LongPair> items = new HashSet<>(this.size);
forEach((item1, item2) -> {
if (items.size() < numberOfItems) {
items.add(new LongPair(item1, item2));
... | 3.26 |
pulsar_GrowablePriorityLongPairQueue_removeAtWithoutLock_rdh | /**
* it is not a thread-safe method and it should be called before acquiring a lock by a caller.
*
* @param index
* @return */
private LongPair removeAtWithoutLock(int index) {
if (this.size > 0) {
LongPair item = new LongPair(data[index], data[index + 1]);
data[index] = EmptyItem;
da... | 3.26 |
pulsar_HttpLookupService_getBroker_rdh | /**
* Calls http-lookup api to find broker-service address which can serve a given topic.
*
* @param topicName
* topic-name
* @return broker-socket-address that serves given topic
*/
@Override
@SuppressWarnings("deprecation")
public CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> getBroker(TopicNa... | 3.26 |
pulsar_PulsarAdminImpl_bookies_rdh | /**
*
* @return the bookies management object
*/
public Bookies bookies() {
return bookies;
} | 3.26 |
pulsar_PulsarAdminImpl_resourcegroups_rdh | /**
*
* @return the resourcegroups management object
*/
public ResourceGroups resourcegroups() {
return resourcegroups;
} | 3.26 |
pulsar_PulsarAdminImpl_lookups_rdh | /**
*
* @return does a looks up for the broker serving the topic
*/
public Lookup lookups() {
return lookups;
} | 3.26 |
pulsar_PulsarAdminImpl_schemas_rdh | /**
*
* @return the schemas
*/
public Schemas schemas() {
return schemas;
} | 3.26 |
pulsar_PulsarAdminImpl_brokers_rdh | /**
*
* @return the brokers management object
*/
public Brokers brokers() {
return brokers;
} | 3.26 |
pulsar_PulsarAdminImpl_resourceQuotas_rdh | /**
*
* @return the resource quota management object
*/
public ResourceQuotas resourceQuotas() {
return resourceQuotas;
} | 3.26 |
pulsar_PulsarAdminImpl_worker_rdh | /**
*
* @return the Worker stats
*/
public Worker
worker() {
return worker;
} | 3.26 |
pulsar_PulsarAdminImpl_namespaces_rdh | /**
*
* @return the namespaces management object
*/
public Namespaces namespaces() {
return f2; } | 3.26 |
pulsar_PulsarAdminImpl_packages_rdh | /**
*
* @return the packages management object
*/
public Packages packages() {
return packages;
} | 3.26 |
pulsar_PulsarAdminImpl_clusters_rdh | /**
*
* @return the clusters management object
*/
public Clusters clusters() {
return f0;} | 3.26 |
pulsar_PulsarAdminImpl_getClientConfigData_rdh | /**
*
* @return the client Configuration Data that is being used
*/
public ClientConfigurationData getClientConfigData() {
return clientConfigData;
} | 3.26 |
pulsar_PulsarAdminImpl_close_rdh | /**
* Close the Pulsar admin client to release all the resources.
*/
@Override
public void close() {
try {
auth.close();
} catch (IOException e) {
LOG.error("Failed to close the authentication service", e);
}
client.close();
asyncHttpConnector.close();
} | 3.26 |
pulsar_PulsarAdminImpl_sink_rdh | /**
*
* @return the sinks management object
* @deprecated in favor of {@link #sinks}
*/
@Deprecated
public Sink sink() {
return ((Sink) (f3));
} | 3.26 |
pulsar_PulsarAdminImpl_sinks_rdh | /**
*
* @return the sinks management object
*/
public Sinks sinks() {
return f3;
} | 3.26 |
pulsar_PulsarAdminImpl_functions_rdh | /**
*
* @return the functions management object
*/
public Functions functions() {
return functions;
} | 3.26 |
pulsar_PulsarAdminImpl_getServiceUrl_rdh | /**
*
* @return the service HTTP URL that is being used
*/
public String
getServiceUrl() {
return serviceUrl;
} | 3.26 |
pulsar_PulsarAdminImpl_brokerStats_rdh | /**
*
* @return the broker statics
*/
public BrokerStats brokerStats() {
return f1;
} | 3.26 |
pulsar_PulsarAdminImpl_proxyStats_rdh | /**
*
* @return the proxy statics
*/
public ProxyStats proxyStats() {
return proxyStats;
} | 3.26 |
pulsar_PulsarAdminImpl_nonPersistentTopics_rdh | /**
*
* @return the persistentTopics management object
* @deprecated Since 2.0. See {@link #topics()}
*/
@Deprecated
public NonPersistentTopics nonPersistentTopics() {
return nonPersistentTopics;
} | 3.26 |
pulsar_PulsarAdminImpl_source_rdh | /**
*
* @return the sources management object
* @deprecated in favor of {@link #sources()}
*/
@Deprecated
public Source source() {
return ((Source) (sources));
} | 3.26 |
pulsar_PulsarAdminImpl_tenants_rdh | /**
*
* @return the tenants management object
*/
public Tenants tenants() {
return tenants;
} | 3.26 |
pulsar_AuthenticationSasl_isRoleTokenExpired_rdh | // role token exists but expired return true
private boolean isRoleTokenExpired(Map<String, String> responseHeaders) {
if ((((saslRoleToken != null) && (responseHeaders != null)) && // header type match
((responseHeaders.get(SASL_HEADER_TYPE) != null) && responseHeaders.get(SASL_HEADER_TYPE).equalsIgnoreCase(SA... | 3.26 |
pulsar_AuthenticationSasl_newRequestHeader_rdh | // set header according to previous response
@Override
public Set<Entry<String, String>> newRequestHeader(String hostName, AuthenticationDataProvider authData, Map<String, String> previousRespHeaders) throws Exception {
Map<String, String> headers = new HashMap<>();if (authData.hasDataForHttp()) {
authDat... | 3.26 |
pulsar_AuthenticationSasl_setAuthParams_rdh | // use passed in parameter to config ange get jaasCredentialsContainer.
private void setAuthParams(Map<String, String> authParams) throws PulsarClientException {
this.configuration = authParams;
// read section from config files of kerberos
this.loginContextName =
authParams.getOrDefault(JAAS_CLIENT_SECTION_NAME, JAAS_... | 3.26 |
pulsar_PatternMultiTopicsConsumerImpl_run_rdh | // TimerTask to recheck topics change, and trigger subscribe/unsubscribe based on the change.
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;}
client.getLookup().getTopicsUnderNamespace(namespaceName, subscriptionMode, topicsPattern.pattern(), topicsHa... | 3.26 |
pulsar_SchemaBuilder_record_rdh | /**
* Build the schema for a record.
*
* @param name
* name of the record.
* @return builder to build the schema for a record.
*/
static RecordSchemaBuilder record(String name) {
return DefaultImplementation.getDefaultImplementation().newRecordSchemaBuilder(name);
} | 3.26 |
pulsar_StateStoreProvider_init_rdh | /**
* Initialize the state store provider.
*
* @param config
* the config to init the state store provider.
* @param functionDetails
* the function details.
* @throws Exception
* when failed to init the state store provider.
*/
default void init(Map<String, Object> config, FunctionDetails
functionDetails... | 3.26 |
pulsar_WatermarkTimeTriggerPolicy_handleWaterMarkEvent_rdh | /**
* Invokes the trigger all pending windows up to the
* watermark timestamp. The end ts of the window is set
* in the eviction policy context so that the events falling
* within that window can be processed.
*/
private void handleWaterMarkEvent(Event<T> event) {
long watermark... | 3.26 |
pulsar_MetaStore_getManagedLedgerInfo_rdh | /**
* Get the metadata used by the ManagedLedger.
*
* @param ledgerName
* the name of the ManagedLedger
* @param createIfMissing
* whether the managed ledger metadata should be created if it doesn't exist already
* @throws MetaStoreException
*/
default void getManagedLedgerInfo(String ledgerName, boolean cr... | 3.26 |
pulsar_NamespaceIsolationPolicies_setPolicy_rdh | /**
* Set the policy data for a single policy.
*
* @param policyName
* @param policyData
*/
public void setPolicy(String policyName, NamespaceIsolationData policyData) {
policyData.validate();
policies.put(policyName, ((NamespaceIsolationDataImpl) (policyData)));
} | 3.26 |
pulsar_NamespaceIsolationPolicies_getPolicyByNamespace_rdh | /**
* Get the namespace isolation policy for the specified namespace.
*
* <p>There should only be one namespace isolation policy defined for the specific namespace. If multiple policies
* match, the first one will be returned.
*
* @param namespace
* @return */
public NamespaceIsolationPolicy getPolicyByNamespac... | 3.26 |
pulsar_NamespaceIsolationPolicies_getBrokerAssignment_rdh | /**
* Get the broker assignment based on the namespace name.
*
* @param nsPolicy
* The namespace name
* @param brokerAddress
* The broker address is the format of host:port
* @return The broker assignment: {primary, secondary, shared}
*/
private BrokerAssignment getBrokerAssignment(NamespaceIsolationPolicy ... | 3.26 |
pulsar_NamespaceIsolationPolicies_getPolicyByName_rdh | /**
* Access method to get the namespace isolation policy by the policy name.
*
* @param policyName
* @return */
public NamespaceIsolationPolicy getPolicyByName(String
policyName) {
if (policies.get(policyName) == null) {
return null;
}
return new Nam... | 3.26 |
pulsar_NamespaceIsolationPolicies_isSharedBroker_rdh | /**
* Check to see whether a broker is in the shared broker pool or not.
*
* @param host
* @return */
public boolean isSharedBroker(String host) {
for (NamespaceIsolationData policyData
: this.policies.values()) {
NamespaceIsolationPolicyImpl policy = new NamespaceIsolationPolicyImpl(policyData);
... | 3.26 |
pulsar_NamespaceIsolationPolicies_deletePolicy_rdh | /**
* Delete a policy.
*
* @param policyName
*/
public void deletePolicy(String policyName) {
policies.remove(policyName);
} | 3.26 |
pulsar_AuthorizationProvider_getPermissionsAsync_rdh | /**
* Get authorization-action permissions on a namespace.
*
* @param namespaceName
* @return CompletableFuture<Map<String, Set<AuthAction>>>
*/
default CompletableFuture<Map<String, Set<AuthAction>>> getPermissionsAsync(NamespaceName namespaceName) {
return FutureUtil.failedFuture(new IllegalStateException(Strin... | 3.26 |
pulsar_AuthorizationProvider_allowNamespacePolicyOperation_rdh | /**
*
* @deprecated - will be removed after 2.12. Use async variant.
*/
@Deprecated
default Boolean allowNamespacePolicyOperation(NamespaceName namespaceName, PolicyName policy, PolicyOperation operation,
String role, AuthenticationDataSource authData) {
try {
return allowNamespacePolicyOperationAsync(... | 3.26 |
pulsar_AuthorizationProvider_allowTopicOperationAsync_rdh | /**
* Check if a given <tt>role</tt> is allowed to execute a given topic <tt>operation</tt> on the topic.
*
* @param topic
* topic name
* @param role
* role name
* @param operation
* topic operation
* @param authData
* authenticated data
* @return CompletableFuture<Boolean>
*/
default CompletableFut... | 3.26 |
pulsar_AuthorizationProvider_allowNamespaceOperation_rdh | /**
*
* @deprecated - will be removed after 2.12. Use async variant.
*/
@Deprecated
default Boolean allowNamespaceOperation(NamespaceName namespaceName, String role, NamespaceOperation operation, AuthenticationDataSource authData) {
try {
return allowNamespaceOperationAsync(namespaceName, role, operatio... | 3.26 |
pulsar_AuthorizationProvider_allowTenantOperation_rdh | /**
*
* @deprecated - will be removed after 2.12. Use async variant.
*/
@Deprecated
default Boolean allowTenantOperation(String tenantName, String role, TenantOperation operation, AuthenticationDataSource authData) {
try {
return allowTenantOperationAsync(tenantName, role, operation, authData).get();
... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.