name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
pulsar_AdminProxyHandler_copyRequest_rdh
/** * Ensure the Authorization header is carried over after a 307 redirect * from brokers. */ @Override protected Request copyRequest(HttpRequest oldRequest, URI newURI) { String authorization = oldRequest.getHeaders().get(HttpHeader.AUTHORIZATION); Request newRequest = super.copyRequest(oldRequest, newURI);...
3.26
pulsar_OffloadersCache_getOrLoadOffloaders_rdh
/** * Method to load an Offloaders directory or to get an already loaded Offloaders directory. * * @param offloadersPath * - the directory to search the offloaders nar files * @param narExtractionDirectory * - the directory to use for extraction * @return the loaded offloaders class * @throws IOException *...
3.26
pulsar_ConnectionHandler_switchClientCnx_rdh
/** * Update the {@link ClientCnx} for the class, then increment and get the epoch value. Note that the epoch value is * currently only used by the {@link ProducerImpl}. * * @param clientCnx * - the new {@link ClientCnx} * @return the epoch value to use for this pair of {@link ClientCnx} and {@link ProducerImpl...
3.26
pulsar_SubscribeRateLimiter_tryAcquire_rdh
/** * It acquires subscribe from subscribe-limiter and returns if acquired permits succeed. * * @return */ public synchronized boolean tryAcquire(ConsumerIdentifier consumerIdentifier) { addSubscribeLimiterIfAbsent(consumerIdentifier); return (subscribeRateLimiter.get(consumerIdentifier) == null) || subscri...
3.26
pulsar_SubscribeRateLimiter_updateSubscribeRate_rdh
/** * Update subscribe rate by updating rate-limiter. If subscribe-rate is configured < 0 then it closes * the rate-limiter and disables appropriate rate-limiter. * * @param subscribeRate */ private synchronized void updateSubscribeRate(ConsumerIdentifier consumerIdentifier, SubscribeRate subscribeRate) { lo...
3.26
pulsar_SubscribeRateLimiter_getSubscribeRatePerConsumer_rdh
/** * Get configured msg subscribe-throttling rate. Returns -1 if not configured * * @return */ public long getSubscribeRatePerConsumer(ConsumerIdentifier consumerIdentifier) { return subscribeRateLimiter.get(consumerIdentifier) != null ? subscribeRateLimiter.get(consumerIdentifier).getRate() : -1; }
3.26
pulsar_SubscribeRateLimiter_subscribeAvailable_rdh
/** * checks if subscribe-rate limit is configured and if it's configured then check if * subscribe are available or not. * * @return */ public boolean subscribeAvailable(ConsumerIdentifier consumerIdentifier) { return (subscribeRateLimiter.get(consumerIdentifier) == null) || (subscribeRateLimiter.get(consume...
3.26
pulsar_SubscribeRateLimiter_getAvailableSubscribeRateLimit_rdh
/** * returns available subscribes if subscribe-throttling is enabled else it returns -1. * * @return */ public long getAvailableSubscribeRateLimit(ConsumerIdentifier consumerIdentifier) { return subscribeRateLimiter.get(consumerIdentifier) == null ? -1 : subscribeRateLimiter.get(consumerIdentifier).getAvailabl...
3.26
pulsar_AbstractCASReferenceCounted_setRefCnt_rdh
/** * An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly. */ protected final void setRefCnt(int refCnt) { refCntUpdater.set(this, refCnt); }
3.26
pulsar_PulsarChannelInitializer_initTls_rdh
/** * Initialize TLS for a channel. Should be invoked before the channel is connected to the remote address. * * @param ch * the channel * @param sniHost * the value of this argument will be passed as peer host and port when creating the SSLEngine (which * in turn will use these values to set SNI header wh...
3.26
pulsar_LocalBookkeeperEnsemble_waitForConnection_rdh
// Waiting for the SyncConnected event from the ZooKeeper server public void waitForConnection() throws IOException { try { if (!clientConnectLatch.await(zkSessionTimeOut, TimeUnit.MILLISECONDS)) { throw new IOException("Couldn't connect to zookeeper server"); } } catch (Interrupte...
3.26
pulsar_LocalBookkeeperEnsemble_getBookies_rdh
/** * just for testing, avoid direct access to the bookie to start/stop etc. * * @return bookies */ public BookieServer[] getBookies() { BookieServer[] bookies = new BookieServer[bookieComponents.length]; int i = 0; for (LifecycleComponentStack stack : bookieComponents) { for (int numComp = 0; n...
3.26
pulsar_BrokerService_extractTopic_rdh
/** * Safely extract optional topic instance from a future, in a way to avoid unchecked exceptions and race conditions. */ public static Optio...
3.26
pulsar_BrokerService_unblockDispatchersOnUnAckMessages_rdh
/** * Unblocks the dispatchers and removes it from the {@link #blockedDispatchers} list. * * @param dispatcherList */ public void unblockDispatchersOnUnAckMessages(List<PersistentDispatcherMultipleConsumers> dispatcherList) { lock.writeLock().lock(); try { dispatcherList.forEach(dispatcher -> { ...
3.26
pulsar_BrokerService_setupTopicPublishRateLimiterMonitor_rdh
/** * Schedules and monitors publish-throttling for all owned topics that has publish-throttling configured. It also * disables and shutdowns publish-rate-limiter monitor task if broker disables it. */ public void setupTopicPublishRateLimiterMonitor() { // set topic PublishRateLimiterMonitor long topicTickTi...
3.26
pulsar_BrokerService_unloadDeletedReplNamespace_rdh
/** * Unloads the namespace bundles if local cluster is not part of replication-cluster list into the namespace. * So, broker that owns the bundle and doesn't receive the zk-...
3.26
pulsar_BrokerService_updateConfigurationAndRegisterListeners_rdh
/** * Update dynamic-ServiceConfiguration with value present into zk-configuration-map and register listeners on * dynamic-ServiceConfiguration field to take appropriate action on change of zk-configuration-map. */ private void updateConfigurationAndRegisterListeners() { // (1) Dynamic-config value validation:...
3.26
pulsar_BrokerService_loadOrCreatePersistentTopic_rdh
/** * It creates a topic async and returns CompletableFuture. It also throttles down configured max-concurrent topic * loading and puts them into queue once in-process topics are created. ...
3.26
pulsar_BrokerService_createPendingLoadTopic_rdh
/** * Create pending topic and on completion it picks the next one until processes all topics in * {@link #pendingTopicLoadingQueue}.<br/> * It also tries to acquire {@link #topicLoadRequestSemaphore} so throttle down newly incoming topics and release * permit if it was successful to acquire it. */ private void cr...
3.26
pulsar_BrokerService_setupBrokerPublishRateLimiterMonitor_rdh
/** * Schedules and monitors publish-throttling for broker that has publish-throttling configured. It also * disables and shutdowns publish-rate-limiter monitor for broker task if broker disables it. */ public void setupBrokerPublishRateLimiterMonitor() { // set broker PublishRateLimiterMonitor long brokerTi...
3.26
pulsar_BrokerService_unloadServiceUnit_rdh
/** * Unload all the topic served by the broker service under the given service unit. * * @param serviceUnit * @param disconnectClients * disconnect clients * @param closeWithoutWaitingClientDisconnect * don't wait for clients to disconnect * and forcefully close managed-ledger * @return */ private Co...
3.26
pulsar_BrokerService_registerConfigurationListener_rdh
/** * Allows a listener to listen on update of {@link ServiceConfiguration} change, so listener can take appropriate * action if any specific config-field value has been changed. * * On notification, listener should first check if config value has been changed and after taking appropriate * action, listener should...
3.26
pulsar_BrokerService_updateDynamicServiceConfiguration_rdh
/** * Updates pulsar.ServiceConfiguration's dynamic field with value persistent into zk-dynamic path. It also validates * dynamic-value before updating it and throws {@code IllegalArgumentException} if validation fails */ private void updateDynamicServiceConfiguration() { Optional<Map<String, String>> configCach...
3.26
pulsar_BrokerService_startProtocolHandlers_rdh
// This call is used for starting additional protocol handlers public void startProtocolHandlers(Map<String, Map<InetSocketAddress, ChannelInitializer<SocketChannel>>> protocolHandlers) {protocolHandlers.forEach((protocol, initializers) -> { initializers.forEach((address, initializer) -> { try { ...
3.26
pulsar_BrokerService_checkUnAckMessageDispatching_rdh
/** * Adds given dispatcher's unackMessage count to broker-unack message count and if it reaches to the * {@link #maxUnackedMessages} then it blocks all the dispatchers which has unack-messages higher than * {@link #maxUnackedMsgsPerDispatcher}. It unblocks all dispatchers once broker-unack message counts decreased ...
3.26
pulsar_BrokerService_m9_rdh
/** * Get {@link TopicPolicies} for the parameterized topic. * * @param topicName * @return TopicPolicies, if they exist. Otherwise, the value will not be present. */ public Optional<TopicPolicies> m9(TopicName topicName) { if (!pulsar().getConfig().isTopicLevelPoliciesEnabled()) { return Optional.empt...
3.26
pulsar_BrokerService_addUnAckedMessages_rdh
/** * If per-broker unacked message reached to limit then it blocks dispatcher if its unacked message limit has been * reached to {@link #maxUnackedMsgsPerDispatcher}. * * @param dispatcher * @param numberOfMessages */ public void addUnAckedMessages(PersistentDispatcherMultipleConsumers dispatcher, int numberOfMe...
3.26
pulsar_BrokerService_getTopicReference_rdh
/** * Get a reference to a topic that is currently loaded in the broker. * * This method will not make the broker attempt to load the topic if it's not already. */public Optional<Topic> getTopicReference(String topic) { CompletableFuture<Optional<Topic>> future = topics.get(topic); if (((future != null) && ...
3.26
pulsar_BrokerService_forEachTopic_rdh
/** * Iterates over all loaded topics in the broker. */ public void forEachTopic(Consumer<Topic> consumer) { topics.forEach((n, t) -> { Optional<Topic> topic = extractTopic(t); topic.ifPresent(consumer::accept); }); }
3.26
pulsar_OpAddEntry_handleAddFailure_rdh
/** * It handles add failure on the given ledger. it can be triggered when add-entry fails or times out. * * @param lh */ void handleAddFailure(final LedgerHandle lh) { // If we get a write error, we will try to create a new ledger and re-submit the pending writes. If the // ledger creation fails (persistent bk f...
3.26
pulsar_OpAddEntry_run_rdh
// Called in executor hashed on managed ledger name, once the add operation is complete @Override public void run() { if (payloadProcessorHandle != null) { payloadProcessorHandle.release(); } // Remove this entry from the head of the pending queue OpAddEntry firstInQueue = ml.pendingAddEntries.poll(); if (firstInQueue ...
3.26
pulsar_MessageRouter_choosePartition_rdh
/** * Choose a partition based on msg and the topic metadata. * * @param msg * message to route * @param metadata * topic metadata * @return the partition to route the message. * @since 1.22.0 */ default int choosePartition(Message<?> msg, TopicMetadata metadata) { return choosePartition(msg); }
3.26
pulsar_SecretsProvider_init_rdh
/** * This file defines the SecretsProvider interface. This interface is used by the function * instances/containers to actually fetch the secrets. What SecretsProvider to use is * decided by the SecretsProviderConfigurator. */public interface SecretsProvider { /** * Initialize the SecretsProvider. * ...
3.26
pulsar_SecretsProvider_interpolateSecretForValue_rdh
/** * If the passed value is formatted as a reference to a secret, as defined by the implementation, return the * referenced secret. If the value is not formatted as a secret reference or the referenced secret does not exist, * return null. * * @param value * a config value that may be formatted as a reference ...
3.26
pulsar_PulsarAdminException_wrap_rdh
/** * Clone the exception and grab the current stacktrace. * * @param e * a PulsarAdminException * @return a new PulsarAdminException, of the same class. */ public static PulsarAdminException wrap(PulsarAdminException e) { PulsarAdminException cloned = e.clone(); if (e.getClass() != cloned.getClass()) { ...
3.26
pulsar_PulsarAdminException_clone_rdh
/** * This method is meant to be overriden by all subclasses. * We cannot make it 'abstract' because it would be a breaking change in the public API. * * @return a new PulsarAdminException */ protected PulsarAdminException clone() { return new PulsarAdminException(getMessage(), getCause(), httpError, f0); }
3.26
pulsar_LedgerOffloaderFactory_create_rdh
/** * Create a ledger offloader with the provided configuration, user-metadata, schema storage, * scheduler and offloaderStats. * * @param offloadPolicies * offload policies * @param userMetadata * user metadata * @param schemaStorage * used for schema lookup in offloader * @param scheduler * schedul...
3.26
pulsar_ReaderConfiguration_setReaderName_rdh
/** * Set the consumer name. * * @param readerName */ public ReaderConfiguration setReaderName(String readerName) { checkArgument(StringUtils.isNotBlank(readerName)); conf.setReaderName(readerName); return this; }
3.26
pulsar_ReaderConfiguration_setCryptoFailureAction_rdh
/** * Sets the ConsumerCryptoFailureAction to the value specified. * * @param action * The action to take when the decoding fails */ public void setCryptoFailureAction(ConsumerCryptoFailureAction action) { conf.setCryptoFailureAction(action); }
3.26
pulsar_ReaderConfiguration_getSubscriptionRolePrefix_rdh
/** * * @return the subscription role prefix for subscription auth */ public String getSubscriptionRolePrefix() { return conf.getSubscriptionRolePrefix(); }
3.26
pulsar_ReaderConfiguration_setReaderListener_rdh
/** * Sets a {@link ReaderListener} for the reader * <p> * When a {@link ReaderListener} is set, application will receive messages through it. Calls to * {@link Reader#readNext()} will not be allowed. * * @param readerListener * the listener object */public ReaderConfigurat...
3.26
pulsar_ReaderConfiguration_getReceiverQueueSize_rdh
/** * * @return the configure receiver queue size value */ public int getReceiverQueueSize() { return conf.getReceiverQueueSize(); }
3.26
pulsar_ReaderConfiguration_setCryptoKeyReader_rdh
/** * Sets a {@link CryptoKeyReader}. * * @param cryptoKeyReader * CryptoKeyReader object */ public ReaderConfiguration setCryptoKeyReader(CryptoKeyReader cryptoKeyReader) { Objects.requireNonNull(cryptoKeyReader); conf.setCryptoKeyReader(cryptoKeyReader); return this; }
3.26
pulsar_ReaderConfiguration_setSubscriptionRolePrefix_rdh
/** * Set the subscription role prefix for subscription auth. The default prefix is "reader". * * @param subscriptionRolePrefix */ public ReaderConfiguration setSubscriptionRolePrefix(String subscriptionRolePrefix) { checkArgument(StringUtils.isNotBlank(subscriptionRolePrefix)); conf.setSubscriptionRolePrefix(subs...
3.26
pulsar_ReaderConfiguration_getCryptoFailureAction_rdh
/** * * @return The ConsumerCryptoFailureAction */ public ConsumerCryptoFailureAction getCryptoFailureAction() { return conf.getCryptoFailureAction(); }
3.26
pulsar_ReaderConfiguration_getCryptoKeyReader_rdh
/** * * @return the CryptoKeyReader */ public CryptoKeyReader getCryptoKeyReader() { return conf.getCryptoKeyReader(); }
3.26
pulsar_ReaderConfiguration_getReaderName_rdh
/** * * @return the consumer name */ public String getReaderName() {return conf.getReaderName(); }
3.26
pulsar_ReaderConfiguration_setReceiverQueueSize_rdh
/** * Sets the size of the consumer receive queue. * <p> * The consumer receive queue controls how many messages can be accumulated by the {@link Consumer} before the * application calls {@link Consumer#receive()}. Using a higher value could potentially increase the consumer * throughput at the expense of bigger m...
3.26
pulsar_ReaderConfiguration_getReaderListener_rdh
/** * * @return the configured {@link ReaderListener} for the reader */public ReaderListener<byte[]> getReaderListener() {return readerListener; }
3.26
pulsar_InternalConfigurationData_getLedgersRootPath_rdh
/** * * @deprecated */ @Deprecated public String getLedgersRootPath() { return ledgersRootPath; }
3.26
pulsar_SchemaUtils_serializeSchemaProperties_rdh
/** * Serialize schema properties. * * @param properties * schema properties * @return the serialized schema properties */ public static String serializeSchemaProperties(Map<String, String> properties) { GsonBuilder gsonBuilder = new GsonBuilder().registerTypeHierarchyAdapter(Map.class, SCHEMA_PROPERTIES_...
3.26
pulsar_SchemaUtils_jsonifySchemaInfo_rdh
/** * Jsonify the schema info. * * @param schemaInfo * the schema info * @return the jsonified schema info */ public static String jsonifySchemaInfo(SchemaInfo schemaInfo) { GsonBuilder gsonBuilder = new GsonBuilder().setPrettyPrinting().registerTypeHierarchyAdapter(byte[].class, new ByteArrayToStringAdapter(sc...
3.26
pulsar_SchemaUtils_convertKeyValueDataStringToSchemaInfoSchema_rdh
/** * Convert the key/value schema info data json bytes to key/value schema info data bytes. * * @param keyValueSchemaInfoDataJsonBytes * the key/value schema info data json bytes * @return the key/value schema info data bytes */ public static byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSc...
3.26
pulsar_SchemaUtils_convertKeyValueSchemaInfoDataToString_rdh
/** * Convert the key/value schema info data to string. * * @param kvSchemaInfo * the key/value schema info * @return the convert schema info data string */ public static String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) throws IOException { ObjectReader objectRead...
3.26
pulsar_SchemaUtils_deserializeSchemaProperties_rdh
/** * Deserialize schema properties from a serialized schema properties. * * @param serializedProperties * serialized properties * @return the deserialized properties */ public static Map<String, String> deserializeSchemaProperties(String serializedProperties) { GsonBuilder gsonBuilder = new GsonBuil...
3.26
pulsar_SchemaUtils_m0_rdh
/** * Jsonify the schema info with version. * * @param schemaInfoWithVersion * the schema info * @return the jsonified schema info with version */ public static String m0(SchemaInfoWithVersion schemaInfoWithVersion) { GsonBuilder gsonBuilder = new GsonBuilder().setPrettyPrinting().registerTypeHierarchyAdap...
3.26
pulsar_SchemaUtils_jsonifyKeyValueSchemaInfo_rdh
/** * Jsonify the key/value schema info. * * @param kvSchemaInfo * the key/value schema info * @return the jsonified schema info */ public static String jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) { GsonBuilder gsonBuilder = new GsonBuilder().registerTypeHierarchyAdapter(SchemaI...
3.26
pulsar_ProducerConfigurationData_isEncryptionEnabled_rdh
/** * Returns true if encryption keys are added. */ @JsonIgnore public boolean isEncryptionEnabled() { return ((this.encryptionKeys != null) && (!this.encryptionKeys.isEmpty())) && (this.cryptoKeyReader != null); }
3.26
pulsar_BaseContext_getStateStore_rdh
/** * Get the state store with the provided store name. * * @param tenant * the state tenant name * @param ns * the state namespace name * @param name * the state store name * @param <X> * the type of interface of the store to return * @return the state store instance. * @throws ClassCastException ...
3.26
pulsar_BaseContext_getPulsarClient_rdh
/** * Get the pre-configured pulsar client. * * You can use this client to access Pulsar cluster. * The Function will be responsible for disposing this client. * * @return the instance of pulsar client */ default PulsarClient getPulsarClient() { throw new UnsupportedOperat...
3.26
pulsar_BaseContext_getPulsarClientBuilder_rdh
/** * Get the pre-configured pulsar client builder. * * You can use this Builder to setup client to connect to the Pulsar cluster. * But you need to close client properly after using it. * * @return the instance of pulsar client builder. */ default ClientBuilder getPulsarClientBuilder() { throw new Unsupported...
3.26
pulsar_CmdUsageFormatter_appendCommands_rdh
/** * This method is copied from DefaultUsageFormatter, * but the ability to skip deprecated commands is added. * * @param out * @param indentCount * @param descriptionIndent * @param indent */ @Override public void appendCommands(StringBuilder out, int indentCount, int descriptionIndent, String indent) { o...
3.26
pulsar_ConfigValidation_validateConfig_rdh
/** * Validate the config object with default annotation class. * * @param config * config object */ public static void validateConfig(Object config) { validateConfig(config, DEFAULT_ANNOTATION_CLASS); }
3.26
pulsar_AuthenticationProviderToken_getValidationKey_rdh
/** * Try to get the validation key for tokens from several possible config options. */ private Key getValidationKey(ServiceConfiguration conf) throws IOException { String tokenSecretKey = ((String) (conf.getProperty(confTokenSecretKeySettingName))); String tokenPublicKey = ((String) (conf.getProperty(confTok...
3.26
pulsar_AuthenticationProviderToken_getConfTokenAllowedClockSkewSeconds_rdh
// get Token's allowed clock skew in seconds. If not configured, defaults to 0. private long getConfTokenAllowedClockSkewSeconds(ServiceConfiguration conf) throws IllegalArgumentException { String allowedSkewStr = ((String) (conf.getProperty(confTokenAllowedClockSkewSecondsSettingName))); if (StringUtils.isNotBlank(all...
3.26
pulsar_AuthenticationProviderToken_getTokenAudience_rdh
// get Token Audience that stands for this broker from configuration, if not configured return null. private String getTokenAudience(ServiceConfiguration conf) throws IllegalArgumentException { String tokenAudience = ((String) (conf.getProperty(confTokenAudienceSettingName))); if (StringUtils.isNotBlank(tokenAudience)...
3.26
pulsar_AuthenticationProviderToken_authenticate_rdh
/** * * @param authData * Authentication data. * @return null. Explanation of returning null values, {@link AuthenticationState#authenticateAsync(AuthData)} * @throws AuthenticationException */ @Override public AuthData authenticate(AuthData authData) throws AuthenticationException { String token = new String(...
3.26
pulsar_TopicEventsDispatcher_notify_rdh
/** * Dispatches notification to specified listeners. * * @param listeners * @param topic * @param event * @param stage * @param t */ public static void notify(TopicEventsListener[] listeners, String topic, TopicEventsListener.TopicEvent event, TopicEventsListener.EventSt...
3.26
pulsar_TopicEventsDispatcher_removeTopicEventListener_rdh
/** * Removes listeners. * * @param listeners */ public void removeTopicEventListener(TopicEventsListener... listeners) { Objects.requireNonNull(listeners); Arrays.stream(listeners).filter(x -> x != null).forEach(f0::remove); }
3.26
pulsar_TopicEventsDispatcher_addTopicEventListener_rdh
/** * Adds listeners, ignores null listeners. * * @param listeners */ public void addTopicEventListener(TopicEventsListener... listeners) { Objects.requireNonNull(listeners); Arrays.stream(listeners).filter(x -> x != null).forEach(f0::add); }
3.26
pulsar_TopicEventsDispatcher_notifyOnCompletion_rdh
/** * Dispatches SUCCESS/FAILURE notification to all currently added listeners on completion of the future. * * @param future * @param topic * @param event * @param <T> * @return future of a new completion stage */ public <T> CompletableFuture<T> notifyOnCompletion(CompletableFuture<T> future, String topic, Top...
3.26
pulsar_KeyStoreSSLContext_createClientSslContext_rdh
// for web client public static SSLContext createClientSslContext(String keyStoreTypeString, String keyStorePath, String keyStorePassword, String trustStoreTypeString, String trustStorePath, String trustStorePassword) throws GeneralSecurityException, IOException { KeyStoreSSLContext keyStoreSSLContext = new KeyStor...
3.26
pulsar_KeyStoreSSLContext_createServerSslContext_rdh
// the web server only use this method to get SSLContext, it won't use this to configure engine // no need ciphers and protocols public static SSLContext createServerSslContext(String sslProviderString, String keyStoreTypeString, String keyStorePath, String keyStorePassword, boolean allowInsecureConnection, String t...
3.26
pulsar_NamespaceBundleStats_compareTo_rdh
// compare 2 bundles in below aspects: // 1. Inbound bandwidth // 2. Outbound bandwidth // 3. Total megRate (both in and out) // 4. Total topics and producers/consumers // 5. Total cache size public int compareTo(NamespaceBundleStats other) { int result = this.compareByBandwidthIn(other); if (result == 0) { ...
3.26
pulsar_BrokerStatsBase_getTopics2_rdh
// https://github.com/swagger-api/swagger-ui/issues/558 // map support missing @GET @Path("/destinations") @ApiOperation(value = "Get all the topic stats by namespace", response = OutputStream.class, responseContainer = "OutputStream") @ApiResponses({ @ApiResponse(code = 403, message = "Don't have admin permission") })...
3.26
pulsar_ProducerImpl_cnx_rdh
// wrapper for connection methods ClientCnx cnx() { return this.connectionHandler.cnx(); }
3.26
pulsar_ProducerImpl_updateMessageMetadata_rdh
/** * Update the message metadata except those fields that will be updated for chunks later. * * @param msgMetadata * @param uncompressedSize * @return the sequence id */ private void updateMessageMetadata(final MessageMetadata msgMetadata, final int uncompressedSize) { if (!msgMetadata.hasPublishTime())...
3.26
pulsar_ProducerImpl_recoverProcessOpSendMsgFrom_rdh
// Must acquire a lock on ProducerImpl.this before calling method. private void recoverProcessOpSendMsgFrom(ClientCnx cnx, MessageImpl from, long expectedEpoch) { if ((expectedEpoch != this.connectionHandler.getEpoch()) || (cnx() == null)) {// In this case, the cnx passed to this method is no longer the active connecti...
3.26
pulsar_ProducerImpl_isMessageSizeExceeded_rdh
/** * Check if final message size for non-batch and non-chunked messages is larger than max message size. */ private boolean isMessageSizeExceeded(OpSendMsg op) { if ((op.msg != null) && (!conf.isChunkingEnabled())) { int messageSize = op.getMessageHeaderAndPayloadSize(); if (messageSize > ClientCnx.getMaxMessageSize...
3.26
pulsar_ProducerImpl_failPendingBatchMessages_rdh
/** * fail any pending batch messages that were enqueued, however batch was not closed out. */ private void failPendingBatchMessages(PulsarClientException ex) { if (f0.isEmpty()) { return; } final int numMessagesInBatch = f0.getNumMessagesInBatch(); final long currentBatchSize = f0.getCurrentBatchSize(); final int ba...
3.26
pulsar_ProducerImpl_stripChecksum_rdh
/** * Strips checksum from {@link OpSendMsg} command if present else ignore it. * * @param op */ private void stripChecksum(OpSendMsg op) { ByteBufPair msg = op.cmd; if (msg != null) { int totalMsgBufSize = msg.readableBytes(); ByteBuf headerFrame = msg.getFirst(); headerFrame.markReaderIndex(); try { headerFrame....
3.26
pulsar_ProducerImpl_failPendingMessages_rdh
/** * This fails and clears the pending messages with the given exception. This method should be called from within the * ProducerImpl object mutex. */ private void failPendingMessages(ClientCnx cnx, PulsarClientException ex) { if (cnx == null) { final AtomicInteger v128 = new AtomicInteger(); final boolean v129 = ...
3.26
pulsar_ProducerImpl_recoverChecksumError_rdh
/** * Checks message checksum to retry if message was corrupted while sending to broker. Recomputes checksum of the * message header-payload again. * <ul> * <li><b>if matches with existing checksum</b>: it means message was corrupt while sending to broker. So, resend * message</li> * <li><b>if doesn't match with ...
3.26
pulsar_ProducerImpl_run_rdh
/** * Process sendTimeout events. */ @Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } long timeToWaitMs; synchronized(this) { // If it's closing/closed we need to ignore this timeout and not schedule next timeout. if ((getState() == State.Closing) || (getState() =...
3.26
pulsar_ProducerImpl_applyCompression_rdh
/** * Compress the payload if compression is configured. * * @param payload * @return a new payload */ private ByteBuf applyCompression(ByteBuf payload) { ByteBuf compressedPayload = compressor.encode(payload); payload.release(); return compressedPayload; }
3.26
pulsar_ProducerImpl_maybeScheduleBatchFlushTask_rdh
// must acquire semaphore before calling private void maybeScheduleBatchFlushTask() { if ((this.batchFlushTask != null) || (getState() != State.Ready)) { return; } scheduleBatchFlushTask(conf.getBatchingMaxPublishDelayMicros()); }
3.26
pulsar_ProducerImpl_scheduleBatchFlushTask_rdh
// must acquire semaphore before calling private void scheduleBatchFlushTask(long batchingDelayMicros) { ClientCnx cnx = cnx(); if ((cnx != null) && isBatchMessagingEnabled()) { this.batchFlushTask = cnx.ctx().executor().schedule(catchingAndLoggingThrowables(this::batchFlushTask), batchingDelayMicros, TimeUnit.MIC...
3.26
pulsar_AuthenticationDataProvider_getTlsKeyStoreParams_rdh
/** * Used for TLS authentication with keystore type. * * @return a KeyStoreParams for the client certificate chain, or null if the data are not available */ default KeyStoreParams getTlsKeyStoreParams() { return null; }
3.26
pulsar_AuthenticationDataProvider_hasDataForHttp_rdh
/* HTTP */ /** * Check if data for HTTP are available. * * @return true if this authentication data contain data for HTTP */ default boolean hasDataForHttp() { return false; }
3.26
pulsar_AuthenticationDataProvider_getTlsCertificateFilePath_rdh
/** * * @return a client certificate file path */ default String getTlsCertificateFilePath() { return null; }
3.26
pulsar_AuthenticationDataProvider_hasDataFromCommand_rdh
/* Command */ /** * Check if data from Pulsar protocol are available. * * @return true if this authentication data contain data from Pulsar protocol */ default boolean hasDataFromCommand() { return false; }
3.26
pulsar_AuthenticationDataProvider_getHttpHeaders_rdh
/** * * @return an enumeration of all the header names */ default Set<Map.Entry<String, String>> getHttpHeaders() throws Exception { return null;}
3.26
pulsar_AuthenticationDataProvider_hasDataForTls_rdh
/* TLS */ /** * Check if data for TLS are available. * * @return true if this authentication data contain data for TLS */ default boolean hasDataForTls() { return false; }
3.26
pulsar_AuthenticationDataProvider_m0_rdh
/** * For mutual authentication, This method use passed in `data` to evaluate and challenge, * then returns null if authentication has completed; * returns authenticated data back to server side, if authentication has not completed. * * <p>Mainly used for mutual authentication like sasl. */ default AuthData m0(Au...
3.26
pulsar_AuthenticationDataProvider_getHttpAuthType_rdh
/** * * @return a authentication scheme, or {@code null} if the request will not be authenticated. */ default String getHttpAuthType() { return null; }
3.26
pulsar_AuthenticationDataProvider_getTlsPrivateKeyFilePath_rdh
/** * * @return a private key file path */ default String getTlsPrivateKeyFilePath() { return null; } /** * * @return an input-stream of the trust store, or null if the trust-store provided at {@link ClientConfigurationData#getTlsTrustStorePath()}
3.26
pulsar_AuthenticationDataProvider_getCommandData_rdh
/** * * @return authentication data which will be stored in a command */ default String getCommandData() { return null; }
3.26
pulsar_ModularLoadManagerStrategy_create_rdh
/** * Create a placement strategy using the configuration. * * @param conf * ServiceConfiguration to use. * @return A placement strategy from the given configurations. */ static ModularLoadManagerStrategy create(final ServiceConfiguration conf) { try { return Reflections.createInstance(conf.getLoa...
3.26
pulsar_ModularLoadManagerStrategy_onActiveBrokersChange_rdh
/** * Triggered when active brokers change. */ default void onActiveBrokersChange(Set<String> activeBrokers) { }
3.26
pulsar_BacklogQuotaManager_advanceSlowestSystemCursor_rdh
/** * Advances the slowest cursor if that is a system cursor. * * @param persistentTopic * @return true if the slowest cursor is a system cursor */ private boolean advanceSlowestSystemCursor(PersistentTopic persistentTopic) { ManagedLedgerImpl mLedger = ((ManagedLedgerImpl) (persistentTopic.getManagedLedger())...
3.26