name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
pulsar_ModularLoadManagerImpl_initialize_rdh | /**
* Initialize this load manager using the given PulsarService. Should be called only once, after invoking the
* default constructor.
*
* @param pulsar
* The service to initialize with.
*/
@Override
public void initialize(final PulsarService pulsar) {
this.pulsar = pulsar;
this.pulsarResources = pulsa... | 3.26 |
pulsar_ModularLoadManagerImpl_updateBundleSplitMetrics_rdh | /**
* As leader broker, update bundle split metrics.
*
* @param bundlesSplit
* the number of bundles splits
*/
private void updateBundleSplitMetrics(int bundlesSplit) {
bundleSplitCount += bundlesSplit;
List<Metrics> metrics = new ArrayList<>();
Map<String, String> dimensions = new HashMap<>();
dimensions.put("... | 3.26 |
pulsar_ModularLoadManagerImpl_writeBundleDataOnZooKeeper_rdh | /**
* As the leader broker, write bundle data aggregated from all brokers to metadata store.
*/
@Override
public void writeBundleDataOnZooKeeper() {
updateBundleData();
// Write the bundle data to metadata store.
List<CompletableFuture<Void>> futures = new ArrayList<>();
for (Map.Entry<String, BundleData> entry : lo... | 3.26 |
pulsar_ModularLoadManagerImpl_reapDeadBrokerPreallocations_rdh | // For each broker that we have a recent load report, see if they are still alive
private void reapDeadBrokerPreallocations(List<String> aliveBrokers) {
for (String broker : loadData.getBrokerData().keySet()) {if (!aliveBrokers.contains(broker)) {
if (log.isDebugEnabled()) {
log.debug("... | 3.26 |
pulsar_ModularLoadManagerImpl_start_rdh | /**
* As any broker, start the load manager.
*
* @throws PulsarServerException
* If an unexpected error prevented the load manager from being started.
*/
@Override
public void start() throws PulsarServerException {
try {
// At this point, the ports will be updated with the real port number that the server was as... | 3.26 |
pulsar_ModularLoadManagerImpl_updateLoadBalancingMetrics_rdh | /**
* As any broker, update System Resource Usage Percentage.
*
* @param systemResourceUsage
*/
private void updateLoadBalancingMetrics(final SystemResourceUsage systemResourceUsage) {
List<Metrics> metrics = new ArrayList<>();
Map<String, String> dimensions = new HashMap<>();
dimensions.put("broker", pulsar.getAdv... | 3.26 |
pulsar_ModularLoadManagerImpl_needBrokerDataUpdate_rdh | // Determine if the broker data requires an update by delegating to the update condition.
private boolean needBrokerDataUpdate() {
final long updateMaxIntervalMillis
=
TimeUnit.MINUTES.toMillis(conf.getLoadBalancerReportUpdateMaxIntervalMinutes());
long timeSinceLastReportWrittenToStore = System.currentTimeMillis() - ... | 3.26 |
pulsar_ModularLoadManagerImpl_updateAllBrokerData_rdh | // As the leader broker, update the broker data map in loadData by querying metadata store for the broker data put
// there by each broker via updateLocalBrokerData.
private void updateAllBrokerData() {
final Set<String> activeBrokers = getAvailableBrokers();
final Map<String, BrokerData> brokerDataMap = loadData.getBr... | 3.26 |
pulsar_Schema_generic_rdh | /**
* Returns a generic schema of existing schema info.
*
* <p>Only supports AVRO and JSON.
*
* @param schemaInfo
* schema info
* @return a generic schema instance
*/
static GenericSchema<GenericRecord> generic(SchemaInfo schemaInfo) {return DefaultImplementation.getDefaultImplementation().getGenericSchema(... | 3.26 |
pulsar_Schema_supportSchemaVersioning_rdh | /**
* Returns whether this schema supports versioning.
*
* <p>Most of the schema implementations don't really support schema versioning, or it just doesn't
* make any sense to support schema versionings (e.g. primitive schemas). Only schema returns
* {@link GenericRecord} should support schema versioning.
*
* <p... | 3.26 |
pulsar_Schema_PROTOBUF_rdh | /**
* Create a Protobuf schema type with schema definition.
*
* @param schemaDefinition
* schemaDefinition the definition of the schema
* @return a Schema instance
*/
static <T extends GeneratedMessageV3> Schema<T> PROTOBUF(SchemaDefinition<T> schemaDefinition) {
return DefaultImplementation.getDefaultImplement... | 3.26 |
pulsar_Schema_getNativeSchema_rdh | /**
* Return the native schema that is wrapped by Pulsar API.
* For instance with this method you can access the Avro schema
*
* @return the internal schema or null if not present
*/
default Optional<Object> getNativeSchema() {
return Optional.empty();
} | 3.26 |
pulsar_Schema_getSchema_rdh | // CHECKSTYLE.ON: MethodName
static Schema<?> getSchema(SchemaInfo schemaInfo) {
return DefaultImplementation.getDefaultImplementation().getSchema(schemaInfo);
} | 3.26 |
pulsar_Schema_JSON_rdh | /**
* Create a JSON schema type with schema definition.
*
* @param schemaDefinition
* the definition of the schema
* @return a Schema instance
*/
static <T> Schema<T> JSON(SchemaDefinition schemaDefinition)
{
return DefaultImplementation.getDefaultImplementation().newJSONSchema(schemaDefinition);
} | 3.26 |
pulsar_Schema_AUTO_PRODUCE_BYTES_rdh | /**
* Create a schema instance that accepts a serialized payload
* and validates it against the schema specified.
*
* @return the auto schema instance
* @since 2.5.0
* @see #AUTO_PRODUCE_BYTES()
*/
static Schema<byte[]> AUTO_PRODUCE_BYTES(Schema<?> schema) {
return DefaultImplementation.getDefaultImplementation(... | 3.26 |
pulsar_Schema_configureSchemaInfo_rdh | /**
* Configure the schema to use the provided schema info.
*
* @param topic
* topic name
* @param componentName
* component name
* @param schemaInfo
* schema info
*/
default void configureSchemaInfo(String topic, String componentName, SchemaInfo schemaInfo) {
// no-op
} | 3.26 |
pulsar_Schema_AUTO_CONSUME_rdh | /**
* Create a schema instance that automatically deserialize messages
* based on the current topic schema.
*
* <p>The messages values are deserialized into a {@link GenericRecord} object,
* that extends the {@link GenericObject} interface.
*
* @return the auto schema instance
*/
static Schema<GenericRecord> AU... | 3.26 |
pulsar_Schema_m1_rdh | /**
* Create a Avro schema type with schema definition.
*
* @param schemaDefinition
* the definition of the schema
* @return a Schema instance
*/
static <T> Schema<T> m1(SchemaDefinition<T> schemaDefinition) {
return DefaultImplementation.getDefaultImplementation().newAvroSchema(schemaDefinition);
} | 3.26 |
pulsar_Schema_AVRO_rdh | /**
* Create a Avro schema type by default configuration of the class.
*
* @param pojo
* the POJO class to be used to extract the Avro schema
* @return a Schema instance
*/
static <T> Schema<T> AVRO(Class<T> pojo) {
return DefaultImplementation.getDefaultImplementation().newAvroSchema(SchemaDefinition.builde... | 3.26 |
pulsar_Schema_validate_rdh | /**
* Check if the message is a valid object for this schema.
*
* <p>The implementation can choose what its most efficient approach to validate the schema.
* If the implementation doesn't provide it, it will attempt to use {@link #decode(byte[])}
* to see if this schema can decode this message or not as a validati... | 3.26 |
pulsar_Schema_NATIVE_AVRO_rdh | /**
* Create a schema instance that accepts a serialized Avro payload
* without validating it against the schema specified.
* It can be useful when migrating data from existing event or message stores.
*
* @return the auto schema instance
* @since 2.9.0
*/
static Schema<byte[]> NATIVE_AVRO(Object schema) {
retur... | 3.26 |
pulsar_Schema_decode_rdh | /**
* Decode a ByteBuffer into an object using a given version. <br/>
*
* @param data
* the ByteBuffer to decode
* @return the deserialized object
*/
default T decode(ByteBuffer data) {
if (data == null) {
return null;
}
return decode(getBytes(data));
} | 3.26 |
pulsar_Schema_m0_rdh | /**
* Decode a ByteBuffer into an object using a given version. <br/>
*
* @param data
* the ByteBuffer to decode
* @param schemaVersion
* the schema version to decode the object. null indicates using latest version.
* @return the deserialized object
*/
default T m0(ByteBuffer data,
byte[] schemaVersion) {
i... | 3.26 |
pulsar_Schema_PROTOBUF_NATIVE_rdh | /**
* Create a Protobuf-Native schema type with schema definition.
*
* @param schemaDefinition
* schemaDefinition the definition of the schema
* @return a Schema instance
*/
static <T extends GeneratedMessageV3> Schema<T> PROTOBUF_NATIVE(SchemaDefinition<T> schemaDefinition) {
return DefaultImplementation.getDe... | 3.26 |
pulsar_Schema_KeyValue_rdh | /**
* Key Value Schema using passed in key, value and encoding type schemas.
*/
static <K, V> Schema<KeyValue<K, V>> KeyValue(Schema<K> key, Schema<V> value, KeyValueEncodingType keyValueEncodingType) {
return DefaultImplementation.getDefaultImplementation().newKeyValueSchema(key, value, keyValueEncodingType);
} | 3.26 |
pulsar_BinaryProtoLookupService_getPartitionedTopicMetadata_rdh | /**
* calls broker binaryProto-lookup api to get metadata of partitioned-topic.
*/
public CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(TopicName topicName) {
final MutableObject<CompletableFuture> newFutureCreated = new MutableObject<>();
... | 3.26 |
pulsar_BinaryProtoLookupService_getBroker_rdh | /**
* Calls broker binaryProto-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
*/
public CompletableFuture<Pair<InetSocketAddress, InetSocketAddress>> getBroker(TopicName topicName) {
final Mut... | 3.26 |
pulsar_HeapDumpUtil_dumpHeap_rdh | /**
* Dump the heap of the JVM.
*
* @param file
* the system-dependent filename
* @param liveObjects
* if true dump only live objects i.e. objects that are reachable from others
*/
public static void dumpHeap(File file, boolean liveObjects) {
try {
HotS... | 3.26 |
pulsar_HeapDumpUtil_getHotSpotDiagnosticMXBean_rdh | // Utility method to get the HotSpotDiagnosticMXBean
private static HotSpotDiagnosticMXBean getHotSpotDiagnosticMXBean() {
try {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
return ManagementFactory.newPlatformMXBeanProxy(server, HOTSPOT_BEAN_NAME, HotSpotDiagnosticMXBean.class... | 3.26 |
pulsar_ClientCredentialsFlow_fromParameters_rdh | /**
* Constructs a {@link ClientCredentialsFlow} from configuration parameters.
*
* @param params
* @return */public static ClientCredentialsFlow fromParameters(Map<String, String> params) {
URL v4 =
parseParameterUrl(params, CONFIG_PARAM_ISSUER_URL);
String privateKeyUrl = parseParameterString(params... | 3.26 |
pulsar_ClientCredentialsFlow_loadPrivateKey_rdh | /**
* Loads the private key from the given URL.
*
* @param privateKeyURL
* @return * @throws IOException
*/
private static KeyFile loadPrivateKey(String privateKeyURL) throws IOException {
try {
URLConnection urlConnection = new URL(privateKeyURL).openConnection();
... | 3.26 |
pulsar_StructuredEventLog_get_rdh | /**
* Create a new logger object, from which root events can be created.
*/
static StructuredEventLog get() {
return
Initializer.get();
} | 3.26 |
pulsar_WRRPlacementStrategy_findBrokerForPlacement_rdh | /**
* Function : getByWeightedRoundRobin returns ResourceUnit selected by WRR algorithm
* based on available resource on RU.
* <code>
* ^
* |
* |
* |
* | | | | |
* | | | ... | 3.26 |
pulsar_PulsarSchemaToKafkaSchema_parseAvroSchema_rdh | // Parse json to shaded schema
private static Schema parseAvroSchema(String schemaJson) {
final Parser parser = new Parser();
parser.setValidateDefaults(false);
return parser.parse(schemaJson);
} | 3.26 |
pulsar_KeySharedPolicy_setAllowOutOfOrderDelivery_rdh | /**
* If enabled, it will relax the ordering requirement, allowing the broker to send out-of-order messages in case of
* failures. This will make it faster for new consumers to join without being stalled by an existing slow consumer.
*
* <p>In this case, a single consumer will still receive all the keys, but they m... | 3.26 |
pulsar_WatermarkTimeEvictionPolicy_evict_rdh | /**
* {@inheritDoc }
* <p/>
* Keeps events with future ts in the queue for processing in the next
* window. If the ts difference is more than the lag, stops scanning
* the queue for the current window.
*/
@Overridepublic Action evict(Event<T> event) {
if (evictionContext == null) {
// It is possible t... | 3.26 |
pulsar_BatchMessageIdImpl_toMessageIdImpl_rdh | // MessageIdImpl is widely used as the key of a hash map, in this case, we should convert the batch message id to
// have the correct hash code.
@Deprecated
public MessageIdImpl toMessageIdImpl() {
return ((MessageIdImpl) (MessageIdAdvUtils.discardBatch(this)));
} | 3.26 |
pulsar_HeapHistogramUtil_callDiagnosticCommand_rdh | /**
* Calls a diagnostic commands.
* The available operations are similar to what the jcmd commandline tool has,
* however the naming of the operations are different. The "help" operation can be used
* to find out the available operations. For example, the jcmd command "Thread.print" maps
* to "threadPrint" operat... | 3.26 |
pulsar_JSONSchema_getBackwardsCompatibleJsonSchemaInfo_rdh | /**
* Implemented for backwards compatibility reasons.
* since the original schema generated by JSONSchema was based off the json schema standard
* since then we have standardized on Avro
*
* @return */public SchemaInfo getBackwardsCompatibleJsonSchemaInfo() {
SchemaInfo backwardsCompatibleSchemaInfo;
try... | 3.26 |
pulsar_JSONSchema_clearCaches_rdh | /**
* Clears the caches tied to the ObjectMapper instances and replaces the singleton ObjectMapper instance.
*
* This can be used in tests to ensure that classloaders and class references don't leak across tests.
*/
public static void clearCaches() {
jsonMapper().getTypeFactory().clearCache();
replaceSing... | 3.26 |
pulsar_AbstractDispatcherSingleActiveConsumer_disconnectAllConsumers_rdh | /**
* Disconnect all consumers on this dispatcher (server side close). This triggers channelInactive on the inbound
* handler which calls dispatcher.removeConsumer(), where the closeFuture is completed
*
* @return */
public synchronized CompletableFuture<Void> disconnectAllConsumers(boolean isResetCursor) {
cl... | 3.26 |
pulsar_AbstractDispatcherSingleActiveConsumer_canUnsubscribe_rdh | /**
* Handle unsubscribe command from the client API For failover subscription, if consumer is connected consumer, we
* can unsubscribe.
*
* @param consumer
* Calling consumer object
*/
public synchronized boolean canUnsubscribe(Consumer consumer) {
return (consumers.size() == 1) && Objects.equals(consumer,... | 3.26 |
pulsar_AbstractDispatcherSingleActiveConsumer_pickAndScheduleActiveConsumer_rdh | /**
* Pick active consumer for a topic for {@link SubType#Failover} subscription.
* If it's a non-partitioned topic then it'll pick consumer based on order they subscribe to the topic.
* If is's a partitioned topic, first sort consumers based on their priority level and consumer name then
* distributed partitions e... | 3.26 |
pulsar_URIPreconditions_checkURI_rdh | /**
* Check whether the given string is a legal URI and passes the user's check.
*
* @param uri
* URI String
* @param predicate
* User defined rule
* @throws IllegalArgumentException
* Illegal URI or failed in the user's rules
*/
public static void checkURI(@Nonnull
String uri, @Nonnull
Predicate<URI> p... | 3.26 |
pulsar_URIPreconditions_checkURIIfPresent_rdh | /**
* Check whether the given string is a legal URI and passes the user's check.
*
* @param uri
* URI String
* @param predicate
* User defined rule
* @throws IllegalArgumentException
* Illegal URI or failed in the user's rules
*/
public static void checkURIIfPresent(@Nullable
String uri, @Nonnull
Predica... | 3.26 |
pulsar_ServiceConfigurationUtils_getInternalListener_rdh | /**
* Gets the internal advertised listener for broker-to-broker communication.
*
* @return a non-null advertised listener
*/
public static AdvertisedListener getInternalListener(ServiceConfiguration
config, String protocol) {
Map<String, AdvertisedListener> result = MultipleListenerValidator.validateAndAnalysi... | 3.26 |
pulsar_ServiceConfigurationUtils_getAppliedAdvertisedAddress_rdh | /**
* Get the address of Broker, first try to get it from AdvertisedAddress.
* If it is not set, try to get the address set by advertisedListener.
* If it is still not set, get it through InetAddress.getLocalHost().
*
* @param configuration
* @param ignoreAdvertisedListener
* Sometimes we can’t use the default... | 3.26 |
pulsar_PersistentAcknowledgmentsGroupingTracker_isDuplicate_rdh | /**
* Since the ack are delayed, we need to do some best-effort duplicate check to discard messages that are being
* resent after a disconnection and for which the user has already sent an acknowledgement.
*/@Override
public boolean isDuplicate(MessageId messageId) {
if (!(messageId instanceof MessageIdAdv)) {
... | 3.26 |
pulsar_PersistentAcknowledgmentsGroupingTracker_flush_rdh | /**
* Flush all the pending acks and send them to the broker.
*/
@Override
public void flush() {
ClientCnx cnx = consumer.getClientCnx();if (cnx == null) {
if
(log.isDebugEnabled()) {
log.debug("[{}] Cannot flush pending acks since we're not connected to broker", consumer);
}
... | 3.26 |
pulsar_PropertiesUtils_filterAndMapProperties_rdh | /**
* Filters the {@link Properties} object so that only properties with the configured prefix are retained,
* and then replaces the srcPrefix with the targetPrefix when putting the key value pairs in the resulting map.
*
* @param props
* - the properties object to filter
* @param srcPrefix
* - the prefix to... | 3.26 |
pulsar_Producer_completed_rdh | /**
* Executed from managed ledger thread when the message is persisted.
*/
@Override
public void completed(Exception exception, long ledgerId, long entryId) {
if (exception != null) {final ServerError
serverError = getServerError(exception);
producer.cnx.execute(() -> {
if (!(exception instanceof TopicClosed... | 3.26 |
pulsar_Producer_run_rdh | /**
* Executed from I/O thread when sending receipt back to client.
*/
@Override
public void run() {
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] [{}] Persisted message. cnx {}, sequenceId {}", producer.topic, producer.producerName, producer.producerId, producer.cnx, sequenceId);
}
// stats
rateIn.recordMultipleE... | 3.26 |
pulsar_Producer_disconnect_rdh | /**
* It closes the producer from server-side and sends command to client to disconnect producer from existing
* connection without closing that connection.
*
* @return Completable future indicating completion of producer close
*/
public CompletableFuture<Void> disconnect(Optional<BrokerLookupData> assignedBrokerL... | 3.26 |
pulsar_Producer_isSuccessorTo_rdh | /**
* Method to determine if this producer can replace another producer.
*
* @param other
* - producer to compare to this one
* @return true if this producer is a subsequent instantiation of the same logical producer. Otherwise, false.
*/
public boolean isSuccessorTo(Producer other) {
return (((Objects.equals(p... | 3.26 |
pulsar_Producer_close_rdh | /**
* Close the producer immediately if: a. the connection is dropped b. it's a graceful close and no pending publish
* acks are left else wait for pending publish acks
*
* @return completable future indicate completion of close
*/
public synchronized CompletableFuture<Void> close(boolean removeFromTopic) {
if (l... | 3.26 |
pulsar_Producer_parseRemoteClusterName_rdh | /**
* Producer name for replicator is in format.
* "replicatorPrefix.localCluster" (old)
* "replicatorPrefix.localCluster-->remoteCluster" (new)
*/
private String parseRemoteClusterName(String producerName, boolean isRemote, String replicatorPrefix) {
if (isRemote) {
String clusterName = producerName.substring(... | 3.26 |
pulsar_Producer_getLastSequenceId_rdh | /**
* Return the sequence id of.
*
* @return the sequence id
*/
public long getLastSequenceId() {
if (isNonPersistentTopic) {
return -1;
} else {
return ((PersistentTopic) (topic)).getLastPublishedSequenceId(producerName);
}
} | 3.26 |
pulsar_PulsarLedgerIdGenerator_formatHalfId_rdh | /**
* Formats half an ID as 10-character 0-padded string.
*
* @param i
* - 32 bits of the ID to format
* @return a 10-character 0-padded string.
*/
private String formatHalfId(int i) {
return String.format("%010d", i);
} | 3.26 |
zilla_DefaultBufferPool_release_rdh | /**
* Releases a slot so it may be used by other streams
*
* @param slot
* - Id of a previously acquired slot
*/
@Override
public void release(int slot)
{
assert used.get(slot);
used.clear(slot);
availableSlots.value++;
poolBuffer.putLongOrdered(usedIndex + (slot << 3), 0L);
} | 3.26 |
zilla_HpackHuffman_encodedSize_rdh | // Returns the no of bytes needed to encode src
public static int encodedSize(DirectBuffer src, int offset, int length) {
int totalBits = 0;
for (int i = 0; i < length; i++) {
int index = src.getByte(offset + i) & 0xff;
int bits = CODES[index][1];
totalBits += bits;
}
return (t... | 3.26 |
zilla_HpackHuffman_encode_rdh | // Huffman encodes src buffer into dst buffer
// Assumes enough space is in the dst buffer
public static void
encode(DirectBuffer src, MutableDirectBuffer dst) {
// assert dst.capacity() >= encodedSize(src, 0, src.capacity());
int remainingBits = 0;
int dstIndex = 0;
long currentSeq = 0;// Aligned to L... | 3.26 |
zilla_HpackHuffman_transition_rdh | // Build one Node x byte transition
private static void transition(Node node, int b) {
Node cur = node;
String str = node.symbols[b];
for (int i = 7; i >= 0; i--) {
int bit
= (b >>> i) & 0x1;// Using MSB to traverse
cur = (bit == 0) ? cur.left : cur.... | 3.26 |
zilla_HpackContext_staticIndex11_rdh | // Index in static table for the given name of length 11
private static int staticIndex11(DirectBuffer name) {
return (name.getByte(10) == 'r') && STATIC_TABLE[53].name.equals(name) ? 53 : -1;// retry-after
} | 3.26 |
zilla_HpackContext_evict_rdh | // Evicts older entries from dynamic table
private void evict(int noEntries) {
for (int i = 0; i
< noEntries; i++) {
HeaderField header = table.get(i);
tableSize -= header.size;
if (encoding) {
Long id = noEvictions + i;
if (id... | 3.26 |
zilla_HpackContext_valid_rdh | // @return true if the index is valid
// false otherwise
public boolean valid(int index) {
return (index != 0) && (index < (STATIC_TABLE.length + table.size()));
} | 3.26 |
zilla_HpackContext_staticIndex15_rdh | // Index in static table for the given name of length 15
private static int staticIndex15(DirectBuffer name) {
switch (name.getByte(14)) {
case 'e' :
// accept-language
if (STATIC_TABLE[17].name.equals(name)) {
return 17;
}
break;
case... | 3.26 |
zilla_HpackContext_staticIndex8_rdh | // Index in static table for the given name of length 8
private static int staticIndex8(DirectBuffer name) {
switch (name.getByte(7)) {
case 'e' :
// if-range
if (STATIC_TABLE[42].name.equals(name)) {
... | 3.26 |
zilla_HpackContext_staticIndex4_rdh | // Index in static table for the given name of length 4
private static int staticIndex4(DirectBuffer name) {switch (name.getByte(3)) {
case 'e' :
// date
if (STATIC_TABLE[33].name.equals(name)) {
return 33;
}
break;
case 'g' :
// etag
if (STATIC_TABL... | 3.26 |
zilla_HpackContext_staticIndex18_rdh | // Index in static table for the given name of length 18
private static int staticIndex18(DirectBuffer name) {
return (name.getByte(17) == 'e') && STATIC_TABLE[48].name.equals(name) ? 48 : -1;// proxy-authenticate
} | 3.26 |
zilla_HpackContext_staticIndex5_rdh | // Index in static table for the given name of length 5
private static int staticIndex5(DirectBuffer
name) {
switch (name.getByte(4)) {
case 'e' :
// range
if (STATIC_TABLE[50].name.equals(name)) {
return 50;
}
break;
case 'h' :
// path
if
(STA... | 3.26 |
zilla_HpackContext_staticIndex10_rdh | // Index in static table for the given name of length 10
private static int staticIndex10(DirectBuffer name) {
switch (name.getByte(9)) {
case 'e' :
// set-cookie
if (STATIC_TABLE[55].name.equals(name)) {
return 55;
}
break;
case 't' :
... | 3.26 |
zilla_HpackContext_staticIndex14_rdh | // Index in static table for the given name of length 14
private static int staticIndex14(DirectBuffer name) {
switch (name.getByte(13)) {
case 'h' :
// content-length
if (STATIC_TABLE[28].name.equals(name)) {
return 28;
}
break;
case ... | 3.26 |
zilla_HpackContext_staticIndex25_rdh | // Index in static table for the given name of length 25
private static int staticIndex25(DirectBuffer name) {
return (name.getByte(24) == 'y') && STATIC_TABLE[56].name.equals(name) ? 56 : -1;// strict-transport-security
} | 3.26 |
zilla_HpackContext_m1_rdh | // Index in static table for the given name of length 19
private static int m1(DirectBuffer name) {
switch (name.getByte(18)) {
case 'e' :// if-unmodified-since
if (STATIC_TABLE[43].name.equals(name)) {
return 43;
}
break;
case 'n' :
// content-disposition
if (STATIC_TABLE[25].name.equals(n... | 3.26 |
zilla_HpackContext_staticIndex3_rdh | // Index in static table for the given name of length 3
private static int staticIndex3(DirectBuffer name) {
switch (name.getByte(2)) {
case 'a' :
// via
if (STATIC_TABLE[60].name.equals(name)) {
return 60;
}
break;case 'e' :
// age
if (STATIC_TABLE[21]... | 3.26 |
zilla_HpackContext_staticIndex12_rdh | // Index in static table for the given name of length 12
private static int staticIndex12(DirectBuffer name) {
switch (name.getByte(11)) {
case 'e' :
// content-type
if (STATIC_TABLE[31].name.equals(name)) {
return 31;
}
break;
case '... | 3.26 |
zilla_HpackContext_staticIndex16_rdh | // Index in static table for the given name of length 16
private static int staticIndex16(DirectBuffer name) {
switch (name.getByte(15)) {
case 'e'
:
// content-language
if (STATIC_TABLE[27].name.equals(name)) {
return 27;
}
// www-authenticate
if (STATIC_TAB... | 3.26 |
zilla_HpackContext_staticIndex27_rdh | // Index in static table for the given name of length 27
private static int staticIndex27(DirectBuffer name) {
return (name.getByte(26) == 'n') && STATIC_TABLE[20].name.equals(name) ? 20 : -1;// access-control-allow-origi
} | 3.26 |
zilla_HpackContext_staticIndex13_rdh | // Index in static table for the given name of length 13
private static int staticIndex13(DirectBuffer name) {
switch (name.getByte(12)) {
case 'd' :
// last-modified
if (STATIC_TABLE[44].name.equals(name)) {
re... | 3.26 |
zilla_HpackContext_staticIndex17_rdh | // Index in static table for the given name of length 17
private static int staticIndex17(DirectBuffer name) {
switch (name.getByte(16)) {
case 'e' :
// if-modified-since
if (STATIC_TABLE[40].name.equals(name)) {
return 40;
}
break;
case 'g' :
// transfer-encoding
if (STATIC_TABLE[57].n... | 3.26 |
zilla_HpackContext_staticIndex6_rdh | // Index in static table for the given name of length 6
private static int staticIndex6(DirectBuffer name) {
switch (name.getByte(5)) {
case 'e' :
// cookie
if (STATIC_TABLE[32].name.equals(name)) {
return 32;
}
break;
case 'r' :
// server
if (STATIC_T... | 3.26 |
zilla_DispatchAgent_supplyCounterWriter_rdh | // required for testing
public LongConsumer supplyCounterWriter(long bindingId, long metricId) {
return countersLayout.supplyWriter(bindingId, metricId);
} | 3.26 |
zilla_DispatchAgent_supplyHistogramWriter_rdh | // required for testing
public LongConsumer supplyHistogramWriter(long bindingId, long metricId) {
return histogramsLayout.supplyWriter(bindingId, metricId);
} | 3.26 |
zilla_DispatchAgent_supplyGaugeWriter_rdh | // required for testing
public LongConsumer
supplyGaugeWriter(long bindingId, long metricId) {
return gaugesLayout.supplyWriter(bindingId, metricId);
} | 3.26 |
zilla_StructFlyweightGenerator_defaultPriorField_rdh | // TODO: Varuint32 should NEVER be < 0
private void defaultPriorField(CodeBlock.Builder code) {
if ((priorDefaultValue != null) && f2) {
code.addStatement("$L($L)", priorFieldIfDefaulted, defaultName(priorFieldIfDefaulted));
} else // Attempt to default the entire object. This will fail if it has any re... | 3.26 |
zilla_HttpClientFactory_encodeLiteral_rdh | // TODO dynamic table, Huffman, never indexed
private void encodeLiteral(HpackLiteralHeaderFieldFW.Builder builder, HpackContext hpackContext, DirectBuffer nameBuffer, DirectBuffer valueBuffer) {
builder.type(WITHOUT_INDEXING);
final int nameIndex = hpackContext.index(nameBuffer);
if (nameIndex != (-1)) {
builder.name... | 3.26 |
zilla_HttpClientFactory_collectHeaders_rdh | // Collect headers into map to resolve target
// TODO avoid this
private void collectHeaders(DirectBuffer name, DirectBuffer value)
{
if (!error()) {
String nameStr = name.getStringWithoutLengthUtf8(0, name.capacity());
String valueStr = value.getStringWithoutLengthUtf8(0, value.capacity());
// TODO cookie needs to be ... | 3.26 |
zilla_HttpClientFactory_teHeader_rdh | // 8.1.2.2 TE header MUST NOT contain any value other than "trailers".
private void teHeader(DirectBuffer name, DirectBuffer value) {
if (((!error()) && name.equals(TE)) && (!value.equals(TRAILERS))) {
streamError = Http2ErrorCode.PROTOCOL_ERROR;
}
} | 3.26 |
zilla_WsServerFactory_assembleHeader_rdh | // @return no bytes consumed to assemble websocket header
private int assembleHeader(DirectBuffer buffer, int
offset, int length) {
int remaining = Math.min(length, MAXIMUM_HEADER_SIZE - headerLength);
// may cop... | 3.26 |
zilla_HttpServerFactory_teHeader_rdh | // 8.1.2.2 TE header MUST NOT contain any value other than "trailers".
private void teHeader(DirectBuffer name, DirectBuffer value) {
if (((!error()) && name.equals(TE)) && (!value.equals(TRAILERS))) {
streamError = Http2ErrorCode.PROTOCOL_ERROR;
}
} | 3.26 |
zilla_HttpServerFactory_serverHeader_rdh | // Checks if response has server header
private void serverHeader(HttpHeaderFW header) {serverHeader |= header.name().value().equals(context.nameBuffer(54));
} | 3.26 |
zilla_HttpServerFactory_collectHeaders_rdh | // Collect headers into map to resolve target
// TODO avoid this
private void collectHeaders(DirectBuffer name, DirectBuffer value) {
if (!error()) {
String nameStr = name.getStringWithoutLengthUtf8(0, name.capacity());
String valueStr = value.getStringWithoutLengthUtf8(0, value.capacity());
// TODO cookie needs to be ... | 3.26 |
zilla_HttpServerFactory_encodeLiteral_rdh | // TODO dynamic table, Huffman, never indexed
private void encodeLiteral(HpackLiteralHeaderFieldFW.Builder builder, HpackContext hpackContext, DirectBuffer nameBuffer, DirectBuffer valueBuffer) {
builder.type(WITHOUT_INDEXING);
final int nameIndex = hpackContext.index(nameBuffer);
if (nameIndex != (-1)) {
builder.name(... | 3.26 |
zilla_ManyToOneRingBuffer_nextCorrelationId_rdh | /**
* {@inheritDoc }
*/
public long nextCorrelationId() {
return buffer.getAndAddLong(correlationIdCounterIndex, 1);
} | 3.26 |
zilla_ManyToOneRingBuffer_size_rdh | /**
* {@inheritDoc }
*/
public int size() {
long headBefore;
long tail;
long headAfter = buffer.getLongVolatile(headPositionIndex);
do {
headBefore = headAfter;
tail = buffer.getLongVolatile(tailPositionIndex);
headAfter = buffer.getLongVolatile(headPositionIndex);
} while... | 3.26 |
zilla_ManyToOneRingBuffer_commit_rdh | /**
* {@inheritDoc }
*/
public void commit(final int index) {
final int recordIndex = computeRecordIndex(index);
final AtomicBuffer buffer = this.buffer;
final int recordLength = verifyClaimedSpaceNotReleased(buffer, recordIndex);
buffer.putIntOrdered(lengthOffset(recordIndex), -recordLength); } | 3.26 |
zilla_ManyToOneRingBuffer_capacity_rdh | /**
* {@inheritDoc }
*/
public int capacity() {
return f0;
} | 3.26 |
zilla_ManyToOneRingBuffer_abort_rdh | /**
* {@inheritDoc }
*/
public void abort(final int index) {
final int recordIndex = computeRecordIndex(index);
final AtomicBuffer buffer = this.buffer;
final int recordLength = verifyClaimedSpaceNotReleased(buffer, recordIndex);
buffer.putInt(typeOffset(recordIndex), PADDING_MSG_TYPE_ID);
buffer.... | 3.26 |
zilla_ManyToOneRingBuffer_unblock_rdh | /**
* {@inheritDoc }
*/
public boolean unblock() {
final AtomicBuffer buffer = this.buffer;
final int mask = f0 - 1;
final int consumerIndex = ((int) (buffer.getLongVolatile(headPositionIndex) & mask));
final int producerIndex = ((int) (buffer.getLongVolatile(tailPositionIndex) & mask));
if (pro... | 3.26 |
zilla_ManyToOneRingBuffer_read_rdh | /**
* {@inheritDoc }
*/public int read(final MessageHandler handler, final int messageCountLimit) {
int messagesRead = 0;final AtomicBuffer buffer = this.buffer;
final long head = buffer.getLong(headPositionIndex);
final int capacity = this.f0;
final int headIndex = ((int) (head)) & (capacity - ... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.