name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_TextValueInputFormat_getCharsetName_rdh
// -------------------------------------------------------------------------------------------- public String getCharsetName() { return charsetName; }
3.26
flink_TextValueInputFormat_readRecord_rdh
// -------------------------------------------------------------------------------------------- @Override public StringValue readRecord(StringValue reuse, byte[] bytes, int offset, int numBytes) { if (this.ascii) { reuse.setValueAscii(bytes, offset, numBytes); return reuse; } else { ByteBuffer byteW...
3.26
flink_TextValueInputFormat_toString_rdh
// -------------------------------------------------------------------------------------------- @Override public String toString() { return ((("TextValueInputFormat (" + Arrays.toString(getFilePaths())) + ") - ") + this.charsetName) + (this.skipInvalidLines ? "(skipping invalid lines)" : ""); }
3.26
flink_WorksetIterationNode_getOperatorName_rdh
// -------------------------------------------------------------------------------------------- @Overridepublic String getOperatorName() { return "Workset Iteration"; }
3.26
flink_WorksetIterationNode_acceptForStepFunction_rdh
// -------------------------------------------------------------------------------------------- // Iteration Specific Traversals // -------------------------------------------------------------------------------------------- public void acceptForStepFunction(Visitor<OptimizerNode> visitor) { this.singleRoot.accept(...
3.26
flink_WorksetIterationNode_getIterationContract_rdh
// -------------------------------------------------------------------------------------------- public DeltaIterationBase<?, ?> getIterationContract() { return ((DeltaIterationBase<?, ?>) (getOperator())); }
3.26
flink_WorksetIterationNode_getPossibleProperties_rdh
// -------------------------------------------------------------------------------------------- // Properties and Optimization // -------------------------------------------------------------------------------------------- @Overrideprotected List<OperatorDescriptorDual> getPossibleProperties() { return this.dataPro...
3.26
flink_CopyOnWriteSkipListStateMap_releaseAllResource_rdh
/** * Release all resource used by the map. */ private void releaseAllResource() {long node = levelIndexHeader.getNextNode(0); while (node != NIL_NODE) { long nextNode = helpGetNextNode(node, 0); long valuePointer = SkipListUtils.helpGetValuePointer(node, spaceAllocator); spaceAl...
3.26
flink_CopyOnWriteSkipListStateMap_totalSize_rdh
/** * Returns total size of this map, including logically removed state. */ int totalSize() { return totalSize; }
3.26
flink_CopyOnWriteSkipListStateMap_putValue_rdh
/** * Update or insert the value for the given node. * * @param currentNode * the node to put value for. * @param value * the value to put. * @param returnOldState * whether to return the old state. * @return the old state if it exists and {@code returnOldState} is true, or else null. */ private S putVa...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetStateEntry_rdh
/** * Returns the state entry of the node. */private StateEntry<K, N, S> helpGetStateEntry(long node) { Node nodeStorage = getNodeSegmentAndOffset(node); MemorySegment segment = nodeStorage.nodeSegment; int offsetInSegment = nodeStorage.nodeOffset; int level = SkipListUtils.getLevel(segment, offset...
3.26
flink_CopyOnWriteSkipListStateMap_deleteNodeMeta_rdh
/** * Physically delte the meta of the node, including the node level index, the node key, and * reduce the total size of the skip list. * * @param node * node to remove. * @param prevNode * previous node at the level 0. * @param nextNode * next node at the level 0. * @return value pointer of the node. ...
3.26
flink_CopyOnWriteSkipListStateMap_doPhysicalRemoveAndGetValue_rdh
/** * Removes the node physically, and return the newest-version value pointer. Space used by key * and value will be freed here, but the space of newest-version value will not be freed, and * the caller should be responsible for the free of space. * * @param node * node to remove. * @param prevNode * previ...
3.26
flink_CopyOnWriteSkipListStateMap_doWriteValue_rdh
/** * Write the meta and data for the value to the space where the value pointer points. * * @param valuePointer * pointer to the space where the meta and data is written. * @param value * data of the value. * @param version * version of this value. * @param keyPointer * pointer to the key. * @param ...
3.26
flink_CopyOnWriteSkipListStateMap_isNodeRemoved_rdh
// Help methods --------------------------------------------------------------- /** * Whether the node has been logically removed. */ private boolean isNodeRemoved(long node) { return SkipListUtils.isNodeRemoved(node, spaceAllocator);}
3.26
flink_CopyOnWriteSkipListStateMap_doWriteKey_rdh
/** * Write the meta and data for the key to the given node. * * @param node * the node for the key to write. * @param level * level of this node. * @param keySegment * memory segment storing the key. * @param keyOffset * offset of key in memory segment. * @param keyLen * length of the key. * @pa...
3.26
flink_CopyOnWriteSkipListStateMap_helpSetNextNode_rdh
/** * Set the next node of the given node at the given level. */private void helpSetNextNode(long node, long nextNode, int level) { SkipListUtils.helpSetNextNode(node, nextNode, level, levelIndexHeader, spaceAllocator); }
3.26
flink_CopyOnWriteSkipListStateMap_doPhysicalRemove_rdh
/** * Removes the node physically, and free all space used by the key and value. * * @param node * node to remove. * @param prevNode * previous node at the level 0. * @param nextNode * next node at the level 0. */private void doPhysicalRemove(long node, long prevNode, long nextNode) { // free space used ...
3.26
flink_CopyOnWriteSkipListStateMap_findPredecessor_rdh
/** * Find the predecessor node for the given key at the given level. The key is in the memory * segment positioning at the given offset. * * @param keySegment * memory segment which contains the key. * @param keyOffset * offset of the key in the memory segment. * @param level * the level. * @return nod...
3.26
flink_CopyOnWriteSkipListStateMap_iterateAndProcess_rdh
/** * Iterate the skip list and perform given function. * * @param keySegment * memory segment storing the key. * @param keyOffset * offset of the key. * @param keyLen * length of the key. * @param function * the function to apply when the skip list contains the given key, which * accepts two param...
3.26
flink_CopyOnWriteSkipListStateMap_helpSetNodeStatus_rdh
/** * Set node status to the given new status, and return old status. */ private NodeStatus helpSetNodeStatus(long node, NodeStatus newStatus) { Node nodeStorage = getNodeSegmentAndOffset(node); MemorySegment segment = nodeStorage.nodeSegment; int offsetInSegment = nodeStorage.nodeOffset; NodeStat...
3.26
flink_CopyOnWriteSkipListStateMap_tryToDeleteNodesPhysically_rdh
/** * Try to delete some nodes that has been logically removed. */ private void tryToDeleteNodesPhysically() { if (highestRequiredSnapshotVersionPlusOne != 0) { return; } int threshold = ((int) (totalSize * logicalRemovedKeysRatio)); int size = logicallyRemovedNodes.size(); if (size > threshold) { deleteLogically...
3.26
flink_CopyOnWriteSkipListStateMap_updateStat_rdh
/** * Update some statistics. */ private void updateStat() { requestCount++; }
3.26
flink_CopyOnWriteSkipListStateMap_getNode_rdh
/** * Find the node containing the given key. * * @param keySegment * memory segment storing the key. * @param keyOffset * offset of the key. * @param keyLen * length of the key. * @return the state. Null will be returned if key does not exist. */ @VisibleForTesting @Nullable S getNode(MemorySegment k...
3.26
flink_CopyOnWriteSkipListStateMap_updateValueWithCopyOnWrite_rdh
/** * Update the value of the node with copy-on-write mode. The old value will be linked after the * new value, and can be still accessed. * * @param node * the node to update. * @param value * the value. * @return the old value pointer. */ private long updateValueWithCopyOnWrite(long node, byte[] value) {...
3.26
flink_CopyOnWriteSkipListStateMap_getRandomIndexLevel_rdh
/** * Return a random level for new node. * * <p>The implementation refers to the {@code randomLevel} method of JDK7's * ConcurrentSkipListMap. See * https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java#L899 */ private int getRandomIndexLevel() ...
3.26
flink_CopyOnWriteSkipListStateMap_getKeys_rdh
// ---------------------------------------------------------------------------------- @Override public Stream<K> getKeys(N namespace) { updateStat(); MemorySegment namespaceSegment = skipListKeySerializer.serializeNamespaceToSegment(namespace); Iterator<Long> nodeIter = new NamespaceNodeIterator(namespaceSe...
3.26
flink_CopyOnWriteSkipListStateMap_updateValueWithReplace_rdh
/** * Update the value of the node with replace mode. The old value will be unlinked and replaced * by the new value, and can not be accessed later. Note that the space of the old value is not * freed here, and the caller of this method should be responsible for the space management. * * @param node * the node ...
3.26
flink_CopyOnWriteSkipListStateMap_getNodeStateHelper_rdh
/** * Return the state of the node. null will be returned if the node is removed. */ private S getNodeStateHelper(long node) { Node nodeStorage = getNodeSegmentAndOffset(node); MemorySegment segment = nodeStorage.nodeSegment; int v112 = nodeStorage.nodeOffset; long valuePointer = SkipListUtils.getValueP...
3.26
flink_CopyOnWriteSkipListStateMap_getFirstNodeWithNamespace_rdh
/** * Find the first node with the given namespace at level 0. * * @param namespaceSegment * memory segment storing the namespace. * @param namespaceOffset * offset of the namespace. * @param namespaceLen * length of the namespace. * @return the first node with the given namespace. NIL_NODE will be retur...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetNextNode_rdh
/** * Return the next of the given node at the given level. */ long helpGetNextNode(long node, int level) { return SkipListUtils.helpGetNextNode(node, level, this.levelIndexHeader, this.spaceAllocator); }
3.26
flink_CopyOnWriteSkipListStateMap_removeNode_rdh
/** * Remove the given node indicated by {@link SkipListNodePointers#currentNode}. * * @param pointers * pointers of the node to remove and its prev/next node. * @param isLogicallyRemoved * whether the node to remove is already logically removed. * @param returnOldState * whether to return the old state a...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetState_rdh
/** * Return the state pointed by the given pointer. The serializer used is the {@link #skipListValueSerializer}. Because serializer is not thread safe, so this method should only * be called in the state map synchronously. */ S helpGetState(long valuePointer) { return helpGetState(valuePointer, skipListValueSer...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetKey_rdh
/** * Returns the key of the node. */ private K helpGetKey(long node) { Node nodeStorage = getNodeSegmentAndOffset(node); MemorySegment segment = nodeStorage.nodeSegment; int offsetInSegment = nodeStorage.nodeOffset; int level = SkipListUtils.getLevel(segment, offsetInSegment); int keyDataLen ...
3.26
flink_CopyOnWriteSkipListStateMap_getNodeInternal_rdh
/** * Find the node containing the given key. * * @param key * the key. * @param namespace * the namespace. * @return id of the node. NIL_NODE will be returned if key does no exist. */ private S getNodeInternal(K key, N namespace) { MemorySegment keySegment = getKeySegment(key, namespace); int keyL...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetBytesForKeyAndNamespace_rdh
/** * Returns the byte arrays of serialized key and namespace. * * @param node * the node. * @return a tuple of byte arrays of serialized key and namespace */ Tuple2<byte[], byte[]> helpGetBytesForKeyAndNamespace(long node) { Node nodeStorage = getNodeSegmentAndOffset(node); MemorySegment segment = no...
3.26
flink_CopyOnWriteSkipListStateMap_helpGetBytesForState_rdh
/** * Returns the byte array of serialized state. * * @param valuePointer * pointer to value. * @return byte array of serialized value. */ byte[] helpGetBytesForState(long valuePointer) { Node node = getNodeSegmentAndOffset(valuePointer); MemorySegment segment = node.nodeSegment; int offsetInSegment...
3.26
flink_CopyOnWriteSkipListStateMap_getKeySegment_rdh
/** * Get the {@link MemorySegment} wrapping up the serialized key bytes. * * @param key * the key. * @param namespace * the namespace. * @return the {@link MemorySegment} wrapping up the serialized key bytes. */ private MemorySegment getKeySegment(K key, N namespace) { return skipListKeySerializer.seri...
3.26
flink_FileCatalogStore_contains_rdh
/** * Returns whether the specified catalog exists in the catalog store. * * @param catalogName * the name of the catalog to check * @return {@code true} if the catalog exists in the catalog store, {@code false} otherwise * @throws CatalogException * if the catalog store is not open or if there is an error c...
3.26
flink_FileCatalogStore_storeCatalog_rdh
/** * Stores the specified catalog in the catalog store. * * @param catalogName * the name of the catalog * @param catalog * the catalog descriptor to store * @throws CatalogException * if the catalog store is not open or if there is an error storing the * catalog */ @Override public void storeCatalog...
3.26
flink_FileCatalogStore_listCatalogs_rdh
/** * Returns a set of all catalog names in the catalog store. * * @return a set of all catalog names in the catalog store * @throws CatalogException * if the catalog store is not open or if there is an error retrieving * the list of catalog names */ @Override public Set<String> listCatalogs() throws Catalog...
3.26
flink_FileCatalogStore_open_rdh
/** * Opens the catalog store and initializes the catalog file map. * * @throws CatalogException * if the catalog store directory does not exist, not a directory, or * if there is an error reading the directory */ @Override public void open() throws CatalogException { try { FileSystem fs = catalog...
3.26
flink_FileCatalogStore_removeCatalog_rdh
/** * Removes the specified catalog from the catalog store. * * @param catalogName * the name of the catalog to remove * @param ignoreIfNotExists * whether to ignore if the catalog does not exist in the catalog store * @throws CatalogException * if the catalog store is not open or if there is an error rem...
3.26
flink_TumbleWithSize_on_rdh
/** * Specifies the time attribute on which rows are grouped. * * <p>For streaming tables you can specify grouping by a event-time or processing-time * attribute. * * <p>For batch tables you can specify grouping on a timestamp or long attribute. * * @param timeField * time attribute for streaming and batch t...
3.26
flink_ApplicationStatus_fromJobStatus_rdh
/** * Derives the ApplicationStatus that should be used for a job that resulted in the given job * status. If the job is not yet in a globally terminal state, this method returns {@link #UNKNOWN}. */ public static ApplicationStatus fromJobStatus(JobStatus jobStatus) { return JOB_STATUS_APPLICATION_STATUS_BI_MAP....
3.26
flink_ApplicationStatus_processExitCode_rdh
/** * Gets the process exit code associated with this status. * * @return The associated process exit code. */ public int processExitCode() { return processExitCode; }
3.26
flink_ApplicationStatus_deriveJobStatus_rdh
/** * Derives the {@link JobStatus} from the {@code ApplicationStatus}. * * @return The corresponding {@code JobStatus}. * @throws UnsupportedOperationException * for {@link #UNKNOWN}. */ public JobStatus deriveJobStatus() { if (!JOB_STATUS_APPLICATION_STATUS_BI_MAP.inverse().containsKey(this)) { th...
3.26
flink_HiveMetastoreClientWrapper_getNotNullColumns_rdh
// -------- Start of shimmed methods ---------- public Set<String> getNotNullColumns(Configuration conf, String dbName, String tableName) { return hiveShim.getNotNullColumns(client, conf, dbName, tableName); }
3.26
flink_KeyGroupPartitioner_buildHistogramByAccumulatingCounts_rdh
/** * This method creates a histogram from the counts per key-group in {@link #counterHistogram}. */ private int buildHistogramByAccumulatingCounts() { int sum = 0; for (int i = 0; i < counterHistogram.length; ++i) { int currentSlotValue = counterHistogram[i]; counterHistogram[i] = sum; ...
3.26
flink_KeyGroupPartitioner_partitionByKeyGroup_rdh
/** * Partitions the data into key-groups and returns the result as a {@link PartitioningResult}. */ public PartitioningResult<T> partitionByKeyGroup() { if (computedResult == null) { reportAllElementKeyGroups();int outputNumberOfElements = buildHistogramByAccumulatingCounts(); executePartitioning...
3.26
flink_KeyGroupPartitioner_reportAllElementKeyGroups_rdh
/** * This method iterates over the input data and reports the key-group for each element. */ protected void reportAllElementKeyGroups() { Preconditions.checkState(partitioningSource.length >= numberOfElements); for (int i = 0; i < numberOfElements; ++i) { int keyGroup = KeyGroupRangeAssignment.assi...
3.26
flink_StateHandleStoreUtils_deserialize_rdh
/** * Deserializes the passed data into a {@link RetrievableStateHandle}. * * @param data * The data that shall be deserialized. * @param <T> * The type of data handled by the deserialized {@code RetrievableStateHandle}. * @return The {@code RetrievableStateHandle} instance. ...
3.26
flink_StateHandleStoreUtils_serializeOrDiscard_rdh
/** * Serializes the passed {@link StateObject} and discards the state in case of failure. * * @param stateObject * the {@code StateObject} that shall be serialized. * @return The serialized version of the passed {@code StateObject}. * @throws Exception * if an error occurred during the serialization. The co...
3.26
flink_NetUtils_validateHostPortString_rdh
/** * Validates if the given String represents a hostname:port. * * <p>Works also for ipv6. * * <p>See: * http://stackoverflow.com/questions/2345063/java-common-way-to-validate-and-convert-hostport-to-inetsocketaddress * * @return URL object for accessing host and port *...
3.26
flink_NetUtils_getIPv6UrlRepresentation_rdh
/** * Creates a compressed URL style representation of an Inet6Address. * * <p>This method copies and adopts code from Google's Guava library. We re-implement this here * in order to reduce dependency on Guava. The Guava library has frequently caused dependency * conflicts in the past. */ private static String ge...
3.26
flink_NetUtils_ipAddressAndPortToUrlString_rdh
/** * Encodes an IP address and port to be included in URL. in particular, this method makes sure * that IPv6 addresses have the proper formatting to be included in URLs. * * @param address * The address to be included in the URL. * @param port * The port for the URL address. * @return The proper URL string...
3.26
flink_NetUtils_getHostnameFromFQDN_rdh
/** * Turn a fully qualified domain name (fqdn) into a hostname. If the fqdn has multiple subparts * (separated by a period '.'), it will take the first part. Otherwise it takes the entire fqdn. * * @param fqdn * The fully qualified domain name. * @return The hostname. */ public static String getHostnameFromFQ...
3.26
flink_NetUtils_getPortRangeFromString_rdh
// ------------------------------------------------------------------------ // Port range parsing // ------------------------------------------------------------------------ /** * Returns an iterator over available ports defined by the range definition. * * @param rangeDefinition * String describing a single port...
3.26
flink_NetUtils_createSocketFromPorts_rdh
/** * Tries to allocate a socket from the given sets of ports. * * @param portsIterator * A set of ports to choose from. * @param factory * A factory for creating the SocketServer * @return null if no port was available or an allocated socket. */ public static ServerSocket createSocketFromPorts(Iterator<Int...
3.26
flink_NetUtils_m1_rdh
/** * Check whether the given port is in right range when connecting to somewhere. * * @param port * the port to check * @return true if the number in the range 1 to 65535 */ public static boolean m1(int port) { return (1 <= port) && (port <= 65535); }
3.26
flink_NetUtils_ipAddressToUrlString_rdh
/** * Encodes an IP address properly as a URL string. This method makes sure that IPv6 addresses * have the proper formatting to be included in URLs. * * @param address * The IP address to encode. * @return The proper URL string encoded IP address. */ public static String ipAddressToUrlString(InetAddress addre...
3.26
flink_NetUtils_unresolvedHostAndPortToNormalizedString_rdh
/** * Returns a valid address for Pekko. It returns a String of format 'host:port'. When an IPv6 * address is specified, it normalizes the IPv6 address to avoid complications with the exact * URL match policy of Pekko. * * @param host * The hostname, IPv4 or IPv6 address * @param port * The port * @return ...
3.26
flink_NetUtils_m0_rdh
// ------------------------------------------------------------------------ // Encoding of IP addresses for URLs // ------------------------------------------------------------------------ /** * Returns an address in a normalized format for Pekko. When an IPv6 address is specified, it * normalizes the IPv6 address to...
3.26
flink_NetUtils_parseHostPortAddress_rdh
/** * Converts a string of the form "host:port" into an {@link InetSocketAddress}. * * @param hostPort * The "host:port" string. * @return The converted InetSocketAddress. */ public static InetSocketAddress parseHostPortAddress(String hostPort) { URL url = validateHostPortString(hostPort); return new In...
3.26
flink_NetUtils_socketToUrl_rdh
/** * Converts an InetSocketAddress to a URL. This method assigns the "http://" schema to the URL * by default. * * @param socketAddress * the InetSocketAddress to be converted * @return a URL object representing the provided socket address with "http://" schema */ public static URL socketToUrl(InetSocketAddre...
3.26
flink_NetUtils_isValidHostPort_rdh
/** * check whether the given port is in right range when getting port from local system. * * @param port * the port to check * @return true if the number in the range 0 to 65535 */ public static boolean isValidHostPort(int port) { return (0 <= port) && (port <= 65535); }
3.26
flink_NetUtils_getCorrectHostnamePort_rdh
/** * Converts a string of the form "host:port" into an {@link URL}. * * @param hostPort * The "host:port" string. * @return The converted URL. */ public static URL getCorrectHostnamePort(String hostPort) { return validateHostPortString(hostPort); }
3.26
flink_NetUtils_hostAndPortToUrlString_rdh
/** * Normalizes and encodes a hostname and port to be included in URL. In particular, this method * makes sure that IPv6 address literals have the proper formatting to be included in URLs. * * @param host * The address to be included in the URL. * @param port * The port for the URL address. * @return The p...
3.26
flink_NetUtils_acceptWithoutTimeout_rdh
/** * Calls {@link ServerSocket#accept()} on the provided server socket, suppressing any thrown * {@link SocketTimeoutException}s. This is a workaround for the underlying JDK-8237858 bug in * JDK 11 that can cause errant SocketTimeoutExceptions to be thrown at unexpected times. * * <p>This method expects the provi...
3.26
flink_NetUtils_socketAddressToUrlString_rdh
/** * Encodes an IP address and port to be included in URL. in particular, this method makes sure * that IPv6 addresses have the proper formatting to be included in URLs. * * @param address * The socket address with the IP address and port. * @return The proper URL string encoded IP address and port. */ public...
3.26
flink_NetUtils_getWildcardIPAddress_rdh
/** * Returns the wildcard address to listen on all interfaces. * * @return Either 0.0.0.0 or :: depending on the IP setup. */ public static String getWildcardIPAddress() { return WILDCARD_ADDRESS; }
3.26
flink_NetUtils_getAvailablePort_rdh
// ------------------------------------------------------------------------ // Lookup of to free ports // ------------------------------------------------------------------------ /** * Find a non-occupied port. * * @return A non-occupied port. */ public static Port getAvailablePort() { for (int i = 0; i < 50; i++) ...
3.26
flink_PlanGenerator_registerCachedFilesWithPlan_rdh
/** * Registers all files that were registered at this execution environment's cache registry of * the given plan's cache registry. * * @param p * The plan to register files at. * @throws IOException * Thrown if checks for existence and sanity fail. */ private void registerCachedFilesWithPlan(Plan p) throws...
3.26
flink_PlanGenerator_registerGenericTypeInfoIfConfigured_rdh
/** * Check plan for GenericTypeInfo's and register the types at the serializers. * * @param plan * the generated plan. */ private void registerGenericTypeInfoIfConfigured(Plan plan) { if (!config.isAutoTypeRegistrationDisabled()) { plan.accept(new Visitor<Operator<?>>() { pri...
3.26
flink_PlanGenerator_createPlan_rdh
/** * Create plan. * * @return the generated plan. */ private Plan createPlan() { final OperatorTranslation translator = new OperatorTranslation(); final Plan plan = translator.translateToPlan(sinks, jobName); if (defaultParallelism > 0) {plan.setDefaultParallelism(defaultParallelism);} plan.setExec...
3.26
flink_OrCondition_getLeft_rdh
/** * * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getLeft() { return left; }
3.26
flink_OrCondition_getRight_rdh
/** * * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getRight() { return right; }
3.26
flink_HyperLogLogPlusPlus_query_rdh
/** * Compute the HyperLogLog estimate. * * <p>Variable names in the HLL++ paper match variable names in the code. */ public long query(HllBuffer buffer) { // Compute the inver...
3.26
flink_HyperLogLogPlusPlus_distance_rdh
/** * Use square of the difference between the current estimate and the estimate at the given index * as distance metric. */ private double distance(double e, double[] estimates, int i) { double v23 = e - estimates[i]; return v23 * v23; }
3.26
flink_HyperLogLogPlusPlus_trueRsd_rdh
/** * The <code>rsd</code> of HLL++ is always equal to or better than the <code>rsd</code> * requested. This method returns the <code>rsd</code> this instance actually guarantees. * * @return the actual <code>rsd</code>. */ public double trueRsd() { return 1.04 / Math.sqrt(m);}
3.26
flink_HyperLogLogPlusPlus_estimateBias_rdh
/** * Estimate the bias using the raw estimates with their respective biases from the HLL++ * appendix. We currently use KNN interpolation to determine the bias (as suggested in the * paper). */ public double estimateBias(double e) { double[] estimates = RAW_ESTIMATE_DATA[p - 4]; int numEstimates = estima...
3.26
flink_BigDecParser_parseField_rdh
/** * Static utility to parse a field of type BigDecimal from a byte sequence that represents text * characters (such as when read from a file stream). * * @param bytes * The bytes containing the text data that should be parsed. * @param startPos * The offset to start the parsing. * @param length * The l...
3.26
flink_ResultSubpartitionView_notifyRequiredSegmentId_rdh
/** * In tiered storage shuffle mode, only required segments will be sent to prevent the redundant * buffer usage. Downstream will notify the upstream by this method to send required segments. * * @param segmentId * segment id is the id indicating the required id. */ default void notifyRequiredSegmentId(int seg...
3.26
flink_InFlightRequestTracker_m0_rdh
/** * Deregisters an in-flight request. */ public void m0() {phaser.arriveAndDeregister(); }
3.26
flink_OperatorInformation_getOutputType_rdh
/** * Gets the return type of the user code function. */ public TypeInformation<OUT> getOutputType() { return outputType; }
3.26
flink_PythonStreamGroupAggregateOperator_getUserDefinedFunctionsProto_rdh
/** * Gets the proto representation of the Python user-defined aggregate functions to be executed. */ @Override public UserDefinedAggregateFunctions getUserDefinedFunctionsProto() {FlinkFnApi.UserDefinedAggregateFunctions.Builder builder = super.getUserDefinedFunctionsProto().toBuilder(); builder.setCountStarIn...
3.26
flink_EventTimeTrigger_create_rdh
/** * Creates an event-time trigger that fires once the watermark passes the end of the window. * * <p>Once the trigger fires all elements are discarded. Elements that arrive late immediately * trigger window evaluation with just this one element. */ public static EventTimeTrigger create() {return new EventTimeTr...
3.26
flink_FromElementsFunction_m0_rdh
/** * Gets the number of elements emitted so far. * * @return The number of elements emitted so far. */ public int m0() { return numElementsEmitted; }
3.26
flink_FromElementsFunction_setOutputType_rdh
/** * Set element type and re-serialize element if required. Should only be called before * serialization/deserialization of this function. */@Override public void setOutputType(TypeInformation<T> outTypeInfo, ExecutionConfig executionConfig) { Preconditions.checkState(elements != null, "The output type should'v...
3.26
flink_FromElementsFunction_checkCollection_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ /** * Verifies that all elements in the collection are non-null, and are of the given class, or a * subclass thereof. * * @param elements * The coll...
3.26
flink_FromElementsFunction_snapshotState_rdh
// ------------------------------------------------------------------------ // Checkpointing // ------------------------------------------------------------------------ @Override public void snapshotState(FunctionSnapshotContext context) throws Exception { Preconditions.checkState(this.checkpointedState != null, ...
3.26
flink_FromElementsFunction_getNumElements_rdh
/** * Gets the number of elements produced in total by this function. * * @return The number of elements produced in total. */public int getNumElements() { return numElements; }
3.26
flink_DatadogHttpReporter_m0_rdh
/** * Removes leading and trailing angle brackets. */ private String m0(String str) { return str.substring(1, str.length() - 1); }
3.26
flink_DatadogHttpReporter_getTagsFromMetricGroup_rdh
/** * Get tags from MetricGroup#getAllVariables(), excluding 'host'. */ private List<String> getTagsFromMetricGroup(MetricGroup metricGroup) { List<String> tags = new ArrayList<>(); for (Map.Entry<String, String> entry : metricGroup.getAllVariables().entrySet()) { if (!entry.getKey().equals(H...
3.26
flink_DatadogHttpReporter_getTagsFromConfig_rdh
/** * Get config tags from config 'metrics.reporter.dghttp.tags'. */ private List<String> getTagsFromConfig(String str) { return Arrays.asList(str.split(",")); }
3.26
flink_CommonExecLookupJoin_validate_rdh
// ---------------------------------------------------------------------------------------- // Validation // ---------------------------------------------------------------------------------------- private void validate(RelOptTable temporalTable) { // validate table source and function implementation first validateTabl...
3.26
flink_DistributedRuntimeUDFContext_setBroadcastVariable_rdh
// -------------------------------------------------------------------------------------------- public void setBroadcastVariable(String name, BroadcastVariableMaterialization<?, ?> value) {this.broadcastVars.put(name, value); }
3.26
flink_JoinOperatorSetsBase_equalTo_rdh
/** * Continues a Join transformation and defines a {@link KeySelector} function for the second * join {@link DataSet}. * * <p>The KeySelector function is called for each element of the second DataSet and extracts * a single key value on which the DataSet is joined. * * <p>The resulting {@link JoinFunctionAssign...
3.26
flink_AbstractOuterJoinDriver_setup_rdh
// ------------------------------------------------------------------------ @Override public void setup(TaskContext<FlatJoinFunction<IT1, IT2, OT>, OT> context) { this.taskContext = context; this.running = true; }
3.26
flink_XORShiftRandom_next_rdh
/** * All other methods like nextInt()/nextDouble()... depends on this, so we just need to * overwrite this. * * @param bits * Random bits * @return The next pseudorandom value from this random number generator's sequence */ @Override public int next(int bits) { long nextSeed = seed ^ (seed << 21); n...
3.26