id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
123,500 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java | ConnectedStreams.keyBy | public ConnectedStreams<IN1, IN2> keyBy(int[] keyPositions1, int[] keyPositions2) {
return new ConnectedStreams<>(environment, inputStream1.keyBy(keyPositions1),
inputStream2.keyBy(keyPositions2));
} | java | public ConnectedStreams<IN1, IN2> keyBy(int[] keyPositions1, int[] keyPositions2) {
return new ConnectedStreams<>(environment, inputStream1.keyBy(keyPositions1),
inputStream2.keyBy(keyPositions2));
} | [
"public",
"ConnectedStreams",
"<",
"IN1",
",",
"IN2",
">",
"keyBy",
"(",
"int",
"[",
"]",
"keyPositions1",
",",
"int",
"[",
"]",
"keyPositions2",
")",
"{",
"return",
"new",
"ConnectedStreams",
"<>",
"(",
"environment",
",",
"inputStream1",
".",
"keyBy",
"(... | KeyBy operation for connected data stream. Assigns keys to the elements of
input1 and input2 according to keyPositions1 and keyPositions2.
@param keyPositions1
The fields used to group the first input stream.
@param keyPositions2
The fields used to group the second input stream.
@return The grouped {@link ConnectedStr... | [
"KeyBy",
"operation",
"for",
"connected",
"data",
"stream",
".",
"Assigns",
"keys",
"to",
"the",
"elements",
"of",
"input1",
"and",
"input2",
"according",
"to",
"keyPositions1",
"and",
"keyPositions2",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java#L137-L140 |
123,501 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java | ConnectedStreams.keyBy | public ConnectedStreams<IN1, IN2> keyBy(KeySelector<IN1, ?> keySelector1, KeySelector<IN2, ?> keySelector2) {
return new ConnectedStreams<>(environment, inputStream1.keyBy(keySelector1),
inputStream2.keyBy(keySelector2));
} | java | public ConnectedStreams<IN1, IN2> keyBy(KeySelector<IN1, ?> keySelector1, KeySelector<IN2, ?> keySelector2) {
return new ConnectedStreams<>(environment, inputStream1.keyBy(keySelector1),
inputStream2.keyBy(keySelector2));
} | [
"public",
"ConnectedStreams",
"<",
"IN1",
",",
"IN2",
">",
"keyBy",
"(",
"KeySelector",
"<",
"IN1",
",",
"?",
">",
"keySelector1",
",",
"KeySelector",
"<",
"IN2",
",",
"?",
">",
"keySelector2",
")",
"{",
"return",
"new",
"ConnectedStreams",
"<>",
"(",
"e... | KeyBy operation for connected data stream. Assigns keys to the elements of
input1 and input2 using keySelector1 and keySelector2.
@param keySelector1
The {@link KeySelector} used for grouping the first input
@param keySelector2
The {@link KeySelector} used for grouping the second input
@return The partitioned {@link C... | [
"KeyBy",
"operation",
"for",
"connected",
"data",
"stream",
".",
"Assigns",
"keys",
"to",
"the",
"elements",
"of",
"input1",
"and",
"input2",
"using",
"keySelector1",
"and",
"keySelector2",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java#L189-L192 |
123,502 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java | ConnectedStreams.keyBy | public <KEY> ConnectedStreams<IN1, IN2> keyBy(
KeySelector<IN1, KEY> keySelector1,
KeySelector<IN2, KEY> keySelector2,
TypeInformation<KEY> keyType) {
return new ConnectedStreams<>(
environment,
inputStream1.keyBy(keySelector1, keyType),
inputStream2.keyBy(keySelector2, keyType));
} | java | public <KEY> ConnectedStreams<IN1, IN2> keyBy(
KeySelector<IN1, KEY> keySelector1,
KeySelector<IN2, KEY> keySelector2,
TypeInformation<KEY> keyType) {
return new ConnectedStreams<>(
environment,
inputStream1.keyBy(keySelector1, keyType),
inputStream2.keyBy(keySelector2, keyType));
} | [
"public",
"<",
"KEY",
">",
"ConnectedStreams",
"<",
"IN1",
",",
"IN2",
">",
"keyBy",
"(",
"KeySelector",
"<",
"IN1",
",",
"KEY",
">",
"keySelector1",
",",
"KeySelector",
"<",
"IN2",
",",
"KEY",
">",
"keySelector2",
",",
"TypeInformation",
"<",
"KEY",
">"... | KeyBy operation for connected data stream. Assigns keys to the elements of
input1 and input2 using keySelector1 and keySelector2 with explicit type information
for the common key type.
@param keySelector1
The {@link KeySelector} used for grouping the first input
@param keySelector2
The {@link KeySelector} used for gro... | [
"KeyBy",
"operation",
"for",
"connected",
"data",
"stream",
".",
"Assigns",
"keys",
"to",
"the",
"elements",
"of",
"input1",
"and",
"input2",
"using",
"keySelector1",
"and",
"keySelector2",
"with",
"explicit",
"type",
"information",
"for",
"the",
"common",
"key"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/ConnectedStreams.java#L206-L214 |
123,503 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelWriterOutputView.java | ChannelWriterOutputView.close | public List<MemorySegment> close() throws IOException
{
// send off set last segment
writeSegment(getCurrentSegment(), getCurrentPositionInSegment(), true);
clear();
// close the writer and gather all segments
final LinkedBlockingQueue<MemorySegment> queue = this.writer.getReturnQueue();
this.writer.clo... | java | public List<MemorySegment> close() throws IOException
{
// send off set last segment
writeSegment(getCurrentSegment(), getCurrentPositionInSegment(), true);
clear();
// close the writer and gather all segments
final LinkedBlockingQueue<MemorySegment> queue = this.writer.getReturnQueue();
this.writer.clo... | [
"public",
"List",
"<",
"MemorySegment",
">",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// send off set last segment",
"writeSegment",
"(",
"getCurrentSegment",
"(",
")",
",",
"getCurrentPositionInSegment",
"(",
")",
",",
"true",
")",
";",
"clear",
"(",
"... | Closes this OutputView, closing the underlying writer and returning all memory segments.
@return A list containing all memory segments originally supplied to this view.
@throws IOException Thrown, if the underlying writer could not be properly closed. | [
"Closes",
"this",
"OutputView",
"closing",
"the",
"underlying",
"writer",
"and",
"returning",
"all",
"memory",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelWriterOutputView.java#L139-L161 |
123,504 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java | MapStateDescriptor.getKeySerializer | public TypeSerializer<UK> getKeySerializer() {
final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer();
if (!(rawSerializer instanceof MapSerializer)) {
throw new IllegalStateException("Unexpected serializer type.");
}
return ((MapSerializer<UK, UV>) rawSerializer).getKeySerializer();
} | java | public TypeSerializer<UK> getKeySerializer() {
final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer();
if (!(rawSerializer instanceof MapSerializer)) {
throw new IllegalStateException("Unexpected serializer type.");
}
return ((MapSerializer<UK, UV>) rawSerializer).getKeySerializer();
} | [
"public",
"TypeSerializer",
"<",
"UK",
">",
"getKeySerializer",
"(",
")",
"{",
"final",
"TypeSerializer",
"<",
"Map",
"<",
"UK",
",",
"UV",
">",
">",
"rawSerializer",
"=",
"getSerializer",
"(",
")",
";",
"if",
"(",
"!",
"(",
"rawSerializer",
"instanceof",
... | Gets the serializer for the keys in the state.
@return The serializer for the keys in the state. | [
"Gets",
"the",
"serializer",
"for",
"the",
"keys",
"in",
"the",
"state",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java#L99-L106 |
123,505 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java | WindowOperator.isElementLate | protected boolean isElementLate(StreamRecord<IN> element){
return (windowAssigner.isEventTime()) &&
(element.getTimestamp() + allowedLateness <= internalTimerService.currentWatermark());
} | java | protected boolean isElementLate(StreamRecord<IN> element){
return (windowAssigner.isEventTime()) &&
(element.getTimestamp() + allowedLateness <= internalTimerService.currentWatermark());
} | [
"protected",
"boolean",
"isElementLate",
"(",
"StreamRecord",
"<",
"IN",
">",
"element",
")",
"{",
"return",
"(",
"windowAssigner",
".",
"isEventTime",
"(",
")",
")",
"&&",
"(",
"element",
".",
"getTimestamp",
"(",
")",
"+",
"allowedLateness",
"<=",
"interna... | Decide if a record is currently late, based on current watermark and allowed lateness.
@param element The element to check
@return The element for which should be considered when sideoutputs | [
"Decide",
"if",
"a",
"record",
"is",
"currently",
"late",
"based",
"on",
"current",
"watermark",
"and",
"allowed",
"lateness",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L585-L588 |
123,506 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java | WindowOperator.deleteCleanupTimer | protected void deleteCleanupTimer(W window) {
long cleanupTime = cleanupTime(window);
if (cleanupTime == Long.MAX_VALUE) {
// no need to clean up because we didn't set one
return;
}
if (windowAssigner.isEventTime()) {
triggerContext.deleteEventTimeTimer(cleanupTime);
} else {
triggerContext.delete... | java | protected void deleteCleanupTimer(W window) {
long cleanupTime = cleanupTime(window);
if (cleanupTime == Long.MAX_VALUE) {
// no need to clean up because we didn't set one
return;
}
if (windowAssigner.isEventTime()) {
triggerContext.deleteEventTimeTimer(cleanupTime);
} else {
triggerContext.delete... | [
"protected",
"void",
"deleteCleanupTimer",
"(",
"W",
"window",
")",
"{",
"long",
"cleanupTime",
"=",
"cleanupTime",
"(",
"window",
")",
";",
"if",
"(",
"cleanupTime",
"==",
"Long",
".",
"MAX_VALUE",
")",
"{",
"// no need to clean up because we didn't set one",
"re... | Deletes the cleanup timer set for the contents of the provided window.
@param window
the window whose state to discard | [
"Deletes",
"the",
"cleanup",
"timer",
"set",
"for",
"the",
"contents",
"of",
"the",
"provided",
"window",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L614-L625 |
123,507 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Rowtime.java | Rowtime.watermarksPeriodicBounded | public Rowtime watermarksPeriodicBounded(long delay) {
internalProperties.putString(ROWTIME_WATERMARKS_TYPE, ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED);
internalProperties.putLong(ROWTIME_WATERMARKS_DELAY, delay);
return this;
} | java | public Rowtime watermarksPeriodicBounded(long delay) {
internalProperties.putString(ROWTIME_WATERMARKS_TYPE, ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED);
internalProperties.putLong(ROWTIME_WATERMARKS_DELAY, delay);
return this;
} | [
"public",
"Rowtime",
"watermarksPeriodicBounded",
"(",
"long",
"delay",
")",
"{",
"internalProperties",
".",
"putString",
"(",
"ROWTIME_WATERMARKS_TYPE",
",",
"ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED",
")",
";",
"internalProperties",
".",
"putLong",
"(",
"ROWTIME_WAT... | Sets a built-in watermark strategy for rowtime attributes which are out-of-order by a bounded
time interval.
<p>Emits watermarks which are the maximum observed timestamp minus the specified delay.
@param delay delay in milliseconds | [
"Sets",
"a",
"built",
"-",
"in",
"watermark",
"strategy",
"for",
"rowtime",
"attributes",
"which",
"are",
"out",
"-",
"of",
"-",
"order",
"by",
"a",
"bounded",
"time",
"interval",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Rowtime.java#L110-L114 |
123,508 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/accumulators/AccumulatorSnapshot.java | AccumulatorSnapshot.deserializeUserAccumulators | public Map<String, Accumulator<?, ?>> deserializeUserAccumulators(ClassLoader classLoader) throws IOException, ClassNotFoundException {
return userAccumulators.deserializeValue(classLoader);
} | java | public Map<String, Accumulator<?, ?>> deserializeUserAccumulators(ClassLoader classLoader) throws IOException, ClassNotFoundException {
return userAccumulators.deserializeValue(classLoader);
} | [
"public",
"Map",
"<",
"String",
",",
"Accumulator",
"<",
"?",
",",
"?",
">",
">",
"deserializeUserAccumulators",
"(",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"userAccumulators",
".",
"deserializeValue... | Gets the user-defined accumulators values.
@return the serialized map | [
"Gets",
"the",
"user",
"-",
"defined",
"accumulators",
"values",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/accumulators/AccumulatorSnapshot.java#L66-L68 |
123,509 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java | WindowsGrouping.reset | public void reset() {
nextWindow = null;
watermark = Long.MIN_VALUE;
triggerWindowStartIndex = 0;
emptyWindowTriggered = true;
resetBuffer();
} | java | public void reset() {
nextWindow = null;
watermark = Long.MIN_VALUE;
triggerWindowStartIndex = 0;
emptyWindowTriggered = true;
resetBuffer();
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"nextWindow",
"=",
"null",
";",
"watermark",
"=",
"Long",
".",
"MIN_VALUE",
";",
"triggerWindowStartIndex",
"=",
"0",
";",
"emptyWindowTriggered",
"=",
"true",
";",
"resetBuffer",
"(",
")",
";",
"}"
] | Reset for next group. | [
"Reset",
"for",
"next",
"group",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java#L95-L101 |
123,510 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java | WindowsGrouping.hasTriggerWindow | public boolean hasTriggerWindow() {
skipEmptyWindow();
Preconditions.checkState(watermark == Long.MIN_VALUE || nextWindow != null,
"next trigger window cannot be null.");
return nextWindow != null && nextWindow.getEnd() <= watermark;
} | java | public boolean hasTriggerWindow() {
skipEmptyWindow();
Preconditions.checkState(watermark == Long.MIN_VALUE || nextWindow != null,
"next trigger window cannot be null.");
return nextWindow != null && nextWindow.getEnd() <= watermark;
} | [
"public",
"boolean",
"hasTriggerWindow",
"(",
")",
"{",
"skipEmptyWindow",
"(",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"watermark",
"==",
"Long",
".",
"MIN_VALUE",
"||",
"nextWindow",
"!=",
"null",
",",
"\"next trigger window cannot be null.\"",
")",
"... | Check if there are windows could be triggered according to the current watermark.
@return true when there are windows to be triggered.
It is designed to be idempotent. | [
"Check",
"if",
"there",
"are",
"windows",
"could",
"be",
"triggered",
"according",
"to",
"the",
"current",
"watermark",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java#L125-L130 |
123,511 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java | CreditBasedPartitionRequestClientHandler.userEventTriggered | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof RemoteInputChannel) {
boolean triggerWrite = inputChannelsWithCredit.isEmpty();
inputChannelsWithCredit.add((RemoteInputChannel) msg);
if (triggerWrite) {
writeAndFlushNextMessageIfPos... | java | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof RemoteInputChannel) {
boolean triggerWrite = inputChannelsWithCredit.isEmpty();
inputChannelsWithCredit.add((RemoteInputChannel) msg);
if (triggerWrite) {
writeAndFlushNextMessageIfPos... | [
"@",
"Override",
"public",
"void",
"userEventTriggered",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
")",
"throws",
"Exception",
"{",
"if",
"(",
"msg",
"instanceof",
"RemoteInputChannel",
")",
"{",
"boolean",
"triggerWrite",
"=",
"inputChannelsWithCre... | Triggered by notifying credit available in the client handler pipeline.
<p>Enqueues the input channel and will trigger write&flush unannounced credits
for this input channel if it is the first one in the queue. | [
"Triggered",
"by",
"notifying",
"credit",
"available",
"in",
"the",
"client",
"handler",
"pipeline",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java#L187-L200 |
123,512 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java | CreditBasedPartitionRequestClientHandler.writeAndFlushNextMessageIfPossible | private void writeAndFlushNextMessageIfPossible(Channel channel) {
if (channelError.get() != null || !channel.isWritable()) {
return;
}
while (true) {
RemoteInputChannel inputChannel = inputChannelsWithCredit.poll();
// The input channel may be null because of the write callbacks
// that are execute... | java | private void writeAndFlushNextMessageIfPossible(Channel channel) {
if (channelError.get() != null || !channel.isWritable()) {
return;
}
while (true) {
RemoteInputChannel inputChannel = inputChannelsWithCredit.poll();
// The input channel may be null because of the write callbacks
// that are execute... | [
"private",
"void",
"writeAndFlushNextMessageIfPossible",
"(",
"Channel",
"channel",
")",
"{",
"if",
"(",
"channelError",
".",
"get",
"(",
")",
"!=",
"null",
"||",
"!",
"channel",
".",
"isWritable",
"(",
")",
")",
"{",
"return",
";",
"}",
"while",
"(",
"t... | Tries to write&flush unannounced credits for the next input channel in queue.
<p>This method may be called by the first input channel enqueuing, or the complete
future's callback in previous input channel, or the channel writability changed event. | [
"Tries",
"to",
"write&flush",
"unannounced",
"credits",
"for",
"the",
"next",
"input",
"channel",
"in",
"queue",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java#L338-L366 |
123,513 | apache/flink | flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java | Kafka08PartitionDiscoverer.getPartitionLeadersForTopics | public List<KafkaTopicPartitionLeader> getPartitionLeadersForTopics(List<String> topics) {
List<KafkaTopicPartitionLeader> partitions = new LinkedList<>();
retryLoop: for (int retry = 0; retry < numRetries; retry++) {
brokersLoop: for (int arrIdx = 0; arrIdx < seedBrokerAddresses.length; arrIdx++) {
LOG.inf... | java | public List<KafkaTopicPartitionLeader> getPartitionLeadersForTopics(List<String> topics) {
List<KafkaTopicPartitionLeader> partitions = new LinkedList<>();
retryLoop: for (int retry = 0; retry < numRetries; retry++) {
brokersLoop: for (int arrIdx = 0; arrIdx < seedBrokerAddresses.length; arrIdx++) {
LOG.inf... | [
"public",
"List",
"<",
"KafkaTopicPartitionLeader",
">",
"getPartitionLeadersForTopics",
"(",
"List",
"<",
"String",
">",
"topics",
")",
"{",
"List",
"<",
"KafkaTopicPartitionLeader",
">",
"partitions",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"retryLoop",
... | Send request to Kafka to get partitions for topics.
@param topics The name of the topics. | [
"Send",
"request",
"to",
"Kafka",
"to",
"get",
"partitions",
"for",
"topics",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java#L184-L241 |
123,514 | apache/flink | flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java | Kafka08PartitionDiscoverer.useNextAddressAsNewContactSeedBroker | private void useNextAddressAsNewContactSeedBroker() {
if (++currentContactSeedBrokerIndex == seedBrokerAddresses.length) {
currentContactSeedBrokerIndex = 0;
}
URL newContactUrl = NetUtils.getCorrectHostnamePort(seedBrokerAddresses[currentContactSeedBrokerIndex]);
this.consumer = new SimpleConsumer(newConta... | java | private void useNextAddressAsNewContactSeedBroker() {
if (++currentContactSeedBrokerIndex == seedBrokerAddresses.length) {
currentContactSeedBrokerIndex = 0;
}
URL newContactUrl = NetUtils.getCorrectHostnamePort(seedBrokerAddresses[currentContactSeedBrokerIndex]);
this.consumer = new SimpleConsumer(newConta... | [
"private",
"void",
"useNextAddressAsNewContactSeedBroker",
"(",
")",
"{",
"if",
"(",
"++",
"currentContactSeedBrokerIndex",
"==",
"seedBrokerAddresses",
".",
"length",
")",
"{",
"currentContactSeedBrokerIndex",
"=",
"0",
";",
"}",
"URL",
"newContactUrl",
"=",
"NetUtil... | Re-establish broker connection using the next available seed broker address. | [
"Re",
"-",
"establish",
"broker",
"connection",
"using",
"the",
"next",
"available",
"seed",
"broker",
"address",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java#L246-L253 |
123,515 | apache/flink | flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java | Kafka08PartitionDiscoverer.brokerToNode | private static Node brokerToNode(Broker broker) {
return new Node(broker.id(), broker.host(), broker.port());
} | java | private static Node brokerToNode(Broker broker) {
return new Node(broker.id(), broker.host(), broker.port());
} | [
"private",
"static",
"Node",
"brokerToNode",
"(",
"Broker",
"broker",
")",
"{",
"return",
"new",
"Node",
"(",
"broker",
".",
"id",
"(",
")",
",",
"broker",
".",
"host",
"(",
")",
",",
"broker",
".",
"port",
"(",
")",
")",
";",
"}"
] | Turn a broker instance into a node instance.
@param broker broker instance
@return Node representing the given broker | [
"Turn",
"a",
"broker",
"instance",
"into",
"a",
"node",
"instance",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java#L261-L263 |
123,516 | apache/flink | flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java | Kafka08PartitionDiscoverer.validateSeedBrokers | private static void validateSeedBrokers(String[] seedBrokers, Exception exception) {
if (!(exception instanceof ClosedChannelException)) {
return;
}
int unknownHosts = 0;
for (String broker : seedBrokers) {
URL brokerUrl = NetUtils.getCorrectHostnamePort(broker.trim());
try {
InetAddress.getByName(... | java | private static void validateSeedBrokers(String[] seedBrokers, Exception exception) {
if (!(exception instanceof ClosedChannelException)) {
return;
}
int unknownHosts = 0;
for (String broker : seedBrokers) {
URL brokerUrl = NetUtils.getCorrectHostnamePort(broker.trim());
try {
InetAddress.getByName(... | [
"private",
"static",
"void",
"validateSeedBrokers",
"(",
"String",
"[",
"]",
"seedBrokers",
",",
"Exception",
"exception",
")",
"{",
"if",
"(",
"!",
"(",
"exception",
"instanceof",
"ClosedChannelException",
")",
")",
"{",
"return",
";",
"}",
"int",
"unknownHos... | Validate that at least one seed broker is valid in case of a
ClosedChannelException.
@param seedBrokers
array containing the seed brokers e.g. ["host1:port1",
"host2:port2"]
@param exception
instance | [
"Validate",
"that",
"at",
"least",
"one",
"seed",
"broker",
"is",
"valid",
"in",
"case",
"of",
"a",
"ClosedChannelException",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java#L275-L293 |
123,517 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java | SortUtil.maxNormalizedKey | public static void maxNormalizedKey(MemorySegment target, int offset, int numBytes) {
//write max value.
for (int i = 0; i < numBytes; i++) {
target.put(offset + i, (byte) -1);
}
} | java | public static void maxNormalizedKey(MemorySegment target, int offset, int numBytes) {
//write max value.
for (int i = 0; i < numBytes; i++) {
target.put(offset + i, (byte) -1);
}
} | [
"public",
"static",
"void",
"maxNormalizedKey",
"(",
"MemorySegment",
"target",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"//write max value.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numBytes",
";",
"i",
"++",
")",
"{",
"target",... | Max unsigned byte is -1. | [
"Max",
"unsigned",
"byte",
"is",
"-",
"1",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java#L49-L54 |
123,518 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java | SortUtil.putDecimalNormalizedKey | public static void putDecimalNormalizedKey(
Decimal record, MemorySegment target, int offset, int len) {
assert record.getPrecision() <= Decimal.MAX_COMPACT_PRECISION;
putLongNormalizedKey(record.toUnscaledLong(), target, offset, len);
} | java | public static void putDecimalNormalizedKey(
Decimal record, MemorySegment target, int offset, int len) {
assert record.getPrecision() <= Decimal.MAX_COMPACT_PRECISION;
putLongNormalizedKey(record.toUnscaledLong(), target, offset, len);
} | [
"public",
"static",
"void",
"putDecimalNormalizedKey",
"(",
"Decimal",
"record",
",",
"MemorySegment",
"target",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"assert",
"record",
".",
"getPrecision",
"(",
")",
"<=",
"Decimal",
".",
"MAX_COMPACT_PRECISION",
... | Just support the compact precision decimal. | [
"Just",
"support",
"the",
"compact",
"precision",
"decimal",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java#L90-L94 |
123,519 | apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java | HadoopUtils.mergeHadoopConf | public static void mergeHadoopConf(Configuration hadoopConfig) {
// we have to load the global configuration here, because the HadoopInputFormatBase does not
// have access to a Flink configuration object
org.apache.flink.configuration.Configuration flinkConfiguration = GlobalConfiguration.loadConfiguration();
... | java | public static void mergeHadoopConf(Configuration hadoopConfig) {
// we have to load the global configuration here, because the HadoopInputFormatBase does not
// have access to a Flink configuration object
org.apache.flink.configuration.Configuration flinkConfiguration = GlobalConfiguration.loadConfiguration();
... | [
"public",
"static",
"void",
"mergeHadoopConf",
"(",
"Configuration",
"hadoopConfig",
")",
"{",
"// we have to load the global configuration here, because the HadoopInputFormatBase does not",
"// have access to a Flink configuration object",
"org",
".",
"apache",
".",
"flink",
".",
... | Merge HadoopConfiguration into Configuration. This is necessary for the HDFS configuration. | [
"Merge",
"HadoopConfiguration",
"into",
"Configuration",
".",
"This",
"is",
"necessary",
"for",
"the",
"HDFS",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java#L37-L51 |
123,520 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/plan/stats/TableStats.java | TableStats.copy | public TableStats copy() {
TableStats copy = new TableStats(this.rowCount);
for (Map.Entry<String, ColumnStats> entry : this.colStats.entrySet()) {
copy.colStats.put(entry.getKey(), entry.getValue().copy());
}
return copy;
} | java | public TableStats copy() {
TableStats copy = new TableStats(this.rowCount);
for (Map.Entry<String, ColumnStats> entry : this.colStats.entrySet()) {
copy.colStats.put(entry.getKey(), entry.getValue().copy());
}
return copy;
} | [
"public",
"TableStats",
"copy",
"(",
")",
"{",
"TableStats",
"copy",
"=",
"new",
"TableStats",
"(",
"this",
".",
"rowCount",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ColumnStats",
">",
"entry",
":",
"this",
".",
"colStats",
".",
... | Create a deep copy of "this" instance.
@return a deep copy | [
"Create",
"a",
"deep",
"copy",
"of",
"this",
"instance",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/plan/stats/TableStats.java#L63-L69 |
123,521 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.getRegisteredSubclassesFromExecutionConfig | private static LinkedHashSet<Class<?>> getRegisteredSubclassesFromExecutionConfig(
Class<?> basePojoClass,
ExecutionConfig executionConfig) {
LinkedHashSet<Class<?>> subclassesInRegistrationOrder = new LinkedHashSet<>(executionConfig.getRegisteredPojoTypes().size());
for (Class<?> registeredClass : execution... | java | private static LinkedHashSet<Class<?>> getRegisteredSubclassesFromExecutionConfig(
Class<?> basePojoClass,
ExecutionConfig executionConfig) {
LinkedHashSet<Class<?>> subclassesInRegistrationOrder = new LinkedHashSet<>(executionConfig.getRegisteredPojoTypes().size());
for (Class<?> registeredClass : execution... | [
"private",
"static",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"getRegisteredSubclassesFromExecutionConfig",
"(",
"Class",
"<",
"?",
">",
"basePojoClass",
",",
"ExecutionConfig",
"executionConfig",
")",
"{",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
... | Extracts the subclasses of the base POJO class registered in the execution config. | [
"Extracts",
"the",
"subclasses",
"of",
"the",
"base",
"POJO",
"class",
"registered",
"in",
"the",
"execution",
"config",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1001-L1017 |
123,522 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.createRegisteredSubclassTags | private static LinkedHashMap<Class<?>, Integer> createRegisteredSubclassTags(LinkedHashSet<Class<?>> registeredSubclasses) {
final LinkedHashMap<Class<?>, Integer> classToTag = new LinkedHashMap<>();
int id = 0;
for (Class<?> registeredClass : registeredSubclasses) {
classToTag.put(registeredClass, id);
id... | java | private static LinkedHashMap<Class<?>, Integer> createRegisteredSubclassTags(LinkedHashSet<Class<?>> registeredSubclasses) {
final LinkedHashMap<Class<?>, Integer> classToTag = new LinkedHashMap<>();
int id = 0;
for (Class<?> registeredClass : registeredSubclasses) {
classToTag.put(registeredClass, id);
id... | [
"private",
"static",
"LinkedHashMap",
"<",
"Class",
"<",
"?",
">",
",",
"Integer",
">",
"createRegisteredSubclassTags",
"(",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"registeredSubclasses",
")",
"{",
"final",
"LinkedHashMap",
"<",
"Class",
"<",
"?",
... | Builds map of registered subclasses to their class tags.
Class tags will be integers starting from 0, assigned incrementally with the order of provided subclasses. | [
"Builds",
"map",
"of",
"registered",
"subclasses",
"to",
"their",
"class",
"tags",
".",
"Class",
"tags",
"will",
"be",
"integers",
"starting",
"from",
"0",
"assigned",
"incrementally",
"with",
"the",
"order",
"of",
"provided",
"subclasses",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1023-L1033 |
123,523 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.createRegisteredSubclassSerializers | private static TypeSerializer<?>[] createRegisteredSubclassSerializers(
LinkedHashSet<Class<?>> registeredSubclasses,
ExecutionConfig executionConfig) {
final TypeSerializer<?>[] subclassSerializers = new TypeSerializer[registeredSubclasses.size()];
int i = 0;
for (Class<?> registeredClass : registeredSub... | java | private static TypeSerializer<?>[] createRegisteredSubclassSerializers(
LinkedHashSet<Class<?>> registeredSubclasses,
ExecutionConfig executionConfig) {
final TypeSerializer<?>[] subclassSerializers = new TypeSerializer[registeredSubclasses.size()];
int i = 0;
for (Class<?> registeredClass : registeredSub... | [
"private",
"static",
"TypeSerializer",
"<",
"?",
">",
"[",
"]",
"createRegisteredSubclassSerializers",
"(",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"registeredSubclasses",
",",
"ExecutionConfig",
"executionConfig",
")",
"{",
"final",
"TypeSerializer",
"<"... | Creates an array of serializers for provided list of registered subclasses.
Order of returned serializers will correspond to order of provided subclasses. | [
"Creates",
"an",
"array",
"of",
"serializers",
"for",
"provided",
"list",
"of",
"registered",
"subclasses",
".",
"Order",
"of",
"returned",
"serializers",
"will",
"correspond",
"to",
"order",
"of",
"provided",
"subclasses",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1039-L1052 |
123,524 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.getSubclassSerializer | TypeSerializer<?> getSubclassSerializer(Class<?> subclass) {
TypeSerializer<?> result = subclassSerializerCache.get(subclass);
if (result == null) {
result = createSubclassSerializer(subclass);
subclassSerializerCache.put(subclass, result);
}
return result;
} | java | TypeSerializer<?> getSubclassSerializer(Class<?> subclass) {
TypeSerializer<?> result = subclassSerializerCache.get(subclass);
if (result == null) {
result = createSubclassSerializer(subclass);
subclassSerializerCache.put(subclass, result);
}
return result;
} | [
"TypeSerializer",
"<",
"?",
">",
"getSubclassSerializer",
"(",
"Class",
"<",
"?",
">",
"subclass",
")",
"{",
"TypeSerializer",
"<",
"?",
">",
"result",
"=",
"subclassSerializerCache",
".",
"get",
"(",
"subclass",
")",
";",
"if",
"(",
"result",
"==",
"null"... | Fetches cached serializer for a non-registered subclass;
also creates the serializer if it doesn't exist yet.
This method is also exposed to package-private access
for testing purposes. | [
"Fetches",
"cached",
"serializer",
"for",
"a",
"non",
"-",
"registered",
"subclass",
";",
"also",
"creates",
"the",
"serializer",
"if",
"it",
"doesn",
"t",
"exist",
"yet",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1061-L1068 |
123,525 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.buildSnapshot | private static <T> PojoSerializerSnapshot<T> buildSnapshot(
Class<T> pojoType,
LinkedHashMap<Class<?>, Integer> registeredSubclassesToTags,
TypeSerializer<?>[] registeredSubclassSerializers,
Field[] fields,
TypeSerializer<?>[] fieldSerializers,
Map<Class<?>, TypeSerializer<?>> nonRegisteredSubclassSer... | java | private static <T> PojoSerializerSnapshot<T> buildSnapshot(
Class<T> pojoType,
LinkedHashMap<Class<?>, Integer> registeredSubclassesToTags,
TypeSerializer<?>[] registeredSubclassSerializers,
Field[] fields,
TypeSerializer<?>[] fieldSerializers,
Map<Class<?>, TypeSerializer<?>> nonRegisteredSubclassSer... | [
"private",
"static",
"<",
"T",
">",
"PojoSerializerSnapshot",
"<",
"T",
">",
"buildSnapshot",
"(",
"Class",
"<",
"T",
">",
"pojoType",
",",
"LinkedHashMap",
"<",
"Class",
"<",
"?",
">",
",",
"Integer",
">",
"registeredSubclassesToTags",
",",
"TypeSerializer",
... | Build and return a snapshot of the serializer's parameters and currently cached serializers. | [
"Build",
"and",
"return",
"a",
"snapshot",
"of",
"the",
"serializer",
"s",
"parameters",
"and",
"currently",
"cached",
"serializers",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1107-L1127 |
123,526 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java | CompileUtils.compile | public static <T> Class<T> compile(ClassLoader cl, String name, String code) {
Tuple2<ClassLoader, String> cacheKey = Tuple2.of(cl, name);
Class<?> clazz = COMPILED_CACHE.getIfPresent(cacheKey);
if (clazz == null) {
clazz = doCompile(cl, name, code);
COMPILED_CACHE.put(cacheKey, clazz);
}
//noinspection... | java | public static <T> Class<T> compile(ClassLoader cl, String name, String code) {
Tuple2<ClassLoader, String> cacheKey = Tuple2.of(cl, name);
Class<?> clazz = COMPILED_CACHE.getIfPresent(cacheKey);
if (clazz == null) {
clazz = doCompile(cl, name, code);
COMPILED_CACHE.put(cacheKey, clazz);
}
//noinspection... | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"compile",
"(",
"ClassLoader",
"cl",
",",
"String",
"name",
",",
"String",
"code",
")",
"{",
"Tuple2",
"<",
"ClassLoader",
",",
"String",
">",
"cacheKey",
"=",
"Tuple2",
".",
"of",
"(",
"cl",... | Compiles a generated code to a Class.
@param cl the ClassLoader used to load the class
@param name the class name
@param code the generated code
@param <T> the class type
@return the compiled class | [
"Compiles",
"a",
"generated",
"code",
"to",
"a",
"Class",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java#L61-L70 |
123,527 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java | CompileUtils.addLineNumber | private static String addLineNumber(String code) {
String[] lines = code.split("\n");
StringBuilder builder = new StringBuilder();
for (int i = 0; i < lines.length; i++) {
builder.append("/* ").append(i + 1).append(" */").append(lines[i]).append("\n");
}
return builder.toString();
} | java | private static String addLineNumber(String code) {
String[] lines = code.split("\n");
StringBuilder builder = new StringBuilder();
for (int i = 0; i < lines.length; i++) {
builder.append("/* ").append(i + 1).append(" */").append(lines[i]).append("\n");
}
return builder.toString();
} | [
"private",
"static",
"String",
"addLineNumber",
"(",
"String",
"code",
")",
"{",
"String",
"[",
"]",
"lines",
"=",
"code",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
... | To output more information when an error occurs.
Generally, when cook fails, it shows which line is wrong. This line number starts at 1. | [
"To",
"output",
"more",
"information",
"when",
"an",
"error",
"occurs",
".",
"Generally",
"when",
"cook",
"fails",
"it",
"shows",
"which",
"line",
"is",
"wrong",
".",
"This",
"line",
"number",
"starts",
"at",
"1",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java#L96-L103 |
123,528 | apache/flink | flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java | AbstractCloseableRegistry.addCloseableInternal | protected final void addCloseableInternal(Closeable closeable, T metaData) {
synchronized (getSynchronizationLock()) {
closeableToRef.put(closeable, metaData);
}
} | java | protected final void addCloseableInternal(Closeable closeable, T metaData) {
synchronized (getSynchronizationLock()) {
closeableToRef.put(closeable, metaData);
}
} | [
"protected",
"final",
"void",
"addCloseableInternal",
"(",
"Closeable",
"closeable",
",",
"T",
"metaData",
")",
"{",
"synchronized",
"(",
"getSynchronizationLock",
"(",
")",
")",
"{",
"closeableToRef",
".",
"put",
"(",
"closeable",
",",
"metaData",
")",
";",
"... | Adds a mapping to the registry map, respecting locking. | [
"Adds",
"a",
"mapping",
"to",
"the",
"registry",
"map",
"respecting",
"locking",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java#L153-L157 |
123,529 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/SortMergeFullOuterJoinIterator.java | SortMergeFullOuterJoinIterator.bufferRows1 | private void bufferRows1() throws IOException {
BinaryRow copy = key1.copy();
buffer1.reset();
do {
buffer1.add(row1);
} while (nextRow1() && keyComparator.compare(key1, copy) == 0);
buffer1.complete();
} | java | private void bufferRows1() throws IOException {
BinaryRow copy = key1.copy();
buffer1.reset();
do {
buffer1.add(row1);
} while (nextRow1() && keyComparator.compare(key1, copy) == 0);
buffer1.complete();
} | [
"private",
"void",
"bufferRows1",
"(",
")",
"throws",
"IOException",
"{",
"BinaryRow",
"copy",
"=",
"key1",
".",
"copy",
"(",
")",
";",
"buffer1",
".",
"reset",
"(",
")",
";",
"do",
"{",
"buffer1",
".",
"add",
"(",
"row1",
")",
";",
"}",
"while",
"... | Buffer rows from iterator1 with same key. | [
"Buffer",
"rows",
"from",
"iterator1",
"with",
"same",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/SortMergeFullOuterJoinIterator.java#L127-L134 |
123,530 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/SortMergeFullOuterJoinIterator.java | SortMergeFullOuterJoinIterator.bufferRows2 | private void bufferRows2() throws IOException {
BinaryRow copy = key2.copy();
buffer2.reset();
do {
buffer2.add(row2);
} while (nextRow2() && keyComparator.compare(key2, copy) == 0);
buffer2.complete();
} | java | private void bufferRows2() throws IOException {
BinaryRow copy = key2.copy();
buffer2.reset();
do {
buffer2.add(row2);
} while (nextRow2() && keyComparator.compare(key2, copy) == 0);
buffer2.complete();
} | [
"private",
"void",
"bufferRows2",
"(",
")",
"throws",
"IOException",
"{",
"BinaryRow",
"copy",
"=",
"key2",
".",
"copy",
"(",
")",
";",
"buffer2",
".",
"reset",
"(",
")",
";",
"do",
"{",
"buffer2",
".",
"add",
"(",
"row2",
")",
";",
"}",
"while",
"... | Buffer rows from iterator2 with same key. | [
"Buffer",
"rows",
"from",
"iterator2",
"with",
"same",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/SortMergeFullOuterJoinIterator.java#L139-L146 |
123,531 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSchemaCompatibility.java | TypeSerializerSchemaCompatibility.compatibleWithReconfiguredSerializer | public static <T> TypeSerializerSchemaCompatibility<T> compatibleWithReconfiguredSerializer(TypeSerializer<T> reconfiguredSerializer) {
return new TypeSerializerSchemaCompatibility<>(
Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER,
Preconditions.checkNotNull(reconfiguredSerializer));
} | java | public static <T> TypeSerializerSchemaCompatibility<T> compatibleWithReconfiguredSerializer(TypeSerializer<T> reconfiguredSerializer) {
return new TypeSerializerSchemaCompatibility<>(
Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER,
Preconditions.checkNotNull(reconfiguredSerializer));
} | [
"public",
"static",
"<",
"T",
">",
"TypeSerializerSchemaCompatibility",
"<",
"T",
">",
"compatibleWithReconfiguredSerializer",
"(",
"TypeSerializer",
"<",
"T",
">",
"reconfiguredSerializer",
")",
"{",
"return",
"new",
"TypeSerializerSchemaCompatibility",
"<>",
"(",
"Typ... | Returns a result that indicates a reconfigured version of the new serializer is compatible, and should be
used instead of the original new serializer.
@param reconfiguredSerializer the reconfigured version of the new serializer.
@return a result that indicates a reconfigured version of the new serializer is compatible... | [
"Returns",
"a",
"result",
"that",
"indicates",
"a",
"reconfigured",
"version",
"of",
"the",
"new",
"serializer",
"is",
"compatible",
"and",
"should",
"be",
"used",
"instead",
"of",
"the",
"original",
"new",
"serializer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSchemaCompatibility.java#L108-L112 |
123,532 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointProperties.java | CheckpointProperties.forCheckpoint | public static CheckpointProperties forCheckpoint(CheckpointRetentionPolicy policy) {
switch (policy) {
case NEVER_RETAIN_AFTER_TERMINATION:
return CHECKPOINT_NEVER_RETAINED;
case RETAIN_ON_FAILURE:
return CHECKPOINT_RETAINED_ON_FAILURE;
case RETAIN_ON_CANCELLATION:
return CHECKPOINT_RETAINED_ON_C... | java | public static CheckpointProperties forCheckpoint(CheckpointRetentionPolicy policy) {
switch (policy) {
case NEVER_RETAIN_AFTER_TERMINATION:
return CHECKPOINT_NEVER_RETAINED;
case RETAIN_ON_FAILURE:
return CHECKPOINT_RETAINED_ON_FAILURE;
case RETAIN_ON_CANCELLATION:
return CHECKPOINT_RETAINED_ON_C... | [
"public",
"static",
"CheckpointProperties",
"forCheckpoint",
"(",
"CheckpointRetentionPolicy",
"policy",
")",
"{",
"switch",
"(",
"policy",
")",
"{",
"case",
"NEVER_RETAIN_AFTER_TERMINATION",
":",
"return",
"CHECKPOINT_NEVER_RETAINED",
";",
"case",
"RETAIN_ON_FAILURE",
":... | Creates the checkpoint properties for a checkpoint.
<p>Checkpoints may be queued in case too many other checkpoints are currently happening.
They are garbage collected automatically, except when the owning job
terminates in state {@link JobStatus#FAILED}. The user is required to
configure the clean up behaviour on job... | [
"Creates",
"the",
"checkpoint",
"properties",
"for",
"a",
"checkpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointProperties.java#L314-L325 |
123,533 | apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/LongParameter.java | LongParameter.setMinimumValue | public LongParameter setMinimumValue(long minimumValue) {
if (hasMaximumValue) {
Util.checkParameter(minimumValue <= maximumValue,
"Minimum value (" + minimumValue + ") must be less than or equal to maximum (" + maximumValue + ")");
}
this.hasMinimumValue = true;
this.minimumValue = minimumValue;
ret... | java | public LongParameter setMinimumValue(long minimumValue) {
if (hasMaximumValue) {
Util.checkParameter(minimumValue <= maximumValue,
"Minimum value (" + minimumValue + ") must be less than or equal to maximum (" + maximumValue + ")");
}
this.hasMinimumValue = true;
this.minimumValue = minimumValue;
ret... | [
"public",
"LongParameter",
"setMinimumValue",
"(",
"long",
"minimumValue",
")",
"{",
"if",
"(",
"hasMaximumValue",
")",
"{",
"Util",
".",
"checkParameter",
"(",
"minimumValue",
"<=",
"maximumValue",
",",
"\"Minimum value (\"",
"+",
"minimumValue",
"+",
"\") must be ... | Set the minimum value.
<p>If a maximum value has been set then the minimum value must not be
greater than the maximum value.
@param minimumValue the minimum value
@return this | [
"Set",
"the",
"minimum",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/LongParameter.java#L73-L83 |
123,534 | apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/LongParameter.java | LongParameter.setMaximumValue | public LongParameter setMaximumValue(long maximumValue) {
if (hasMinimumValue) {
Util.checkParameter(maximumValue >= minimumValue,
"Maximum value (" + maximumValue + ") must be greater than or equal to minimum (" + minimumValue + ")");
}
this.hasMaximumValue = true;
this.maximumValue = maximumValue;
... | java | public LongParameter setMaximumValue(long maximumValue) {
if (hasMinimumValue) {
Util.checkParameter(maximumValue >= minimumValue,
"Maximum value (" + maximumValue + ") must be greater than or equal to minimum (" + minimumValue + ")");
}
this.hasMaximumValue = true;
this.maximumValue = maximumValue;
... | [
"public",
"LongParameter",
"setMaximumValue",
"(",
"long",
"maximumValue",
")",
"{",
"if",
"(",
"hasMinimumValue",
")",
"{",
"Util",
".",
"checkParameter",
"(",
"maximumValue",
">=",
"minimumValue",
",",
"\"Maximum value (\"",
"+",
"maximumValue",
"+",
"\") must be ... | Set the maximum value.
<p>If a minimum value has been set then the maximum value must not be
less than the minimum value.
@param maximumValue the maximum value
@return this | [
"Set",
"the",
"maximum",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/LongParameter.java#L94-L104 |
123,535 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/WriteSinkFunction.java | WriteSinkFunction.cleanFile | protected void cleanFile(String path) {
try {
PrintWriter writer;
writer = new PrintWriter(path);
writer.print("");
writer.close();
} catch (FileNotFoundException e) {
throw new RuntimeException("An error occurred while cleaning the file: " + e.getMessage(), e);
}
} | java | protected void cleanFile(String path) {
try {
PrintWriter writer;
writer = new PrintWriter(path);
writer.print("");
writer.close();
} catch (FileNotFoundException e) {
throw new RuntimeException("An error occurred while cleaning the file: " + e.getMessage(), e);
}
} | [
"protected",
"void",
"cleanFile",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"PrintWriter",
"writer",
";",
"writer",
"=",
"new",
"PrintWriter",
"(",
"path",
")",
";",
"writer",
".",
"print",
"(",
"\"\"",
")",
";",
"writer",
".",
"close",
"(",
")",
... | Creates target file if it does not exist, cleans it if it exists.
@param path
is the path to the location where the tuples are written | [
"Creates",
"target",
"file",
"if",
"it",
"does",
"not",
"exist",
"cleans",
"it",
"if",
"it",
"exists",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/WriteSinkFunction.java#L58-L67 |
123,536 | apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/ImmutableMapState.java | ImmutableMapState.iterator | @Override
public Iterator<Map.Entry<K, V>> iterator() {
return Collections.unmodifiableSet(state.entrySet()).iterator();
} | java | @Override
public Iterator<Map.Entry<K, V>> iterator() {
return Collections.unmodifiableSet(state.entrySet()).iterator();
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"iterator",
"(",
")",
"{",
"return",
"Collections",
".",
"unmodifiableSet",
"(",
"state",
".",
"entrySet",
"(",
")",
")",
".",
"iterator",
"(",
")",
";",
... | Iterates over all the mappings in the state. The iterator cannot
remove elements.
@return A read-only iterator over all the mappings in the state. | [
"Iterates",
"over",
"all",
"the",
"mappings",
"in",
"the",
"state",
".",
"The",
"iterator",
"cannot",
"remove",
"elements",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/ImmutableMapState.java#L111-L114 |
123,537 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java | StaticFileServerHandler.sendNotModified | public static void sendNotModified(ChannelHandlerContext ctx) {
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
setDateHeader(response);
// close the connection as soon as the error message is sent.
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
} | java | public static void sendNotModified(ChannelHandlerContext ctx) {
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
setDateHeader(response);
// close the connection as soon as the error message is sent.
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
} | [
"public",
"static",
"void",
"sendNotModified",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"FullHttpResponse",
"response",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HTTP_1_1",
",",
"NOT_MODIFIED",
")",
";",
"setDateHeader",
"(",
"response",
")",
";",
"// close... | Send the "304 Not Modified" response. This response can be used when the
file timestamp is the same as what the browser is sending up.
@param ctx The channel context to write the response to. | [
"Send",
"the",
"304",
"Not",
"Modified",
"response",
".",
"This",
"response",
"can",
"be",
"used",
"when",
"the",
"file",
"timestamp",
"is",
"the",
"same",
"as",
"what",
"the",
"browser",
"is",
"sending",
"up",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java#L324-L330 |
123,538 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java | StaticFileServerHandler.setContentTypeHeader | public static void setContentTypeHeader(HttpResponse response, File file) {
String mimeType = MimeTypes.getMimeTypeForFileName(file.getName());
String mimeFinal = mimeType != null ? mimeType : MimeTypes.getDefaultMimeType();
response.headers().set(CONTENT_TYPE, mimeFinal);
} | java | public static void setContentTypeHeader(HttpResponse response, File file) {
String mimeType = MimeTypes.getMimeTypeForFileName(file.getName());
String mimeFinal = mimeType != null ? mimeType : MimeTypes.getDefaultMimeType();
response.headers().set(CONTENT_TYPE, mimeFinal);
} | [
"public",
"static",
"void",
"setContentTypeHeader",
"(",
"HttpResponse",
"response",
",",
"File",
"file",
")",
"{",
"String",
"mimeType",
"=",
"MimeTypes",
".",
"getMimeTypeForFileName",
"(",
"file",
".",
"getName",
"(",
")",
")",
";",
"String",
"mimeFinal",
"... | Sets the content type header for the HTTP Response.
@param response HTTP response
@param file file to extract content type | [
"Sets",
"the",
"content",
"type",
"header",
"for",
"the",
"HTTP",
"Response",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java#L372-L376 |
123,539 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/Plan.java | Plan.addDataSink | public void addDataSink(GenericDataSinkBase<?> sink) {
checkNotNull(sink, "The data sink must not be null.");
if (!this.sinks.contains(sink)) {
this.sinks.add(sink);
}
} | java | public void addDataSink(GenericDataSinkBase<?> sink) {
checkNotNull(sink, "The data sink must not be null.");
if (!this.sinks.contains(sink)) {
this.sinks.add(sink);
}
} | [
"public",
"void",
"addDataSink",
"(",
"GenericDataSinkBase",
"<",
"?",
">",
"sink",
")",
"{",
"checkNotNull",
"(",
"sink",
",",
"\"The data sink must not be null.\"",
")",
";",
"if",
"(",
"!",
"this",
".",
"sinks",
".",
"contains",
"(",
"sink",
")",
")",
"... | Adds a data sink to the set of sinks in this program.
@param sink The data sink to add. | [
"Adds",
"a",
"data",
"sink",
"to",
"the",
"set",
"of",
"sinks",
"in",
"this",
"program",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/Plan.java#L199-L205 |
123,540 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/Plan.java | Plan.accept | @Override
public void accept(Visitor<Operator<?>> visitor) {
for (GenericDataSinkBase<?> sink : this.sinks) {
sink.accept(visitor);
}
} | java | @Override
public void accept(Visitor<Operator<?>> visitor) {
for (GenericDataSinkBase<?> sink : this.sinks) {
sink.accept(visitor);
}
} | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"Visitor",
"<",
"Operator",
"<",
"?",
">",
">",
"visitor",
")",
"{",
"for",
"(",
"GenericDataSinkBase",
"<",
"?",
">",
"sink",
":",
"this",
".",
"sinks",
")",
"{",
"sink",
".",
"accept",
"(",
"visitor... | Traverses the job depth first from all data sinks on towards the sources.
@see Visitable#accept(Visitor) | [
"Traverses",
"the",
"job",
"depth",
"first",
"from",
"all",
"data",
"sinks",
"on",
"towards",
"the",
"sources",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/Plan.java#L326-L331 |
123,541 | apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/nodes/exec/NodeResourceConfig.java | NodeResourceConfig.calOperatorParallelism | public static int calOperatorParallelism(double rowCount, Configuration tableConf) {
int maxParallelism = getOperatorMaxParallelism(tableConf);
int minParallelism = getOperatorMinParallelism(tableConf);
int resultParallelism = (int) (rowCount / getRowCountPerPartition(tableConf));
return Math.max(Math.min(resul... | java | public static int calOperatorParallelism(double rowCount, Configuration tableConf) {
int maxParallelism = getOperatorMaxParallelism(tableConf);
int minParallelism = getOperatorMinParallelism(tableConf);
int resultParallelism = (int) (rowCount / getRowCountPerPartition(tableConf));
return Math.max(Math.min(resul... | [
"public",
"static",
"int",
"calOperatorParallelism",
"(",
"double",
"rowCount",
",",
"Configuration",
"tableConf",
")",
"{",
"int",
"maxParallelism",
"=",
"getOperatorMaxParallelism",
"(",
"tableConf",
")",
";",
"int",
"minParallelism",
"=",
"getOperatorMinParallelism",... | Calculates operator parallelism based on rowcount of the operator.
@param rowCount rowCount of the operator
@param tableConf Configuration.
@return the result of operator parallelism. | [
"Calculates",
"operator",
"parallelism",
"based",
"on",
"rowcount",
"of",
"the",
"operator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/nodes/exec/NodeResourceConfig.java#L74-L79 |
123,542 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.createSnapshot | public CheckpointStatsSnapshot createSnapshot() {
CheckpointStatsSnapshot snapshot = latestSnapshot;
// Only create a new snapshot if dirty and no update in progress,
// because we don't want to block the coordinator.
if (dirty && statsReadWriteLock.tryLock()) {
try {
// Create a new snapshot
snapsh... | java | public CheckpointStatsSnapshot createSnapshot() {
CheckpointStatsSnapshot snapshot = latestSnapshot;
// Only create a new snapshot if dirty and no update in progress,
// because we don't want to block the coordinator.
if (dirty && statsReadWriteLock.tryLock()) {
try {
// Create a new snapshot
snapsh... | [
"public",
"CheckpointStatsSnapshot",
"createSnapshot",
"(",
")",
"{",
"CheckpointStatsSnapshot",
"snapshot",
"=",
"latestSnapshot",
";",
"// Only create a new snapshot if dirty and no update in progress,",
"// because we don't want to block the coordinator.",
"if",
"(",
"dirty",
"&&"... | Creates a new snapshot of the available stats.
@return The latest statistics snapshot. | [
"Creates",
"a",
"new",
"snapshot",
"of",
"the",
"available",
"stats",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L157-L180 |
123,543 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.reportPendingCheckpoint | PendingCheckpointStats reportPendingCheckpoint(
long checkpointId,
long triggerTimestamp,
CheckpointProperties props) {
ConcurrentHashMap<JobVertexID, TaskStateStats> taskStateStats = createEmptyTaskStateStatsMap();
PendingCheckpointStats pending = new PendingCheckpointStats(
checkpointId,
trigge... | java | PendingCheckpointStats reportPendingCheckpoint(
long checkpointId,
long triggerTimestamp,
CheckpointProperties props) {
ConcurrentHashMap<JobVertexID, TaskStateStats> taskStateStats = createEmptyTaskStateStatsMap();
PendingCheckpointStats pending = new PendingCheckpointStats(
checkpointId,
trigge... | [
"PendingCheckpointStats",
"reportPendingCheckpoint",
"(",
"long",
"checkpointId",
",",
"long",
"triggerTimestamp",
",",
"CheckpointProperties",
"props",
")",
"{",
"ConcurrentHashMap",
"<",
"JobVertexID",
",",
"TaskStateStats",
">",
"taskStateStats",
"=",
"createEmptyTaskSta... | Creates a new pending checkpoint tracker.
@param checkpointId ID of the checkpoint.
@param triggerTimestamp Trigger timestamp of the checkpoint.
@param props The checkpoint properties.
@return Tracker for statistics gathering. | [
"Creates",
"a",
"new",
"pending",
"checkpoint",
"tracker",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L194-L220 |
123,544 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.reportRestoredCheckpoint | void reportRestoredCheckpoint(RestoredCheckpointStats restored) {
checkNotNull(restored, "Restored checkpoint");
statsReadWriteLock.lock();
try {
counts.incrementRestoredCheckpoints();
latestRestoredCheckpoint = restored;
dirty = true;
} finally {
statsReadWriteLock.unlock();
}
} | java | void reportRestoredCheckpoint(RestoredCheckpointStats restored) {
checkNotNull(restored, "Restored checkpoint");
statsReadWriteLock.lock();
try {
counts.incrementRestoredCheckpoints();
latestRestoredCheckpoint = restored;
dirty = true;
} finally {
statsReadWriteLock.unlock();
}
} | [
"void",
"reportRestoredCheckpoint",
"(",
"RestoredCheckpointStats",
"restored",
")",
"{",
"checkNotNull",
"(",
"restored",
",",
"\"Restored checkpoint\"",
")",
";",
"statsReadWriteLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"counts",
".",
"incrementRestoredCheckpoi... | Callback when a checkpoint is restored.
@param restored The restored checkpoint stats. | [
"Callback",
"when",
"a",
"checkpoint",
"is",
"restored",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L227-L239 |
123,545 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.reportCompletedCheckpoint | private void reportCompletedCheckpoint(CompletedCheckpointStats completed) {
statsReadWriteLock.lock();
try {
latestCompletedCheckpoint = completed;
counts.incrementCompletedCheckpoints();
history.replacePendingCheckpointById(completed);
summary.updateSummary(completed);
dirty = true;
} finally ... | java | private void reportCompletedCheckpoint(CompletedCheckpointStats completed) {
statsReadWriteLock.lock();
try {
latestCompletedCheckpoint = completed;
counts.incrementCompletedCheckpoints();
history.replacePendingCheckpointById(completed);
summary.updateSummary(completed);
dirty = true;
} finally ... | [
"private",
"void",
"reportCompletedCheckpoint",
"(",
"CompletedCheckpointStats",
"completed",
")",
"{",
"statsReadWriteLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"latestCompletedCheckpoint",
"=",
"completed",
";",
"counts",
".",
"incrementCompletedCheckpoints",
"(",... | Callback when a checkpoint completes.
@param completed The completed checkpoint stats. | [
"Callback",
"when",
"a",
"checkpoint",
"completes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L246-L260 |
123,546 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.reportFailedCheckpoint | private void reportFailedCheckpoint(FailedCheckpointStats failed) {
statsReadWriteLock.lock();
try {
counts.incrementFailedCheckpoints();
history.replacePendingCheckpointById(failed);
dirty = true;
} finally {
statsReadWriteLock.unlock();
}
} | java | private void reportFailedCheckpoint(FailedCheckpointStats failed) {
statsReadWriteLock.lock();
try {
counts.incrementFailedCheckpoints();
history.replacePendingCheckpointById(failed);
dirty = true;
} finally {
statsReadWriteLock.unlock();
}
} | [
"private",
"void",
"reportFailedCheckpoint",
"(",
"FailedCheckpointStats",
"failed",
")",
"{",
"statsReadWriteLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"counts",
".",
"incrementFailedCheckpoints",
"(",
")",
";",
"history",
".",
"replacePendingCheckpointById",
"... | Callback when a checkpoint fails.
@param failed The failed checkpoint stats. | [
"Callback",
"when",
"a",
"checkpoint",
"fails",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L267-L277 |
123,547 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.registerMetrics | private void registerMetrics(MetricGroup metricGroup) {
metricGroup.gauge(NUMBER_OF_CHECKPOINTS_METRIC, new CheckpointsCounter());
metricGroup.gauge(NUMBER_OF_IN_PROGRESS_CHECKPOINTS_METRIC, new InProgressCheckpointsCounter());
metricGroup.gauge(NUMBER_OF_COMPLETED_CHECKPOINTS_METRIC, new CompletedCheckpointsCoun... | java | private void registerMetrics(MetricGroup metricGroup) {
metricGroup.gauge(NUMBER_OF_CHECKPOINTS_METRIC, new CheckpointsCounter());
metricGroup.gauge(NUMBER_OF_IN_PROGRESS_CHECKPOINTS_METRIC, new InProgressCheckpointsCounter());
metricGroup.gauge(NUMBER_OF_COMPLETED_CHECKPOINTS_METRIC, new CompletedCheckpointsCoun... | [
"private",
"void",
"registerMetrics",
"(",
"MetricGroup",
"metricGroup",
")",
"{",
"metricGroup",
".",
"gauge",
"(",
"NUMBER_OF_CHECKPOINTS_METRIC",
",",
"new",
"CheckpointsCounter",
"(",
")",
")",
";",
"metricGroup",
".",
"gauge",
"(",
"NUMBER_OF_IN_PROGRESS_CHECKPOI... | Register the exposed metrics.
@param metricGroup Metric group to use for the metrics. | [
"Register",
"the",
"exposed",
"metrics",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L355-L365 |
123,548 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java | DelimitedInputFormat.configure | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
// the if() clauses are to prevent the configure() method from
// overwriting the values set by the setters
if (Arrays.equals(delimiter, new byte[] {'\n'})) {
String delimString = parameters.getString(RECORD_DELIMITER... | java | @Override
public void configure(Configuration parameters) {
super.configure(parameters);
// the if() clauses are to prevent the configure() method from
// overwriting the values set by the setters
if (Arrays.equals(delimiter, new byte[] {'\n'})) {
String delimString = parameters.getString(RECORD_DELIMITER... | [
"@",
"Override",
"public",
"void",
"configure",
"(",
"Configuration",
"parameters",
")",
"{",
"super",
".",
"configure",
"(",
"parameters",
")",
";",
"// the if() clauses are to prevent the configure() method from",
"// overwriting the values set by the setters",
"if",
"(",
... | Configures this input format by reading the path to the file from the configuration and the string that
defines the record delimiter.
@param parameters The configuration object to read the parameters from. | [
"Configures",
"this",
"input",
"format",
"by",
"reading",
"the",
"path",
"to",
"the",
"file",
"from",
"the",
"configuration",
"and",
"the",
"string",
"that",
"defines",
"the",
"record",
"delimiter",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java#L311-L339 |
123,549 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java | DelimitedInputFormat.fillBuffer | private boolean fillBuffer(int offset) throws IOException {
int maxReadLength = this.readBuffer.length - offset;
// special case for reading the whole split.
if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
int read = this.stream.read(this.readBuffer, offset, maxReadLength);
if (read == -1) ... | java | private boolean fillBuffer(int offset) throws IOException {
int maxReadLength = this.readBuffer.length - offset;
// special case for reading the whole split.
if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
int read = this.stream.read(this.readBuffer, offset, maxReadLength);
if (read == -1) ... | [
"private",
"boolean",
"fillBuffer",
"(",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"int",
"maxReadLength",
"=",
"this",
".",
"readBuffer",
".",
"length",
"-",
"offset",
";",
"// special case for reading the whole split.",
"if",
"(",
"this",
".",
"splitLe... | Fills the read buffer with bytes read from the file starting from an offset. | [
"Fills",
"the",
"read",
"buffer",
"with",
"bytes",
"read",
"from",
"the",
"file",
"starting",
"from",
"an",
"offset",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java#L663-L707 |
123,550 | apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/wrapper/HadoopTupleUnwrappingIterator.java | HadoopTupleUnwrappingIterator.set | @Override
public void set(final Iterator<Tuple2<KEY, VALUE>> iterator) {
this.iterator = iterator;
if (this.hasNext()) {
final Tuple2<KEY, VALUE> tuple = iterator.next();
this.curKey = keySerializer.copy(tuple.f0);
this.firstValue = tuple.f1;
this.atFirst = true;
} else {
this.atFirst = false;
}... | java | @Override
public void set(final Iterator<Tuple2<KEY, VALUE>> iterator) {
this.iterator = iterator;
if (this.hasNext()) {
final Tuple2<KEY, VALUE> tuple = iterator.next();
this.curKey = keySerializer.copy(tuple.f0);
this.firstValue = tuple.f1;
this.atFirst = true;
} else {
this.atFirst = false;
}... | [
"@",
"Override",
"public",
"void",
"set",
"(",
"final",
"Iterator",
"<",
"Tuple2",
"<",
"KEY",
",",
"VALUE",
">",
">",
"iterator",
")",
"{",
"this",
".",
"iterator",
"=",
"iterator",
";",
"if",
"(",
"this",
".",
"hasNext",
"(",
")",
")",
"{",
"fina... | Set the Flink iterator to wrap.
@param iterator The Flink iterator to wrap. | [
"Set",
"the",
"Flink",
"iterator",
"to",
"wrap",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/wrapper/HadoopTupleUnwrappingIterator.java#L54-L65 |
123,551 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/QuickSort.java | QuickSort.fix | private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) {
if (s.compare(pN, pO, rN, rO) > 0) {
s.swap(pN, pO, rN, rO);
}
} | java | private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) {
if (s.compare(pN, pO, rN, rO) > 0) {
s.swap(pN, pO, rN, rO);
}
} | [
"private",
"static",
"void",
"fix",
"(",
"IndexedSortable",
"s",
",",
"int",
"pN",
",",
"int",
"pO",
",",
"int",
"rN",
",",
"int",
"rO",
")",
"{",
"if",
"(",
"s",
".",
"compare",
"(",
"pN",
",",
"pO",
",",
"rN",
",",
"rO",
")",
">",
"0",
")",... | Fix the records into sorted order, swapping when the first record is
greater than the second record.
@param s paged sortable
@param pN page number of first record
@param pO page offset of first record
@param rN page number of second record
@param rO page offset of second record | [
"Fix",
"the",
"records",
"into",
"sorted",
"order",
"swapping",
"when",
"the",
"first",
"record",
"is",
"greater",
"than",
"the",
"second",
"record",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/QuickSort.java#L39-L43 |
123,552 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/triggers/ProcessingTimeTriggers.java | ProcessingTimeTriggers.every | public static <W extends Window> AfterFirstElementPeriodic<W> every(Duration time) {
return new AfterFirstElementPeriodic<>(time.toMillis());
} | java | public static <W extends Window> AfterFirstElementPeriodic<W> every(Duration time) {
return new AfterFirstElementPeriodic<>(time.toMillis());
} | [
"public",
"static",
"<",
"W",
"extends",
"Window",
">",
"AfterFirstElementPeriodic",
"<",
"W",
">",
"every",
"(",
"Duration",
"time",
")",
"{",
"return",
"new",
"AfterFirstElementPeriodic",
"<>",
"(",
"time",
".",
"toMillis",
"(",
")",
")",
";",
"}"
] | Creates a trigger that fires by a certain interval after reception of the first element.
@param time the certain interval | [
"Creates",
"a",
"trigger",
"that",
"fires",
"by",
"a",
"certain",
"interval",
"after",
"reception",
"of",
"the",
"first",
"element",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/triggers/ProcessingTimeTriggers.java#L66-L68 |
123,553 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SocketClientSink.java | SocketClientSink.invoke | @Override
public void invoke(IN value) throws Exception {
byte[] msg = schema.serialize(value);
try {
outputStream.write(msg);
if (autoFlush) {
outputStream.flush();
}
}
catch (IOException e) {
// if no re-tries are enable, fail immediately
if (maxNumRetries == 0) {
throw new IOExceptio... | java | @Override
public void invoke(IN value) throws Exception {
byte[] msg = schema.serialize(value);
try {
outputStream.write(msg);
if (autoFlush) {
outputStream.flush();
}
}
catch (IOException e) {
// if no re-tries are enable, fail immediately
if (maxNumRetries == 0) {
throw new IOExceptio... | [
"@",
"Override",
"public",
"void",
"invoke",
"(",
"IN",
"value",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"msg",
"=",
"schema",
".",
"serialize",
"(",
"value",
")",
";",
"try",
"{",
"outputStream",
".",
"write",
"(",
"msg",
")",
";",
"if",
... | Called when new data arrives to the sink, and forwards it to Socket.
@param value The value to write to the socket. | [
"Called",
"when",
"new",
"data",
"arrives",
"to",
"the",
"sink",
"and",
"forwards",
"it",
"to",
"Socket",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SocketClientSink.java#L143-L219 |
123,554 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java | PendingCheckpointStats.reportSubtaskStats | boolean reportSubtaskStats(JobVertexID jobVertexId, SubtaskStateStats subtask) {
TaskStateStats taskStateStats = taskStats.get(jobVertexId);
if (taskStateStats != null && taskStateStats.reportSubtaskStats(subtask)) {
currentNumAcknowledgedSubtasks++;
latestAcknowledgedSubtask = subtask;
currentStateSize ... | java | boolean reportSubtaskStats(JobVertexID jobVertexId, SubtaskStateStats subtask) {
TaskStateStats taskStateStats = taskStats.get(jobVertexId);
if (taskStateStats != null && taskStateStats.reportSubtaskStats(subtask)) {
currentNumAcknowledgedSubtasks++;
latestAcknowledgedSubtask = subtask;
currentStateSize ... | [
"boolean",
"reportSubtaskStats",
"(",
"JobVertexID",
"jobVertexId",
",",
"SubtaskStateStats",
"subtask",
")",
"{",
"TaskStateStats",
"taskStateStats",
"=",
"taskStats",
".",
"get",
"(",
"jobVertexId",
")",
";",
"if",
"(",
"taskStateStats",
"!=",
"null",
"&&",
"tas... | Reports statistics for a single subtask.
@param jobVertexId ID of the task/operator the subtask belongs to.
@param subtask The statistics for the subtask.
@return <code>true</code> if successfully reported or <code>false</code> otherwise. | [
"Reports",
"statistics",
"for",
"a",
"single",
"subtask",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java#L120-L138 |
123,555 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java | PendingCheckpointStats.reportCompletedCheckpoint | CompletedCheckpointStats.DiscardCallback reportCompletedCheckpoint(String externalPointer) {
CompletedCheckpointStats completed = new CompletedCheckpointStats(
checkpointId,
triggerTimestamp,
props,
numberOfSubtasks,
new HashMap<>(taskStats),
currentNumAcknowledgedSubtasks,
currentStateSize,
c... | java | CompletedCheckpointStats.DiscardCallback reportCompletedCheckpoint(String externalPointer) {
CompletedCheckpointStats completed = new CompletedCheckpointStats(
checkpointId,
triggerTimestamp,
props,
numberOfSubtasks,
new HashMap<>(taskStats),
currentNumAcknowledgedSubtasks,
currentStateSize,
c... | [
"CompletedCheckpointStats",
".",
"DiscardCallback",
"reportCompletedCheckpoint",
"(",
"String",
"externalPointer",
")",
"{",
"CompletedCheckpointStats",
"completed",
"=",
"new",
"CompletedCheckpointStats",
"(",
"checkpointId",
",",
"triggerTimestamp",
",",
"props",
",",
"nu... | Reports a successfully completed pending checkpoint.
@param externalPointer Optional external storage path if checkpoint was externalized.
@return Callback for the {@link CompletedCheckpoint} instance to notify about disposal. | [
"Reports",
"a",
"successfully",
"completed",
"pending",
"checkpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java#L146-L162 |
123,556 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java | OptimizerNode.setBroadcastInputs | public void setBroadcastInputs(Map<Operator<?>, OptimizerNode> operatorToNode, ExecutionMode defaultExchangeMode) {
// skip for Operators that don't support broadcast variables
if (!(getOperator() instanceof AbstractUdfOperator<?, ?>)) {
return;
}
// get all broadcast inputs
AbstractUdfOperator<?, ?> ope... | java | public void setBroadcastInputs(Map<Operator<?>, OptimizerNode> operatorToNode, ExecutionMode defaultExchangeMode) {
// skip for Operators that don't support broadcast variables
if (!(getOperator() instanceof AbstractUdfOperator<?, ?>)) {
return;
}
// get all broadcast inputs
AbstractUdfOperator<?, ?> ope... | [
"public",
"void",
"setBroadcastInputs",
"(",
"Map",
"<",
"Operator",
"<",
"?",
">",
",",
"OptimizerNode",
">",
"operatorToNode",
",",
"ExecutionMode",
"defaultExchangeMode",
")",
"{",
"// skip for Operators that don't support broadcast variables ",
"if",
"(",
"!",
"(",
... | This function connects the operators that produce the broadcast inputs to this operator.
@param operatorToNode The map from program operators to optimizer nodes.
@param defaultExchangeMode The data exchange mode to use, if the operator does not
specify one.
@throws CompilerException | [
"This",
"function",
"connects",
"the",
"operators",
"that",
"produce",
"the",
"broadcast",
"inputs",
"to",
"this",
"operator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java#L177-L194 |
123,557 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java | OptimizerNode.setParallelism | public void setParallelism(int parallelism) {
if (parallelism < 1 && parallelism != ExecutionConfig.PARALLELISM_DEFAULT) {
throw new IllegalArgumentException("Parallelism of " + parallelism + " is invalid.");
}
this.parallelism = parallelism;
} | java | public void setParallelism(int parallelism) {
if (parallelism < 1 && parallelism != ExecutionConfig.PARALLELISM_DEFAULT) {
throw new IllegalArgumentException("Parallelism of " + parallelism + " is invalid.");
}
this.parallelism = parallelism;
} | [
"public",
"void",
"setParallelism",
"(",
"int",
"parallelism",
")",
"{",
"if",
"(",
"parallelism",
"<",
"1",
"&&",
"parallelism",
"!=",
"ExecutionConfig",
".",
"PARALLELISM_DEFAULT",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parallelism of \"",
... | Sets the parallelism for this optimizer node.
The parallelism denotes how many parallel instances of the operator will be
spawned during the execution.
@param parallelism The parallelism to set. If this value is {@link ExecutionConfig#PARALLELISM_DEFAULT}
then the system will take the default number of parallel instan... | [
"Sets",
"the",
"parallelism",
"for",
"this",
"optimizer",
"node",
".",
"The",
"parallelism",
"denotes",
"how",
"many",
"parallel",
"instances",
"of",
"the",
"operator",
"will",
"be",
"spawned",
"during",
"the",
"execution",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java#L394-L399 |
123,558 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java | OptimizerNode.computeUnionOfInterestingPropertiesFromSuccessors | public void computeUnionOfInterestingPropertiesFromSuccessors() {
List<DagConnection> conns = getOutgoingConnections();
if (conns.size() == 0) {
// no incoming, we have none ourselves
this.intProps = new InterestingProperties();
} else {
this.intProps = conns.get(0).getInterestingProperties().clone();
... | java | public void computeUnionOfInterestingPropertiesFromSuccessors() {
List<DagConnection> conns = getOutgoingConnections();
if (conns.size() == 0) {
// no incoming, we have none ourselves
this.intProps = new InterestingProperties();
} else {
this.intProps = conns.get(0).getInterestingProperties().clone();
... | [
"public",
"void",
"computeUnionOfInterestingPropertiesFromSuccessors",
"(",
")",
"{",
"List",
"<",
"DagConnection",
">",
"conns",
"=",
"getOutgoingConnections",
"(",
")",
";",
"if",
"(",
"conns",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"// no incoming, we ha... | Computes all the interesting properties that are relevant to this node. The interesting
properties are a union of the interesting properties on each outgoing connection.
However, if two interesting properties on the outgoing connections overlap,
the interesting properties will occur only once in this set. For that, thi... | [
"Computes",
"all",
"the",
"interesting",
"properties",
"that",
"are",
"relevant",
"to",
"this",
"node",
".",
"The",
"interesting",
"properties",
"are",
"a",
"union",
"of",
"the",
"interesting",
"properties",
"on",
"each",
"outgoing",
"connection",
".",
"However"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java#L546-L558 |
123,559 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java | OptimizerNode.areBranchCompatible | protected boolean areBranchCompatible(PlanNode plan1, PlanNode plan2) {
if (plan1 == null || plan2 == null) {
throw new NullPointerException();
}
// if there is no open branch, the children are always compatible.
// in most plans, that will be the dominant case
if (this.hereJoinedBranches == null || thi... | java | protected boolean areBranchCompatible(PlanNode plan1, PlanNode plan2) {
if (plan1 == null || plan2 == null) {
throw new NullPointerException();
}
// if there is no open branch, the children are always compatible.
// in most plans, that will be the dominant case
if (this.hereJoinedBranches == null || thi... | [
"protected",
"boolean",
"areBranchCompatible",
"(",
"PlanNode",
"plan1",
",",
"PlanNode",
"plan2",
")",
"{",
"if",
"(",
"plan1",
"==",
"null",
"||",
"plan2",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"// if there is ... | Checks whether to candidate plans for the sub-plan of this node are comparable. The two
alternative plans are comparable, if
a) There is no branch in the sub-plan of this node
b) Both candidates have the same candidate as the child at the last open branch.
@param plan1 The root node of the first candidate plan.
@para... | [
"Checks",
"whether",
"to",
"candidate",
"plans",
"for",
"the",
"sub",
"-",
"plan",
"of",
"this",
"node",
"are",
"comparable",
".",
"The",
"two",
"alternative",
"plans",
"are",
"comparable",
"if"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/OptimizerNode.java#L970-L990 |
123,560 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java | HeartbeatServices.createHeartbeatManager | public <I, O> HeartbeatManager<I, O> createHeartbeatManager(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerImpl<>(
heartbeatTimeout,
resourceId,
heartbeatListener,
scheduledExecutor,
scheduledExec... | java | public <I, O> HeartbeatManager<I, O> createHeartbeatManager(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerImpl<>(
heartbeatTimeout,
resourceId,
heartbeatListener,
scheduledExecutor,
scheduledExec... | [
"public",
"<",
"I",
",",
"O",
">",
"HeartbeatManager",
"<",
"I",
",",
"O",
">",
"createHeartbeatManager",
"(",
"ResourceID",
"resourceId",
",",
"HeartbeatListener",
"<",
"I",
",",
"O",
">",
"heartbeatListener",
",",
"ScheduledExecutor",
"scheduledExecutor",
",",... | Creates a heartbeat manager which does not actively send heartbeats.
@param resourceId Resource Id which identifies the owner of the heartbeat manager
@param heartbeatListener Listener which will be notified upon heartbeat timeouts for registered
targets
@param scheduledExecutor Scheduled executor to be used for sched... | [
"Creates",
"a",
"heartbeat",
"manager",
"which",
"does",
"not",
"actively",
"send",
"heartbeats",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java#L61-L74 |
123,561 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java | HeartbeatServices.createHeartbeatManagerSender | public <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerSenderImpl<>(
heartbeatInterval,
heartbeatTimeout,
resourceId,
heartbeatListener,
s... | java | public <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor scheduledExecutor,
Logger log) {
return new HeartbeatManagerSenderImpl<>(
heartbeatInterval,
heartbeatTimeout,
resourceId,
heartbeatListener,
s... | [
"public",
"<",
"I",
",",
"O",
">",
"HeartbeatManager",
"<",
"I",
",",
"O",
">",
"createHeartbeatManagerSender",
"(",
"ResourceID",
"resourceId",
",",
"HeartbeatListener",
"<",
"I",
",",
"O",
">",
"heartbeatListener",
",",
"ScheduledExecutor",
"scheduledExecutor",
... | Creates a heartbeat manager which actively sends heartbeats to monitoring targets.
@param resourceId Resource Id which identifies the owner of the heartbeat manager
@param heartbeatListener Listener which will be notified upon heartbeat timeouts for registered
targets
@param scheduledExecutor Scheduled executor to be ... | [
"Creates",
"a",
"heartbeat",
"manager",
"which",
"actively",
"sends",
"heartbeats",
"to",
"monitoring",
"targets",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java#L88-L102 |
123,562 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java | ShardConsumer.adjustRunLoopFrequency | protected long adjustRunLoopFrequency(long processingStartTimeNanos, long processingEndTimeNanos)
throws InterruptedException {
long endTimeNanos = processingEndTimeNanos;
if (fetchIntervalMillis != 0) {
long processingTimeNanos = processingEndTimeNanos - processingStartTimeNanos;
long sleepTimeMillis = fet... | java | protected long adjustRunLoopFrequency(long processingStartTimeNanos, long processingEndTimeNanos)
throws InterruptedException {
long endTimeNanos = processingEndTimeNanos;
if (fetchIntervalMillis != 0) {
long processingTimeNanos = processingEndTimeNanos - processingStartTimeNanos;
long sleepTimeMillis = fet... | [
"protected",
"long",
"adjustRunLoopFrequency",
"(",
"long",
"processingStartTimeNanos",
",",
"long",
"processingEndTimeNanos",
")",
"throws",
"InterruptedException",
"{",
"long",
"endTimeNanos",
"=",
"processingEndTimeNanos",
";",
"if",
"(",
"fetchIntervalMillis",
"!=",
"... | Adjusts loop timing to match target frequency if specified.
@param processingStartTimeNanos The start time of the run loop "work"
@param processingEndTimeNanos The end time of the run loop "work"
@return The System.nanoTime() after the sleep (if any)
@throws InterruptedException | [
"Adjusts",
"loop",
"timing",
"to",
"match",
"target",
"frequency",
"if",
"specified",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java#L285-L298 |
123,563 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java | ShardConsumer.adaptRecordsToRead | private int adaptRecordsToRead(long runLoopTimeNanos, int numRecords, long recordBatchSizeBytes,
int maxNumberOfRecordsPerFetch) {
if (useAdaptiveReads && numRecords != 0 && runLoopTimeNanos != 0) {
long averageRecordSizeBytes = recordBatchSizeBytes / numRecords;
// Adjust number of records to fetch from the... | java | private int adaptRecordsToRead(long runLoopTimeNanos, int numRecords, long recordBatchSizeBytes,
int maxNumberOfRecordsPerFetch) {
if (useAdaptiveReads && numRecords != 0 && runLoopTimeNanos != 0) {
long averageRecordSizeBytes = recordBatchSizeBytes / numRecords;
// Adjust number of records to fetch from the... | [
"private",
"int",
"adaptRecordsToRead",
"(",
"long",
"runLoopTimeNanos",
",",
"int",
"numRecords",
",",
"long",
"recordBatchSizeBytes",
",",
"int",
"maxNumberOfRecordsPerFetch",
")",
"{",
"if",
"(",
"useAdaptiveReads",
"&&",
"numRecords",
"!=",
"0",
"&&",
"runLoopTi... | Calculates how many records to read each time through the loop based on a target throughput
and the measured frequenecy of the loop.
@param runLoopTimeNanos The total time of one pass through the loop
@param numRecords The number of records of the last read operation
@param recordBatchSizeBytes The total batch size of ... | [
"Calculates",
"how",
"many",
"records",
"to",
"read",
"each",
"time",
"through",
"the",
"loop",
"based",
"on",
"a",
"target",
"throughput",
"and",
"the",
"measured",
"frequenecy",
"of",
"the",
"loop",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/ShardConsumer.java#L308-L326 |
123,564 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java | JobVertex.getInvokableClass | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
if (cl == null) {
throw new NullPointerException("The classloader must not be null.");
}
if (invokableClassName == null) {
return null;
}
try {
return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokabl... | java | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
if (cl == null) {
throw new NullPointerException("The classloader must not be null.");
}
if (invokableClassName == null) {
return null;
}
try {
return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokabl... | [
"public",
"Class",
"<",
"?",
"extends",
"AbstractInvokable",
">",
"getInvokableClass",
"(",
"ClassLoader",
"cl",
")",
"{",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The classloader must not be null.\"",
")",
";",
"}... | Returns the invokable class which represents the task of this vertex
@param cl The classloader used to resolve user-defined classes
@return The invokable class, <code>null</code> if it is not set | [
"Returns",
"the",
"invokable",
"class",
"which",
"represents",
"the",
"task",
"of",
"this",
"vertex"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L257-L274 |
123,565 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java | JobVertex.setResources | public void setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
this.minResources = checkNotNull(minResources);
this.preferredResources = checkNotNull(preferredResources);
} | java | public void setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
this.minResources = checkNotNull(minResources);
this.preferredResources = checkNotNull(preferredResources);
} | [
"public",
"void",
"setResources",
"(",
"ResourceSpec",
"minResources",
",",
"ResourceSpec",
"preferredResources",
")",
"{",
"this",
".",
"minResources",
"=",
"checkNotNull",
"(",
"minResources",
")",
";",
"this",
".",
"preferredResources",
"=",
"checkNotNull",
"(",
... | Sets the minimum and preferred resources for the task.
@param minResources The minimum resource for the task.
@param preferredResources The preferred resource for the task. | [
"Sets",
"the",
"minimum",
"and",
"preferred",
"resources",
"for",
"the",
"task",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L339-L342 |
123,566 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java | JobVertex.setSlotSharingGroup | public void setSlotSharingGroup(SlotSharingGroup grp) {
if (this.slotSharingGroup != null) {
this.slotSharingGroup.removeVertexFromGroup(id);
}
this.slotSharingGroup = grp;
if (grp != null) {
grp.addVertexToGroup(id);
}
} | java | public void setSlotSharingGroup(SlotSharingGroup grp) {
if (this.slotSharingGroup != null) {
this.slotSharingGroup.removeVertexFromGroup(id);
}
this.slotSharingGroup = grp;
if (grp != null) {
grp.addVertexToGroup(id);
}
} | [
"public",
"void",
"setSlotSharingGroup",
"(",
"SlotSharingGroup",
"grp",
")",
"{",
"if",
"(",
"this",
".",
"slotSharingGroup",
"!=",
"null",
")",
"{",
"this",
".",
"slotSharingGroup",
".",
"removeVertexFromGroup",
"(",
"id",
")",
";",
"}",
"this",
".",
"slot... | Associates this vertex with a slot sharing group for scheduling. Different vertices in the same
slot sharing group can run one subtask each in the same slot.
@param grp The slot sharing group to associate the vertex with. | [
"Associates",
"this",
"vertex",
"with",
"a",
"slot",
"sharing",
"group",
"for",
"scheduling",
".",
"Different",
"vertices",
"in",
"the",
"same",
"slot",
"sharing",
"group",
"can",
"run",
"one",
"subtask",
"each",
"in",
"the",
"same",
"slot",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L366-L375 |
123,567 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/types/valuearray/IntValueArray.java | IntValueArray.ensureCapacity | private void ensureCapacity(int minCapacity) {
long currentCapacity = data.length;
if (minCapacity <= currentCapacity) {
return;
}
// increase capacity by at least ~50%
long expandedCapacity = Math.max(minCapacity, currentCapacity + (currentCapacity >> 1));
int newCapacity = (int) Math.min(MAX_ARRAY_SI... | java | private void ensureCapacity(int minCapacity) {
long currentCapacity = data.length;
if (minCapacity <= currentCapacity) {
return;
}
// increase capacity by at least ~50%
long expandedCapacity = Math.max(minCapacity, currentCapacity + (currentCapacity >> 1));
int newCapacity = (int) Math.min(MAX_ARRAY_SI... | [
"private",
"void",
"ensureCapacity",
"(",
"int",
"minCapacity",
")",
"{",
"long",
"currentCapacity",
"=",
"data",
".",
"length",
";",
"if",
"(",
"minCapacity",
"<=",
"currentCapacity",
")",
"{",
"return",
";",
"}",
"// increase capacity by at least ~50%",
"long",
... | If the size of the array is insufficient to hold the given capacity then
copy the array into a new, larger array.
@param minCapacity minimum required number of elements | [
"If",
"the",
"size",
"of",
"the",
"array",
"is",
"insufficient",
"to",
"hold",
"the",
"given",
"capacity",
"then",
"copy",
"the",
"array",
"into",
"a",
"new",
"larger",
"array",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/types/valuearray/IntValueArray.java#L101-L118 |
123,568 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunner.java | JobManagerRunner.unregisterJobFromHighAvailability | private void unregisterJobFromHighAvailability() {
try {
runningJobsRegistry.setJobFinished(jobGraph.getJobID());
}
catch (Throwable t) {
log.error("Could not un-register from high-availability services job {} ({})." +
"Other JobManager's may attempt to recover it and re-execute it.",
jobGraph.get... | java | private void unregisterJobFromHighAvailability() {
try {
runningJobsRegistry.setJobFinished(jobGraph.getJobID());
}
catch (Throwable t) {
log.error("Could not un-register from high-availability services job {} ({})." +
"Other JobManager's may attempt to recover it and re-execute it.",
jobGraph.get... | [
"private",
"void",
"unregisterJobFromHighAvailability",
"(",
")",
"{",
"try",
"{",
"runningJobsRegistry",
".",
"setJobFinished",
"(",
"jobGraph",
".",
"getJobID",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"log",
".",
"error",
"(",
... | Marks this runner's job as not running. Other JobManager will not recover the job
after this call.
<p>This method never throws an exception. | [
"Marks",
"this",
"runner",
"s",
"job",
"as",
"not",
"running",
".",
"Other",
"JobManager",
"will",
"not",
"recover",
"the",
"job",
"after",
"this",
"call",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunner.java#L265-L274 |
123,569 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java | FailoverRegion.failover | private void failover(long globalModVersionOfFailover) {
if (!executionGraph.getRestartStrategy().canRestart()) {
executionGraph.failGlobal(new FlinkException("RestartStrategy validate fail"));
}
else {
JobStatus curStatus = this.state;
if (curStatus.equals(JobStatus.RUNNING)) {
cancel(globalModVersi... | java | private void failover(long globalModVersionOfFailover) {
if (!executionGraph.getRestartStrategy().canRestart()) {
executionGraph.failGlobal(new FlinkException("RestartStrategy validate fail"));
}
else {
JobStatus curStatus = this.state;
if (curStatus.equals(JobStatus.RUNNING)) {
cancel(globalModVersi... | [
"private",
"void",
"failover",
"(",
"long",
"globalModVersionOfFailover",
")",
"{",
"if",
"(",
"!",
"executionGraph",
".",
"getRestartStrategy",
"(",
")",
".",
"canRestart",
"(",
")",
")",
"{",
"executionGraph",
".",
"failGlobal",
"(",
"new",
"FlinkException",
... | Notice the region to failover, | [
"Notice",
"the",
"region",
"to",
"failover"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java#L121-L137 |
123,570 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java | FailoverRegion.cancel | private void cancel(final long globalModVersionOfFailover) {
executionGraph.getJobMasterMainThreadExecutor().assertRunningInMainThread();
while (true) {
JobStatus curStatus = this.state;
if (curStatus.equals(JobStatus.RUNNING)) {
if (transitionState(curStatus, JobStatus.CANCELLING)) {
createTerminat... | java | private void cancel(final long globalModVersionOfFailover) {
executionGraph.getJobMasterMainThreadExecutor().assertRunningInMainThread();
while (true) {
JobStatus curStatus = this.state;
if (curStatus.equals(JobStatus.RUNNING)) {
if (transitionState(curStatus, JobStatus.CANCELLING)) {
createTerminat... | [
"private",
"void",
"cancel",
"(",
"final",
"long",
"globalModVersionOfFailover",
")",
"{",
"executionGraph",
".",
"getJobMasterMainThreadExecutor",
"(",
")",
".",
"assertRunningInMainThread",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"JobStatus",
"curStatus",
... | cancel all executions in this sub graph | [
"cancel",
"all",
"executions",
"in",
"this",
"sub",
"graph"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java#L140-L156 |
123,571 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java | FailoverRegion.reset | private void reset(long globalModVersionOfFailover) {
try {
// reset all connected ExecutionVertexes
final Collection<CoLocationGroup> colGroups = new HashSet<>();
final long restartTimestamp = System.currentTimeMillis();
for (ExecutionVertex ev : connectedExecutionVertexes) {
CoLocationGroup cgroup ... | java | private void reset(long globalModVersionOfFailover) {
try {
// reset all connected ExecutionVertexes
final Collection<CoLocationGroup> colGroups = new HashSet<>();
final long restartTimestamp = System.currentTimeMillis();
for (ExecutionVertex ev : connectedExecutionVertexes) {
CoLocationGroup cgroup ... | [
"private",
"void",
"reset",
"(",
"long",
"globalModVersionOfFailover",
")",
"{",
"try",
"{",
"// reset all connected ExecutionVertexes",
"final",
"Collection",
"<",
"CoLocationGroup",
">",
"colGroups",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"final",
"long",
"... | reset all executions in this sub graph | [
"reset",
"all",
"executions",
"in",
"this",
"sub",
"graph"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java#L172-L204 |
123,572 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java | FailoverRegion.restart | private void restart(long globalModVersionOfFailover) {
try {
if (transitionState(JobStatus.CREATED, JobStatus.RUNNING)) {
// if we have checkpointed state, reload it into the executions
if (executionGraph.getCheckpointCoordinator() != null) {
// we restart the checkpoint scheduler for
// i) enab... | java | private void restart(long globalModVersionOfFailover) {
try {
if (transitionState(JobStatus.CREATED, JobStatus.RUNNING)) {
// if we have checkpointed state, reload it into the executions
if (executionGraph.getCheckpointCoordinator() != null) {
// we restart the checkpoint scheduler for
// i) enab... | [
"private",
"void",
"restart",
"(",
"long",
"globalModVersionOfFailover",
")",
"{",
"try",
"{",
"if",
"(",
"transitionState",
"(",
"JobStatus",
".",
"CREATED",
",",
"JobStatus",
".",
"RUNNING",
")",
")",
"{",
"// if we have checkpointed state, reload it into the execut... | restart all executions in this sub graph | [
"restart",
"all",
"executions",
"in",
"this",
"sub",
"graph"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java#L207-L253 |
123,573 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.getManagedMemorySize | public static long getManagedMemorySize(Configuration configuration) {
long managedMemorySize;
String managedMemorySizeDefaultVal = TaskManagerOptions.MANAGED_MEMORY_SIZE.defaultValue();
if (!configuration.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE).equals(managedMemorySizeDefaultVal)) {
try {
manage... | java | public static long getManagedMemorySize(Configuration configuration) {
long managedMemorySize;
String managedMemorySizeDefaultVal = TaskManagerOptions.MANAGED_MEMORY_SIZE.defaultValue();
if (!configuration.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE).equals(managedMemorySizeDefaultVal)) {
try {
manage... | [
"public",
"static",
"long",
"getManagedMemorySize",
"(",
"Configuration",
"configuration",
")",
"{",
"long",
"managedMemorySize",
";",
"String",
"managedMemorySizeDefaultVal",
"=",
"TaskManagerOptions",
".",
"MANAGED_MEMORY_SIZE",
".",
"defaultValue",
"(",
")",
";",
"if... | Parses the configuration to get the managed memory size and validates the value.
@param configuration configuration object
@return managed memory size (in megabytes) | [
"Parses",
"the",
"configuration",
"to",
"get",
"the",
"managed",
"memory",
"size",
"and",
"validates",
"the",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L41-L62 |
123,574 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.getManagedMemoryFraction | public static float getManagedMemoryFraction(Configuration configuration) {
float managedMemoryFraction = configuration.getFloat(TaskManagerOptions.MANAGED_MEMORY_FRACTION);
checkConfigParameter(managedMemoryFraction > 0.0f && managedMemoryFraction < 1.0f, managedMemoryFraction,
TaskManagerOptions.MANAGED_MEMOR... | java | public static float getManagedMemoryFraction(Configuration configuration) {
float managedMemoryFraction = configuration.getFloat(TaskManagerOptions.MANAGED_MEMORY_FRACTION);
checkConfigParameter(managedMemoryFraction > 0.0f && managedMemoryFraction < 1.0f, managedMemoryFraction,
TaskManagerOptions.MANAGED_MEMOR... | [
"public",
"static",
"float",
"getManagedMemoryFraction",
"(",
"Configuration",
"configuration",
")",
"{",
"float",
"managedMemoryFraction",
"=",
"configuration",
".",
"getFloat",
"(",
"TaskManagerOptions",
".",
"MANAGED_MEMORY_FRACTION",
")",
";",
"checkConfigParameter",
... | Parses the configuration to get the fraction of managed memory and validates the value.
@param configuration configuration object
@return fraction of managed memory | [
"Parses",
"the",
"configuration",
"to",
"get",
"the",
"fraction",
"of",
"managed",
"memory",
"and",
"validates",
"the",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L70-L78 |
123,575 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.getMemoryType | public static MemoryType getMemoryType(Configuration configuration) {
// check whether we use heap or off-heap memory
final MemoryType memType;
if (configuration.getBoolean(TaskManagerOptions.MEMORY_OFF_HEAP)) {
memType = MemoryType.OFF_HEAP;
} else {
memType = MemoryType.HEAP;
}
return memType;
} | java | public static MemoryType getMemoryType(Configuration configuration) {
// check whether we use heap or off-heap memory
final MemoryType memType;
if (configuration.getBoolean(TaskManagerOptions.MEMORY_OFF_HEAP)) {
memType = MemoryType.OFF_HEAP;
} else {
memType = MemoryType.HEAP;
}
return memType;
} | [
"public",
"static",
"MemoryType",
"getMemoryType",
"(",
"Configuration",
"configuration",
")",
"{",
"// check whether we use heap or off-heap memory",
"final",
"MemoryType",
"memType",
";",
"if",
"(",
"configuration",
".",
"getBoolean",
"(",
"TaskManagerOptions",
".",
"ME... | Parses the configuration to get the type of memory.
@param configuration configuration object
@return type of memory | [
"Parses",
"the",
"configuration",
"to",
"get",
"the",
"type",
"of",
"memory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L86-L95 |
123,576 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.getSlot | public static int getSlot(Configuration configuration) {
int slots = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1);
// we need this because many configs have been written with a "-1" entry
if (slots == -1) {
slots = 1;
}
ConfigurationParserUtils.checkConfigParameter(slots >= 1, slots, Tas... | java | public static int getSlot(Configuration configuration) {
int slots = configuration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, 1);
// we need this because many configs have been written with a "-1" entry
if (slots == -1) {
slots = 1;
}
ConfigurationParserUtils.checkConfigParameter(slots >= 1, slots, Tas... | [
"public",
"static",
"int",
"getSlot",
"(",
"Configuration",
"configuration",
")",
"{",
"int",
"slots",
"=",
"configuration",
".",
"getInteger",
"(",
"TaskManagerOptions",
".",
"NUM_TASK_SLOTS",
",",
"1",
")",
";",
"// we need this because many configs have been written ... | Parses the configuration to get the number of slots and validates the value.
@param configuration configuration object
@return the number of slots in task manager | [
"Parses",
"the",
"configuration",
"to",
"get",
"the",
"number",
"of",
"slots",
"and",
"validates",
"the",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L103-L114 |
123,577 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.checkConfigParameter | public static void checkConfigParameter(boolean condition, Object parameter, String name, String errorMessage)
throws IllegalConfigurationException {
if (!condition) {
throw new IllegalConfigurationException("Invalid configuration value for " +
name + " : " + parameter + " - " + errorMessage);
}
} | java | public static void checkConfigParameter(boolean condition, Object parameter, String name, String errorMessage)
throws IllegalConfigurationException {
if (!condition) {
throw new IllegalConfigurationException("Invalid configuration value for " +
name + " : " + parameter + " - " + errorMessage);
}
} | [
"public",
"static",
"void",
"checkConfigParameter",
"(",
"boolean",
"condition",
",",
"Object",
"parameter",
",",
"String",
"name",
",",
"String",
"errorMessage",
")",
"throws",
"IllegalConfigurationException",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
... | Validates a condition for a config parameter and displays a standard exception, if the
the condition does not hold.
@param condition The condition that must hold. If the condition is false, an exception is thrown.
@param parameter The parameter value. Will be shown in the exception message.
@param ... | [
"Validates",
"a",
"condition",
"for",
"a",
"config",
"parameter",
"and",
"displays",
"a",
"standard",
"exception",
"if",
"the",
"the",
"condition",
"does",
"not",
"hold",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L127-L133 |
123,578 | apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java | YarnHighAvailabilityServices.forSingleJobAppMaster | public static YarnHighAvailabilityServices forSingleJobAppMaster(
Configuration flinkConfig,
org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException {
checkNotNull(flinkConfig, "flinkConfig");
checkNotNull(hadoopConfig, "hadoopConfig");
final HighAvailabilityMode mode = HighAvailabilityMode.... | java | public static YarnHighAvailabilityServices forSingleJobAppMaster(
Configuration flinkConfig,
org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException {
checkNotNull(flinkConfig, "flinkConfig");
checkNotNull(hadoopConfig, "hadoopConfig");
final HighAvailabilityMode mode = HighAvailabilityMode.... | [
"public",
"static",
"YarnHighAvailabilityServices",
"forSingleJobAppMaster",
"(",
"Configuration",
"flinkConfig",
",",
"org",
".",
"apache",
".",
"hadoop",
".",
"conf",
".",
"Configuration",
"hadoopConfig",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"flin... | Creates the high-availability services for a single-job Flink YARN application, to be
used in the Application Master that runs both ResourceManager and JobManager.
@param flinkConfig The Flink configuration.
@param hadoopConfig The Hadoop configuration for the YARN cluster.
@return The created high-availability serv... | [
"Creates",
"the",
"high",
"-",
"availability",
"services",
"for",
"a",
"single",
"-",
"job",
"Flink",
"YARN",
"application",
"to",
"be",
"used",
"in",
"the",
"Application",
"Master",
"that",
"runs",
"both",
"ResourceManager",
"and",
"JobManager",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java#L318-L336 |
123,579 | apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java | YarnHighAvailabilityServices.forYarnTaskManager | public static YarnHighAvailabilityServices forYarnTaskManager(
Configuration flinkConfig,
org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException {
checkNotNull(flinkConfig, "flinkConfig");
checkNotNull(hadoopConfig, "hadoopConfig");
final HighAvailabilityMode mode = HighAvailabilityMode.fro... | java | public static YarnHighAvailabilityServices forYarnTaskManager(
Configuration flinkConfig,
org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException {
checkNotNull(flinkConfig, "flinkConfig");
checkNotNull(hadoopConfig, "hadoopConfig");
final HighAvailabilityMode mode = HighAvailabilityMode.fro... | [
"public",
"static",
"YarnHighAvailabilityServices",
"forYarnTaskManager",
"(",
"Configuration",
"flinkConfig",
",",
"org",
".",
"apache",
".",
"hadoop",
".",
"conf",
".",
"Configuration",
"hadoopConfig",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"flinkCo... | Creates the high-availability services for the TaskManagers participating in
a Flink YARN application.
@param flinkConfig The Flink configuration.
@param hadoopConfig The Hadoop configuration for the YARN cluster.
@return The created high-availability services.
@throws IOException Thrown, if the high-availability s... | [
"Creates",
"the",
"high",
"-",
"availability",
"services",
"for",
"the",
"TaskManagers",
"participating",
"in",
"a",
"Flink",
"YARN",
"application",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/highavailability/YarnHighAvailabilityServices.java#L349-L370 |
123,580 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelReaderInputView.java | ChannelReaderInputView.close | @Override
public List<MemorySegment> close() throws IOException {
if (this.closed) {
throw new IllegalStateException("Already closed.");
}
this.closed = true;
// re-collect all memory segments
ArrayList<MemorySegment> list = this.freeMem;
final MemorySegment current = getCurrentSegment();
if (current... | java | @Override
public List<MemorySegment> close() throws IOException {
if (this.closed) {
throw new IllegalStateException("Already closed.");
}
this.closed = true;
// re-collect all memory segments
ArrayList<MemorySegment> list = this.freeMem;
final MemorySegment current = getCurrentSegment();
if (current... | [
"@",
"Override",
"public",
"List",
"<",
"MemorySegment",
">",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Already closed.\"",
")",
";",
"}",
"this",
".",
"clo... | Closes this InputView, closing the underlying reader and returning all memory segments.
@return A list containing all memory segments originally supplied to this view.
@throws IOException Thrown, if the underlying reader could not be properly closed. | [
"Closes",
"this",
"InputView",
"closing",
"the",
"underlying",
"reader",
"and",
"returning",
"all",
"memory",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelReaderInputView.java#L171-L199 |
123,581 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelReaderInputView.java | ChannelReaderInputView.sendReadRequest | protected void sendReadRequest(MemorySegment seg) throws IOException {
if (this.numRequestsRemaining != 0) {
this.reader.readBlock(seg);
if (this.numRequestsRemaining != -1) {
this.numRequestsRemaining--;
}
} else {
// directly add it to the end of the return queue
this.freeMem.add(seg);
}
} | java | protected void sendReadRequest(MemorySegment seg) throws IOException {
if (this.numRequestsRemaining != 0) {
this.reader.readBlock(seg);
if (this.numRequestsRemaining != -1) {
this.numRequestsRemaining--;
}
} else {
// directly add it to the end of the return queue
this.freeMem.add(seg);
}
} | [
"protected",
"void",
"sendReadRequest",
"(",
"MemorySegment",
"seg",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"numRequestsRemaining",
"!=",
"0",
")",
"{",
"this",
".",
"reader",
".",
"readBlock",
"(",
"seg",
")",
";",
"if",
"(",
"this",
... | Sends a new read requests, if further requests remain. Otherwise, this method adds the segment
directly to the readers return queue.
@param seg The segment to use for the read request.
@throws IOException Thrown, if the reader is in error. | [
"Sends",
"a",
"new",
"read",
"requests",
"if",
"further",
"requests",
"remain",
".",
"Otherwise",
"this",
"method",
"adds",
"the",
"segment",
"directly",
"to",
"the",
"readers",
"return",
"queue",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/ChannelReaderInputView.java#L267-L277 |
123,582 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeinfo/TypeInformation.java | TypeInformation.of | public static <T> TypeInformation<T> of(Class<T> typeClass) {
try {
return TypeExtractor.createTypeInfo(typeClass);
}
catch (InvalidTypesException e) {
throw new FlinkRuntimeException(
"Cannot extract TypeInformation from Class alone, because generic parameters are missing. " +
"Please use TypeInf... | java | public static <T> TypeInformation<T> of(Class<T> typeClass) {
try {
return TypeExtractor.createTypeInfo(typeClass);
}
catch (InvalidTypesException e) {
throw new FlinkRuntimeException(
"Cannot extract TypeInformation from Class alone, because generic parameters are missing. " +
"Please use TypeInf... | [
"public",
"static",
"<",
"T",
">",
"TypeInformation",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"typeClass",
")",
"{",
"try",
"{",
"return",
"TypeExtractor",
".",
"createTypeInfo",
"(",
"typeClass",
")",
";",
"}",
"catch",
"(",
"InvalidTypesExcep... | Creates a TypeInformation for the type described by the given class.
<p>This method only works for non-generic types. For generic types, use the
{@link #of(TypeHint)} method.
@param typeClass The class of the type.
@param <T> The generic type.
@return The TypeInformation object for the type described by the hint. | [
"Creates",
"a",
"TypeInformation",
"for",
"the",
"type",
"described",
"by",
"the",
"given",
"class",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/TypeInformation.java#L209-L220 |
123,583 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryArray.java | BinaryArray.calculateFixLengthPartSize | public static int calculateFixLengthPartSize(InternalType type) {
if (type.equals(InternalTypes.BOOLEAN)) {
return 1;
} else if (type.equals(InternalTypes.BYTE)) {
return 1;
} else if (type.equals(InternalTypes.SHORT)) {
return 2;
} else if (type.equals(InternalTypes.INT)) {
return 4;
} else if (t... | java | public static int calculateFixLengthPartSize(InternalType type) {
if (type.equals(InternalTypes.BOOLEAN)) {
return 1;
} else if (type.equals(InternalTypes.BYTE)) {
return 1;
} else if (type.equals(InternalTypes.SHORT)) {
return 2;
} else if (type.equals(InternalTypes.INT)) {
return 4;
} else if (t... | [
"public",
"static",
"int",
"calculateFixLengthPartSize",
"(",
"InternalType",
"type",
")",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"InternalTypes",
".",
"BOOLEAN",
")",
")",
"{",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",... | It store real value when type is primitive.
It store the length and offset of variable-length part when type is string, map, etc. | [
"It",
"store",
"real",
"value",
"when",
"type",
"is",
"primitive",
".",
"It",
"store",
"the",
"length",
"and",
"offset",
"of",
"variable",
"-",
"length",
"part",
"when",
"type",
"is",
"string",
"map",
"etc",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryArray.java#L59-L81 |
123,584 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.getPreferredLocationsBasedOnState | public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocationsBasedOnState() {
TaskManagerLocation priorLocation;
if (currentExecution.getTaskRestore() != null && (priorLocation = getLatestPriorLocation()) != null) {
return Collections.singleton(CompletableFuture.completedFuture(priorLocation));... | java | public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocationsBasedOnState() {
TaskManagerLocation priorLocation;
if (currentExecution.getTaskRestore() != null && (priorLocation = getLatestPriorLocation()) != null) {
return Collections.singleton(CompletableFuture.completedFuture(priorLocation));... | [
"public",
"Collection",
"<",
"CompletableFuture",
"<",
"TaskManagerLocation",
">",
">",
"getPreferredLocationsBasedOnState",
"(",
")",
"{",
"TaskManagerLocation",
"priorLocation",
";",
"if",
"(",
"currentExecution",
".",
"getTaskRestore",
"(",
")",
"!=",
"null",
"&&",... | Gets the preferred location to execute the current task execution attempt, based on the state
that the execution attempt will resume.
@return A size-one collection with the location preference, or null, if there is no
location preference based on the state. | [
"Gets",
"the",
"preferred",
"location",
"to",
"execute",
"the",
"current",
"task",
"execution",
"attempt",
"based",
"on",
"the",
"state",
"that",
"the",
"execution",
"attempt",
"will",
"resume",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L504-L512 |
123,585 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.resetForNewExecution | public Execution resetForNewExecution(final long timestamp, final long originatingGlobalModVersion)
throws GlobalModVersionMismatch {
LOG.debug("Resetting execution vertex {} for new execution.", getTaskNameWithSubtaskIndex());
synchronized (priorExecutions) {
// check if another global modification has been... | java | public Execution resetForNewExecution(final long timestamp, final long originatingGlobalModVersion)
throws GlobalModVersionMismatch {
LOG.debug("Resetting execution vertex {} for new execution.", getTaskNameWithSubtaskIndex());
synchronized (priorExecutions) {
// check if another global modification has been... | [
"public",
"Execution",
"resetForNewExecution",
"(",
"final",
"long",
"timestamp",
",",
"final",
"long",
"originatingGlobalModVersion",
")",
"throws",
"GlobalModVersionMismatch",
"{",
"LOG",
".",
"debug",
"(",
"\"Resetting execution vertex {} for new execution.\"",
",",
"get... | Archives the current Execution and creates a new Execution for this vertex.
<p>This method atomically checks if the ExecutionGraph is still of an expected
global mod. version and replaces the execution if that is the case. If the ExecutionGraph
has increased its global mod. version in the meantime, this operation fail... | [
"Archives",
"the",
"current",
"Execution",
"and",
"creates",
"a",
"new",
"Execution",
"for",
"this",
"vertex",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L586-L648 |
123,586 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.scheduleOrUpdateConsumers | void scheduleOrUpdateConsumers(ResultPartitionID partitionId) {
final Execution execution = currentExecution;
// Abort this request if there was a concurrent reset
if (!partitionId.getProducerId().equals(execution.getAttemptId())) {
return;
}
final IntermediateResultPartition partition = resultPartition... | java | void scheduleOrUpdateConsumers(ResultPartitionID partitionId) {
final Execution execution = currentExecution;
// Abort this request if there was a concurrent reset
if (!partitionId.getProducerId().equals(execution.getAttemptId())) {
return;
}
final IntermediateResultPartition partition = resultPartition... | [
"void",
"scheduleOrUpdateConsumers",
"(",
"ResultPartitionID",
"partitionId",
")",
"{",
"final",
"Execution",
"execution",
"=",
"currentExecution",
";",
"// Abort this request if there was a concurrent reset",
"if",
"(",
"!",
"partitionId",
".",
"getProducerId",
"(",
")",
... | Schedules or updates the consumer tasks of the result partition with the given ID. | [
"Schedules",
"or",
"updates",
"the",
"consumer",
"tasks",
"of",
"the",
"result",
"partition",
"with",
"the",
"given",
"ID",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L707-L732 |
123,587 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.checkInputDependencyConstraints | boolean checkInputDependencyConstraints() {
if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) {
// InputDependencyConstraint == ANY
return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable);
} else {
// InputDependencyConstraint == ALL
return IntStream.range(0, in... | java | boolean checkInputDependencyConstraints() {
if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) {
// InputDependencyConstraint == ANY
return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable);
} else {
// InputDependencyConstraint == ALL
return IntStream.range(0, in... | [
"boolean",
"checkInputDependencyConstraints",
"(",
")",
"{",
"if",
"(",
"getInputDependencyConstraint",
"(",
")",
"==",
"InputDependencyConstraint",
".",
"ANY",
")",
"{",
"// InputDependencyConstraint == ANY",
"return",
"IntStream",
".",
"range",
"(",
"0",
",",
"input... | Check whether the InputDependencyConstraint is satisfied for this vertex.
@return whether the input constraint is satisfied | [
"Check",
"whether",
"the",
"InputDependencyConstraint",
"is",
"satisfied",
"for",
"this",
"vertex",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L767-L775 |
123,588 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.isInputConsumable | boolean isInputConsumable(int inputNumber) {
return Arrays.stream(inputEdges[inputNumber]).map(ExecutionEdge::getSource).anyMatch(
IntermediateResultPartition::isConsumable);
} | java | boolean isInputConsumable(int inputNumber) {
return Arrays.stream(inputEdges[inputNumber]).map(ExecutionEdge::getSource).anyMatch(
IntermediateResultPartition::isConsumable);
} | [
"boolean",
"isInputConsumable",
"(",
"int",
"inputNumber",
")",
"{",
"return",
"Arrays",
".",
"stream",
"(",
"inputEdges",
"[",
"inputNumber",
"]",
")",
".",
"map",
"(",
"ExecutionEdge",
"::",
"getSource",
")",
".",
"anyMatch",
"(",
"IntermediateResultPartition"... | Get whether an input of the vertex is consumable.
An input is consumable when when any partition in it is consumable.
Note that a BLOCKING result partition is only consumable when all partitions in the result are FINISHED.
@return whether the input is consumable | [
"Get",
"whether",
"an",
"input",
"of",
"the",
"vertex",
"is",
"consumable",
".",
"An",
"input",
"is",
"consumable",
"when",
"when",
"any",
"partition",
"in",
"it",
"is",
"consumable",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L785-L788 |
123,589 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.notifyStateTransition | void notifyStateTransition(Execution execution, ExecutionState newState, Throwable error) {
// only forward this notification if the execution is still the current execution
// otherwise we have an outdated execution
if (currentExecution == execution) {
getExecutionGraph().notifyExecutionChange(execution, newS... | java | void notifyStateTransition(Execution execution, ExecutionState newState, Throwable error) {
// only forward this notification if the execution is still the current execution
// otherwise we have an outdated execution
if (currentExecution == execution) {
getExecutionGraph().notifyExecutionChange(execution, newS... | [
"void",
"notifyStateTransition",
"(",
"Execution",
"execution",
",",
"ExecutionState",
"newState",
",",
"Throwable",
"error",
")",
"{",
"// only forward this notification if the execution is still the current execution",
"// otherwise we have an outdated execution",
"if",
"(",
"cur... | Simply forward this notification. | [
"Simply",
"forward",
"this",
"notification",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L813-L819 |
123,590 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java | Serializers.getContainedGenericTypes | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getTypeAt(i);
if (type instanceof CompositeType) {
getContainedGenericTypes((CompositeType<?>) type, target);
} els... | java | private static void getContainedGenericTypes(CompositeType<?> typeInfo, List<GenericTypeInfo<?>> target) {
for (int i = 0; i < typeInfo.getArity(); i++) {
TypeInformation<?> type = typeInfo.getTypeAt(i);
if (type instanceof CompositeType) {
getContainedGenericTypes((CompositeType<?>) type, target);
} els... | [
"private",
"static",
"void",
"getContainedGenericTypes",
"(",
"CompositeType",
"<",
"?",
">",
"typeInfo",
",",
"List",
"<",
"GenericTypeInfo",
"<",
"?",
">",
">",
"target",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"typeInfo",
".",
"ge... | Returns all GenericTypeInfos contained in a composite type.
@param typeInfo {@link CompositeType} | [
"Returns",
"all",
"GenericTypeInfos",
"contained",
"in",
"a",
"composite",
"type",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java#L135-L146 |
123,591 | apache/flink | flink-filesystems/flink-s3-fs-base/src/main/java/org/apache/flink/fs/s3/common/utils/RefCountedTmpFileCreator.java | RefCountedTmpFileCreator.apply | @Override
public RefCountedFile apply(File file) throws IOException {
final File directory = tempDirectories[nextIndex()];
while (true) {
try {
if (file == null) {
final File newFile = new File(directory, ".tmp_" + UUID.randomUUID());
final OutputStream out = Files.newOutputStream(newFile.toPath(... | java | @Override
public RefCountedFile apply(File file) throws IOException {
final File directory = tempDirectories[nextIndex()];
while (true) {
try {
if (file == null) {
final File newFile = new File(directory, ".tmp_" + UUID.randomUUID());
final OutputStream out = Files.newOutputStream(newFile.toPath(... | [
"@",
"Override",
"public",
"RefCountedFile",
"apply",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"final",
"File",
"directory",
"=",
"tempDirectories",
"[",
"nextIndex",
"(",
")",
"]",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"if",
"(... | Gets the next temp file and stream to temp file.
This creates the temp file atomically, making sure no previous file is overwritten.
<p>This method is safe against concurrent use.
@return A pair of temp file and output stream to that temp file.
@throws IOException Thrown, if the stream to the temp file could not be o... | [
"Gets",
"the",
"next",
"temp",
"file",
"and",
"stream",
"to",
"temp",
"file",
".",
"This",
"creates",
"the",
"temp",
"file",
"atomically",
"making",
"sure",
"no",
"previous",
"file",
"is",
"overwritten",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-s3-fs-base/src/main/java/org/apache/flink/fs/s3/common/utils/RefCountedTmpFileCreator.java#L72-L90 |
123,592 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java | AsynchronousFileIOChannel.registerAllRequestsProcessedListener | protected boolean registerAllRequestsProcessedListener(NotificationListener listener) throws IOException {
checkNotNull(listener);
synchronized (listenerLock) {
if (allRequestsProcessedListener == null) {
// There was a race with the processing of the last outstanding request
if (requestsNotReturned.get... | java | protected boolean registerAllRequestsProcessedListener(NotificationListener listener) throws IOException {
checkNotNull(listener);
synchronized (listenerLock) {
if (allRequestsProcessedListener == null) {
// There was a race with the processing of the last outstanding request
if (requestsNotReturned.get... | [
"protected",
"boolean",
"registerAllRequestsProcessedListener",
"(",
"NotificationListener",
"listener",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"listener",
")",
";",
"synchronized",
"(",
"listenerLock",
")",
"{",
"if",
"(",
"allRequestsProcessedListener",... | Registers a listener to be notified when all outstanding requests have been processed.
<p> New requests can arrive right after the listener got notified. Therefore, it is not safe
to assume that the number of outstanding requests is still zero after a notification unless
there was a close right before the listener got... | [
"Registers",
"a",
"listener",
"to",
"be",
"notified",
"when",
"all",
"outstanding",
"requests",
"have",
"been",
"processed",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java#L266-L283 |
123,593 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java | ScatterGatherIteration.createResult | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare some type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformatio... | java | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare some type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformatio... | [
"@",
"Override",
"public",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"VV",
">",
">",
"createResult",
"(",
")",
"{",
"if",
"(",
"this",
".",
"initialVertices",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The input data set has not ... | Creates the operator that represents this scatter-gather graph computation.
@return The operator that represents this scatter-gather graph computation. | [
"Creates",
"the",
"operator",
"that",
"represents",
"this",
"scatter",
"-",
"gather",
"graph",
"computation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java#L137-L179 |
123,594 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java | ScatterGatherIteration.buildScatterFunctionVerticesWithDegrees | private CoGroupOperator<?, ?, Tuple2<K, Message>> buildScatterFunctionVerticesWithDegrees(
DeltaIteration<Vertex<K, Tuple3<VV, LongValue, LongValue>>, Vertex<K, Tuple3<VV, LongValue, LongValue>>> iteration,
TypeInformation<Tuple2<K, Message>> messageTypeInfo, int whereArg, int equalToArg,
DataSet<LongValue> nu... | java | private CoGroupOperator<?, ?, Tuple2<K, Message>> buildScatterFunctionVerticesWithDegrees(
DeltaIteration<Vertex<K, Tuple3<VV, LongValue, LongValue>>, Vertex<K, Tuple3<VV, LongValue, LongValue>>> iteration,
TypeInformation<Tuple2<K, Message>> messageTypeInfo, int whereArg, int equalToArg,
DataSet<LongValue> nu... | [
"private",
"CoGroupOperator",
"<",
"?",
",",
"?",
",",
"Tuple2",
"<",
"K",
",",
"Message",
">",
">",
"buildScatterFunctionVerticesWithDegrees",
"(",
"DeltaIteration",
"<",
"Vertex",
"<",
"K",
",",
"Tuple3",
"<",
"VV",
",",
"LongValue",
",",
"LongValue",
">",... | Method that builds the scatter function using a coGroup operator for a vertex
containing degree information.
It afterwards configures the function with a custom name and broadcast variables.
@param iteration
@param messageTypeInfo
@param whereArg the argument for the where within the coGroup
@param equalToArg the argu... | [
"Method",
"that",
"builds",
"the",
"scatter",
"function",
"using",
"a",
"coGroup",
"operator",
"for",
"a",
"vertex",
"containing",
"degree",
"information",
".",
"It",
"afterwards",
"configures",
"the",
"function",
"with",
"a",
"custom",
"name",
"and",
"broadcast... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java#L497-L523 |
123,595 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java | ScatterGatherIteration.createResultSimpleVertex | private DataSet<Vertex<K, VV>> createResultSimpleVertex(EdgeDirection messagingDirection,
TypeInformation<Tuple2<K, Message>> messageTypeInfo, DataSet<LongValue> numberOfVertices) {
DataSet<Tuple2<K, Message>> messages;
TypeInformation<Vertex<K, VV>> vertexTypes = initialVertices.getType();
final DeltaIterat... | java | private DataSet<Vertex<K, VV>> createResultSimpleVertex(EdgeDirection messagingDirection,
TypeInformation<Tuple2<K, Message>> messageTypeInfo, DataSet<LongValue> numberOfVertices) {
DataSet<Tuple2<K, Message>> messages;
TypeInformation<Vertex<K, VV>> vertexTypes = initialVertices.getType();
final DeltaIterat... | [
"private",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"VV",
">",
">",
"createResultSimpleVertex",
"(",
"EdgeDirection",
"messagingDirection",
",",
"TypeInformation",
"<",
"Tuple2",
"<",
"K",
",",
"Message",
">",
">",
"messageTypeInfo",
",",
"DataSet",
"<",
"Long... | Creates the operator that represents this scatter-gather graph computation for a simple vertex.
@param messagingDirection
@param messageTypeInfo
@param numberOfVertices
@return the operator | [
"Creates",
"the",
"operator",
"that",
"represents",
"this",
"scatter",
"-",
"gather",
"graph",
"computation",
"for",
"a",
"simple",
"vertex",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java#L559-L598 |
123,596 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.setParallelism | public O setParallelism(int parallelism) {
Preconditions.checkArgument(parallelism > 0 || parallelism == ExecutionConfig.PARALLELISM_DEFAULT,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default).");
this.parallelism = parallelism;
@SuppressWarnings("unchecked")
... | java | public O setParallelism(int parallelism) {
Preconditions.checkArgument(parallelism > 0 || parallelism == ExecutionConfig.PARALLELISM_DEFAULT,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default).");
this.parallelism = parallelism;
@SuppressWarnings("unchecked")
... | [
"public",
"O",
"setParallelism",
"(",
"int",
"parallelism",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"parallelism",
">",
"0",
"||",
"parallelism",
"==",
"ExecutionConfig",
".",
"PARALLELISM_DEFAULT",
",",
"\"The parallelism must be at least one, or ExecutionC... | Sets the parallelism for this operator.
The parallelism must be 1 or more.
@param parallelism The parallelism for this operator. A value equal to {@link ExecutionConfig#PARALLELISM_DEFAULT}
will use the system default.
@return The operator with set parallelism. | [
"Sets",
"the",
"parallelism",
"for",
"this",
"operator",
".",
"The",
"parallelism",
"must",
"be",
"1",
"or",
"more",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L121-L130 |
123,597 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.setResources | private O setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources must be not null.");
Preconditions.checkArgument(minResources.isValid() && ... | java | private O setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources must be not null.");
Preconditions.checkArgument(minResources.isValid() && ... | [
"private",
"O",
"setResources",
"(",
"ResourceSpec",
"minResources",
",",
"ResourceSpec",
"preferredResources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"minResources",
",",
"\"The min resources must be not null.\"",
")",
";",
"Preconditions",
".",
"checkNotNu... | Sets the minimum and preferred resources for this operator. This overrides the default resources.
The lower and upper resource limits will be considered in dynamic resource resize feature for future plan.
@param minResources The minimum resources for this operator.
@param preferredResources The preferred resources for... | [
"Sets",
"the",
"minimum",
"and",
"preferred",
"resources",
"for",
"this",
"operator",
".",
"This",
"overrides",
"the",
"default",
"resources",
".",
"The",
"lower",
"and",
"upper",
"resource",
"limits",
"will",
"be",
"considered",
"in",
"dynamic",
"resource",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L145-L158 |
123,598 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.setResources | private O setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
@SuppressWarnin... | java | private O setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
@SuppressWarnin... | [
"private",
"O",
"setResources",
"(",
"ResourceSpec",
"resources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"resources",
",",
"\"The resources must be not null.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"resources",
".",
"isValid",
"(",
")... | Sets the resources for this operator. This overrides the default minimum and preferred resources.
@param resources The resources for this operator.
@return The operator with set minimum and preferred resources. | [
"Sets",
"the",
"resources",
"for",
"this",
"operator",
".",
"This",
"overrides",
"the",
"default",
"minimum",
"and",
"preferred",
"resources",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L166-L176 |
123,599 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/GraphAlgorithmWrappingBase.java | GraphAlgorithmWrappingBase.setParallelism | public GraphAlgorithmWrappingBase<K, VV, EV, R> setParallelism(int parallelism) {
Preconditions.checkArgument(parallelism > 0 || parallelism == PARALLELISM_DEFAULT,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default).");
this.parallelism = parallelism;
return t... | java | public GraphAlgorithmWrappingBase<K, VV, EV, R> setParallelism(int parallelism) {
Preconditions.checkArgument(parallelism > 0 || parallelism == PARALLELISM_DEFAULT,
"The parallelism must be at least one, or ExecutionConfig.PARALLELISM_DEFAULT (use system default).");
this.parallelism = parallelism;
return t... | [
"public",
"GraphAlgorithmWrappingBase",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"R",
">",
"setParallelism",
"(",
"int",
"parallelism",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"parallelism",
">",
"0",
"||",
"parallelism",
"==",
"PARALLELISM_DEFAULT",
... | Set the parallelism for this algorithm's operators. This parameter is
necessary because processing a small amount of data with high operator
parallelism is slow and wasteful with memory and buffers.
<p>Operator parallelism should be set to this given value unless
processing asymptotically more data, in which case the ... | [
"Set",
"the",
"parallelism",
"for",
"this",
"algorithm",
"s",
"operators",
".",
"This",
"parameter",
"is",
"necessary",
"because",
"processing",
"a",
"small",
"amount",
"of",
"data",
"with",
"high",
"operator",
"parallelism",
"is",
"slow",
"and",
"wasteful",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/GraphAlgorithmWrappingBase.java#L59-L66 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.