name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_ExecNodePlanDumper_dagToString_rdh
/** * Converts an {@link ExecNode} DAG to a string as a tree style. * * <p>The following DAG of {@link ExecNode} * * <pre>{@code Sink1 Sink2 * | | * Filter3 Filter4 * \ / * Join * / \ * Filter1 Filter2 * \ / * Project * | * Scan}</pre> * * <p>w...
3.26
flink_CheckpointCommitter_setOperatorId_rdh
/** * Internally used to set the operator ID after instantiation. * * @param id * @throws Exception */ public void setOperatorId(String id) throws Exception { this.operatorId = id; }
3.26
flink_CheckpointCommitter_setJobId_rdh
/** * Internally used to set the job ID after instantiation. * * @param id * @throws Exception */ public void setJobId(String id) throws Exception { this.jobId = id; }
3.26
flink_TPCHQuery3_m0_rdh
// ************************************************************************* // PROGRAM // ************************************************************************* public static void m0(String[] args) throws Exception { LOGGER.warn(DATASET_DEPRECATION_INFO); final ParameterTool params = ParameterTool.fromArgs(...
3.26
flink_TPCHQuery3_getLineitemDataSet_rdh
// ************************************************************************* // UTIL METHODS // ************************************************************************* private static DataSet<Lineitem> getLineitemDataSet(ExecutionEnvironment env, String lineitemPath) { return env.readCsvFile(lineitemPath).fieldDel...
3.26
flink_CharVarCharTrimPadCastRule_stringExceedsLength_rdh
// --------------- // Shared methods // --------------- static String stringExceedsLength(String strTerm, int targetLength) { return (methodCall(strTerm, "length") + " > ") + targetLength; }
3.26
flink_HiveParserExpressionWalker_walk_rdh
/** * walk the current operator and its descendants. */ protected void walk(Node nd) throws SemanticException { // Push the node in the stack opStack.push(nd); // While there are still nodes to dispatch... while (!opStack.empty()) { Node node = opStack.peek(); if ((node.getChildren() == nu...
3.26
flink_HiveParserExpressionWalker_shouldByPass_rdh
/** * We should bypass subquery since we have already processed and created logical plan (in * genLogicalPlan) for subquery at this point. SubQueryExprProcessor will use generated plan and * creates appropriate ExprNodeSubQueryDesc. */ private boolean shouldByPass(Node childNode, Node parentNode) { if ((parentN...
3.26
flink_HiveParserUnparseTranslator_addIdentifierTranslation_rdh
/** * Register a translation for an identifier. */ public void addIdentifierTranslation(HiveParserASTNode identifier) { if (!enabled) { return; } assert identifier.getToken().getType() == HiveASTParser.Identifier; String replacementText = identifier.getText(); rep...
3.26
flink_HiveParserUnparseTranslator_addCopyTranslation_rdh
/** * Register a "copy" translation in which a node will be translated into whatever the * translation turns out to be for another node (after previously registered translations have * already been performed). Deferred translations are performed in the order they are * registered, and follow the same rules regardin...
3.26
flink_LastValueAggFunction_getArgumentDataTypes_rdh
// -------------------------------------------------------------------------------------------- // Planning // -------------------------------------------------------------------------------------------- @Override public List<DataType> getArgumentDataTypes() {return Collections.singletonList(valueDataType); }
3.26
flink_LastValueAggFunction_createAccumulator_rdh
// -------------------------------------------------------------------------------------------- @Override public RowData createAccumulator() { GenericRowData acc = new GenericRowData(2); acc.setField(0, null); acc.setField(1, Long.MIN_VALUE); return acc; }
3.26
flink_IntMaximum_add_rdh
// ------------------------------------------------------------------------ // Primitive Specializations // ------------------------------------------------------------------------ public void add(int value) { this.max = Math.max(this.max, value); }
3.26
flink_IntMaximum_toString_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ @Override public String toString() { return "IntMaximum " + this.max; }
3.26
flink_SourceTestSuiteBase_addCollectSink_rdh
/** * Add a collect sink in the job. */ protected CollectIteratorBuilder<T> addCollectSink(DataStream<T> stream) { TypeSerializer<T> serializer = stream.getType().createSerializer(stream.getExecutionConfig()); String accumulatorName = "dataStreamCollect_" + UUID.randomUUID(); CollectSinkOperatorFactory<T>...
3.26
flink_SourceTestSuiteBase_testMultipleSplits_rdh
/** * Test connector source with multiple splits in the external system * * <p>This test will create 4 splits in the external system, write test data to all splits, and * consume back via a Flink job with 4 parallelism. * * <p>The number and order of records in each split consumed by Flink need to be identical to...
3.26
flink_SourceTestSuiteBase_generateAndWriteTestData_rdh
// ----------------------------- Helper Functions --------------------------------- /** * Generate a set of test records and write it to the given split writer. * * @param externalContext * External context * @return List of generated test records */ protected List<T> generateAndWriteTestData(int splitIndex, ...
3.26
flink_SourceTestSuiteBase_testSourceMetrics_rdh
/** * Test connector source metrics. * * <p>This test will create 4 splits in the external system first, write test data to all splits * and consume back via a Flink job with parallelism 4. Then read and compare the metrics. * * <p>Now test: numRecordsIn */@TestTemplate @DisplayName("Test source metrics") public...
3.26
flink_SourceTestSuiteBase_generateTestDataForWriter_rdh
/** * Generate a set of split writers. * * @param externalContext * External context * @param splitIndex * the split index * @param writer * the writer to send data * @return List of generated test records */ protected List<T> generateTestDataForWriter(DataStreamSourceExternalContext<T> externalContext,...
3.26
flink_SourceTestSuiteBase_getTestDataSize_rdh
/** * Get the size of test data. * * @param collections * test data * @return the size of test data */ protected int getTestDataSize(List<List<T>> collections) { int v78 = 0; for (Collection<T> collection : collections) { v78 += collection.size(); } return v78; }
3.26
flink_SourceTestSuiteBase_checkSourceMetrics_rdh
/** * Compare the metrics. */ private boolean checkSourceMetrics(MetricQuerier queryRestClient, TestEnvironment testEnv, JobID jobId, String sourceName, long allRecordSize) throws Exception { Double sumNumRecordsIn = queryRestClient.getAggregatedMetricsByRestAPI(testEnv.getRestEndpoint(), jobId, sourceName, Met...
3.26
flink_SourceTestSuiteBase_testScaleDown_rdh
/** * Test connector source restart from a savepoint with a lower parallelism. * * <p>This test will create 4 splits in the external system first, write test data to all splits * and consume back via a Flink job with parallelism 4. Then stop the job with savepoint, * restart the job from the checkpoint with a lowe...
3.26
flink_SourceTestSuiteBase_checkResultWithSemantic_rdh
/** * Compare the test data with the result. * * <p>If the source is bounded, limit should be null. * * @param resultIterator * the data read from the job * @param testData * the test data * @param semantic * the supported semantic, see {@link CheckpointingMode} * @param limit * expected number of t...
3.26
flink_SourceTestSuiteBase_testSavepoint_rdh
/** * Test connector source restart from a savepoint. * * <p>This test will create 4 splits in the external system first, write test data to all * splits, and consume back via a Flink job. Then stop the job with savepoint, restart the job * from the checkpoint. After the job has been running, add some extra data t...
3.26
flink_SourceTestSuiteBase_testSourceSingleSplit_rdh
/** * Test connector source with only one split in the external system. * * <p>This test will create one split in the external system, write test data into it, and * consume back via a Flink job with 1 parallelism. * * <p>The number and order of records consumed by Flink need to be identical to the test data * w...
3.26
flink_SourceTestSuiteBase_testScaleUp_rdh
/** * Test connector source restart from a savepoint with a higher parallelism. * * <p>This test will create 4 splits in the external system first, write test data to all splits * and consume back via a Flink job with parallelism 2. Then stop the job with savepoint, * restart the job from the checkpoint with a hig...
3.26
flink_TieredStorageResultSubpartitionView_readNettyPayload_rdh
// ------------------------------- // Internal Methods // ------------------------------- private Optional<Buffer> readNettyPayload(NettyPayloadManager nettyPayloadManager) throws IOException { NettyPayload nettyPayload = nettyPayloadManager.poll(); if (nettyPayload == null) { return Optional.empty(); ...
3.26
flink_CompressionUtils_extractTarFileUsingTar_rdh
// See // https://github.com/apache/hadoop/blob/7f93349ee74da5f35276b7535781714501ab2457/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java private static void extractTarFileUsingTar(String inFilePath, String targetDirPath, boolean gzipped) throws IOException {inFilePath = makeSecureS...
3.26
flink_CompressionUtils_extractTarFileUsingJava_rdh
// Follow the pattern suggested in // https://commons.apache.org/proper/commons-compress/examples.html private static void extractTarFileUsingJava(String inFilePath, String targetDirPath, boolean gzipped) throws IOException { try (InputStream fi = Files.newInputStream(Paths.get(inFilePath));InputStream bi = new Buf...
3.26
flink_PersistentMetadataCheckpointStorageLocation_createMetadataOutputStream_rdh
// ------------------------------------------------------------------------ @Override public CheckpointMetadataOutputStream createMetadataOutputStream() throws IOException { return new FsCheckpointMetadataOutputStream(fileSystem, metadataFilePath, checkpointDirectory); }
3.26
flink_PatternStream_inEventTime_rdh
/** * Sets the time characteristic to event time. */ public PatternStream<T> inEventTime() { return new PatternStream<>(builder.inEventTime()); } /** * Applies a process function to the detected pattern sequence. For each pattern sequence the * provided {@link PatternProcessFunction} is called. In order to pr...
3.26
flink_PatternStream_inProcessingTime_rdh
/** * Sets the time characteristic to processing time. */ public PatternStream<T> inProcessingTime() { return new PatternStream<>(builder.inProcessingTime()); }
3.26
flink_PatternStream_sideOutputLateData_rdh
/** * Send late arriving data to the side output identified by the given {@link OutputTag}. A * record is considered late after the watermark has passed its timestamp. * * <p>You can get the stream of late data using {@link SingleOutputStreamOperator#getSideOutput(OutputTag)} on the {@link SingleOutputStreamOperato...
3.26
flink_TriFunctionWithException_unchecked_rdh
/** * Convert at {@link TriFunctionWithException} into a {@link TriFunction}. * * @param triFunctionWithException * function with exception to convert into a function * @param <A> * first input type * @param <B> * second input type * @param <C> * third input type * @param <D> * output type * @ret...
3.26
flink_DataExchangeMode_getForForwardExchange_rdh
// ------------------------------------------------------------------------ public static DataExchangeMode getForForwardExchange(ExecutionMode mode) { return FORWARD[mode.ordinal()]; }
3.26
flink_DataExchangeMode_select_rdh
/** * Computes the mode of data exchange to be used for a given execution mode and ship strategy. * The type of the data exchange depends also on whether this connection has been identified to * require pipeline breaking for deadlock avoidance. * * <ul> * <li>If the connection is set to be pipeline breaking, th...
3.26
flink_DataSetUtils_partitionByRange_rdh
/** * Range-partitions a DataSet using the specified key selector function. */ public static <T, K extends Comparable<K>> PartitionOperator<T> partitionByRange(DataSet<T> input, DataDistribution distribution, KeySelector<T, K> keyExtractor) { final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExt...
3.26
flink_DataSetUtils_sample_rdh
/** * Generate a sample of DataSet by the probability fraction of each element. * * @param withReplacement * Whether element can be selected more than once. * @param fraction * Probability that each element is chosen, should be [0,1] without replacement, * and [0, ∞) with replacement. While fraction is lar...
3.26
flink_DataSetUtils_zipWithIndex_rdh
/** * Method that assigns a unique {@link Long} value to all elements in the input data set. The * generated values are consecutive. * * @param input * the input data set * @return a data set of tuple 2 consisting of consecutive ids and initial values. */ public static <T> DataSet<Tuple2<Long, T>> zipWithIndex...
3.26
flink_DataSetUtils_zipWithUniqueId_rdh
/** * Method that assigns a unique {@link Long} value to all elements in the input data set as * described below. * * <ul> * <li>a map function is applied to the input data set * <li>each map task holds a counter c which is increased for each record * <li>c is shifted by n bits where n = log2(number of par...
3.26
flink_DataSetUtils_countElementsPerPartition_rdh
/** * Method that goes over all the elements in each partition in order to retrieve the total * number of elements. * * @param input * the DataSet received as input * @return a data set containing tuples of subtask index, number of elements mappings. */ public static <T> Dat...
3.26
flink_DataSetUtils_getBitSize_rdh
// ************************************************************************* // UTIL METHODS // ************************************************************************* public static int getBitSize(long value) { if (value > Integer.MAX_VALUE) { return 64 - Integer.numberOfLeadingZeros(((int) (value >> 32))); } else ...
3.26
flink_DataSetUtils_summarize_rdh
// -------------------------------------------------------------------------------------------- // Summarize // -------------------------------------------------------------------------------------------- /** * Summarize a DataSet of Tuples by collecting single pass statistics for all columns. * * <p>Example usage: ...
3.26
flink_DataSetUtils_sampleWithSize_rdh
/** * Generate a sample of DataSet which contains fixed size elements. * * <p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, * use sample with fraction unless you need exact precision. * * @param withReplacement * Whether element can be selected more than once. * @p...
3.26
flink_FlinkZooKeeperQuorumPeer_setRequiredProperties_rdh
/** * Sets required properties to reasonable defaults and logs it. */ private static void setRequiredProperties(Properties zkProps) { // Set default client port if (zkProps.getProperty("clientPort") == null) { zkProps.setProperty("clientPort", String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_PORT)); LO...
3.26
flink_FlinkZooKeeperQuorumPeer_main_rdh
// ------------------------------------------------------------------------ public static void main(String[] args) { try { // startup checks and logging EnvironmentInformation.logEnvironmentInfo(LOG, "ZooKeeper Quorum Peer", args); final ParameterTool params = ParameterTool.fromArgs(args)...
3.26
flink_FlinkZooKeeperQuorumPeer_runFlinkZkQuorumPeer_rdh
// ------------------------------------------------------------------------ /** * Runs a ZooKeeper {@link QuorumPeer} if further peers are configured or a single {@link ZooKeeperServer} if no further peers are configured. * * @param zkConfigFile * ZooKeeper config file 'zoo.cfg' * @param peerId * ID for the '...
3.26
flink_AbstractStreamingWriter_commitUpToCheckpoint_rdh
/** * Commit up to this checkpoint id. */protected void commitUpToCheckpoint(long checkpointId) throws Exception {helper.commitUpToCheckpoint(checkpointId); }
3.26
flink_ContaineredTaskManagerParameters_create_rdh
// ------------------------------------------------------------------------ // Factory // ------------------------------------------------------------------------ /** * Computes the parameters to be used to start a TaskManager Java process. * * @param config * The Flink configuration. * @param taskExecutorProces...
3.26
flink_ContaineredTaskManagerParameters_toString_rdh
// ------------------------------------------------------------------------ @Override public String toString() { return (((("TaskManagerParameters {" + "taskExecutorProcessSpec=") + taskExecutorProcessSpec) + ", taskManagerEnv=") + taskManagerEnv) + '}'; }
3.26
flink_ContaineredTaskManagerParameters_getTaskExecutorProcessSpec_rdh
// ------------------------------------------------------------------------ public TaskExecutorProcessSpec getTaskExecutorProcessSpec() { return taskExecutorProcessSpec; }
3.26
flink_SlidingProcessingTimeWindows_m1_rdh
/** * Creates a new {@code SlidingProcessingTimeWindows} {@link WindowAssigner} that assigns * elements to time windows based on the element timestamp and offset. * * <p>For example, if you want window a stream by hour,but window begins at the 15th minutes of * each hour, you can use {@code of(Time.hours(1),Time.m...
3.26
flink_SlidingProcessingTimeWindows_m0_rdh
/** * Creates a new {@code SlidingProcessingTimeWindows} {@link WindowAssigner} that assigns * elements to sliding time windows based on the element timestamp. * * @param size * The size of the generated windows. * @param slide * The slide interval of the generated windows. * @return The time policy. */ pu...
3.26
flink_FileSourceRecordEmitter_emitRecord_rdh
/** * The {@link RecordEmitter} implementation for {@link FileSourceReader}. * * <p>This updates the {@link FileSourceSplit} for every emitted record. Because the {@link FileSourceSplit} points to the position from where to start reading (after recovery), the current * offset and records-to-skip need to always poin...
3.26
flink_TimestampsAndWatermarksOperator_m0_rdh
/** * Override the base implementation to completely ignore statuses propagated from upstream. */ @Override public void m0(WatermarkStatus watermarkStatus) throws Exception { }
3.26
flink_TimestampsAndWatermarksOperator_processWatermark_rdh
/** * Override the base implementation to completely ignore watermarks propagated from upstream, * except for the "end of time" watermark. */ @Override public void processWatermark(Watermark mark) throws Exception { // if we receive a Long.MAX_VALUE watermark we forward it since it is used // to signal the e...
3.26
flink_CompensatedSum_delta_rdh
/** * The correction term. */ public double delta() { return delta; }
3.26
flink_CompensatedSum_value_rdh
/** * The value of the sum. */ public double value() { return value; }
3.26
flink_CompensatedSum_add_rdh
/** * Increments the Kahan sum by adding two sums, and updating the correction term for reducing * numeric errors. */ public CompensatedSum add(CompensatedSum other) { double correctedSum = other.value() + (delta + other.delta()); double updatedValue = value + correctedSum; double u...
3.26
flink_SlotProfile_getPreferredLocations_rdh
/** * Returns the preferred locations for the slot. */ public Collection<TaskManagerLocation> getPreferredLocations() { return preferredLocations; }
3.26
flink_SlotProfile_getReservedAllocations_rdh
/** * Returns a set of all reserved allocation ids from the execution graph. It will used by {@link PreviousAllocationSlotSelectionStrategy} to support local recovery. In this case, a vertex * cannot take an reserved allocation unless it exactly prefers that allocation. * * <p>This is optional and can be empty if u...
3.26
flink_SlotProfile_priorAllocation_rdh
/** * Returns a slot profile for the given resource profile, prior allocations and all prior * allocation ids from the whole execution graph. * * @param taskResourceProfile * specifying the required resources for the task slot * @param physicalSlotResourceProfile * specifying the required resources for the p...
3.26
flink_SlotProfile_getPhysicalSlotResourceProfile_rdh
/** * Returns the desired resource profile for the physical slot to host this task slot. */ public ResourceProfile getPhysicalSlotResourceProfile() {return physicalSlotResourceProfile; }
3.26
flink_SlotProfile_getTaskResourceProfile_rdh
/** * Returns the desired resource profile for the task slot. */ public ResourceProfile getTaskResourceProfile() { return taskResourceProfile; }
3.26
flink_SlotProfile_getPreferredAllocations_rdh
/** * Returns the desired allocation ids for the slot. */ public Collection<AllocationID> getPreferredAllocations() { return preferredAllocations; }
3.26
flink_LongMinimum_add_rdh
// ------------------------------------------------------------------------ // Primitive Specializations // ------------------------------------------------------------------------ public void add(long value) { this.min = Math.min(this.min, value); }
3.26
flink_LongMinimum_toString_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ @Override public String toString() { return "LongMinimum " + this.min; }
3.26
flink_StreamingSemiAntiJoinOperator_processElement1_rdh
/** * Process an input element and output incremental joined records, retraction messages will be * sent in some scenarios. * * <p>Following is the pseudo code to describe the core logic of this method. * * <pre> * if there is no matched rows on the other side * if anti join, send input record * if there are...
3.26
flink_StreamingSemiAntiJoinOperator_processElement2_rdh
/** * Process an input element and output incremental joined records, retraction messages will be * sent in some scenarios. * * <p>Following is the pseudo code to describe the core logic of this method. * * <p>Note: "+I" represents "INSERT", "-D" represents "DELETE", "+U" represents "UPDATE_AFTER", * "-U" repres...
3.26
flink_HiveParserTypeCheckProcFactory_getColumnExprProcessor_rdh
/** * Factory method to get ColumnExprProcessor. */ public HiveParserTypeCheckProcFactory.ColumnExprProcessor getColumnExprProcessor() { return new HiveParserTypeCheckProcFactory.ColumnExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getFuncExprNodeDescWithUdfData_rdh
/** * This function create an ExprNodeDesc for a UDF function given the children (arguments). * It will insert implicit type conversion functions if necessary. Currently this is only * used to handle CAST with hive UDFs. So no need to check flink functions. */ public static ExprNodeDesc getFuncExprNodeDescWithUdf...
3.26
flink_HiveParserTypeCheckProcFactory_convert_rdh
// temporary type-safe casting private static Map<HiveParserASTNode, ExprNodeDesc> convert(Map<Node, Object> outputs) { Map<HiveParserASTNode, ExprNodeDesc> converted = new LinkedHashMap<>(); for (Map.Entry<Node, Object> v13 : outputs.entrySet()) { if ((v13.getKey() instanceof HiveParserASTNode) && ((v13.getValue()...
3.26
flink_HiveParserTypeCheckProcFactory_getDateTimeExprProcessor_rdh
/** * Factory method to get DateExprProcessor. */ public HiveParserTypeCheckProcFactory.DateTimeExprProcessor getDateTimeExprProcessor() {return new HiveParserTypeCheckProcFactory.DateTimeExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getNumExprProcessor_rdh
/** * Factory method to get NumExprProcessor. */ public HiveParserTypeCheckProcFactory.NumExprProcessor getNumExprProcessor() { return new HiveParserTypeCheckProcFactory.NumExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_convertSqlOperator_rdh
// try to create an ExprNodeDesc with a SqlOperator private ExprNodeDesc convertSqlOperator(String funcText, List<ExprNodeDesc> children, HiveParserTypeCheckCtx ctx) throws SemanticException { SqlOperator sqlOperator = HiveParserUtils.getSqlOperator(funcText, ctx.getSqlOperatorTable(), SqlFunctionCategory.USER_DEFIN...
3.26
flink_HiveParserTypeCheckProcFactory_processGByExpr_rdh
/** * Function to do groupby subexpression elimination. This is called by all the processors * initially. As an example, consider the query select a+b, count(1) from T group by a+b; Then * a+b is already precomputed in the group by operators key, so we substitute a+b in the select * list with the internal column na...
3.26
flink_HiveParserTypeCheckProcFactory_getNullExprProcessor_rdh
/** * Factory method to get NullExprProcessor. */ public HiveParserTypeCheckProcFactory.NullExprProcessor getNullExprProcessor() { return new HiveParserTypeCheckProcFactory.NullExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getStrExprProcessor_rdh
/** * Factory method to get StrExprProcessor. */ public HiveParserTypeCheckProcFactory.StrExprProcessor getStrExprProcessor() { return new HiveParserTypeCheckProcFactory.StrExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getBoolExprProcessor_rdh
/** * Factory method to get BoolExprProcessor. */ public HiveParserTypeCheckProcFactory.BoolExprProcessor getBoolExprProcessor() { return new HiveParserTypeCheckProcFactory.BoolExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getIntervalExprProcessor_rdh
/** * Factory method to get IntervalExprProcessor. */ public HiveParserTypeCheckProcFactory.IntervalExprProcessor getIntervalExprProcessor() { return new HiveParserTypeCheckProcFactory.IntervalExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_getDefaultExprProcessor_rdh
/** * Factory method to get DefaultExprProcessor. */ public HiveParserTypeCheckProcFactory.DefaultExprProcessor getDefaultExprProcessor() { return new HiveParserTypeCheckProcFactory.DefaultExprProcessor(); }
3.26
flink_HiveParserTypeCheckProcFactory_isDescendant_rdh
// Returns true if des is a descendant of ans (ancestor) private boolean isDescendant(Node ans, Node des) { if (ans.getChildren() == null) {return false; } for (Node v120 : ans.getChildren()) { if (v120 == des) { return true; } if (isDescendant(v120, des)) { return true;} } return false; }
3.26
flink_FlinkBushyJoinReorderRule_findBestOrder_rdh
/** * Find best join reorder using bushy join reorder strategy. We will first try to reorder all * the inner join type input factors in the multiJoin. Then, we will add all outer join factors * to the top of reordered join tree generated by the first step. If there are factors, which * join condition is true, we wi...
3.26
flink_FlinkBushyJoinReorderRule_foundNextLevel_rdh
/** * Found possible join plans for the next level based on the found plans in the prev levels. */ private static Map<Set<Integer>, JoinPlan> foundNextLevel(RelBuilder relBuilder, List<Map<Set<Integer>, JoinPlan>> foundPlans, LoptMultiJoin multiJoin) { Map<Set<Integer>, JoinPlan> currentLevelJoinPlanMap = new Li...
3.26
flink_FlinkBushyJoinReorderRule_createTopProject_rdh
/** * Creates the topmost projection that will sit on top of the selected join ordering. The * projection needs to match the original join ordering. Also, places any post-join filters on * top of the project. */ private static RelNode createTopProject(RelBuilder relBuilder, LoptMultiJoin multiJoin, JoinPlan final...
3.26
flink_FlinkBushyJoinReorderRule_reorderInnerJoin_rdh
/** * Reorder all the inner join type input factors in the multiJoin. * * <p>The result contains the selected join order of each layer and is stored in a HashMap. The * number of layers is equals to the number of inner join type input factors in the multiJoin. * E.g. for inner join case ((A IJ B) IJ C): * * <p>T...
3.26
flink_FlinkBushyJoinReorderRule_getBestPlan_rdh
/** * Get the best plan for current level by comparing cost. */ private static JoinPlan getBestPlan(Map<Set<Integer>, JoinPlan> levelPlan) { JoinPlan bestPlan = null; for (Map.Entry<Set<Integer>, JoinPlan> entry : levelPlan.entrySet()) { if ((bestPlan == null) || entry.getValue().betterThan(be...
3.26
flink_RowtimeValidator_getRowtimeComponents_rdh
// utilities public static Optional<Tuple2<TimestampExtractor, WatermarkStrategy>> getRowtimeComponents(DescriptorProperties properties, String prefix) { // create timestamp extractor TimestampExtractor extractor; Optional<String> t = properties.getOptionalString(prefix + ROWTIME_TIMESTAMPS_TYPE); if (...
3.26
flink_PlanProjectOperator_map_rdh
// TODO We should use code generation for this. @SuppressWarnings("unchecked") @Override public R map(Tuple inTuple) throws Exception { for (int i = 0; i < fields.length; i++) {f2.setField(inTuple.getField(f1[i]), i); } return ((R) (f2)); ...
3.26
flink_PartitionOperatorBase_getPartitionMethod_rdh
// -------------------------------------------------------------------------------------------- public PartitionMethod getPartitionMethod() {return this.partitionMethod; }
3.26
flink_PartitionOperatorBase_executeOnCollections_rdh
// -------------------------------------------------------------------------------------------- @Override protected List<IN> executeOnCollections(List<IN> inputData, RuntimeContext runtimeContext, ExecutionConfig executionConfig) { return inputData; }
3.26
flink_TaskStatsRequestCoordinator_handleSuccessfulResponse_rdh
/** * Handles the successfully returned tasks stats response by collecting the corresponding * subtask samples. * * @param requestId * ID of the request. * @param executionIds * ID of the sampled task. * @param result * Result of stats request returned by an individual task. * @throws IllegalStateExcept...
3.26
flink_TaskStatsRequestCoordinator_shutDown_rdh
/** * Shuts down the coordinator. * * <p>After shut down, no further operations are executed. */ public void shutDown() { synchronized(lock) { if (!isShutDown) { log.info("Shutting down task stats request coordinator."); for (PendingStatsRequest<T, V> pending : pendingRequests.v...
3.26
flink_TaskStatsRequestCoordinator_m0_rdh
/** * Collects result from one of the tasks. * * @param executionId * ID of the Task. * @param taskStatsResult * Result of the stats sample from the Task. */protected void m0(ImmutableSet<ExecutionAttemptID> executionId, T taskStatsResult) { checkDiscarded(); if (pendingTasks.remove(executionId)) { ...
3.26
flink_TaskStatsRequestCoordinator_handleFailedResponse_rdh
/** * Handles the failed stats response by canceling the corresponding unfinished pending request. * * @param requestId * ID of the request to cancel. * @param cause * Cause of the cancelling (can be <code>null</code>). */ public void handleFailedResponse(int requestId, @Nullable Throwable cause) { synch...
3.26
flink_KvStateInfo_getKeySerializer_rdh
/** * * @return The serializer for the key the state is associated to. */ public TypeSerializer<K> getKeySerializer() { return keySerializer; }
3.26
flink_KvStateInfo_duplicate_rdh
/** * Creates a deep copy of the current {@link KvStateInfo} by duplicating all the included * serializers. * * <p>This method assumes correct implementation of the {@link TypeSerializer#duplicate()} * method of the included serializers. */ public KvStateInfo<K, N, V> duplicate() { final TypeSerializer<K> d...
3.26
flink_KvStateInfo_getStateValueSerializer_rdh
/** * * @return The serializer for the values kept in the state. */ public TypeSerializer<V> getStateValueSerializer() { return stateValueSerializer; }
3.26
flink_KMeansDataGenerator_main_rdh
/** * Main method to generate data for the {@link KMeans} example program. * * <p>The generator creates to files: * * <ul> * <li><code>&lt; output-path &gt;/points</code> for the data points * <li><code>&lt; output-path &gt;/centers</code> for the cluster centers * </ul> ...
3.26
flink_MetadataV2Serializer_serializeOperatorState_rdh
// ------------------------------------------------------------------------ // version-specific serialization // ------------------------------------------------------------------------ @Override protected void serializeOperatorState(OperatorState operatorState, DataOutputStream dos) throws IOException { checkSta...
3.26