name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
pulsar_BacklogQuotaManager_dropBacklogForSizeLimit_rdh
/** * Drop the backlog on the topic. * * @param persistentTopic * The topic from which backlog should be dropped * @param quota * Backlog quota set for the topic */ private void dropBacklogForSizeLimit(PersistentTopic persistentTopic, BacklogQuota quota) { // Set the reduction factor to 90%. The aim is t...
3.26
pulsar_BacklogQuotaManager_m0_rdh
/** * Disconnect producers on given topic. * * @param persistentTopic * The topic on which all producers should be disconnected */ private void m0(PersistentTopic persistentTopic) { List<CompletableFuture<Void>> futures = new ArrayList<>(); Map<String, Producer> v21 = persistentTopic.getProducers();v...
3.26
pulsar_BacklogQuotaManager_dropBacklogForTimeLimit_rdh
/** * Drop the backlog on the topic. * * @param persistentTopic * The topic from which backlog should be dropped * @param quota * Backlog quota set for the topic */ private void dropBacklogForTimeLimit(PersistentTopic persistentTopic, BacklogQuota quota, boolean preciseTimeBasedBacklogQuotaCheck) { // I...
3.26
pulsar_BacklogQuotaManager_handleExceededBacklogQuota_rdh
/** * Handle exceeded size backlog by using policies set in the zookeeper for given topic. * * @param persistentTopic * Topic on which backlog has been exceeded */ public void handleExceededBacklogQuota(PersistentTopic persistentTopic, BacklogQuotaType backlogQuotaType, boolean preciseTimeBasedBacklogQuotaCheck)...
3.26
pulsar_NamespacesBase_internalSetReplicatorDispatchRate_rdh
/** * Base method for setReplicatorDispatchRate v1 and v2. * Notion: don't re-use this logic. */protected void internalSetReplicatorDispatchRate(AsyncResponse asyncResponse, DispatchRateImpl dispatchRate) { validateSuperUserAccessAsync().thenAccept(__ -> { log.info("[{}] Set namespace replicator dispatch-rate {}/{}"...
3.26
pulsar_NamespacesBase_m1_rdh
// clear zk-node resources for deleting namespace protected CompletableFuture<Void> m1() { // clear resource of `/namespace/{namespaceName}` for zk-node return // clear /loadbalance/bundle-data // clear z-node of local policies // we have successfully removed all the ownership for the namespace,...
3.26
pulsar_NamespacesBase_internalDeleteNamespaceAsync_rdh
/** * Delete the namespace and retry to resolve some topics that were not created successfully(in metadata) * during the deletion. */ @Nonnull protected CompletableFuture<Void> internalDeleteNamespaceAsync(boolean force) { final CompletableFuture<Void> future = new CompletableFuture<>(); m0(force, 5, fu...
3.26
pulsar_NamespacesBase_internalGetBacklogQuotaMap_rdh
/** * Base method for getBackLogQuotaMap v1 and v2. * Notion: don't re-use this logic. */ protected void internalGetBacklogQuotaMap(AsyncResponse asyncResponse) { validateNamespacePolicyOperationAsync(namespaceName, PolicyName.BACKLOG, PolicyOperation.READ).thenCompose(__ -> namespaceResources().getPoliciesAsync(na...
3.26
pulsar_NamespacesBase_internalRemoveReplicatorDispatchRate_rdh
/** * Base method for removeReplicatorDispatchRate v1 and v2. * Notion: don't re-use this logic. */ protected void internalRemoveReplicatorDispatchRate(AsyncResponse asyncResponse) { validateSuperUserAccessAsync().thenCompose(__ -> namespaceResources().setPoliciesAsync(namespaceName, policies -> { String clusterName...
3.26
pulsar_NamespacesBase_internalGetReplicatorDispatchRate_rdh
/** * Base method for getReplicatorDispatchRate v1 and v2. * Notion: don't re-use this logic. */ protected void internalGetReplicatorDispatchRate(AsyncResponse asyncResponse) { validateNamespacePolicyOperationAsync(namespaceName, PolicyName.REPLICATION_RATE, PolicyOperation.READ).thenCompose(__ -> namespaceResources...
3.26
pulsar_NamespacesBase_internalSetBacklogQuota_rdh
/** * Base method for setBacklogQuota v1 and v2. * Notion: don't re-use this logic. */ protected void internalSetBacklogQuota(AsyncResponse asyncResponse, BacklogQuotaType backlogQuotaType, BacklogQuota backlogQuota) { validateNamespacePolicyOperationAsync(namespaceName, PolicyName.BACKLOG, PolicyOperation.WRITE).th...
3.26
pulsar_ClientConfiguration_isTlsAllowInsecureConnection_rdh
/** * * @return whether the Pulsar client accept untrusted TLS certificate from broker */ public boolean isTlsAllowInsecureConnection() { return confData.isTlsAllowInsecureConnection(); }
3.26
pulsar_ClientConfiguration_setStatsInterval_rdh
/** * Set the interval between each stat info <i>(default: 60 seconds)</i> Stats will be activated with positive. * statsIntervalSeconds It should be set to at least 1 second * * @param statsInterval * the interval between each stat info * @param unit * time unit for {@code statsInterval} */ public void set...
3.26
pulsar_ClientConfiguration_isUseTcpNoDelay_rdh
/** * * @return whether TCP no-delay should be set on the connections */ public boolean isUseTcpNoDelay() { return confData.isUseTcpNoDelay();}
3.26
pulsar_ClientConfiguration_getConnectionsPerBroker_rdh
/** * * @return the max number of connections per single broker */ public int getConnectionsPerBroker() { return confData.getConnectionsPerBroker();}
3.26
pulsar_ClientConfiguration_setAuthentication_rdh
/** * Set the authentication provider to use in the Pulsar client instance. * <p> * Example: * <p> * * <pre> * <code> * ClientConfiguration confData = new ClientConfiguration(); * String authPluginClassName = "org.apache.pulsar.client.impl.auth.MyAuthentication"; * Map<String, String> authParams = new HashMap...
3.26
pulsar_ClientConfiguration_setUseTcpNoDelay_rdh
/** * Configure whether to use TCP no-delay flag on the connection, to disable Nagle algorithm. * <p> * No-delay features make sure packets are sent out on the network as soon as possible, and it's critical to achieve * low latency publishes. On the other hand, sending out a huge number of small packets might limit...
3.26
pulsar_ClientConfiguration_getIoThreads_rdh
/** * * @return the number of threads to use for handling connections */ public int getIoThreads() { return confData.getNumIoThreads(); }
3.26
pulsar_ClientConfiguration_setTlsTrustCertsFilePath_rdh
/** * Set the path to the trusted TLS certificate file. * * @param tlsTrustCertsFilePath */ public void setTlsTrustCertsFilePath(String tlsTrustCertsFilePath) { confData.setTlsTrustCertsFilePath(tlsTrustCertsFilePath); }
3.26
pulsar_ClientConfiguration_getOperationTimeoutMs_rdh
/** * * @return the operation timeout in ms */ public long getOperationTimeoutMs() { return confData.getOperationTimeoutMs(); }
3.26
pulsar_ClientConfiguration_getMaxNumberOfRejectedRequestPerConnection_rdh
/** * Get configured max number of reject-request in a time-frame (60 seconds) after which connection will be closed. * * @return */ public int getMaxNumberOfRejectedRequestPerConnection() {return confData.getMaxNumberOfRejectedRequestPerConnection(); }
3.26
pulsar_ClientConfiguration_getTlsTrustCertsFilePath_rdh
/** * * @return path to the trusted TLS certificate file */ public String getTlsTrustCertsFilePath() {return confData.getTlsTrustCertsFilePath(); }
3.26
pulsar_ClientConfiguration_setTlsHostnameVerificationEnable_rdh
/** * It allows to validate hostname verification when client connects to broker over tls. It validates incoming x509 * certificate and matches provided hostname(CN/SAN) with expected broker's host name. It follows RFC 2818, 3.1. * Server Identity hostname verification. * * @see <a href="https://tools.ietf.org/htm...
3.26
pulsar_ClientConfiguration_setConnectionsPerBroker_rdh
/** * Sets the max number of connection that the client library will open to a single broker. * <p> * By default, the connection pool will use a single connection for all the producers and consumers. Increasing this * parameter may improve throughput when using many producers over a high latency connection. * <p> ...
3.26
pulsar_ClientConfiguration_setIoThreads_rdh
/** * Set the number of threads to be used for handling connections to brokers <i>(default: 1 thread)</i>. * * @param numIoThreads */ public void setIoThreads(int numIoThreads) { checkArgument(numIoThreads > 0); confData.setNumIoThreads(numIoThreads); }
3.26
pulsar_ClientConfiguration_getStatsIntervalSeconds_rdh
/** * Stats will be activated with positive statsIntervalSeconds. * * @return the interval between each stat info <i>(default: 60 seconds)</i> */ public long getStatsIntervalSeconds() { return confData.getStatsIntervalSeconds(); }
3.26
pulsar_ClientConfiguration_getListenerThreads_rdh
/** * * @return the number of threads to use for message listeners */ public int getListenerThreads() { return confData.getNumListenerThreads(); }
3.26
pulsar_ClientConfiguration_isUseTls_rdh
/** * * @return whether TLS encryption is used on the connection */ public boolean isUseTls() { return confData.isUseTls(); }
3.26
pulsar_ClientConfiguration_getAuthentication_rdh
/** * * @return the authentication provider to be used */ public Authentication getAuthentication() { return confData.getAuthentication(); }
3.26
pulsar_ClientConfiguration_setUseTls_rdh
/** * Configure whether to use TLS encryption on the connection <i>(default: false)</i>. * * @param useTls */ public void setUseTls(boolean useTls) {confData.setUseTls(useTls); }
3.26
pulsar_ClientConfiguration_getConcurrentLookupRequest_rdh
/** * Get configured total allowed concurrent lookup-request. * * @return */ public int getConcurrentLookupRequest() { return confData.getConcurrentLookupRequest(); }
3.26
pulsar_ClientConfiguration_setOperationTimeout_rdh
/** * Set the operation timeout <i>(default: 30 seconds)</i>. * <p> * Producer-create, subscribe and unsubscribe operations will be retried until this interval, after which the * operation will be marked as failed * * @param operationTimeout * operation timeout * @param unit * time unit for {@code operatio...
3.26
pulsar_ClientConfiguration_setConnectionTimeout_rdh
/** * Set the duration of time to wait for a connection to a broker to be established. If the duration * passes without a response from the broker, the connection attempt is dropped. * * @param duration * the duration to wait * @param unit * the time unit in which the duration is defined */public void setC...
3.26
pulsar_ClientCnx_addPendingLookupRequests_rdh
// caller of this method needs to be protected under pendingLookupRequestSemaphore private void addPendingLookupRequests(long requestId, TimedCompletableFuture<LookupDataResult> future) { pendingRequests.put(requestId, future); requestTimeoutQueue.add(new RequestTime(requestId, RequestType.Lookup)); }
3.26
pulsar_ClientCnx_exceptionCaught_rdh
// Command Handlers @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (state != State.Failed) { // No need to report stack trace for known exceptions that happen in disconnections log.warn("[{}] Got exception {}", remoteAddress, ClientCnx.isKnownException(cause) ? ...
3.26
pulsar_ClientCnx_idleCheck_rdh
/** * Check client connection is now free. This method will not change the state to idle. * * @return true if the connection is eligible. */ public boolean idleCheck() { if ((pendingRequests != null) && (!pendingRequests.isEmpty())) { return false; } if ((waitingLookupRequests != null) && (!waitingLookupRequests....
3.26
pulsar_ClientBuilderImpl_description_rdh
/** * Set the description. * * <p> By default, when the client connects to the broker, a version string like "Pulsar-Java-v<x.y.z>" will be * carried and saved by the broker. The client version string could be queried from the topic stats. * * <p> This metho...
3.26
pulsar_FunctionUtils_getFunctionClass_rdh
/** * Extract the Pulsar Function class from a function or archive. */ public static String getFunctionClass(ClassLoader classLoader) throws IOException { NarClassLoader ncl = ((NarClassLoader) (classLoader)); String configStr = ncl.getServiceDefinition(f0); FunctionDefinition conf = ObjectMapperFactory.g...
3.26
pulsar_ResourceUnitRanking_getEstimatedMessageRate_rdh
/** * Get the estimated message rate. */public double getEstimatedMessageRate() { return this.f0; }
3.26
pulsar_ResourceUnitRanking_getAllocatedLoadPercentageMemory_rdh
/** * Percetage of memory allocated to bundle's quota. */ public double getAllocatedLoadPercentageMemory() {return this.allocatedLoadPercentageMemory; }
3.26
pulsar_ResourceUnitRanking_calculateBrokerCapacity_rdh
/** * Calculate how many bundles could be handle with the specified resources. */ private static long calculateBrokerCapacity(ResourceQuota defaultQuota, double usableCPU, double usableMem, double usableBandwidthOut, double usableBandwidthIn) {// estimate capacity with usable CPU double cpuCapacity = (usableCPU / cpu...
3.26
pulsar_ResourceUnitRanking_removeLoadedServiceUnit_rdh
/** * Remove a service unit from the loaded bundle list. */ public void removeLoadedServiceUnit(String suName, ResourceQuota quota) { if (this.loadedBundles.remove(suName)) { this.allocatedQuota.substract(quota); estimateLoadPercentage(); } }
3.26
pulsar_ResourceUnitRanking_getLoadedBundles_rdh
/** * Get the loaded bundles. */ public Set<String> getLoadedBundles() { return loadedBundles; }
3.26
pulsar_ResourceUnitRanking_getEstimatedLoadPercentage_rdh
/** * Get the estimated load percentage. */public double getEstimatedLoadPercentage() { return this.estimatedLoadPercentage; }
3.26
pulsar_ResourceUnitRanking_isServiceUnitPreAllocated_rdh
/** * Check if a ServiceUnit is pre-allocated to this ResourceUnit. */ public boolean isServiceUnitPreAllocated(String suName) { return this.preAllocatedBundles.contains(suName); }
3.26
pulsar_ResourceUnitRanking_calculateBrokerMaxCapacity_rdh
/** * Estimate the maximum number namespace bundles a ResourceUnit is able to handle with all resource. */ public static long calculateBrokerMaxCapacity(SystemResourceUsage systemResourceUsage, ResourceQuota defaultQuota) { double bandwidthOutLimit = systemResourceUsage.bandwidthOut.limit * KBITS_TO_BYTES; double ban...
3.26
pulsar_ResourceUnitRanking_addPreAllocatedServiceUnit_rdh
/** * Pre-allocate a ServiceUnit to this ResourceUnit. */ public void addPreAllocatedServiceUnit(String suName, ResourceQuota quota) { this.preAllocatedBundles.add(suName); this.preAllocatedQuota.add(quota); estimateLoadPercentage(); }
3.26
pulsar_ResourceUnitRanking_estimateMaxCapacity_rdh
/** * Estimate the maximum number of namespace bundles ths ResourceUnit is able to handle with all resource. */ public long estimateMaxCapacity(ResourceQuota defaultQuota) { return calculateBrokerMaxCapacity(this.systemResourceUsage, defaultQuota); }
3.26
pulsar_ResourceUnitRanking_compareMessageRateTo_rdh
/** * Compare two loads based on message rate only. */ public int compareMessageRateTo(ResourceUnitRanking other) { return Double.compare(this.f0, other.f0); }
3.26
pulsar_ResourceUnitRanking_getPreAllocatedBundles_rdh
/** * Get the pre-allocated bundles. */ public Set<String> getPreAllocatedBundles() { return this.preAllocatedBundles; }
3.26
pulsar_ResourceUnitRanking_getAllocatedLoadPercentageBandwidthIn_rdh
/** * Percentage of inbound bandwidth allocated to bundle's quota. */ public double getAllocatedLoadPercentageBandwidthIn() { return this.allocatedLoadPercentageBandwidthIn; }
3.26
pulsar_ResourceUnitRanking_isServiceUnitLoaded_rdh
/** * Check if a ServiceUnit is already loaded by this ResourceUnit. */ public boolean isServiceUnitLoaded(String suName) { return this.loadedBundles.contains(suName); }
3.26
pulsar_ResourceUnitRanking_getAllocatedLoadPercentageBandwidthOut_rdh
/** * Percentage of outbound bandwidth allocated to bundle's quota. */ public double getAllocatedLoadPercentageBandwidthOut() { return this.allocatedLoadPercentageBandwidthOut; }
3.26
pulsar_ResourceUnitRanking_getAllocatedLoadPercentageCPU_rdh
/** * Percentage of CPU allocated to bundle's quota. */ public double getAllocatedLoadPercentageCPU() { return this.allocatedLoadPercentageCPU; }
3.26
pulsar_AbstractBaseDispatcher_filterEntriesForConsumer_rdh
/** * Filter messages that are being sent to a consumers. * <p> * Messages can be filtered out for multiple reasons: * <ul> * <li>Checksum or metadata corrupted * <li>Message is an internal marker * <li>Message is not meant to be delivered immediately * </ul> * * @param entries * a list of entries as read ...
3.26
pulsar_ServiceURI_selectOne_rdh
/** * Create a new URI from the service URI which only specifies one of the hosts. * * @return a pulsar service URI with a single host specified */ public String selectOne() { StringBuilder sb = new StringBuilder(); if (serviceName != null) {sb.append(serviceName); for (int i = 0; i < serviceIn...
3.26
pulsar_ServiceURI_create_rdh
/** * Create a service uri instance from a {@link URI} instance. * * @param uri * {@link URI} instance * @return a service uri instance * @throws NullPointerException * if {@code uriStr} is null * @throws IllegalArgumentException * if the given string violates RFC&...
3.26
pulsar_NonPersistentSubscription_deleteForcefully_rdh
/** * Forcefully close all consumers and deletes the subscription. * * @return */ @Override public CompletableFuture<Void> deleteForcefully() { return delete(true); }
3.26
pulsar_NonPersistentSubscription_disconnect_rdh
/** * Disconnect all consumers attached to the dispatcher and close this subscription. * * @return CompletableFuture indicating the completion of disconnect operation */ @Override public synchronized CompletableFuture<Void> disconnect() { CompletableFuture<Void> disconnectFuture = new CompletableFuture<>(); ...
3.26
pulsar_NonPersistentSubscription_delete_rdh
/** * Delete the subscription by closing and deleting its managed cursor. Handle unsubscribe call from admin layer. * * @param closeIfConsumersConnected * Flag indicate whether explicitly close connected consumers before trying to delete subscription. If * any consumer is connected to it and if this flag is di...
3.26
pulsar_NonPersistentSubscription_doUnsubscribe_rdh
/** * Handle unsubscribe command from the client API Check with the dispatcher is this consumer can proceed with * unsubscribe. * * @param consumer * consumer object that is initiating the unsubscribe operation * @return CompletableFuture indicating the completion of ubsubscribe operation */ @Override public C...
3.26
pulsar_IScheduler_rebalance_rdh
/** * Rebalances function instances scheduled to workers. * * @param currentAssignments * current assignments * @param workers * current list of active workers * @return A list of new assignments */ default List<Function.Assignment> rebalance(List<Function.Assignment> currentAssignments, Set<String> workers...
3.26
pulsar_TopicMessageImpl_getTopicName_rdh
/** * Get the topic name with partition part of this message. * * @return the name of the topic on which this message was published */ @Override public String getTopicName() { return msg.getTopicName(); }
3.26
pulsar_TopicMessageImpl_getTopicPartitionName_rdh
/** * Get the topic name which contains partition part for this message. * * @return the topic name which contains Partition part */ @Deprecated public String getTopicPartitionName() { return topicPartitionName; }
3.26
pulsar_AbstractHdfsConnector_resetHDFSResources_rdh
/* Reset Hadoop Configuration and FileSystem based on the supplied configuration resources. */ protected HdfsResources resetHDFSResources(HdfsSinkConfig hdfsSinkConfig) throws IOException { Configuration config = new ExtendedConfiguration(); config.setClassLoader(Thread.currentThread().getContextClassLoader...
3.26
pulsar_AbstractHdfsConnector_getFileSystem_rdh
/** * This exists in order to allow unit tests to override it so that they don't take several * minutes waiting for UDP packets to be received. * * @param config * the configuration to use * @return the FileSystem that is created for the given Configuration * @throws IOException * if unable to create the Fi...
3.26
pulsar_AbstractHdfsConnector_checkHdfsUriForTimeout_rdh
/* Reduce the timeout of a socket connection from the default in FileSystem.get() */ protected void checkHdfsUriForTimeout(Configuration config) throws IOException { URI hdfsUri = FileSystem.getDefaultUri(config); String address = hdfsUri.getAuthority(); int port = hdfsUri.getPort(); if (((address == ...
3.26
pulsar_DebeziumSource_topicNamespace_rdh
// namespace for output topics, default value is "tenant/namespace" public static String topicNamespace(SourceContext sourceContext) { String v1 = sourceContext.getTenant(); String namespace = sourceContext.getNamespace(); return ((StringUtils.isEmpty(v1) ? TopicName.PUBLIC_TENANT : v1) + "/") + (Stri...
3.26
pulsar_JettyRequestLogFactory_createRequestLogger_rdh
/** * Build a new Jetty request logger using the format defined in this class. * * @return a request logger */public static CustomRequestLog createRequestLogger() { return new CustomRequestLog(new Slf4jRequestLogWriter(), LOG_FORMAT); }
3.26
pulsar_RequestWrapper_getBody_rdh
// Use this method to read the request body N times public byte[] getBody() { return this.body; }
3.26
pulsar_BlobStoreManagedLedgerOffloader_offload_rdh
/** * Upload the DataBlocks associated with the given ReadHandle using MultiPartUpload, * Creating indexBlocks for each corresponding DataBlock that is uploaded. */ @Override public CompletableFuture<Void> offload(ReadHandle readHandle, UUID uuid, Map<String, String> extraMetadata) { final String managedLedgerN...
3.26
pulsar_BlobStoreManagedLedgerOffloader_getBlobStoreLocation_rdh
/** * Attempts to create a BlobStoreLocation from the values in the offloadDriverMetadata, * however, if no values are available, it defaults to the currently configured * provider, region, bucket, etc. * * @param offloadDriverMetadata * @return */ private BlobStoreLocation getBlobStoreLocation(Map<String, Strin...
3.26
pulsar_BrokerUsage_populateFrom_rdh
/** * Factory method that returns an instance of this class populated from metrics we expect the keys that we are * looking there's no explicit type checked object which guarantees that we have a specific type of metrics. * * @param metrics * metrics object containing the metrics collected per minute from mbeans...
3.26
pulsar_OffloadIndexBlockImpl_toStream_rdh
/** * Get the content of the index block as InputStream. * Read out in format: * | index_magic_header | index_block_len | data_object_len | data_header_len | * | index_entry_count | segment_metadata_len | segment metadata | index entries... | */ @Override public IndexInputStream toStream() throws IOExceptio...
3.26
pulsar_ClientCnxIdleState_tryMarkReleasing_rdh
/** * Changes the idle-state of the connection to #{@link State#RELEASING}, This method only changes this * connection from the #{@link State#IDLE} state to the #{@link State#RELEASING} state. * * @return Whether change idle-stat to #{@link State#RELEASING} success. */ public boolean tryMarkReleasing() { retur...
3.26
pulsar_ClientCnxIdleState_m0_rdh
/** * * @return Whether this connection is in idle. */ public boolean m0() { return getIdleStat() == State.IDLE; }
3.26
pulsar_ClientCnxIdleState_tryMarkIdleAndInitIdleTime_rdh
/** * Try to transform the state of the connection to #{@link State#IDLE}, state should only be * transformed to #{@link State#IDLE} from state #{@link State#USING}. if the state * is successfully transformed, "idleMarkTime" will be assigned to current time. */ public void tryMarkIdleAndInitIdleTime() { if (c...
3.26
pulsar_ClientCnxIdleState_isReleasing_rdh
/** * * @return Whether this connection is in idle and will be released soon. */ public boolean isReleasing() {return getIdleStat() == State.RELEASING; }
3.26
pulsar_ClientCnxIdleState_doIdleDetect_rdh
/** * Check whether the connection is idle, and if so, set the idle-state to #{@link State#IDLE}. * If the state is already idle and the {@param maxIdleSeconds} is reached, set the state to * #{@link State#RELEASING}. */ public void doIdleDetect(long maxIdleSeconds) { if (isReleasing()) { return; ...
3.26
pulsar_ClientCnxIdleState_tryMarkReleasedAndCloseConnection_rdh
/** * Changes the idle-state of the connection to #{@link State#RELEASED}, This method only changes this * connection from the #{@link State#RELEASING} state to the #{@link State#RELEASED} * state, and close {@param clientCnx} if change state to #{@link State#RELEASED} success. * * @return Whether change idle-stat...
3.26
pulsar_ClientCnxIdleState_isReleased_rdh
/** * * @return Whether this connection has already been released. */ public boolean isReleased() { return getIdleStat() == State.RELEASED; }
3.26
pulsar_ClientCnxIdleState_getIdleStat_rdh
/** * Get idle-stat. * * @return connection idle-stat */ public State getIdleStat() { return STATE_UPDATER.get(this); }
3.26
pulsar_ClientCnxIdleState_isUsing_rdh
/** * * @return Whether this connection is in use. */ public boolean isUsing() { return getIdleStat() == State.USING; }
3.26
pulsar_ClientCnxIdleState_compareAndSetIdleStat_rdh
/** * Compare and switch idle-stat. * * @return Whether the update is successful.Because there may be other threads competing, possible return false. */ boolean compareAndSetIdleStat(State originalStat, State newStat) { return STATE_UPDATER.compareAndSet(this, originalStat, newStat); }
3.26
pulsar_PulsarRecord_individualAck_rdh
/** * Some sink sometimes wants to control the ack type. */ public void individualAck() { this.customAckFunction.accept(false); }
3.26
pulsar_SchemaData_fromSchemaInfo_rdh
/** * Convert a schema info to a schema data. * * @param schemaInfo * schema info * @return the converted schema schema data */ public static SchemaData fromSchemaInfo(SchemaInfo schemaInfo) { return SchemaData.builder().type(schemaInfo.getType()).data(schemaInfo.getSchema()).props(schemaInfo.getProperties...
3.26
pulsar_SchemaData_toSchemaInfo_rdh
/** * Convert a schema data to a schema info. * * @return the converted schema info. */ public SchemaInfo toSchemaInfo() { return SchemaInfo.builder().name("").type(type).schema(data).properties(props).build(); }
3.26
pulsar_MessageImpl_create_rdh
// Constructor for out-going message public static <T> MessageImpl<T> create(MessageMetadata msgMetadata, ByteBuffer payload, Schema<T> schema, String topic) { @SuppressWarnings("unchecked") MessageImpl<T> msg = ((MessageImpl<T>) (RECYCLER.get())); msg.msgMetadata.clear(); ms...
3.26
pulsar_MessageImpl_getPayload_rdh
/** * used only for unit-test to validate payload's state and ref-cnt. * * @return */ @VisibleForTesting ByteBuf getPayload() { return payload; }
3.26
pulsar_MessageImpl_m2_rdh
// For messages produced by older version producers without schema, the schema version is an empty byte array // rather than null. @Override public byte[] m2() { if (msgMetadata.hasSchemaVersion()) { byte[] schemaVersion = msgMetadata.getSchemaVersion(); return schemaVersion.length == 0 ? null : schemaV...
3.26
pulsar_BindAddressValidator_migrateBindAddresses_rdh
/** * Generates bind addresses based on legacy configuration properties. */ private static List<BindAddress> migrateBindAddresses(ServiceConfiguration config) { List<BindAddress> addresses = new ArrayList<>(2); if (config.getBrokerServicePort().isPresent()) { ...
3.26
pulsar_BindAddressValidator_validateBindAddresses_rdh
/** * Validate the configuration of `bindAddresses`. * * @param config * the pulsar broker configure. * @param schemes * a filter on the schemes of the bind addresses, or null to not apply a filter. * @return a list of bind addresses. */ public static List<BindAddress> validateBindAddresses(ServiceConfigu...
3.26
pulsar_PulsarMockLedgerHandle_readAsync_rdh
// ReadHandle interface @Override public CompletableFuture<LedgerEntries> readAsync(long firstEntry, long lastEntry) { return readHandle.readAsync(firstEntry, lastEntry); }
3.26
pulsar_CompletableFutureCancellationHandler_setCancelAction_rdh
/** * Set the action to run when the future gets cancelled or timeouts. * The cancellation or timeout might be originating from any "upstream" future. * The implementation ensures that the cancel action gets called once. * Handles possible race conditions that might happen when the future gets cancelled * before t...
3.26
pulsar_CompletableFutureCancellationHandler_attachToFuture_rdh
/** * Attaches the cancellation handler to handle cancels * and timeouts. A cancellation handler instance can be used only once. * * @param future * the future to attach the handler to */ public synchronized void attachToFuture(CompletableFuture<?> future) { if (attached) { throw new IllegalStateExc...
3.26
pulsar_CompletableFutureCancellationHandler_createFuture_rdh
/** * Creates a new {@link CompletableFuture} and attaches the cancellation handler * to handle cancels and timeouts. * * @param <T> * the result type of the future * @return a new future instance */ public <T> CompletableFuture<T> createFuture() { CompletableFuture<T> future = new CompletableFuture<>...
3.26
pulsar_BasicKubernetesManifestCustomizer_partialDeepClone_rdh
/** * A clone where the maps and lists are properly cloned. The k8s resources themselves are shallow clones. */ public RuntimeOpts partialDeepClone() { return new RuntimeOpts(jobNamespace, jobName, extraLabels != null ? new HashMap<>(extraLabels) : null, extraAnnotations != null ? new HashMap<>(extraAnnotations)...
3.26
pulsar_RawBatchConverter_rebatchMessage_rdh
/** * Take a batched message and a filter, and returns a message with the only the sub-messages * which match the filter. Returns an empty optional if no messages match. * * NOTE: this message does not alter the reference count of the RawMessage argument. */ public static Optional<RawMessage> rebatchMessage(RawM...
3.26
pulsar_PositionImpl_toString_rdh
/** * String representation of virtual cursor - LedgerId:EntryId. */ @Override public String toString() {return (ledgerId + ":") + entryId; }
3.26
pulsar_PositionImpl_getPositionAfterEntries_rdh
/** * Position after moving entryNum messages, * if entryNum < 1, then return the current position. */ public PositionImpl getPositionAfterEntries(int entryNum) { if (entryNum < 1) { return this; } if (entryId < 0) { return PositionImpl.get(ledgerId, entryNum - 1); } else { ...
3.26