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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
124,400 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.freeSlot | public int freeSlot(AllocationID allocationId, Throwable cause) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Free slot {}.", taskSlot, cause);
} else {
LOG.info("Free slot {}.", taskSlot);
... | java | public int freeSlot(AllocationID allocationId, Throwable cause) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Free slot {}.", taskSlot, cause);
} else {
LOG.info("Free slot {}.", taskSlot);
... | [
"public",
"int",
"freeSlot",
"(",
"AllocationID",
"allocationId",
",",
"Throwable",
"cause",
")",
"throws",
"SlotNotFoundException",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"allocationId",
")",
";",
"if",
"(",
"taskSlot"... | Tries to free the slot. If the slot is empty it will set the state of the task slot to free
and return its index. If the slot is not empty, then it will set the state of the task slot
to releasing, fail all tasks and return -1.
@param allocationId identifying the task slot to be freed
@param cause to fail the tasks wi... | [
"Tries",
"to",
"free",
"the",
"slot",
".",
"If",
"the",
"slot",
"is",
"empty",
"it",
"will",
"set",
"the",
"state",
"of",
"the",
"task",
"slot",
"to",
"free",
"and",
"return",
"its",
"index",
".",
"If",
"the",
"slot",
"is",
"not",
"empty",
"then",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L301-L352 |
124,401 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.isValidTimeout | public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
checkInit();
return timerService.isValid(allocationId, ticket);
} | java | public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
checkInit();
return timerService.isValid(allocationId, ticket);
} | [
"public",
"boolean",
"isValidTimeout",
"(",
"AllocationID",
"allocationId",
",",
"UUID",
"ticket",
")",
"{",
"checkInit",
"(",
")",
";",
"return",
"timerService",
".",
"isValid",
"(",
"allocationId",
",",
"ticket",
")",
";",
"}"
] | Check whether the timeout with ticket is valid for the given allocation id.
@param allocationId to check against
@param ticket of the timeout
@return True if the timeout is valid; otherwise false | [
"Check",
"whether",
"the",
"timeout",
"with",
"ticket",
"is",
"valid",
"for",
"the",
"given",
"allocation",
"id",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L361-L365 |
124,402 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.isAllocated | public boolean isAllocated(int index, JobID jobId, AllocationID allocationId) {
TaskSlot taskSlot = taskSlots.get(index);
return taskSlot.isAllocated(jobId, allocationId);
} | java | public boolean isAllocated(int index, JobID jobId, AllocationID allocationId) {
TaskSlot taskSlot = taskSlots.get(index);
return taskSlot.isAllocated(jobId, allocationId);
} | [
"public",
"boolean",
"isAllocated",
"(",
"int",
"index",
",",
"JobID",
"jobId",
",",
"AllocationID",
"allocationId",
")",
"{",
"TaskSlot",
"taskSlot",
"=",
"taskSlots",
".",
"get",
"(",
"index",
")",
";",
"return",
"taskSlot",
".",
"isAllocated",
"(",
"jobId... | Check whether the slot for the given index is allocated for the given job and allocation id.
@param index of the task slot
@param jobId for which the task slot should be allocated
@param allocationId which should match the task slot's allocation id
@return True if the given task slot is allocated for the given job and... | [
"Check",
"whether",
"the",
"slot",
"for",
"the",
"given",
"index",
"is",
"allocated",
"for",
"the",
"given",
"job",
"and",
"allocation",
"id",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L375-L379 |
124,403 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.tryMarkSlotActive | public boolean tryMarkSlotActive(JobID jobId, AllocationID allocationId) {
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null && taskSlot.isAllocated(jobId, allocationId)) {
return taskSlot.markActive();
} else {
return false;
}
} | java | public boolean tryMarkSlotActive(JobID jobId, AllocationID allocationId) {
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null && taskSlot.isAllocated(jobId, allocationId)) {
return taskSlot.markActive();
} else {
return false;
}
} | [
"public",
"boolean",
"tryMarkSlotActive",
"(",
"JobID",
"jobId",
",",
"AllocationID",
"allocationId",
")",
"{",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"allocationId",
")",
";",
"if",
"(",
"taskSlot",
"!=",
"null",
"&&",
"taskSlot",
".",
"isAllocated",
... | Try to mark the specified slot as active if it has been allocated by the given job.
@param jobId of the allocated slot
@param allocationId identifying the allocation
@return True if the task slot could be marked active. | [
"Try",
"to",
"mark",
"the",
"specified",
"slot",
"as",
"active",
"if",
"it",
"has",
"been",
"allocated",
"by",
"the",
"given",
"job",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L388-L396 |
124,404 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.addTask | public boolean addTask(Task task) throws SlotNotFoundException, SlotNotActiveException {
Preconditions.checkNotNull(task);
TaskSlot taskSlot = getTaskSlot(task.getAllocationId());
if (taskSlot != null) {
if (taskSlot.isActive(task.getJobID(), task.getAllocationId())) {
if (taskSlot.add(task)) {
task... | java | public boolean addTask(Task task) throws SlotNotFoundException, SlotNotActiveException {
Preconditions.checkNotNull(task);
TaskSlot taskSlot = getTaskSlot(task.getAllocationId());
if (taskSlot != null) {
if (taskSlot.isActive(task.getJobID(), task.getAllocationId())) {
if (taskSlot.add(task)) {
task... | [
"public",
"boolean",
"addTask",
"(",
"Task",
"task",
")",
"throws",
"SlotNotFoundException",
",",
"SlotNotActiveException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"task",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"task",
".",
"getAllocati... | Add the given task to the slot identified by the task's allocation id.
@param task to add to the task slot with the respective allocation id
@throws SlotNotFoundException if there was no slot for the given allocation id
@throws SlotNotActiveException if there was no slot active for task's job and allocation id
@return... | [
"Add",
"the",
"given",
"task",
"to",
"the",
"slot",
"identified",
"by",
"the",
"task",
"s",
"allocation",
"id",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L471-L491 |
124,405 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.removeTask | public Task removeTask(ExecutionAttemptID executionAttemptID) {
checkInit();
TaskSlotMapping taskSlotMapping = taskSlotMappings.remove(executionAttemptID);
if (taskSlotMapping != null) {
Task task = taskSlotMapping.getTask();
TaskSlot taskSlot = taskSlotMapping.getTaskSlot();
taskSlot.remove(task.getE... | java | public Task removeTask(ExecutionAttemptID executionAttemptID) {
checkInit();
TaskSlotMapping taskSlotMapping = taskSlotMappings.remove(executionAttemptID);
if (taskSlotMapping != null) {
Task task = taskSlotMapping.getTask();
TaskSlot taskSlot = taskSlotMapping.getTaskSlot();
taskSlot.remove(task.getE... | [
"public",
"Task",
"removeTask",
"(",
"ExecutionAttemptID",
"executionAttemptID",
")",
"{",
"checkInit",
"(",
")",
";",
"TaskSlotMapping",
"taskSlotMapping",
"=",
"taskSlotMappings",
".",
"remove",
"(",
"executionAttemptID",
")",
";",
"if",
"(",
"taskSlotMapping",
"!... | Remove the task with the given execution attempt id from its task slot. If the owning task
slot is in state releasing and empty after removing the task, the slot is freed via the
slot actions.
@param executionAttemptID identifying the task to remove
@return The removed task if there is any for the given execution atte... | [
"Remove",
"the",
"task",
"with",
"the",
"given",
"execution",
"attempt",
"id",
"from",
"its",
"task",
"slot",
".",
"If",
"the",
"owning",
"task",
"slot",
"is",
"in",
"state",
"releasing",
"and",
"empty",
"after",
"removing",
"the",
"task",
"the",
"slot",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L501-L520 |
124,406 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.getTask | public Task getTask(ExecutionAttemptID executionAttemptID) {
TaskSlotMapping taskSlotMapping = taskSlotMappings.get(executionAttemptID);
if (taskSlotMapping != null) {
return taskSlotMapping.getTask();
} else {
return null;
}
} | java | public Task getTask(ExecutionAttemptID executionAttemptID) {
TaskSlotMapping taskSlotMapping = taskSlotMappings.get(executionAttemptID);
if (taskSlotMapping != null) {
return taskSlotMapping.getTask();
} else {
return null;
}
} | [
"public",
"Task",
"getTask",
"(",
"ExecutionAttemptID",
"executionAttemptID",
")",
"{",
"TaskSlotMapping",
"taskSlotMapping",
"=",
"taskSlotMappings",
".",
"get",
"(",
"executionAttemptID",
")",
";",
"if",
"(",
"taskSlotMapping",
"!=",
"null",
")",
"{",
"return",
... | Get the task for the given execution attempt id. If none could be found, then return null.
@param executionAttemptID identifying the requested task
@return The task for the given execution attempt id if it exist; otherwise null | [
"Get",
"the",
"task",
"for",
"the",
"given",
"execution",
"attempt",
"id",
".",
"If",
"none",
"could",
"be",
"found",
"then",
"return",
"null",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L528-L536 |
124,407 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.properties | public Kafka properties(Properties properties) {
Preconditions.checkNotNull(properties);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
this.kafkaProperties.clear();
properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v));
return this;
} | java | public Kafka properties(Properties properties) {
Preconditions.checkNotNull(properties);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
this.kafkaProperties.clear();
properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v));
return this;
} | [
"public",
"Kafka",
"properties",
"(",
"Properties",
"properties",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"properties",
")",
";",
"if",
"(",
"this",
".",
"kafkaProperties",
"==",
"null",
")",
"{",
"this",
".",
"kafkaProperties",
"=",
"new",
"Has... | Sets the configuration properties for the Kafka consumer. Resets previously set properties.
@param properties The configuration properties for the Kafka consumer. | [
"Sets",
"the",
"configuration",
"properties",
"for",
"the",
"Kafka",
"consumer",
".",
"Resets",
"previously",
"set",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L97-L105 |
124,408 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.property | public Kafka property(String key, String value) {
Preconditions.checkNotNull(key);
Preconditions.checkNotNull(value);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
kafkaProperties.put(key, value);
return this;
} | java | public Kafka property(String key, String value) {
Preconditions.checkNotNull(key);
Preconditions.checkNotNull(value);
if (this.kafkaProperties == null) {
this.kafkaProperties = new HashMap<>();
}
kafkaProperties.put(key, value);
return this;
} | [
"public",
"Kafka",
"property",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"value",
")",
";",
"if",
"(",
"this",
".",
"kafkaProperties",
"=="... | Adds a configuration properties for the Kafka consumer.
@param key property key for the Kafka consumer
@param value property value for the Kafka consumer | [
"Adds",
"a",
"configuration",
"properties",
"for",
"the",
"Kafka",
"consumer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L113-L121 |
124,409 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.startFromSpecificOffsets | public Kafka startFromSpecificOffsets(Map<Integer, Long> specificOffsets) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
this.specificOffsets = Preconditions.checkNotNull(specificOffsets);
return this;
} | java | public Kafka startFromSpecificOffsets(Map<Integer, Long> specificOffsets) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
this.specificOffsets = Preconditions.checkNotNull(specificOffsets);
return this;
} | [
"public",
"Kafka",
"startFromSpecificOffsets",
"(",
"Map",
"<",
"Integer",
",",
"Long",
">",
"specificOffsets",
")",
"{",
"this",
".",
"startupMode",
"=",
"StartupMode",
".",
"SPECIFIC_OFFSETS",
";",
"this",
".",
"specificOffsets",
"=",
"Preconditions",
".",
"ch... | Configures to start reading partitions from specific offsets, set independently for each partition.
Resets previously set offsets.
@param specificOffsets the specified offsets for partitions
@see FlinkKafkaConsumerBase#setStartFromSpecificOffsets(Map) | [
"Configures",
"to",
"start",
"reading",
"partitions",
"from",
"specific",
"offsets",
"set",
"independently",
"for",
"each",
"partition",
".",
"Resets",
"previously",
"set",
"offsets",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L163-L167 |
124,410 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.startFromSpecificOffset | public Kafka startFromSpecificOffset(int partition, long specificOffset) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
if (this.specificOffsets == null) {
this.specificOffsets = new HashMap<>();
}
this.specificOffsets.put(partition, specificOffset);
return this;
} | java | public Kafka startFromSpecificOffset(int partition, long specificOffset) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
if (this.specificOffsets == null) {
this.specificOffsets = new HashMap<>();
}
this.specificOffsets.put(partition, specificOffset);
return this;
} | [
"public",
"Kafka",
"startFromSpecificOffset",
"(",
"int",
"partition",
",",
"long",
"specificOffset",
")",
"{",
"this",
".",
"startupMode",
"=",
"StartupMode",
".",
"SPECIFIC_OFFSETS",
";",
"if",
"(",
"this",
".",
"specificOffsets",
"==",
"null",
")",
"{",
"th... | Configures to start reading partitions from specific offsets and specifies the given offset for
the given partition.
@param partition partition index
@param specificOffset partition offset to start reading from
@see FlinkKafkaConsumerBase#setStartFromSpecificOffsets(Map) | [
"Configures",
"to",
"start",
"reading",
"partitions",
"from",
"specific",
"offsets",
"and",
"specifies",
"the",
"given",
"offset",
"for",
"the",
"given",
"partition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L177-L184 |
124,411 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.sinkPartitionerCustom | public Kafka sinkPartitionerCustom(Class<? extends FlinkKafkaPartitioner> partitionerClass) {
sinkPartitionerType = CONNECTOR_SINK_PARTITIONER_VALUE_CUSTOM;
sinkPartitionerClass = Preconditions.checkNotNull(partitionerClass);
return this;
} | java | public Kafka sinkPartitionerCustom(Class<? extends FlinkKafkaPartitioner> partitionerClass) {
sinkPartitionerType = CONNECTOR_SINK_PARTITIONER_VALUE_CUSTOM;
sinkPartitionerClass = Preconditions.checkNotNull(partitionerClass);
return this;
} | [
"public",
"Kafka",
"sinkPartitionerCustom",
"(",
"Class",
"<",
"?",
"extends",
"FlinkKafkaPartitioner",
">",
"partitionerClass",
")",
"{",
"sinkPartitionerType",
"=",
"CONNECTOR_SINK_PARTITIONER_VALUE_CUSTOM",
";",
"sinkPartitionerClass",
"=",
"Preconditions",
".",
"checkNo... | Configures how to partition records from Flink's partitions into Kafka's partitions.
<p>This strategy allows for a custom partitioner by providing an implementation
of {@link FlinkKafkaPartitioner}. | [
"Configures",
"how",
"to",
"partition",
"records",
"from",
"Flink",
"s",
"partitions",
"into",
"Kafka",
"s",
"partitions",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L243-L247 |
124,412 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java | KeyGroupRangeAssignment.assignKeyToParallelOperator | public static int assignKeyToParallelOperator(Object key, int maxParallelism, int parallelism) {
return computeOperatorIndexForKeyGroup(maxParallelism, parallelism, assignToKeyGroup(key, maxParallelism));
} | java | public static int assignKeyToParallelOperator(Object key, int maxParallelism, int parallelism) {
return computeOperatorIndexForKeyGroup(maxParallelism, parallelism, assignToKeyGroup(key, maxParallelism));
} | [
"public",
"static",
"int",
"assignKeyToParallelOperator",
"(",
"Object",
"key",
",",
"int",
"maxParallelism",
",",
"int",
"parallelism",
")",
"{",
"return",
"computeOperatorIndexForKeyGroup",
"(",
"maxParallelism",
",",
"parallelism",
",",
"assignToKeyGroup",
"(",
"ke... | Assigns the given key to a parallel operator index.
@param key the key to assign
@param maxParallelism the maximum supported parallelism, aka the number of key-groups.
@param parallelism the current parallelism of the operator
@return the index of the parallel operator to which the given key should be routed. | [
"Assigns",
"the",
"given",
"key",
"to",
"a",
"parallel",
"operator",
"index",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java#L47-L49 |
124,413 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java | KeyGroupRangeAssignment.computeKeyGroupRangeForOperatorIndex | public static KeyGroupRange computeKeyGroupRangeForOperatorIndex(
int maxParallelism,
int parallelism,
int operatorIndex) {
checkParallelismPreconditions(parallelism);
checkParallelismPreconditions(maxParallelism);
Preconditions.checkArgument(maxParallelism >= parallelism,
"Maximum parallelism must not... | java | public static KeyGroupRange computeKeyGroupRangeForOperatorIndex(
int maxParallelism,
int parallelism,
int operatorIndex) {
checkParallelismPreconditions(parallelism);
checkParallelismPreconditions(maxParallelism);
Preconditions.checkArgument(maxParallelism >= parallelism,
"Maximum parallelism must not... | [
"public",
"static",
"KeyGroupRange",
"computeKeyGroupRangeForOperatorIndex",
"(",
"int",
"maxParallelism",
",",
"int",
"parallelism",
",",
"int",
"operatorIndex",
")",
"{",
"checkParallelismPreconditions",
"(",
"parallelism",
")",
";",
"checkParallelismPreconditions",
"(",
... | Computes the range of key-groups that are assigned to a given operator under the given parallelism and maximum
parallelism.
IMPORTANT: maxParallelism must be <= Short.MAX_VALUE to avoid rounding problems in this method. If we ever want
to go beyond this boundary, this method must perform arithmetic on long values.
@p... | [
"Computes",
"the",
"range",
"of",
"key",
"-",
"groups",
"that",
"are",
"assigned",
"to",
"a",
"given",
"operator",
"under",
"the",
"given",
"parallelism",
"and",
"maximum",
"parallelism",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java#L85-L99 |
124,414 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java | KeyGroupRangeAssignment.computeDefaultMaxParallelism | public static int computeDefaultMaxParallelism(int operatorParallelism) {
checkParallelismPreconditions(operatorParallelism);
return Math.min(
Math.max(
MathUtils.roundUpToPowerOfTwo(operatorParallelism + (operatorParallelism / 2)),
DEFAULT_LOWER_BOUND_MAX_PARALLELISM),
UPPER_BOUND_MAX_PARALLE... | java | public static int computeDefaultMaxParallelism(int operatorParallelism) {
checkParallelismPreconditions(operatorParallelism);
return Math.min(
Math.max(
MathUtils.roundUpToPowerOfTwo(operatorParallelism + (operatorParallelism / 2)),
DEFAULT_LOWER_BOUND_MAX_PARALLELISM),
UPPER_BOUND_MAX_PARALLE... | [
"public",
"static",
"int",
"computeDefaultMaxParallelism",
"(",
"int",
"operatorParallelism",
")",
"{",
"checkParallelismPreconditions",
"(",
"operatorParallelism",
")",
";",
"return",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"MathUtils",
".",
"roundUpToPow... | Computes a default maximum parallelism from the operator parallelism. This is used in case the user has not
explicitly configured a maximum parallelism to still allow a certain degree of scale-up.
@param operatorParallelism the operator parallelism as basis for computation.
@return the computed default maximum paralle... | [
"Computes",
"a",
"default",
"maximum",
"parallelism",
"from",
"the",
"operator",
"parallelism",
".",
"This",
"is",
"used",
"in",
"case",
"the",
"user",
"has",
"not",
"explicitly",
"configured",
"a",
"maximum",
"parallelism",
"to",
"still",
"allow",
"a",
"certa... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeAssignment.java#L126-L135 |
124,415 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java | LocalExecutor.executePlan | @Override
public JobExecutionResult executePlan(Plan plan) throws Exception {
if (plan == null) {
throw new IllegalArgumentException("The plan may not be null.");
}
synchronized (this.lock) {
// check if we start a session dedicated for this execution
final boolean shutDownAtEnd;
if (jobExecutorSe... | java | @Override
public JobExecutionResult executePlan(Plan plan) throws Exception {
if (plan == null) {
throw new IllegalArgumentException("The plan may not be null.");
}
synchronized (this.lock) {
// check if we start a session dedicated for this execution
final boolean shutDownAtEnd;
if (jobExecutorSe... | [
"@",
"Override",
"public",
"JobExecutionResult",
"executePlan",
"(",
"Plan",
"plan",
")",
"throws",
"Exception",
"{",
"if",
"(",
"plan",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The plan may not be null.\"",
")",
";",
"}",
"syn... | Executes the given program on a local runtime and waits for the job to finish.
<p>If the executor has not been started before, this starts the executor and shuts it down
after the job finished. If the job runs in session mode, the executor is kept alive until
no more references to the executor exist.</p>
@param plan ... | [
"Executes",
"the",
"given",
"program",
"on",
"a",
"local",
"runtime",
"and",
"waits",
"for",
"the",
"job",
"to",
"finish",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java#L180-L230 |
124,416 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java | LocalExecutor.execute | public static JobExecutionResult execute(Program pa, String... args) throws Exception {
return execute(pa.getPlan(args));
} | java | public static JobExecutionResult execute(Program pa, String... args) throws Exception {
return execute(pa.getPlan(args));
} | [
"public",
"static",
"JobExecutionResult",
"execute",
"(",
"Program",
"pa",
",",
"String",
"...",
"args",
")",
"throws",
"Exception",
"{",
"return",
"execute",
"(",
"pa",
".",
"getPlan",
"(",
"args",
")",
")",
";",
"}"
] | Executes the given program.
@param pa The program.
@param args The parameters.
@return The execution result of the program.
@throws Exception Thrown, if either the startup of the local execution context, or the execution
caused an exception. | [
"Executes",
"the",
"given",
"program",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java#L274-L276 |
124,417 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java | LocalExecutor.optimizerPlanAsJSON | public static String optimizerPlanAsJSON(Plan plan) throws Exception {
final int parallelism = plan.getDefaultParallelism() == ExecutionConfig.PARALLELISM_DEFAULT ? 1 : plan.getDefaultParallelism();
Optimizer pc = new Optimizer(new DataStatistics(), new Configuration());
pc.setDefaultParallelism(parallelism);
... | java | public static String optimizerPlanAsJSON(Plan plan) throws Exception {
final int parallelism = plan.getDefaultParallelism() == ExecutionConfig.PARALLELISM_DEFAULT ? 1 : plan.getDefaultParallelism();
Optimizer pc = new Optimizer(new DataStatistics(), new Configuration());
pc.setDefaultParallelism(parallelism);
... | [
"public",
"static",
"String",
"optimizerPlanAsJSON",
"(",
"Plan",
"plan",
")",
"throws",
"Exception",
"{",
"final",
"int",
"parallelism",
"=",
"plan",
".",
"getDefaultParallelism",
"(",
")",
"==",
"ExecutionConfig",
".",
"PARALLELISM_DEFAULT",
"?",
"1",
":",
"pl... | Creates a JSON representation of the given dataflow's execution plan.
@param plan The dataflow plan.
@return The dataflow's execution plan, as a JSON string.
@throws Exception Thrown, if the optimization process that creates the execution plan failed. | [
"Creates",
"a",
"JSON",
"representation",
"of",
"the",
"given",
"dataflow",
"s",
"execution",
"plan",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java#L298-L306 |
124,418 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java | LocalExecutor.getPlanAsJSON | public static String getPlanAsJSON(Plan plan) {
List<DataSinkNode> sinks = Optimizer.createPreOptimizedPlan(plan);
return new PlanJSONDumpGenerator().getPactPlanAsJSON(sinks);
} | java | public static String getPlanAsJSON(Plan plan) {
List<DataSinkNode> sinks = Optimizer.createPreOptimizedPlan(plan);
return new PlanJSONDumpGenerator().getPactPlanAsJSON(sinks);
} | [
"public",
"static",
"String",
"getPlanAsJSON",
"(",
"Plan",
"plan",
")",
"{",
"List",
"<",
"DataSinkNode",
">",
"sinks",
"=",
"Optimizer",
".",
"createPreOptimizedPlan",
"(",
"plan",
")",
";",
"return",
"new",
"PlanJSONDumpGenerator",
"(",
")",
".",
"getPactPl... | Creates a JSON representation of the given dataflow plan.
@param plan The dataflow plan.
@return The dataflow plan (prior to optimization) as a JSON string. | [
"Creates",
"a",
"JSON",
"representation",
"of",
"the",
"given",
"dataflow",
"plan",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java#L314-L317 |
124,419 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/MessageParameter.java | MessageParameter.resolve | public final void resolve(X value) {
Preconditions.checkState(!resolved, "This parameter was already resolved.");
this.value = Preconditions.checkNotNull(value);
this.resolved = true;
} | java | public final void resolve(X value) {
Preconditions.checkState(!resolved, "This parameter was already resolved.");
this.value = Preconditions.checkNotNull(value);
this.resolved = true;
} | [
"public",
"final",
"void",
"resolve",
"(",
"X",
"value",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"resolved",
",",
"\"This parameter was already resolved.\"",
")",
";",
"this",
".",
"value",
"=",
"Preconditions",
".",
"checkNotNull",
"(",
"value",... | Resolves this parameter for the given value.
@param value value to resolve this parameter with | [
"Resolves",
"this",
"parameter",
"for",
"the",
"given",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/MessageParameter.java#L64-L68 |
124,420 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.createShardConsumer | protected ShardConsumer createShardConsumer(
Integer subscribedShardStateIndex,
StreamShardHandle subscribedShard,
SequenceNumber lastSequenceNum,
ShardMetricsReporter shardMetricsReporter) {
return new ShardConsumer<>(
this,
subscribedShardStateIndex,
subscribedShard,
lastSequenceNum,
this.kin... | java | protected ShardConsumer createShardConsumer(
Integer subscribedShardStateIndex,
StreamShardHandle subscribedShard,
SequenceNumber lastSequenceNum,
ShardMetricsReporter shardMetricsReporter) {
return new ShardConsumer<>(
this,
subscribedShardStateIndex,
subscribedShard,
lastSequenceNum,
this.kin... | [
"protected",
"ShardConsumer",
"createShardConsumer",
"(",
"Integer",
"subscribedShardStateIndex",
",",
"StreamShardHandle",
"subscribedShard",
",",
"SequenceNumber",
"lastSequenceNum",
",",
"ShardMetricsReporter",
"shardMetricsReporter",
")",
"{",
"return",
"new",
"ShardConsume... | Create a new shard consumer.
Override this method to customize shard consumer behavior in subclasses.
@param subscribedShardStateIndex the state index of the shard this consumer is subscribed to
@param subscribedShard the shard this consumer is subscribed to
@param lastSequenceNum the sequence number in the shard to st... | [
"Create",
"a",
"new",
"shard",
"consumer",
".",
"Override",
"this",
"method",
"to",
"customize",
"shard",
"consumer",
"behavior",
"in",
"subclasses",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L298-L310 |
124,421 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.snapshotState | public HashMap<StreamShardMetadata, SequenceNumber> snapshotState() {
// this method assumes that the checkpoint lock is held
assert Thread.holdsLock(checkpointLock);
HashMap<StreamShardMetadata, SequenceNumber> stateSnapshot = new HashMap<>();
for (KinesisStreamShardState shardWithState : subscribedShardsStat... | java | public HashMap<StreamShardMetadata, SequenceNumber> snapshotState() {
// this method assumes that the checkpoint lock is held
assert Thread.holdsLock(checkpointLock);
HashMap<StreamShardMetadata, SequenceNumber> stateSnapshot = new HashMap<>();
for (KinesisStreamShardState shardWithState : subscribedShardsStat... | [
"public",
"HashMap",
"<",
"StreamShardMetadata",
",",
"SequenceNumber",
">",
"snapshotState",
"(",
")",
"{",
"// this method assumes that the checkpoint lock is held",
"assert",
"Thread",
".",
"holdsLock",
"(",
"checkpointLock",
")",
";",
"HashMap",
"<",
"StreamShardMetad... | Creates a snapshot of the current last processed sequence numbers of each subscribed shard.
@return state snapshot | [
"Creates",
"a",
"snapshot",
"of",
"the",
"current",
"last",
"processed",
"sequence",
"numbers",
"of",
"each",
"subscribed",
"shard",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L471-L480 |
124,422 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.advanceLastDiscoveredShardOfStream | public void advanceLastDiscoveredShardOfStream(String stream, String shardId) {
String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream);
// the update is valid only if the given shard id is greater
// than the previous last seen shard id of the stream
if (lastSeenShardIdOfSt... | java | public void advanceLastDiscoveredShardOfStream(String stream, String shardId) {
String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream);
// the update is valid only if the given shard id is greater
// than the previous last seen shard id of the stream
if (lastSeenShardIdOfSt... | [
"public",
"void",
"advanceLastDiscoveredShardOfStream",
"(",
"String",
"stream",
",",
"String",
"shardId",
")",
"{",
"String",
"lastSeenShardIdOfStream",
"=",
"this",
".",
"subscribedStreamsToLastDiscoveredShardIds",
".",
"get",
"(",
"stream",
")",
";",
"// the update i... | Updates the last discovered shard of a subscribed stream; only updates if the update is valid. | [
"Updates",
"the",
"last",
"discovered",
"shard",
"of",
"a",
"subscribed",
"stream",
";",
"only",
"updates",
"if",
"the",
"update",
"is",
"valid",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L519-L530 |
124,423 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.registerNewSubscribedShardState | public int registerNewSubscribedShardState(KinesisStreamShardState newSubscribedShardState) {
synchronized (checkpointLock) {
subscribedShardsState.add(newSubscribedShardState);
// If a registered shard has initial state that is not SENTINEL_SHARD_ENDING_SEQUENCE_NUM (will be the case
// if the consumer had... | java | public int registerNewSubscribedShardState(KinesisStreamShardState newSubscribedShardState) {
synchronized (checkpointLock) {
subscribedShardsState.add(newSubscribedShardState);
// If a registered shard has initial state that is not SENTINEL_SHARD_ENDING_SEQUENCE_NUM (will be the case
// if the consumer had... | [
"public",
"int",
"registerNewSubscribedShardState",
"(",
"KinesisStreamShardState",
"newSubscribedShardState",
")",
"{",
"synchronized",
"(",
"checkpointLock",
")",
"{",
"subscribedShardsState",
".",
"add",
"(",
"newSubscribedShardState",
")",
";",
"// If a registered shard h... | Register a new subscribed shard state.
@param newSubscribedShardState the new shard state that this fetcher is to be subscribed to | [
"Register",
"a",
"new",
"subscribed",
"shard",
"state",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L670-L699 |
124,424 | apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java | KinesisDataFetcher.emitWatermark | @VisibleForTesting
protected void emitWatermark() {
LOG.debug("Evaluating watermark for subtask {} time {}", indexOfThisConsumerSubtask, getCurrentTimeMillis());
long potentialWatermark = Long.MAX_VALUE;
long idleTime =
(shardIdleIntervalMillis > 0)
? getCurrentTimeMillis() - shardIdleIntervalMillis
:... | java | @VisibleForTesting
protected void emitWatermark() {
LOG.debug("Evaluating watermark for subtask {} time {}", indexOfThisConsumerSubtask, getCurrentTimeMillis());
long potentialWatermark = Long.MAX_VALUE;
long idleTime =
(shardIdleIntervalMillis > 0)
? getCurrentTimeMillis() - shardIdleIntervalMillis
:... | [
"@",
"VisibleForTesting",
"protected",
"void",
"emitWatermark",
"(",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Evaluating watermark for subtask {} time {}\"",
",",
"indexOfThisConsumerSubtask",
",",
"getCurrentTimeMillis",
"(",
")",
")",
";",
"long",
"potentialWatermark",
... | Called periodically to emit a watermark. Checks all shards for the current event time
watermark, and possibly emits the next watermark.
<p>Shards that have not received an update for a certain interval are considered inactive so as
to not hold back the watermark indefinitely. When all shards are inactive, the subtask ... | [
"Called",
"periodically",
"to",
"emit",
"a",
"watermark",
".",
"Checks",
"all",
"shards",
"for",
"the",
"current",
"event",
"time",
"watermark",
"and",
"possibly",
"emits",
"the",
"next",
"watermark",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L720-L752 |
124,425 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphAnalyticBase.java | GraphAnalyticBase.setParallelism | public GraphAnalyticBase<K, VV, EV, T> 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 this;
} | java | public GraphAnalyticBase<K, VV, EV, T> 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 this;
} | [
"public",
"GraphAnalyticBase",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"T",
">",
"setParallelism",
"(",
"int",
"parallelism",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"parallelism",
">",
"0",
"||",
"parallelism",
"==",
"PARALLELISM_DEFAULT",
",",
"... | Set the parallelism for this analytic'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 d... | [
"Set",
"the",
"parallelism",
"for",
"this",
"analytic",
"s",
"operators",
".",
"This",
"parameter",
"is",
"necessary",
"because",
"processing",
"a",
"small",
"amount",
"of",
"data",
"with",
"high",
"operator",
"parallelism",
"is",
"slow",
"and",
"wasteful",
"w... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphAnalyticBase.java#L60-L67 |
124,426 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java | AkkaRpcServiceUtils.createRandomName | public static String createRandomName(String prefix) {
Preconditions.checkNotNull(prefix, "Prefix must not be null.");
long nameOffset;
// obtain the next name offset by incrementing it atomically
do {
nameOffset = nextNameOffset.get();
} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L))... | java | public static String createRandomName(String prefix) {
Preconditions.checkNotNull(prefix, "Prefix must not be null.");
long nameOffset;
// obtain the next name offset by incrementing it atomically
do {
nameOffset = nextNameOffset.get();
} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L))... | [
"public",
"static",
"String",
"createRandomName",
"(",
"String",
"prefix",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"prefix",
",",
"\"Prefix must not be null.\"",
")",
";",
"long",
"nameOffset",
";",
"// obtain the next name offset by incrementing it atomically"... | Creates a random name of the form prefix_X, where X is an increasing number.
@param prefix Prefix string to prepend to the monotonically increasing name offset number
@return A random name of the form prefix_X where X is an increasing number | [
"Creates",
"a",
"random",
"name",
"of",
"the",
"form",
"prefix_X",
"where",
"X",
"is",
"an",
"increasing",
"number",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java#L224-L235 |
124,427 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java | AbstractStreamOperator.dispose | @Override
public void dispose() throws Exception {
Exception exception = null;
StreamTask<?, ?> containingTask = getContainingTask();
CloseableRegistry taskCloseableRegistry = containingTask != null ?
containingTask.getCancelables() :
null;
try {
if (taskCloseableRegistry == null ||
taskCloseab... | java | @Override
public void dispose() throws Exception {
Exception exception = null;
StreamTask<?, ?> containingTask = getContainingTask();
CloseableRegistry taskCloseableRegistry = containingTask != null ?
containingTask.getCancelables() :
null;
try {
if (taskCloseableRegistry == null ||
taskCloseab... | [
"@",
"Override",
"public",
"void",
"dispose",
"(",
")",
"throws",
"Exception",
"{",
"Exception",
"exception",
"=",
"null",
";",
"StreamTask",
"<",
"?",
",",
"?",
">",
"containingTask",
"=",
"getContainingTask",
"(",
")",
";",
"CloseableRegistry",
"taskCloseabl... | This method is called at the very end of the operator's life, both in the case of a successful
completion of the operation, and in the case of a failure and canceling.
<p>This method is expected to make a thorough effort to release all resources
that the operator has acquired. | [
"This",
"method",
"is",
"called",
"at",
"the",
"very",
"end",
"of",
"the",
"operator",
"s",
"life",
"both",
"in",
"the",
"case",
"of",
"a",
"successful",
"completion",
"of",
"the",
"operation",
"and",
"in",
"the",
"case",
"of",
"a",
"failure",
"and",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java#L324-L371 |
124,428 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java | AbstractStreamOperator.snapshotState | public void snapshotState(StateSnapshotContext context) throws Exception {
final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
//TODO all of this can be removed once heap-based timers are integrated with RocksDB incremental snapshots
if (keyedStateBackend instanceof AbstractKeyedStateBackend &&... | java | public void snapshotState(StateSnapshotContext context) throws Exception {
final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
//TODO all of this can be removed once heap-based timers are integrated with RocksDB incremental snapshots
if (keyedStateBackend instanceof AbstractKeyedStateBackend &&... | [
"public",
"void",
"snapshotState",
"(",
"StateSnapshotContext",
"context",
")",
"throws",
"Exception",
"{",
"final",
"KeyedStateBackend",
"<",
"?",
">",
"keyedStateBackend",
"=",
"getKeyedStateBackend",
"(",
")",
";",
"//TODO all of this can be removed once heap-based timer... | Stream operators with state, which want to participate in a snapshot need to override this hook method.
@param context context that provides information and means required for taking a snapshot | [
"Stream",
"operators",
"with",
"state",
"which",
"want",
"to",
"participate",
"in",
"a",
"snapshot",
"need",
"to",
"override",
"this",
"hook",
"method",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java#L433-L468 |
124,429 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putProperties | public void putProperties(Map<String, String> properties) {
for (Map.Entry<String, String> property : properties.entrySet()) {
put(property.getKey(), property.getValue());
}
} | java | public void putProperties(Map<String, String> properties) {
for (Map.Entry<String, String> property : properties.entrySet()) {
put(property.getKey(), property.getValue());
}
} | [
"public",
"void",
"putProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"property",
":",
"properties",
".",
"entrySet",
"(",
")",
")",
"{",
"put",
"... | Adds a set of properties. | [
"Adds",
"a",
"set",
"of",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L91-L95 |
124,430 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putProperties | public void putProperties(DescriptorProperties otherProperties) {
for (Map.Entry<String, String> otherProperty : otherProperties.properties.entrySet()) {
put(otherProperty.getKey(), otherProperty.getValue());
}
} | java | public void putProperties(DescriptorProperties otherProperties) {
for (Map.Entry<String, String> otherProperty : otherProperties.properties.entrySet()) {
put(otherProperty.getKey(), otherProperty.getValue());
}
} | [
"public",
"void",
"putProperties",
"(",
"DescriptorProperties",
"otherProperties",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"otherProperty",
":",
"otherProperties",
".",
"properties",
".",
"entrySet",
"(",
")",
")",
"{",
... | Adds a set of descriptor properties. | [
"Adds",
"a",
"set",
"of",
"descriptor",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L100-L104 |
124,431 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putClass | public void putClass(String key, Class<?> clazz) {
checkNotNull(key);
checkNotNull(clazz);
final String error = InstantiationUtil.checkForInstantiationError(clazz);
if (error != null) {
throw new ValidationException("Class '" + clazz.getName() + "' is not supported: " + error);
}
put(key, clazz.getName()... | java | public void putClass(String key, Class<?> clazz) {
checkNotNull(key);
checkNotNull(clazz);
final String error = InstantiationUtil.checkForInstantiationError(clazz);
if (error != null) {
throw new ValidationException("Class '" + clazz.getName() + "' is not supported: " + error);
}
put(key, clazz.getName()... | [
"public",
"void",
"putClass",
"(",
"String",
"key",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"clazz",
")",
";",
"final",
"String",
"error",
"=",
"InstantiationUtil",
".",
"checkForInstantiat... | Adds a class under the given key. | [
"Adds",
"a",
"class",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L109-L117 |
124,432 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putString | public void putString(String key, String str) {
checkNotNull(key);
checkNotNull(str);
put(key, str);
} | java | public void putString(String key, String str) {
checkNotNull(key);
checkNotNull(str);
put(key, str);
} | [
"public",
"void",
"putString",
"(",
"String",
"key",
",",
"String",
"str",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"str",
")",
";",
"put",
"(",
"key",
",",
"str",
")",
";",
"}"
] | Adds a string under the given key. | [
"Adds",
"a",
"string",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L122-L126 |
124,433 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putBoolean | public void putBoolean(String key, boolean b) {
checkNotNull(key);
put(key, Boolean.toString(b));
} | java | public void putBoolean(String key, boolean b) {
checkNotNull(key);
put(key, Boolean.toString(b));
} | [
"public",
"void",
"putBoolean",
"(",
"String",
"key",
",",
"boolean",
"b",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"put",
"(",
"key",
",",
"Boolean",
".",
"toString",
"(",
"b",
")",
")",
";",
"}"
] | Adds a boolean under the given key. | [
"Adds",
"a",
"boolean",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L131-L134 |
124,434 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putLong | public void putLong(String key, long l) {
checkNotNull(key);
put(key, Long.toString(l));
} | java | public void putLong(String key, long l) {
checkNotNull(key);
put(key, Long.toString(l));
} | [
"public",
"void",
"putLong",
"(",
"String",
"key",
",",
"long",
"l",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"put",
"(",
"key",
",",
"Long",
".",
"toString",
"(",
"l",
")",
")",
";",
"}"
] | Adds a long under the given key. | [
"Adds",
"a",
"long",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L139-L142 |
124,435 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putInt | public void putInt(String key, int i) {
checkNotNull(key);
put(key, Integer.toString(i));
} | java | public void putInt(String key, int i) {
checkNotNull(key);
put(key, Integer.toString(i));
} | [
"public",
"void",
"putInt",
"(",
"String",
"key",
",",
"int",
"i",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"put",
"(",
"key",
",",
"Integer",
".",
"toString",
"(",
"i",
")",
")",
";",
"}"
] | Adds an integer under the given key. | [
"Adds",
"an",
"integer",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L147-L150 |
124,436 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putCharacter | public void putCharacter(String key, char c) {
checkNotNull(key);
put(key, Character.toString(c));
} | java | public void putCharacter(String key, char c) {
checkNotNull(key);
put(key, Character.toString(c));
} | [
"public",
"void",
"putCharacter",
"(",
"String",
"key",
",",
"char",
"c",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"put",
"(",
"key",
",",
"Character",
".",
"toString",
"(",
"c",
")",
")",
";",
"}"
] | Adds a character under the given key. | [
"Adds",
"a",
"character",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L155-L158 |
124,437 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putTableSchema | public void putTableSchema(String key, TableSchema schema) {
checkNotNull(key);
checkNotNull(schema);
final String[] fieldNames = schema.getFieldNames();
final TypeInformation<?>[] fieldTypes = schema.getFieldTypes();
final List<List<String>> values = new ArrayList<>();
for (int i = 0; i < schema.getField... | java | public void putTableSchema(String key, TableSchema schema) {
checkNotNull(key);
checkNotNull(schema);
final String[] fieldNames = schema.getFieldNames();
final TypeInformation<?>[] fieldTypes = schema.getFieldTypes();
final List<List<String>> values = new ArrayList<>();
for (int i = 0; i < schema.getField... | [
"public",
"void",
"putTableSchema",
"(",
"String",
"key",
",",
"TableSchema",
"schema",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"schema",
")",
";",
"final",
"String",
"[",
"]",
"fieldNames",
"=",
"schema",
".",
"getFieldNames",
... | Adds a table schema under the given key. | [
"Adds",
"a",
"table",
"schema",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L163-L179 |
124,438 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putIndexedVariableProperties | public void putIndexedVariableProperties(String key, List<Map<String, String>> subKeyValues) {
checkNotNull(key);
checkNotNull(subKeyValues);
for (int idx = 0; idx < subKeyValues.size(); idx++) {
final Map<String, String> values = subKeyValues.get(idx);
for (Map.Entry<String, String> value : values.entrySet... | java | public void putIndexedVariableProperties(String key, List<Map<String, String>> subKeyValues) {
checkNotNull(key);
checkNotNull(subKeyValues);
for (int idx = 0; idx < subKeyValues.size(); idx++) {
final Map<String, String> values = subKeyValues.get(idx);
for (Map.Entry<String, String> value : values.entrySet... | [
"public",
"void",
"putIndexedVariableProperties",
"(",
"String",
"key",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"subKeyValues",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"subKeyValues",
")",
";",
"for",
"... | Adds an indexed mapping of properties under a common key.
<p>For example:
<pre>
schema.fields.0.type = INT, schema.fields.0.name = test
schema.fields.1.name = test2
</pre>
<p>The arity of the subKeyValues can differ. | [
"Adds",
"an",
"indexed",
"mapping",
"of",
"properties",
"under",
"a",
"common",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L229-L238 |
124,439 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/IntermediateResult.java | IntermediateResult.getPartitionById | public IntermediateResultPartition getPartitionById(IntermediateResultPartitionID resultPartitionId) {
// Looks ups the partition number via the helper map and returns the
// partition. Currently, this happens infrequently enough that we could
// consider removing the map and scanning the partitions on every look... | java | public IntermediateResultPartition getPartitionById(IntermediateResultPartitionID resultPartitionId) {
// Looks ups the partition number via the helper map and returns the
// partition. Currently, this happens infrequently enough that we could
// consider removing the map and scanning the partitions on every look... | [
"public",
"IntermediateResultPartition",
"getPartitionById",
"(",
"IntermediateResultPartitionID",
"resultPartitionId",
")",
"{",
"// Looks ups the partition number via the helper map and returns the",
"// partition. Currently, this happens infrequently enough that we could",
"// consider removi... | Returns the partition with the given ID.
@param resultPartitionId ID of the partition to look up
@throws NullPointerException If partition ID <code>null</code>
@throws IllegalArgumentException Thrown if unknown partition ID
@return Intermediate result partition with the given ID | [
"Returns",
"the",
"partition",
"with",
"the",
"given",
"ID",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/IntermediateResult.java#L120-L132 |
124,440 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.get | public String get(String key) {
addToDefaults(key, null);
unrequestedParameters.remove(key);
return data.get(key);
} | java | public String get(String key) {
addToDefaults(key, null);
unrequestedParameters.remove(key);
return data.get(key);
} | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"unrequestedParameters",
".",
"remove",
"(",
"key",
")",
";",
"return",
"data",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Returns the String value for the given key.
If the key does not exist it will return null. | [
"Returns",
"the",
"String",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"it",
"will",
"return",
"null",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L237-L241 |
124,441 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.get | public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
}
} | java | public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
}
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"defaultValue",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"re... | Returns the String value for the given key.
If the key does not exist it will return the given default value. | [
"Returns",
"the",
"String",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"it",
"will",
"return",
"the",
"given",
"default",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L260-L268 |
124,442 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.has | public boolean has(String value) {
addToDefaults(value, null);
unrequestedParameters.remove(value);
return data.containsKey(value);
} | java | public boolean has(String value) {
addToDefaults(value, null);
unrequestedParameters.remove(value);
return data.containsKey(value);
} | [
"public",
"boolean",
"has",
"(",
"String",
"value",
")",
"{",
"addToDefaults",
"(",
"value",
",",
"null",
")",
";",
"unrequestedParameters",
".",
"remove",
"(",
"value",
")",
";",
"return",
"data",
".",
"containsKey",
"(",
"value",
")",
";",
"}"
] | Check if value is set. | [
"Check",
"if",
"value",
"is",
"set",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L273-L277 |
124,443 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getInt | public int getInt(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Integer.parseInt(value);
} | java | public int getInt(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Integer.parseInt(value);
} | [
"public",
"int",
"getInt",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"}"
] | Returns the Integer value for the given key.
The method fails if the key does not exist or the value is not an Integer. | [
"Returns",
"the",
"Integer",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"or",
"the",
"value",
"is",
"not",
"an",
"Integer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L285-L289 |
124,444 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getLong | public long getLong(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Long.parseLong(value);
} | java | public long getLong(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Long.parseLong(value);
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Long",
".",
"parseLong",
"(",
"value",
")",
";",
"}"
] | Returns the Long value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Long",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L310-L314 |
124,445 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getFloat | public float getFloat(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Float.valueOf(value);
} | java | public float getFloat(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Float.valueOf(value);
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Float",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Float value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Float",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L335-L339 |
124,446 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getFloat | public float getFloat(String key, float defaultValue) {
addToDefaults(key, Float.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Float.valueOf(value);
}
} | java | public float getFloat(String key, float defaultValue) {
addToDefaults(key, Float.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Float.valueOf(value);
}
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
",",
"float",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Float",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",... | Returns the Float value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Float. | [
"Returns",
"the",
"Float",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"fails",
"if",
"the",
"value",
"is",
"not",
"a",
"Floa... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L345-L353 |
124,447 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getDouble | public double getDouble(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Double.valueOf(value);
} | java | public double getDouble(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Double.valueOf(value);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Double",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Double value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Double",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L361-L365 |
124,448 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getDouble | public double getDouble(String key, double defaultValue) {
addToDefaults(key, Double.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Double.valueOf(value);
}
} | java | public double getDouble(String key, double defaultValue) {
addToDefaults(key, Double.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Double.valueOf(value);
}
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Double",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
... | Returns the Double value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Double. | [
"Returns",
"the",
"Double",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"fails",
"if",
"the",
"value",
"is",
"not",
"a",
"Dou... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L371-L379 |
124,449 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getBoolean | public boolean getBoolean(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Boolean.valueOf(value);
} | java | public boolean getBoolean(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Boolean.valueOf(value);
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Boolean value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Boolean",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L387-L391 |
124,450 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
addToDefaults(key, Boolean.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Boolean.valueOf(value);
}
} | java | public boolean getBoolean(String key, boolean defaultValue) {
addToDefaults(key, Boolean.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Boolean.valueOf(value);
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Boolean",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if"... | Returns the Boolean value for the given key. If the key does not exists it will return the default value given.
The method returns whether the string of the value is "true" ignoring cases. | [
"Returns",
"the",
"Boolean",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"returns",
"whether",
"the",
"string",
"of",
"the",
"v... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L397-L405 |
124,451 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getShort | public short getShort(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Short.valueOf(value);
} | java | public short getShort(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Short.valueOf(value);
} | [
"public",
"short",
"getShort",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Short",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Short value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Short",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L413-L417 |
124,452 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getShort | public short getShort(String key, short defaultValue) {
addToDefaults(key, Short.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Short.valueOf(value);
}
} | java | public short getShort(String key, short defaultValue) {
addToDefaults(key, Short.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Short.valueOf(value);
}
} | [
"public",
"short",
"getShort",
"(",
"String",
"key",
",",
"short",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Short",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",... | Returns the Short value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Short. | [
"Returns",
"the",
"Short",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"fails",
"if",
"the",
"value",
"is",
"not",
"a",
"Shor... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L423-L431 |
124,453 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getByte | public byte getByte(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Byte.valueOf(value);
} | java | public byte getByte(String key) {
addToDefaults(key, null);
String value = getRequired(key);
return Byte.valueOf(value);
} | [
"public",
"byte",
"getByte",
"(",
"String",
"key",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"null",
")",
";",
"String",
"value",
"=",
"getRequired",
"(",
"key",
")",
";",
"return",
"Byte",
".",
"valueOf",
"(",
"value",
")",
";",
"}"
] | Returns the Byte value for the given key.
The method fails if the key does not exist. | [
"Returns",
"the",
"Byte",
"value",
"for",
"the",
"given",
"key",
".",
"The",
"method",
"fails",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L439-L443 |
124,454 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getByte | public byte getByte(String key, byte defaultValue) {
addToDefaults(key, Byte.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Byte.valueOf(value);
}
} | java | public byte getByte(String key, byte defaultValue) {
addToDefaults(key, Byte.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Byte.valueOf(value);
}
} | [
"public",
"byte",
"getByte",
"(",
"String",
"key",
",",
"byte",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Byte",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"... | Returns the Byte value for the given key. If the key does not exists it will return the default value given.
The method fails if the value is not a Byte. | [
"Returns",
"the",
"Byte",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"fails",
"if",
"the",
"value",
"is",
"not",
"a",
"Byte"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L449-L457 |
124,455 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java | TaskManagerLocation.getFqdnHostName | private static String getFqdnHostName(InetAddress inetAddress) {
String fqdnHostName;
try {
fqdnHostName = inetAddress.getCanonicalHostName();
} catch (Throwable t) {
LOG.warn("Unable to determine the canonical hostname. Input split assignment (such as " +
"for HDFS files) may be non-local when the cano... | java | private static String getFqdnHostName(InetAddress inetAddress) {
String fqdnHostName;
try {
fqdnHostName = inetAddress.getCanonicalHostName();
} catch (Throwable t) {
LOG.warn("Unable to determine the canonical hostname. Input split assignment (such as " +
"for HDFS files) may be non-local when the cano... | [
"private",
"static",
"String",
"getFqdnHostName",
"(",
"InetAddress",
"inetAddress",
")",
"{",
"String",
"fqdnHostName",
";",
"try",
"{",
"fqdnHostName",
"=",
"inetAddress",
".",
"getCanonicalHostName",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
... | Gets the fully qualified hostname of the TaskManager based on the network address.
@param inetAddress the network address that the TaskManager binds its sockets to
@return fully qualified hostname of the TaskManager | [
"Gets",
"the",
"fully",
"qualified",
"hostname",
"of",
"the",
"TaskManager",
"based",
"on",
"the",
"network",
"address",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java#L173-L185 |
124,456 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java | TaskManagerLocation.getHostName | public static String getHostName(InetAddress inetAddress) {
String hostName;
String fqdnHostName = getFqdnHostName(inetAddress);
if (fqdnHostName.equals(inetAddress.getHostAddress())) {
// this happens when the name lookup fails, either due to an exception,
// or because no hostname can be found for the ad... | java | public static String getHostName(InetAddress inetAddress) {
String hostName;
String fqdnHostName = getFqdnHostName(inetAddress);
if (fqdnHostName.equals(inetAddress.getHostAddress())) {
// this happens when the name lookup fails, either due to an exception,
// or because no hostname can be found for the ad... | [
"public",
"static",
"String",
"getHostName",
"(",
"InetAddress",
"inetAddress",
")",
"{",
"String",
"hostName",
";",
"String",
"fqdnHostName",
"=",
"getFqdnHostName",
"(",
"inetAddress",
")",
";",
"if",
"(",
"fqdnHostName",
".",
"equals",
"(",
"inetAddress",
"."... | Gets the hostname of the TaskManager based on the network address.
@param inetAddress the network address that the TaskManager binds its sockets to
@return hostname of the TaskManager | [
"Gets",
"the",
"hostname",
"of",
"the",
"TaskManager",
"based",
"on",
"the",
"network",
"address",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java#L193-L209 |
124,457 | apache/flink | flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCAppendTableSinkBuilder.java | JDBCAppendTableSinkBuilder.setParameterTypes | public JDBCAppendTableSinkBuilder setParameterTypes(TypeInformation<?>... types) {
int[] ty = new int[types.length];
for (int i = 0; i < types.length; ++i) {
ty[i] = JDBCTypeUtil.typeInformationToSqlType(types[i]);
}
this.parameterTypes = ty;
return this;
} | java | public JDBCAppendTableSinkBuilder setParameterTypes(TypeInformation<?>... types) {
int[] ty = new int[types.length];
for (int i = 0; i < types.length; ++i) {
ty[i] = JDBCTypeUtil.typeInformationToSqlType(types[i]);
}
this.parameterTypes = ty;
return this;
} | [
"public",
"JDBCAppendTableSinkBuilder",
"setParameterTypes",
"(",
"TypeInformation",
"<",
"?",
">",
"...",
"types",
")",
"{",
"int",
"[",
"]",
"ty",
"=",
"new",
"int",
"[",
"types",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Specify the type of the rows that the sink will be accepting.
@param types the type of each field | [
"Specify",
"the",
"type",
"of",
"the",
"rows",
"that",
"the",
"sink",
"will",
"be",
"accepting",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCAppendTableSinkBuilder.java#L100-L107 |
124,458 | apache/flink | flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCAppendTableSinkBuilder.java | JDBCAppendTableSinkBuilder.build | public JDBCAppendTableSink build() {
Preconditions.checkNotNull(parameterTypes,
"Types of the query parameters are not specified." +
" Please specify types using the setParameterTypes() method.");
JDBCOutputFormat format = JDBCOutputFormat.buildJDBCOutputFormat()
.setUsername(username)
.setPassword(pas... | java | public JDBCAppendTableSink build() {
Preconditions.checkNotNull(parameterTypes,
"Types of the query parameters are not specified." +
" Please specify types using the setParameterTypes() method.");
JDBCOutputFormat format = JDBCOutputFormat.buildJDBCOutputFormat()
.setUsername(username)
.setPassword(pas... | [
"public",
"JDBCAppendTableSink",
"build",
"(",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"parameterTypes",
",",
"\"Types of the query parameters are not specified.\"",
"+",
"\" Please specify types using the setParameterTypes() method.\"",
")",
";",
"JDBCOutputFormat",
... | Finalizes the configuration and checks validity.
@return Configured JDBCOutputFormat | [
"Finalizes",
"the",
"configuration",
"and",
"checks",
"validity",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCAppendTableSinkBuilder.java#L123-L139 |
124,459 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerUtils.java | TypeSerializerUtils.configureForBackwardsCompatibility | @SuppressWarnings({"unchecked", "deprecation"})
private static <T> TypeSerializerSnapshot<T> configureForBackwardsCompatibility(
TypeSerializerSnapshot<?> snapshot,
TypeSerializer<?> serializer) {
TypeSerializerSnapshot<T> typedSnapshot = (TypeSerializerSnapshot<T>) snapshot;
TypeSerializer<T> typedSerializ... | java | @SuppressWarnings({"unchecked", "deprecation"})
private static <T> TypeSerializerSnapshot<T> configureForBackwardsCompatibility(
TypeSerializerSnapshot<?> snapshot,
TypeSerializer<?> serializer) {
TypeSerializerSnapshot<T> typedSnapshot = (TypeSerializerSnapshot<T>) snapshot;
TypeSerializer<T> typedSerializ... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"deprecation\"",
"}",
")",
"private",
"static",
"<",
"T",
">",
"TypeSerializerSnapshot",
"<",
"T",
">",
"configureForBackwardsCompatibility",
"(",
"TypeSerializerSnapshot",
"<",
"?",
">",
"snapshot",
",",
... | Utility method to bind the serializer and serializer snapshot to a common
generic type variable. | [
"Utility",
"method",
"to",
"bind",
"the",
"serializer",
"and",
"serializer",
"snapshot",
"to",
"a",
"common",
"generic",
"type",
"variable",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerUtils.java#L56-L69 |
124,460 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java | SerializedCheckpointData.fromDeque | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer) throws IOException {
return fromDeque(checkpoints, serializer, new DataOutputSerializer(128));
} | java | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer) throws IOException {
return fromDeque(checkpoints, serializer, new DataOutputSerializer(128));
} | [
"public",
"static",
"<",
"T",
">",
"SerializedCheckpointData",
"[",
"]",
"fromDeque",
"(",
"ArrayDeque",
"<",
"Tuple2",
"<",
"Long",
",",
"Set",
"<",
"T",
">",
">",
">",
"checkpoints",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"throws",
"I... | Converts a list of checkpoints with elements into an array of SerializedCheckpointData.
@param checkpoints The checkpoints to be converted into IdsCheckpointData.
@param serializer The serializer to serialize the IDs.
@param <T> The type of the ID.
@return An array of serializable SerializedCheckpointData, one per ent... | [
"Converts",
"a",
"list",
"of",
"checkpoints",
"with",
"elements",
"into",
"an",
"array",
"of",
"SerializedCheckpointData",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java#L98-L102 |
124,461 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java | SerializedCheckpointData.fromDeque | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer,
DataOutputSerializer outputBuffer) throws IOException {
SerializedCheckpointData[] serializedCheckpoints = new SerializedCheckpointData[checkpoints.size()];
int pos = 0;
f... | java | public static <T> SerializedCheckpointData[] fromDeque(
ArrayDeque<Tuple2<Long, Set<T>>> checkpoints,
TypeSerializer<T> serializer,
DataOutputSerializer outputBuffer) throws IOException {
SerializedCheckpointData[] serializedCheckpoints = new SerializedCheckpointData[checkpoints.size()];
int pos = 0;
f... | [
"public",
"static",
"<",
"T",
">",
"SerializedCheckpointData",
"[",
"]",
"fromDeque",
"(",
"ArrayDeque",
"<",
"Tuple2",
"<",
"Long",
",",
"Set",
"<",
"T",
">",
">",
">",
"checkpoints",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
",",
"DataOutputSer... | Converts a list of checkpoints into an array of SerializedCheckpointData.
@param checkpoints The checkpoints to be converted into IdsCheckpointData.
@param serializer The serializer to serialize the IDs.
@param outputBuffer The reusable serialization buffer.
@param <T> The type of the ID.
@return An array of serializa... | [
"Converts",
"a",
"list",
"of",
"checkpoints",
"into",
"an",
"array",
"of",
"SerializedCheckpointData",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java#L115-L136 |
124,462 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java | SerializedCheckpointData.toDeque | public static <T> ArrayDeque<Tuple2<Long, Set<T>>> toDeque(
SerializedCheckpointData[] data,
TypeSerializer<T> serializer) throws IOException {
ArrayDeque<Tuple2<Long, Set<T>>> deque = new ArrayDeque<>(data.length);
DataInputDeserializer deser = null;
for (SerializedCheckpointData checkpoint : data) {
... | java | public static <T> ArrayDeque<Tuple2<Long, Set<T>>> toDeque(
SerializedCheckpointData[] data,
TypeSerializer<T> serializer) throws IOException {
ArrayDeque<Tuple2<Long, Set<T>>> deque = new ArrayDeque<>(data.length);
DataInputDeserializer deser = null;
for (SerializedCheckpointData checkpoint : data) {
... | [
"public",
"static",
"<",
"T",
">",
"ArrayDeque",
"<",
"Tuple2",
"<",
"Long",
",",
"Set",
"<",
"T",
">",
">",
">",
"toDeque",
"(",
"SerializedCheckpointData",
"[",
"]",
"data",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"throws",
"IOExceptio... | De-serializes an array of SerializedCheckpointData back into an ArrayDeque of element checkpoints.
@param data The data to be deserialized.
@param serializer The serializer used to deserialize the data.
@param <T> The type of the elements.
@return An ArrayDeque of element checkpoints.
@throws IOException Thrown, if t... | [
"De",
"-",
"serializes",
"an",
"array",
"of",
"SerializedCheckpointData",
"back",
"into",
"an",
"ArrayDeque",
"of",
"element",
"checkpoints",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java#L152-L179 |
124,463 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/JaasModule.java | JaasModule.generateDefaultConfigFile | private static File generateDefaultConfigFile() {
final File jaasConfFile;
try {
Path jaasConfPath = Files.createTempFile("jaas-", ".conf");
try (InputStream resourceStream = JaasModule.class.getClassLoader().getResourceAsStream(JAAS_CONF_RESOURCE_NAME)) {
Files.copy(resourceStream, jaasConfPath, Standard... | java | private static File generateDefaultConfigFile() {
final File jaasConfFile;
try {
Path jaasConfPath = Files.createTempFile("jaas-", ".conf");
try (InputStream resourceStream = JaasModule.class.getClassLoader().getResourceAsStream(JAAS_CONF_RESOURCE_NAME)) {
Files.copy(resourceStream, jaasConfPath, Standard... | [
"private",
"static",
"File",
"generateDefaultConfigFile",
"(",
")",
"{",
"final",
"File",
"jaasConfFile",
";",
"try",
"{",
"Path",
"jaasConfPath",
"=",
"Files",
".",
"createTempFile",
"(",
"\"jaas-\"",
",",
"\".conf\"",
")",
";",
"try",
"(",
"InputStream",
"re... | Generate the default JAAS config file. | [
"Generate",
"the",
"default",
"JAAS",
"config",
"file",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/JaasModule.java#L143-L156 |
124,464 | apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java | ColumnOperationUtils.renameColumns | public static List<Expression> renameColumns(List<String> inputFields, List<Expression> newAliases) {
LinkedHashMap<String, Expression> finalFields = new LinkedHashMap<>();
inputFields.forEach(field -> finalFields.put(field, new UnresolvedReferenceExpression(field)));
newAliases.forEach(expr -> {
String name ... | java | public static List<Expression> renameColumns(List<String> inputFields, List<Expression> newAliases) {
LinkedHashMap<String, Expression> finalFields = new LinkedHashMap<>();
inputFields.forEach(field -> finalFields.put(field, new UnresolvedReferenceExpression(field)));
newAliases.forEach(expr -> {
String name ... | [
"public",
"static",
"List",
"<",
"Expression",
">",
"renameColumns",
"(",
"List",
"<",
"String",
">",
"inputFields",
",",
"List",
"<",
"Expression",
">",
"newAliases",
")",
"{",
"LinkedHashMap",
"<",
"String",
",",
"Expression",
">",
"finalFields",
"=",
"new... | Creates a projection list that renames existing columns to new names.
<p><b>NOTE:</b> Resulting expression are still unresolved.
@param inputFields names of current columns
@param newAliases new aliases for current columns
@return projection expressions | [
"Creates",
"a",
"projection",
"list",
"that",
"renames",
"existing",
"columns",
"to",
"new",
"names",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java#L57-L67 |
124,465 | apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java | ColumnOperationUtils.dropFields | public static List<Expression> dropFields(List<String> inputFields, List<Expression> dropExpressions) {
Set<String> columnsToDrop = dropExpressions.stream()
.map(expr -> expr.accept(dropColumnsExtractor))
.collect(Collectors.toSet());
columnsToDrop.forEach(c -> {
if (!inputFields.contains(c)) {
throw ... | java | public static List<Expression> dropFields(List<String> inputFields, List<Expression> dropExpressions) {
Set<String> columnsToDrop = dropExpressions.stream()
.map(expr -> expr.accept(dropColumnsExtractor))
.collect(Collectors.toSet());
columnsToDrop.forEach(c -> {
if (!inputFields.contains(c)) {
throw ... | [
"public",
"static",
"List",
"<",
"Expression",
">",
"dropFields",
"(",
"List",
"<",
"String",
">",
"inputFields",
",",
"List",
"<",
"Expression",
">",
"dropExpressions",
")",
"{",
"Set",
"<",
"String",
">",
"columnsToDrop",
"=",
"dropExpressions",
".",
"stre... | Creates a projection list that removes given columns.
<p><b>NOTE:</b> Resulting expression are still unresolved.
@param inputFields names of current columns
@param dropExpressions columns to remove
@return projection expressions | [
"Creates",
"a",
"projection",
"list",
"that",
"removes",
"given",
"columns",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java#L100-L115 |
124,466 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.countElementsPerPartition | public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) {
return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Integer, Long>>() {
@Override
public void mapPartition(Iterable<T> values, Collector<Tuple2<Integer, Long>> out) throws Exception {
long counter = 0... | java | public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) {
return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Integer, Long>>() {
@Override
public void mapPartition(Iterable<T> values, Collector<Tuple2<Integer, Long>> out) throws Exception {
long counter = 0... | [
"public",
"static",
"<",
"T",
">",
"DataSet",
"<",
"Tuple2",
"<",
"Integer",
",",
"Long",
">",
">",
"countElementsPerPartition",
"(",
"DataSet",
"<",
"T",
">",
"input",
")",
"{",
"return",
"input",
".",
"mapPartition",
"(",
"new",
"RichMapPartitionFunction",... | Method that goes over all the elements in each partition in order to retrieve
the total number of elements.
@param input the DataSet received as input
@return a data set containing tuples of subtask index, number of elements mappings. | [
"Method",
"that",
"goes",
"over",
"all",
"the",
"elements",
"in",
"each",
"partition",
"in",
"order",
"to",
"retrieve",
"the",
"total",
"number",
"of",
"elements",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L69-L80 |
124,467 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.partitionByRange | public static <T> PartitionOperator<T> partitionByRange(DataSet<T> input, DataDistribution distribution, int... fields) {
return new PartitionOperator<>(input, PartitionOperatorBase.PartitionMethod.RANGE, new Keys.ExpressionKeys<>(fields, input.getType(), false), distribution, Utils.getCallLocationName());
} | java | public static <T> PartitionOperator<T> partitionByRange(DataSet<T> input, DataDistribution distribution, int... fields) {
return new PartitionOperator<>(input, PartitionOperatorBase.PartitionMethod.RANGE, new Keys.ExpressionKeys<>(fields, input.getType(), false), distribution, Utils.getCallLocationName());
} | [
"public",
"static",
"<",
"T",
">",
"PartitionOperator",
"<",
"T",
">",
"partitionByRange",
"(",
"DataSet",
"<",
"T",
">",
"input",
",",
"DataDistribution",
"distribution",
",",
"int",
"...",
"fields",
")",
"{",
"return",
"new",
"PartitionOperator",
"<>",
"("... | Range-partitions a DataSet on the specified tuple field positions. | [
"Range",
"-",
"partitions",
"a",
"DataSet",
"on",
"the",
"specified",
"tuple",
"field",
"positions",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L273-L275 |
124,468 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.partitionByRange | public static <T, K extends Comparable<K>> PartitionOperator<T> partitionByRange(DataSet<T> input, DataDistribution distribution, KeySelector<T, K> keyExtractor) {
final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, input.getType());
return new PartitionOperator<>(input, PartitionOper... | java | public static <T, K extends Comparable<K>> PartitionOperator<T> partitionByRange(DataSet<T> input, DataDistribution distribution, KeySelector<T, K> keyExtractor) {
final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, input.getType());
return new PartitionOperator<>(input, PartitionOper... | [
"public",
"static",
"<",
"T",
",",
"K",
"extends",
"Comparable",
"<",
"K",
">",
">",
"PartitionOperator",
"<",
"T",
">",
"partitionByRange",
"(",
"DataSet",
"<",
"T",
">",
"input",
",",
"DataDistribution",
"distribution",
",",
"KeySelector",
"<",
"T",
",",... | Range-partitions a DataSet using the specified key selector function. | [
"Range",
"-",
"partitions",
"a",
"DataSet",
"using",
"the",
"specified",
"key",
"selector",
"function",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L287-L290 |
124,469 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.summarize | public static <R extends Tuple, T extends Tuple> R summarize(DataSet<T> input) throws Exception {
if (!input.getType().isTupleType()) {
throw new IllegalArgumentException("summarize() is only implemented for DataSet's of Tuples");
}
final TupleTypeInfoBase<?> inType = (TupleTypeInfoBase<?>) input.getType();
... | java | public static <R extends Tuple, T extends Tuple> R summarize(DataSet<T> input) throws Exception {
if (!input.getType().isTupleType()) {
throw new IllegalArgumentException("summarize() is only implemented for DataSet's of Tuples");
}
final TupleTypeInfoBase<?> inType = (TupleTypeInfoBase<?>) input.getType();
... | [
"public",
"static",
"<",
"R",
"extends",
"Tuple",
",",
"T",
"extends",
"Tuple",
">",
"R",
"summarize",
"(",
"DataSet",
"<",
"T",
">",
"input",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"input",
".",
"getType",
"(",
")",
".",
"isTupleType",
"("... | Summarize a DataSet of Tuples by collecting single pass statistics for all columns.
<p>Example usage:
<pre>
{@code
Dataset<Tuple3<Double, String, Boolean>> input = // [...]
Tuple3<NumericColumnSummary,StringColumnSummary, BooleanColumnSummary> summary = DataSetUtils.summarize(input)
summary.f0.getStandardDeviation()
... | [
"Summarize",
"a",
"DataSet",
"of",
"Tuples",
"by",
"collecting",
"single",
"pass",
"statistics",
"for",
"all",
"columns",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L311-L333 |
124,470 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/CsvReader.java | CsvReader.ignoreComments | public CsvReader ignoreComments(String commentPrefix) {
if (commentPrefix == null || commentPrefix.length() == 0) {
throw new IllegalArgumentException("The comment prefix must not be null or an empty string");
}
this.commentPrefix = commentPrefix;
return this;
} | java | public CsvReader ignoreComments(String commentPrefix) {
if (commentPrefix == null || commentPrefix.length() == 0) {
throw new IllegalArgumentException("The comment prefix must not be null or an empty string");
}
this.commentPrefix = commentPrefix;
return this;
} | [
"public",
"CsvReader",
"ignoreComments",
"(",
"String",
"commentPrefix",
")",
"{",
"if",
"(",
"commentPrefix",
"==",
"null",
"||",
"commentPrefix",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The comment pref... | Configures the string that starts comments.
By default comments will be treated as invalid lines.
This function only recognizes comments which start at the beginning of the line!
@param commentPrefix The string that starts the comments.
@return The CSV reader instance itself, to allow for fluent function chaining. | [
"Configures",
"the",
"string",
"that",
"starts",
"comments",
".",
"By",
"default",
"comments",
"will",
"be",
"treated",
"as",
"invalid",
"lines",
".",
"This",
"function",
"only",
"recognizes",
"comments",
"which",
"start",
"at",
"the",
"beginning",
"of",
"the"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/CsvReader.java#L156-L163 |
124,471 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/CsvReader.java | CsvReader.pojoType | public <T> DataSource<T> pojoType(Class<T> pojoType, String... pojoFields) {
Preconditions.checkNotNull(pojoType, "The POJO type class must not be null.");
Preconditions.checkNotNull(pojoFields, "POJO fields must be specified (not null) if output type is a POJO.");
final TypeInformation<T> ti = TypeExtractor.cre... | java | public <T> DataSource<T> pojoType(Class<T> pojoType, String... pojoFields) {
Preconditions.checkNotNull(pojoType, "The POJO type class must not be null.");
Preconditions.checkNotNull(pojoFields, "POJO fields must be specified (not null) if output type is a POJO.");
final TypeInformation<T> ti = TypeExtractor.cre... | [
"public",
"<",
"T",
">",
"DataSource",
"<",
"T",
">",
"pojoType",
"(",
"Class",
"<",
"T",
">",
"pojoType",
",",
"String",
"...",
"pojoFields",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"pojoType",
",",
"\"The POJO type class must not be null.\"",
")... | Configures the reader to read the CSV data and parse it to the given type. The all fields of the type
must be public or able to set value. The type information for the fields is obtained from the type class.
@param pojoType The class of the target POJO.
@param pojoFields The fields of the POJO which are mapped to CSV ... | [
"Configures",
"the",
"reader",
"to",
"read",
"the",
"CSV",
"data",
"and",
"parse",
"it",
"to",
"the",
"given",
"type",
".",
"The",
"all",
"fields",
"of",
"the",
"type",
"must",
"be",
"public",
"or",
"able",
"to",
"set",
"value",
".",
"The",
"type",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/CsvReader.java#L316-L332 |
124,472 | apache/flink | flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java | TextElement.code | public static TextElement code(String text) {
TextElement element = text(text);
element.textStyles.add(TextStyle.CODE);
return element;
} | java | public static TextElement code(String text) {
TextElement element = text(text);
element.textStyles.add(TextStyle.CODE);
return element;
} | [
"public",
"static",
"TextElement",
"code",
"(",
"String",
"text",
")",
"{",
"TextElement",
"element",
"=",
"text",
"(",
"text",
")",
";",
"element",
".",
"textStyles",
".",
"add",
"(",
"TextStyle",
".",
"CODE",
")",
";",
"return",
"element",
";",
"}"
] | Creates a block of text formatted as code.
@param text a block of text that will be formatted as code
@return block of text formatted as code | [
"Creates",
"a",
"block",
"of",
"text",
"formatted",
"as",
"code",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java#L64-L68 |
124,473 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java | RequestedGlobalProperties.setAnyPartitioning | public void setAnyPartitioning(FieldSet partitionedFields) {
if (partitionedFields == null) {
throw new NullPointerException();
}
this.partitioning = PartitioningProperty.ANY_PARTITIONING;
this.partitioningFields = partitionedFields;
this.ordering = null;
} | java | public void setAnyPartitioning(FieldSet partitionedFields) {
if (partitionedFields == null) {
throw new NullPointerException();
}
this.partitioning = PartitioningProperty.ANY_PARTITIONING;
this.partitioningFields = partitionedFields;
this.ordering = null;
} | [
"public",
"void",
"setAnyPartitioning",
"(",
"FieldSet",
"partitionedFields",
")",
"{",
"if",
"(",
"partitionedFields",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"this",
".",
"partitioning",
"=",
"PartitioningProperty",
... | Sets these properties to request some partitioning on the given fields. This will allow
both hash partitioning and range partitioning to match.
If the fields are provided as {@link FieldSet}, then any permutation of the fields is a
valid partitioning, including subsets. If the fields are given as a {@link FieldList},
... | [
"Sets",
"these",
"properties",
"to",
"request",
"some",
"partitioning",
"on",
"the",
"given",
"fields",
".",
"This",
"will",
"allow",
"both",
"hash",
"partitioning",
"and",
"range",
"partitioning",
"to",
"match",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java#L112-L119 |
124,474 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java | RequestedGlobalProperties.reset | public void reset() {
this.partitioning = PartitioningProperty.RANDOM_PARTITIONED;
this.ordering = null;
this.partitioningFields = null;
this.dataDistribution = null;
this.customPartitioner = null;
} | java | public void reset() {
this.partitioning = PartitioningProperty.RANDOM_PARTITIONED;
this.ordering = null;
this.partitioningFields = null;
this.dataDistribution = null;
this.customPartitioner = null;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"partitioning",
"=",
"PartitioningProperty",
".",
"RANDOM_PARTITIONED",
";",
"this",
".",
"ordering",
"=",
"null",
";",
"this",
".",
"partitioningFields",
"=",
"null",
";",
"this",
".",
"dataDistribution",... | This method resets the properties to a state where no properties are given. | [
"This",
"method",
"resets",
"the",
"properties",
"to",
"a",
"state",
"where",
"no",
"properties",
"are",
"given",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java#L220-L226 |
124,475 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java | RequestedGlobalProperties.parameterizeChannel | public void parameterizeChannel(Channel channel, boolean globalDopChange,
ExecutionMode exchangeMode, boolean breakPipeline) {
// safety check. Fully replicated input must be preserved.
if (channel.getSource().getGlobalProperties().isFullyReplicated() &&
!(this.partitioning == PartitioningProperty.FUL... | java | public void parameterizeChannel(Channel channel, boolean globalDopChange,
ExecutionMode exchangeMode, boolean breakPipeline) {
// safety check. Fully replicated input must be preserved.
if (channel.getSource().getGlobalProperties().isFullyReplicated() &&
!(this.partitioning == PartitioningProperty.FUL... | [
"public",
"void",
"parameterizeChannel",
"(",
"Channel",
"channel",
",",
"boolean",
"globalDopChange",
",",
"ExecutionMode",
"exchangeMode",
",",
"boolean",
"breakPipeline",
")",
"{",
"// safety check. Fully replicated input must be preserved.",
"if",
"(",
"channel",
".",
... | Parametrizes the ship strategy fields of a channel such that the channel produces
the desired global properties.
@param channel The channel to parametrize.
@param globalDopChange Flag indicating whether the parallelism changes
between sender and receiver.
@param exchangeMode The mode of data exchange (pipelined, alway... | [
"Parametrizes",
"the",
"ship",
"strategy",
"fields",
"of",
"a",
"channel",
"such",
"that",
"the",
"channel",
"produces",
"the",
"desired",
"global",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java#L350-L435 |
124,476 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/security/DynamicConfiguration.java | DynamicConfiguration.addAppConfigurationEntry | public void addAppConfigurationEntry(String name, AppConfigurationEntry... entry) {
final AppConfigurationEntry[] existing = dynamicEntries.get(name);
final AppConfigurationEntry[] updated;
if (existing == null) {
updated = Arrays.copyOf(entry, entry.length);
}
else {
updated = merge(existing, entry);
... | java | public void addAppConfigurationEntry(String name, AppConfigurationEntry... entry) {
final AppConfigurationEntry[] existing = dynamicEntries.get(name);
final AppConfigurationEntry[] updated;
if (existing == null) {
updated = Arrays.copyOf(entry, entry.length);
}
else {
updated = merge(existing, entry);
... | [
"public",
"void",
"addAppConfigurationEntry",
"(",
"String",
"name",
",",
"AppConfigurationEntry",
"...",
"entry",
")",
"{",
"final",
"AppConfigurationEntry",
"[",
"]",
"existing",
"=",
"dynamicEntries",
".",
"get",
"(",
"name",
")",
";",
"final",
"AppConfiguratio... | Add entries for the given application name. | [
"Add",
"entries",
"for",
"the",
"given",
"application",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/security/DynamicConfiguration.java#L59-L69 |
124,477 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.getChar | @SuppressWarnings("restriction")
public final char getChar(int index) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
return UNSAFE.getChar(heapMemory, pos);
}
else if (address > addressLimit) {
throw new IllegalStateException("This segment has been freed.");
}
else {... | java | @SuppressWarnings("restriction")
public final char getChar(int index) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
return UNSAFE.getChar(heapMemory, pos);
}
else if (address > addressLimit) {
throw new IllegalStateException("This segment has been freed.");
}
else {... | [
"@",
"SuppressWarnings",
"(",
"\"restriction\"",
")",
"public",
"final",
"char",
"getChar",
"(",
"int",
"index",
")",
"{",
"final",
"long",
"pos",
"=",
"address",
"+",
"index",
";",
"if",
"(",
"index",
">=",
"0",
"&&",
"pos",
"<=",
"addressLimit",
"-",
... | Reads a char value from the given position, in the system's native byte order.
@param index The position from which the memory will be read.
@return The char value at the given position.
@throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment
size minus 2. | [
"Reads",
"a",
"char",
"value",
"from",
"the",
"given",
"position",
"in",
"the",
"system",
"s",
"native",
"byte",
"order",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L421-L434 |
124,478 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putChar | @SuppressWarnings("restriction")
public final void putChar(int index, char value) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
UNSAFE.putChar(heapMemory, pos, value);
}
else if (address > addressLimit) {
throw new IllegalStateException("segment has been freed");
}
... | java | @SuppressWarnings("restriction")
public final void putChar(int index, char value) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
UNSAFE.putChar(heapMemory, pos, value);
}
else if (address > addressLimit) {
throw new IllegalStateException("segment has been freed");
}
... | [
"@",
"SuppressWarnings",
"(",
"\"restriction\"",
")",
"public",
"final",
"void",
"putChar",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"final",
"long",
"pos",
"=",
"address",
"+",
"index",
";",
"if",
"(",
"index",
">=",
"0",
"&&",
"pos",
"<="... | Writes a char value to the given position, in the system's native byte order.
@param index The position at which the memory will be written.
@param value The char value to be written.
@throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment
size minus 2. | [
"Writes",
"a",
"char",
"value",
"to",
"the",
"given",
"position",
"in",
"the",
"system",
"s",
"native",
"byte",
"order",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L487-L500 |
124,479 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putShort | public final void putShort(int index, short value) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
UNSAFE.putShort(heapMemory, pos, value);
}
else if (address > addressLimit) {
throw new IllegalStateException("segment has been freed");
}
else {
// index is in fact i... | java | public final void putShort(int index, short value) {
final long pos = address + index;
if (index >= 0 && pos <= addressLimit - 2) {
UNSAFE.putShort(heapMemory, pos, value);
}
else if (address > addressLimit) {
throw new IllegalStateException("segment has been freed");
}
else {
// index is in fact i... | [
"public",
"final",
"void",
"putShort",
"(",
"int",
"index",
",",
"short",
"value",
")",
"{",
"final",
"long",
"pos",
"=",
"address",
"+",
"index",
";",
"if",
"(",
"index",
">=",
"0",
"&&",
"pos",
"<=",
"addressLimit",
"-",
"2",
")",
"{",
"UNSAFE",
... | Writes the given short value into this buffer at the given position, using
the native byte order of the system.
@param index The position at which the value will be written.
@param value The short value to be written.
@throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment
size ... | [
"Writes",
"the",
"given",
"short",
"value",
"into",
"this",
"buffer",
"at",
"the",
"given",
"position",
"using",
"the",
"native",
"byte",
"order",
"of",
"the",
"system",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L620-L632 |
124,480 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.compare | public final int compare(MemorySegment seg2, int offset1, int offset2, int len) {
while (len >= 8) {
long l1 = this.getLongBigEndian(offset1);
long l2 = seg2.getLongBigEndian(offset2);
if (l1 != l2) {
return (l1 < l2) ^ (l1 < 0) ^ (l2 < 0) ? -1 : 1;
}
offset1 += 8;
offset2 += 8;
len -= 8;
... | java | public final int compare(MemorySegment seg2, int offset1, int offset2, int len) {
while (len >= 8) {
long l1 = this.getLongBigEndian(offset1);
long l2 = seg2.getLongBigEndian(offset2);
if (l1 != l2) {
return (l1 < l2) ^ (l1 < 0) ^ (l2 < 0) ? -1 : 1;
}
offset1 += 8;
offset2 += 8;
len -= 8;
... | [
"public",
"final",
"int",
"compare",
"(",
"MemorySegment",
"seg2",
",",
"int",
"offset1",
",",
"int",
"offset2",
",",
"int",
"len",
")",
"{",
"while",
"(",
"len",
">=",
"8",
")",
"{",
"long",
"l1",
"=",
"this",
".",
"getLongBigEndian",
"(",
"offset1",
... | Compares two memory segment regions.
@param seg2 Segment to compare this segment with
@param offset1 Offset of this segment to start comparing
@param offset2 Offset of seg2 to start comparing
@param len Length of the compared memory region
@return 0 if equal, -1 if seg1 < seg2, 1 otherwise | [
"Compares",
"two",
"memory",
"segment",
"regions",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1331-L1356 |
124,481 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.swapBytes | public final void swapBytes(byte[] tempBuffer, MemorySegment seg2, int offset1, int offset2, int len) {
if ((offset1 | offset2 | len | (tempBuffer.length - len)) >= 0) {
final long thisPos = this.address + offset1;
final long otherPos = seg2.address + offset2;
if (thisPos <= this.addressLimit - len && other... | java | public final void swapBytes(byte[] tempBuffer, MemorySegment seg2, int offset1, int offset2, int len) {
if ((offset1 | offset2 | len | (tempBuffer.length - len)) >= 0) {
final long thisPos = this.address + offset1;
final long otherPos = seg2.address + offset2;
if (thisPos <= this.addressLimit - len && other... | [
"public",
"final",
"void",
"swapBytes",
"(",
"byte",
"[",
"]",
"tempBuffer",
",",
"MemorySegment",
"seg2",
",",
"int",
"offset1",
",",
"int",
"offset2",
",",
"int",
"len",
")",
"{",
"if",
"(",
"(",
"offset1",
"|",
"offset2",
"|",
"len",
"|",
"(",
"te... | Swaps bytes between two memory segments, using the given auxiliary buffer.
@param tempBuffer The auxiliary buffer in which to put data during triangle swap.
@param seg2 Segment to swap bytes with
@param offset1 Offset of this segment to start swapping
@param offset2 Offset of seg2 to start swapping
@param len Length o... | [
"Swaps",
"bytes",
"between",
"two",
"memory",
"segments",
"using",
"the",
"given",
"auxiliary",
"buffer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1367-L1395 |
124,482 | apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.equalTo | public final boolean equalTo(MemorySegment seg2, int offset1, int offset2, int length) {
int i = 0;
// we assume unaligned accesses are supported.
// Compare 8 bytes at a time.
while (i <= length - 8) {
if (getLong(offset1 + i) != seg2.getLong(offset2 + i)) {
return false;
}
i += 8;
}
// cove... | java | public final boolean equalTo(MemorySegment seg2, int offset1, int offset2, int length) {
int i = 0;
// we assume unaligned accesses are supported.
// Compare 8 bytes at a time.
while (i <= length - 8) {
if (getLong(offset1 + i) != seg2.getLong(offset2 + i)) {
return false;
}
i += 8;
}
// cove... | [
"public",
"final",
"boolean",
"equalTo",
"(",
"MemorySegment",
"seg2",
",",
"int",
"offset1",
",",
"int",
"offset2",
",",
"int",
"length",
")",
"{",
"int",
"i",
"=",
"0",
";",
"// we assume unaligned accesses are supported.",
"// Compare 8 bytes at a time.",
"while"... | Equals two memory segment regions.
@param seg2 Segment to equal this segment with
@param offset1 Offset of this segment to start equaling
@param offset2 Offset of seg2 to start equaling
@param length Length of the equaled memory region
@return true if equal, false otherwise | [
"Equals",
"two",
"memory",
"segment",
"regions",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1407-L1428 |
124,483 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java | CompositeType.getFlatFields | @PublicEvolving
public List<FlatFieldDescriptor> getFlatFields(String fieldExpression) {
List<FlatFieldDescriptor> result = new ArrayList<FlatFieldDescriptor>();
this.getFlatFields(fieldExpression, 0, result);
return result;
} | java | @PublicEvolving
public List<FlatFieldDescriptor> getFlatFields(String fieldExpression) {
List<FlatFieldDescriptor> result = new ArrayList<FlatFieldDescriptor>();
this.getFlatFields(fieldExpression, 0, result);
return result;
} | [
"@",
"PublicEvolving",
"public",
"List",
"<",
"FlatFieldDescriptor",
">",
"getFlatFields",
"(",
"String",
"fieldExpression",
")",
"{",
"List",
"<",
"FlatFieldDescriptor",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"FlatFieldDescriptor",
">",
"(",
")",
";",
"th... | Returns the flat field descriptors for the given field expression.
@param fieldExpression The field expression for which the flat field descriptors are computed.
@return The list of descriptors for the flat fields which are specified by the field expression. | [
"Returns",
"the",
"flat",
"field",
"descriptors",
"for",
"the",
"given",
"field",
"expression",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java#L66-L71 |
124,484 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java | CompositeType.createComparator | @PublicEvolving
public TypeComparator<T> createComparator(int[] logicalKeyFields, boolean[] orders, int logicalFieldOffset, ExecutionConfig config) {
TypeComparatorBuilder<T> builder = createTypeComparatorBuilder();
builder.initializeTypeComparatorBuilder(logicalKeyFields.length);
for (int logicalKeyFieldInde... | java | @PublicEvolving
public TypeComparator<T> createComparator(int[] logicalKeyFields, boolean[] orders, int logicalFieldOffset, ExecutionConfig config) {
TypeComparatorBuilder<T> builder = createTypeComparatorBuilder();
builder.initializeTypeComparatorBuilder(logicalKeyFields.length);
for (int logicalKeyFieldInde... | [
"@",
"PublicEvolving",
"public",
"TypeComparator",
"<",
"T",
">",
"createComparator",
"(",
"int",
"[",
"]",
"logicalKeyFields",
",",
"boolean",
"[",
"]",
"orders",
",",
"int",
"logicalFieldOffset",
",",
"ExecutionConfig",
"config",
")",
"{",
"TypeComparatorBuilder... | Generic implementation of the comparator creation. Composite types are supplying the infrastructure
to create the actual comparators
@return The comparator | [
"Generic",
"implementation",
"of",
"the",
"comparator",
"creation",
".",
"Composite",
"types",
"are",
"supplying",
"the",
"infrastructure",
"to",
"create",
"the",
"actual",
"comparators"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java#L110-L168 |
124,485 | apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java | AbstractYarnClusterDescriptor.getYarnFilesDir | private Path getYarnFilesDir(final ApplicationId appId) throws IOException {
final FileSystem fileSystem = FileSystem.get(yarnConfiguration);
final Path homeDir = fileSystem.getHomeDirectory();
return new Path(homeDir, ".flink/" + appId + '/');
} | java | private Path getYarnFilesDir(final ApplicationId appId) throws IOException {
final FileSystem fileSystem = FileSystem.get(yarnConfiguration);
final Path homeDir = fileSystem.getHomeDirectory();
return new Path(homeDir, ".flink/" + appId + '/');
} | [
"private",
"Path",
"getYarnFilesDir",
"(",
"final",
"ApplicationId",
"appId",
")",
"throws",
"IOException",
"{",
"final",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"get",
"(",
"yarnConfiguration",
")",
";",
"final",
"Path",
"homeDir",
"=",
"fileSystem",
... | Returns the Path where the YARN application files should be uploaded to.
@param appId YARN application id | [
"Returns",
"the",
"Path",
"where",
"the",
"YARN",
"application",
"files",
"should",
"be",
"uploaded",
"to",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L1059-L1063 |
124,486 | apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java | AbstractYarnClusterDescriptor.failSessionDuringDeployment | private void failSessionDuringDeployment(YarnClient yarnClient, YarnClientApplication yarnApplication) {
LOG.info("Killing YARN application");
try {
yarnClient.killApplication(yarnApplication.getNewApplicationResponse().getApplicationId());
} catch (Exception e) {
// we only log a debug message here becaus... | java | private void failSessionDuringDeployment(YarnClient yarnClient, YarnClientApplication yarnApplication) {
LOG.info("Killing YARN application");
try {
yarnClient.killApplication(yarnApplication.getNewApplicationResponse().getApplicationId());
} catch (Exception e) {
// we only log a debug message here becaus... | [
"private",
"void",
"failSessionDuringDeployment",
"(",
"YarnClient",
"yarnClient",
",",
"YarnClientApplication",
"yarnApplication",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Killing YARN application\"",
")",
";",
"try",
"{",
"yarnClient",
".",
"killApplication",
"(",
"yar... | Kills YARN application and stops YARN client.
<p>Use this method to kill the App before it has been properly deployed | [
"Kills",
"YARN",
"application",
"and",
"stops",
"YARN",
"client",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L1196-L1207 |
124,487 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamSink.java | DataStreamSink.setResources | private DataStreamSink<T> 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(minResource... | java | private DataStreamSink<T> 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(minResource... | [
"private",
"DataStreamSink",
"<",
"T",
">",
"setResources",
"(",
"ResourceSpec",
"minResources",
",",
"ResourceSpec",
"preferredResources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"minResources",
",",
"\"The min resources must be not null.\"",
")",
";",
"Pr... | Sets the minimum and preferred resources for this sink, and the lower and upper resource limits will
be considered in resource resize feature for future plan.
@param minResources The minimum resources for this sink.
@param preferredResources The preferred resources for this sink
@return The sink with set minimum and p... | [
"Sets",
"the",
"minimum",
"and",
"preferred",
"resources",
"for",
"this",
"sink",
"and",
"the",
"lower",
"and",
"upper",
"resource",
"limits",
"will",
"be",
"considered",
"in",
"resource",
"resize",
"feature",
"for",
"future",
"plan",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamSink.java#L129-L138 |
124,488 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/filecache/FileCache.java | FileCache.shutdown | public void shutdown() {
synchronized (lock) {
// first shutdown the thread pool
ScheduledExecutorService es = this.executorService;
if (es != null) {
es.shutdown();
try {
es.awaitTermination(cleanupInterval, TimeUnit.MILLISECONDS);
}
catch (InterruptedException e) {
// may happen
... | java | public void shutdown() {
synchronized (lock) {
// first shutdown the thread pool
ScheduledExecutorService es = this.executorService;
if (es != null) {
es.shutdown();
try {
es.awaitTermination(cleanupInterval, TimeUnit.MILLISECONDS);
}
catch (InterruptedException e) {
// may happen
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// first shutdown the thread pool",
"ScheduledExecutorService",
"es",
"=",
"this",
".",
"executorService",
";",
"if",
"(",
"es",
"!=",
"null",
")",
"{",
"es",
".",
"shutdown",... | Shuts down the file cache by cancelling all. | [
"Shuts",
"down",
"the",
"file",
"cache",
"by",
"cancelling",
"all",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/filecache/FileCache.java#L132-L163 |
124,489 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/filecache/FileCache.java | FileCache.createTmpFile | public Future<Path> createTmpFile(String name, DistributedCacheEntry entry, JobID jobID, ExecutionAttemptID executionId) throws Exception {
synchronized (lock) {
Map<String, Future<Path>> jobEntries = entries.computeIfAbsent(jobID, k -> new HashMap<>());
// register reference holder
final Set<ExecutionAttem... | java | public Future<Path> createTmpFile(String name, DistributedCacheEntry entry, JobID jobID, ExecutionAttemptID executionId) throws Exception {
synchronized (lock) {
Map<String, Future<Path>> jobEntries = entries.computeIfAbsent(jobID, k -> new HashMap<>());
// register reference holder
final Set<ExecutionAttem... | [
"public",
"Future",
"<",
"Path",
">",
"createTmpFile",
"(",
"String",
"name",
",",
"DistributedCacheEntry",
"entry",
",",
"JobID",
"jobID",
",",
"ExecutionAttemptID",
"executionId",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"Map",
... | If the file doesn't exists locally, retrieve the file from the blob-service.
@param entry The cache entry descriptor (path, executable flag)
@param jobID The ID of the job for which the file is copied.
@return The handle to the task that copies the file. | [
"If",
"the",
"file",
"doesn",
"t",
"exists",
"locally",
"retrieve",
"the",
"file",
"from",
"the",
"blob",
"-",
"service",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/filecache/FileCache.java#L174-L212 |
124,490 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.fromConfiguration | public static NetworkEnvironmentConfiguration fromConfiguration(
Configuration configuration,
long maxJvmHeapMemory,
boolean localTaskManagerCommunication,
InetAddress taskManagerAddress) {
final int dataport = getDataport(configuration);
final int pageSize = getPageSize(configuration);
final int numbe... | java | public static NetworkEnvironmentConfiguration fromConfiguration(
Configuration configuration,
long maxJvmHeapMemory,
boolean localTaskManagerCommunication,
InetAddress taskManagerAddress) {
final int dataport = getDataport(configuration);
final int pageSize = getPageSize(configuration);
final int numbe... | [
"public",
"static",
"NetworkEnvironmentConfiguration",
"fromConfiguration",
"(",
"Configuration",
"configuration",
",",
"long",
"maxJvmHeapMemory",
",",
"boolean",
"localTaskManagerCommunication",
",",
"InetAddress",
"taskManagerAddress",
")",
"{",
"final",
"int",
"dataport",... | Utility method to extract network related parameters from the configuration and to
sanity check them.
@param configuration configuration object
@param maxJvmHeapMemory the maximum JVM heap size (in bytes)
@param localTaskManagerCommunication true, to skip initializing the network stack
@param taskManagerAddress identi... | [
"Utility",
"method",
"to",
"extract",
"network",
"related",
"parameters",
"from",
"the",
"configuration",
"and",
"to",
"sanity",
"check",
"them",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L131-L162 |
124,491 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.calculateNewNetworkBufferMemory | @VisibleForTesting
public static long calculateNewNetworkBufferMemory(Configuration config, long maxJvmHeapMemory) {
// The maximum heap memory has been adjusted as in TaskManagerServices#calculateHeapSizeMB
// and we need to invert these calculations.
final long jvmHeapNoNet;
final MemoryType memoryType = Con... | java | @VisibleForTesting
public static long calculateNewNetworkBufferMemory(Configuration config, long maxJvmHeapMemory) {
// The maximum heap memory has been adjusted as in TaskManagerServices#calculateHeapSizeMB
// and we need to invert these calculations.
final long jvmHeapNoNet;
final MemoryType memoryType = Con... | [
"@",
"VisibleForTesting",
"public",
"static",
"long",
"calculateNewNetworkBufferMemory",
"(",
"Configuration",
"config",
",",
"long",
"maxJvmHeapMemory",
")",
"{",
"// The maximum heap memory has been adjusted as in TaskManagerServices#calculateHeapSizeMB",
"// and we need to invert th... | Calculates the amount of memory used for network buffers inside the current JVM instance
based on the available heap or the max heap size and the according configuration parameters.
<p>For containers or when started via scripts, if started with a memory limit and set to use
off-heap memory, the maximum heap size for t... | [
"Calculates",
"the",
"amount",
"of",
"memory",
"used",
"for",
"network",
"buffers",
"inside",
"the",
"current",
"JVM",
"instance",
"based",
"on",
"the",
"available",
"heap",
"or",
"the",
"max",
"heap",
"size",
"and",
"the",
"according",
"configuration",
"param... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L187-L217 |
124,492 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.hasNewNetworkConfig | @SuppressWarnings("deprecation")
@VisibleForTesting
public static boolean hasNewNetworkConfig(final Configuration config) {
return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) ||
config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) ||
config.contains(TaskManagerOptions.NETWORK... | java | @SuppressWarnings("deprecation")
@VisibleForTesting
public static boolean hasNewNetworkConfig(final Configuration config) {
return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) ||
config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) ||
config.contains(TaskManagerOptions.NETWORK... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"VisibleForTesting",
"public",
"static",
"boolean",
"hasNewNetworkConfig",
"(",
"final",
"Configuration",
"config",
")",
"{",
"return",
"config",
".",
"contains",
"(",
"TaskManagerOptions",
".",
"NETWORK_BUFFE... | Returns whether the new network buffer memory configuration is present in the configuration
object, i.e. at least one new parameter is given or the old one is not present.
@param config configuration object
@return <tt>true</tt> if the new configuration method is used, <tt>false</tt> otherwise | [
"Returns",
"whether",
"the",
"new",
"network",
"buffer",
"memory",
"configuration",
"is",
"present",
"in",
"the",
"configuration",
"object",
"i",
".",
"e",
".",
"at",
"least",
"one",
"new",
"parameter",
"is",
"given",
"or",
"the",
"old",
"one",
"is",
"not"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L357-L364 |
124,493 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.calculateNumberOfNetworkBuffers | @SuppressWarnings("deprecation")
private static int calculateNumberOfNetworkBuffers(Configuration configuration, long maxJvmHeapMemory) {
final int numberOfNetworkBuffers;
if (!hasNewNetworkConfig(configuration)) {
// fallback: number of network buffers
numberOfNetworkBuffers = configuration.getInteger(TaskM... | java | @SuppressWarnings("deprecation")
private static int calculateNumberOfNetworkBuffers(Configuration configuration, long maxJvmHeapMemory) {
final int numberOfNetworkBuffers;
if (!hasNewNetworkConfig(configuration)) {
// fallback: number of network buffers
numberOfNetworkBuffers = configuration.getInteger(TaskM... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"static",
"int",
"calculateNumberOfNetworkBuffers",
"(",
"Configuration",
"configuration",
",",
"long",
"maxJvmHeapMemory",
")",
"{",
"final",
"int",
"numberOfNetworkBuffers",
";",
"if",
"(",
"!",
"hasNe... | Calculates the number of network buffers based on configuration and jvm heap size.
@param configuration configuration object
@param maxJvmHeapMemory the maximum JVM heap size (in bytes)
@return the number of network buffers | [
"Calculates",
"the",
"number",
"of",
"network",
"buffers",
"based",
"on",
"configuration",
"and",
"jvm",
"heap",
"size",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L387-L413 |
124,494 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.getPageSize | public static int getPageSize(Configuration configuration) {
final int pageSize = checkedDownCast(MemorySize.parse(
configuration.getString(TaskManagerOptions.MEMORY_SEGMENT_SIZE)).getBytes());
// check page size of for minimum size
ConfigurationParserUtils.checkConfigParameter(pageSize >= MemoryManager.MIN_P... | java | public static int getPageSize(Configuration configuration) {
final int pageSize = checkedDownCast(MemorySize.parse(
configuration.getString(TaskManagerOptions.MEMORY_SEGMENT_SIZE)).getBytes());
// check page size of for minimum size
ConfigurationParserUtils.checkConfigParameter(pageSize >= MemoryManager.MIN_P... | [
"public",
"static",
"int",
"getPageSize",
"(",
"Configuration",
"configuration",
")",
"{",
"final",
"int",
"pageSize",
"=",
"checkedDownCast",
"(",
"MemorySize",
".",
"parse",
"(",
"configuration",
".",
"getString",
"(",
"TaskManagerOptions",
".",
"MEMORY_SEGMENT_SI... | Parses the configuration to get the page size and validates the value.
@param configuration configuration object
@return size of memory segment | [
"Parses",
"the",
"configuration",
"to",
"get",
"the",
"page",
"size",
"and",
"validates",
"the",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L450-L464 |
124,495 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java | SplitDataProperties.splitsOrderedBy | public SplitDataProperties<T> splitsOrderedBy(int[] orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
} else if (orderFields.length == 0) {
throw new InvalidProgramException("OrderFields may not be empty.")... | java | public SplitDataProperties<T> splitsOrderedBy(int[] orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
} else if (orderFields.length == 0) {
throw new InvalidProgramException("OrderFields may not be empty.")... | [
"public",
"SplitDataProperties",
"<",
"T",
">",
"splitsOrderedBy",
"(",
"int",
"[",
"]",
"orderFields",
",",
"Order",
"[",
"]",
"orders",
")",
"{",
"if",
"(",
"orderFields",
"==",
"null",
"||",
"orders",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidPr... | Defines that the data within an input split is sorted on the fields defined by the field positions
in the specified orders.
All records of an input split must be emitted by the input format in the defined order.
<p><b>
IMPORTANT: Providing wrong information with SplitDataProperties can cause wrong results!
</b>
@para... | [
"Defines",
"that",
"the",
"data",
"within",
"an",
"input",
"split",
"is",
"sorted",
"on",
"the",
"fields",
"defined",
"by",
"the",
"field",
"positions",
"in",
"the",
"specified",
"orders",
".",
"All",
"records",
"of",
"an",
"input",
"split",
"must",
"be",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java#L263-L297 |
124,496 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java | SplitDataProperties.splitsOrderedBy | public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
}
String[] orderKeysA = orderFields.split(";");
if (orderKeysA.length == 0) {
throw new InvalidPro... | java | public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
}
String[] orderKeysA = orderFields.split(";");
if (orderKeysA.length == 0) {
throw new InvalidPro... | [
"public",
"SplitDataProperties",
"<",
"T",
">",
"splitsOrderedBy",
"(",
"String",
"orderFields",
",",
"Order",
"[",
"]",
"orders",
")",
"{",
"if",
"(",
"orderFields",
"==",
"null",
"||",
"orders",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidProgramExcept... | Defines that the data within an input split is sorted on the fields defined by the field expressions
in the specified orders. Multiple field expressions must be separated by the semicolon ';' character.
All records of an input split must be emitted by the input format in the defined order.
<p><b>
IMPORTANT: Providing ... | [
"Defines",
"that",
"the",
"data",
"within",
"an",
"input",
"split",
"is",
"sorted",
"on",
"the",
"fields",
"defined",
"by",
"the",
"field",
"expressions",
"in",
"the",
"specified",
"orders",
".",
"Multiple",
"field",
"expressions",
"must",
"be",
"separated",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java#L312-L350 |
124,497 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java | KryoUtils.copy | public static <T> T copy(T from, Kryo kryo, TypeSerializer<T> serializer) {
try {
return kryo.copy(from);
} catch (KryoException ke) {
// Kryo could not copy the object --> try to serialize/deserialize the object
try {
byte[] byteArray = InstantiationUtil.serializeToByteArray(serializer, from);
re... | java | public static <T> T copy(T from, Kryo kryo, TypeSerializer<T> serializer) {
try {
return kryo.copy(from);
} catch (KryoException ke) {
// Kryo could not copy the object --> try to serialize/deserialize the object
try {
byte[] byteArray = InstantiationUtil.serializeToByteArray(serializer, from);
re... | [
"public",
"static",
"<",
"T",
">",
"T",
"copy",
"(",
"T",
"from",
",",
"Kryo",
"kryo",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"try",
"{",
"return",
"kryo",
".",
"copy",
"(",
"from",
")",
";",
"}",
"catch",
"(",
"KryoException... | Tries to copy the given record from using the provided Kryo instance. If this fails, then
the record from is copied by serializing it into a byte buffer and deserializing it from
there.
@param from Element to copy
@param kryo Kryo instance to use
@param serializer TypeSerializer which is used in case of a Kryo failure... | [
"Tries",
"to",
"copy",
"the",
"given",
"record",
"from",
"using",
"the",
"provided",
"Kryo",
"instance",
".",
"If",
"this",
"fails",
"then",
"the",
"record",
"from",
"is",
"copied",
"by",
"serializing",
"it",
"into",
"a",
"byte",
"buffer",
"and",
"deserial... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java#L48-L62 |
124,498 | apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/batch/connectors/cassandra/CassandraInputFormat.java | CassandraInputFormat.open | @Override
public void open(InputSplit ignored) throws IOException {
this.session = cluster.connect();
this.resultSet = session.execute(query);
} | java | @Override
public void open(InputSplit ignored) throws IOException {
this.session = cluster.connect();
this.resultSet = session.execute(query);
} | [
"@",
"Override",
"public",
"void",
"open",
"(",
"InputSplit",
"ignored",
")",
"throws",
"IOException",
"{",
"this",
".",
"session",
"=",
"cluster",
".",
"connect",
"(",
")",
";",
"this",
".",
"resultSet",
"=",
"session",
".",
"execute",
"(",
"query",
")"... | Opens a Session and executes the query.
@param ignored because parameter is not parallelizable.
@throws IOException | [
"Opens",
"a",
"Session",
"and",
"executes",
"the",
"query",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/batch/connectors/cassandra/CassandraInputFormat.java#L49-L53 |
124,499 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java | NetworkBufferPool.redistributeBuffers | private void redistributeBuffers() throws IOException {
assert Thread.holdsLock(factoryLock);
// All buffers, which are not among the required ones
final int numAvailableMemorySegment = totalNumberOfMemorySegments - numTotalRequiredBuffers;
if (numAvailableMemorySegment == 0) {
// in this case, we need to ... | java | private void redistributeBuffers() throws IOException {
assert Thread.holdsLock(factoryLock);
// All buffers, which are not among the required ones
final int numAvailableMemorySegment = totalNumberOfMemorySegments - numTotalRequiredBuffers;
if (numAvailableMemorySegment == 0) {
// in this case, we need to ... | [
"private",
"void",
"redistributeBuffers",
"(",
")",
"throws",
"IOException",
"{",
"assert",
"Thread",
".",
"holdsLock",
"(",
"factoryLock",
")",
";",
"// All buffers, which are not among the required ones",
"final",
"int",
"numAvailableMemorySegment",
"=",
"totalNumberOfMem... | Must be called from synchronized block | [
"Must",
"be",
"called",
"from",
"synchronized",
"block"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java#L345-L411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.