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,100 | apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java | CassandraSink.slotSharingGroup | public CassandraSink<IN> slotSharingGroup(String slotSharingGroup) {
if (useDataStreamSink) {
getSinkTransformation().setSlotSharingGroup(slotSharingGroup);
} else {
getStreamTransformation().setSlotSharingGroup(slotSharingGroup);
}
return this;
} | java | public CassandraSink<IN> slotSharingGroup(String slotSharingGroup) {
if (useDataStreamSink) {
getSinkTransformation().setSlotSharingGroup(slotSharingGroup);
} else {
getStreamTransformation().setSlotSharingGroup(slotSharingGroup);
}
return this;
} | [
"public",
"CassandraSink",
"<",
"IN",
">",
"slotSharingGroup",
"(",
"String",
"slotSharingGroup",
")",
"{",
"if",
"(",
"useDataStreamSink",
")",
"{",
"getSinkTransformation",
"(",
")",
".",
"setSlotSharingGroup",
"(",
"slotSharingGroup",
")",
";",
"}",
"else",
"... | Sets the slot sharing group of this operation. Parallel instances of
operations that are in the same slot sharing group will be co-located in the same
TaskManager slot, if possible.
<p>Operations inherit the slot sharing group of input operations if all input operations
are in the same slot sharing group and no slot s... | [
"Sets",
"the",
"slot",
"sharing",
"group",
"of",
"this",
"operation",
".",
"Parallel",
"instances",
"of",
"operations",
"that",
"are",
"in",
"the",
"same",
"slot",
"sharing",
"group",
"will",
"be",
"co",
"-",
"located",
"in",
"the",
"same",
"TaskManager",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L185-L192 |
124,101 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.put | public final V put(K key, V value) {
final int hash = hash(key);
final int slot = indexOf (hash);
// search the chain from the slot
for (Entry<K, V> e = table[slot]; e != null; e = e.next) {
Object k;
if (e.hashCode == hash && ((k = e.key) == key || key.equals(k))) {
// found match
V old = e.valu... | java | public final V put(K key, V value) {
final int hash = hash(key);
final int slot = indexOf (hash);
// search the chain from the slot
for (Entry<K, V> e = table[slot]; e != null; e = e.next) {
Object k;
if (e.hashCode == hash && ((k = e.key) == key || key.equals(k))) {
// found match
V old = e.valu... | [
"public",
"final",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the chain from the slot",
"for",
"(",
"E... | Inserts the given value, mapped under the given key. If the table already contains a value for
the key, the value is replaced and returned. If no value is contained, yet, the function
returns null.
@param key The key to insert.
@param value The value to insert.
@return The previously mapped value for the key, or null,... | [
"Inserts",
"the",
"given",
"value",
"mapped",
"under",
"the",
"given",
"key",
".",
"If",
"the",
"table",
"already",
"contains",
"a",
"value",
"for",
"the",
"key",
"the",
"value",
"is",
"replaced",
"and",
"returned",
".",
"If",
"no",
"value",
"is",
"conta... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L123-L141 |
124,102 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.putIfAbsent | public final V putIfAbsent(K key, LazyFactory<V> factory) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
// found match
r... | java | public final V putIfAbsent(K key, LazyFactory<V> factory) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
// found match
r... | [
"public",
"final",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"LazyFactory",
"<",
"V",
">",
"factory",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the c... | Inserts a value for the given key, if no value is yet contained for that key. Otherwise,
returns the value currently contained for the key.
<p>The value that is inserted in case that the key is not contained, yet, is lazily created
using the given factory.
@param key The key to insert.
@param factory The factory that... | [
"Inserts",
"a",
"value",
"for",
"the",
"given",
"key",
"if",
"no",
"value",
"is",
"yet",
"contained",
"for",
"that",
"key",
".",
"Otherwise",
"returns",
"the",
"value",
"currently",
"contained",
"for",
"the",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L157-L175 |
124,103 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.get | public V get(K key) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
return entry.value;
}
}
// not found
return null... | java | public V get(K key) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
return entry.value;
}
}
// not found
return null... | [
"public",
"V",
"get",
"(",
"K",
"key",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the chain from the slot",
"for",
"(",
"Entry",
"<",
"K",
",",
"V",
... | Looks up the value mapped under the given key. Returns null if no value is mapped under this key.
@param key The key to look up.
@return The value associated with the key, or null, if no value is found for the key.
@throws java.lang.NullPointerException Thrown, if the key is null. | [
"Looks",
"up",
"the",
"value",
"mapped",
"under",
"the",
"given",
"key",
".",
"Returns",
"null",
"if",
"no",
"value",
"is",
"mapped",
"under",
"this",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L219-L232 |
124,104 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.iterator | @Override
public Iterator<Entry<K, V>> iterator() {
return new Iterator<Entry<K, V>>() {
private final Entry<K, V>[] tab = KeyMap.this.table;
private Entry<K, V> nextEntry;
private int nextPos = 0;
@Override
public boolean hasNext() {
if (nextEntry != null) {
return true;
}
else {... | java | @Override
public Iterator<Entry<K, V>> iterator() {
return new Iterator<Entry<K, V>>() {
private final Entry<K, V>[] tab = KeyMap.this.table;
private Entry<K, V> nextEntry;
private int nextPos = 0;
@Override
public boolean hasNext() {
if (nextEntry != null) {
return true;
}
else {... | [
"@",
"Override",
"public",
"Iterator",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"iterator",
"(",
")",
"{",
"return",
"new",
"Iterator",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"(",
")",
"{",
"private",
"final",
"Entry",
"<",
"K",
",",
"V... | Creates an iterator over the entries of this map.
@return An iterator over the entries of this map. | [
"Creates",
"an",
"iterator",
"over",
"the",
"entries",
"of",
"this",
"map",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L254-L298 |
124,105 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.traverseMaps | public static <K, V> void traverseMaps(
final KeyMap<K, V>[] maps,
final TraversalEvaluator<K, V> visitor,
final long touchedTag)
throws Exception {
// we need to work on the maps in descending size
Arrays.sort(maps, CapacityDescendingComparator.INSTANCE);
final int[] shifts = new int[maps.lengt... | java | public static <K, V> void traverseMaps(
final KeyMap<K, V>[] maps,
final TraversalEvaluator<K, V> visitor,
final long touchedTag)
throws Exception {
// we need to work on the maps in descending size
Arrays.sort(maps, CapacityDescendingComparator.INSTANCE);
final int[] shifts = new int[maps.lengt... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"traverseMaps",
"(",
"final",
"KeyMap",
"<",
"K",
",",
"V",
">",
"[",
"]",
"maps",
",",
"final",
"TraversalEvaluator",
"<",
"K",
",",
"V",
">",
"visitor",
",",
"final",
"long",
"touchedTag",
")",
... | Performs a traversal about logical the multi-map that results from the union of the
given maps. This method does not actually build a union of the map, but traverses the hash maps
together.
@param maps The array uf maps whose union should be traversed.
@param visitor The visitor that is called for each key and all val... | [
"Performs",
"a",
"traversal",
"about",
"logical",
"the",
"multi",
"-",
"map",
"that",
"results",
"from",
"the",
"union",
"of",
"the",
"given",
"maps",
".",
"This",
"method",
"does",
"not",
"actually",
"build",
"a",
"union",
"of",
"the",
"map",
"but",
"tr... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L499-L558 |
124,106 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskIOMetricGroup.java | TaskIOMetricGroup.initializeBufferMetrics | public void initializeBufferMetrics(Task task) {
final MetricGroup buffers = addGroup("buffers");
buffers.gauge("inputQueueLength", new InputBuffersGauge(task));
buffers.gauge("outputQueueLength", new OutputBuffersGauge(task));
buffers.gauge("inPoolUsage", new InputBufferPoolUsageGauge(task));
buffers.gauge("... | java | public void initializeBufferMetrics(Task task) {
final MetricGroup buffers = addGroup("buffers");
buffers.gauge("inputQueueLength", new InputBuffersGauge(task));
buffers.gauge("outputQueueLength", new OutputBuffersGauge(task));
buffers.gauge("inPoolUsage", new InputBufferPoolUsageGauge(task));
buffers.gauge("... | [
"public",
"void",
"initializeBufferMetrics",
"(",
"Task",
"task",
")",
"{",
"final",
"MetricGroup",
"buffers",
"=",
"addGroup",
"(",
"\"buffers\"",
")",
";",
"buffers",
".",
"gauge",
"(",
"\"inputQueueLength\"",
",",
"new",
"InputBuffersGauge",
"(",
"task",
")",... | Initialize Buffer Metrics for a task. | [
"Initialize",
"Buffer",
"Metrics",
"for",
"a",
"task",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskIOMetricGroup.java#L106-L112 |
124,107 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java | KeyGroupRange.getIntersection | public KeyGroupRange getIntersection(KeyGroupRange other) {
int start = Math.max(startKeyGroup, other.startKeyGroup);
int end = Math.min(endKeyGroup, other.endKeyGroup);
return start <= end ? new KeyGroupRange(start, end) : EMPTY_KEY_GROUP_RANGE;
} | java | public KeyGroupRange getIntersection(KeyGroupRange other) {
int start = Math.max(startKeyGroup, other.startKeyGroup);
int end = Math.min(endKeyGroup, other.endKeyGroup);
return start <= end ? new KeyGroupRange(start, end) : EMPTY_KEY_GROUP_RANGE;
} | [
"public",
"KeyGroupRange",
"getIntersection",
"(",
"KeyGroupRange",
"other",
")",
"{",
"int",
"start",
"=",
"Math",
".",
"max",
"(",
"startKeyGroup",
",",
"other",
".",
"startKeyGroup",
")",
";",
"int",
"end",
"=",
"Math",
".",
"min",
"(",
"endKeyGroup",
"... | Create a range that represent the intersection between this range and the given range.
@param other A KeyGroupRange to intersect.
@return Key-group range that is the intersection between this and the given key-group range. | [
"Create",
"a",
"range",
"that",
"represent",
"the",
"intersection",
"between",
"this",
"range",
"and",
"the",
"given",
"range",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java#L80-L84 |
124,108 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java | KeyGroupRange.of | public static KeyGroupRange of(int startKeyGroup, int endKeyGroup) {
return startKeyGroup <= endKeyGroup ? new KeyGroupRange(startKeyGroup, endKeyGroup) : EMPTY_KEY_GROUP_RANGE;
} | java | public static KeyGroupRange of(int startKeyGroup, int endKeyGroup) {
return startKeyGroup <= endKeyGroup ? new KeyGroupRange(startKeyGroup, endKeyGroup) : EMPTY_KEY_GROUP_RANGE;
} | [
"public",
"static",
"KeyGroupRange",
"of",
"(",
"int",
"startKeyGroup",
",",
"int",
"endKeyGroup",
")",
"{",
"return",
"startKeyGroup",
"<=",
"endKeyGroup",
"?",
"new",
"KeyGroupRange",
"(",
"startKeyGroup",
",",
"endKeyGroup",
")",
":",
"EMPTY_KEY_GROUP_RANGE",
"... | Factory method that also handles creation of empty key-groups.
@param startKeyGroup start of the range (inclusive)
@param endKeyGroup end of the range (inclusive)
@return the key-group from start to end or an empty key-group range. | [
"Factory",
"method",
"that",
"also",
"handles",
"creation",
"of",
"empty",
"key",
"-",
"groups",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java#L186-L188 |
124,109 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/iterative/task/AbstractIterativeTask.java | AbstractIterativeTask.createSolutionSetUpdateOutputCollector | protected Collector<OT> createSolutionSetUpdateOutputCollector(Collector<OT> delegate) {
Broker<Object> solutionSetBroker = SolutionSetBroker.instance();
Object ss = solutionSetBroker.get(brokerKey());
if (ss instanceof CompactingHashTable) {
@SuppressWarnings("unchecked")
CompactingHashTable<OT> solutionS... | java | protected Collector<OT> createSolutionSetUpdateOutputCollector(Collector<OT> delegate) {
Broker<Object> solutionSetBroker = SolutionSetBroker.instance();
Object ss = solutionSetBroker.get(brokerKey());
if (ss instanceof CompactingHashTable) {
@SuppressWarnings("unchecked")
CompactingHashTable<OT> solutionS... | [
"protected",
"Collector",
"<",
"OT",
">",
"createSolutionSetUpdateOutputCollector",
"(",
"Collector",
"<",
"OT",
">",
"delegate",
")",
"{",
"Broker",
"<",
"Object",
">",
"solutionSetBroker",
"=",
"SolutionSetBroker",
".",
"instance",
"(",
")",
";",
"Object",
"ss... | Creates a new solution set update output collector.
<p>This collector is used by {@link IterationIntermediateTask} or {@link IterationTailTask} to update the
solution set of workset iterations. Depending on the task configuration, either a fast (non-probing)
{@link org.apache.flink.runtime.iterative.io.SolutionSetFast... | [
"Creates",
"a",
"new",
"solution",
"set",
"update",
"output",
"collector",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/iterative/task/AbstractIterativeTask.java#L341-L357 |
124,110 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java | RpcUtils.terminateRpcService | public static void terminateRpcService(RpcService rpcService, Time timeout) throws InterruptedException, ExecutionException, TimeoutException {
rpcService.stopService().get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
} | java | public static void terminateRpcService(RpcService rpcService, Time timeout) throws InterruptedException, ExecutionException, TimeoutException {
rpcService.stopService().get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"void",
"terminateRpcService",
"(",
"RpcService",
"rpcService",
",",
"Time",
"timeout",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"rpcService",
".",
"stopService",
"(",
")",
".",
"get",
"(",
... | Shuts the given rpc service down and waits for its termination.
@param rpcService to shut down
@param timeout for this operation
@throws InterruptedException if the operation has been interrupted
@throws ExecutionException if a problem occurred
@throws TimeoutException if a timeout occurred | [
"Shuts",
"the",
"given",
"rpc",
"service",
"down",
"and",
"waits",
"for",
"its",
"termination",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java#L89-L91 |
124,111 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java | RpcUtils.terminateRpcServices | public static void terminateRpcServices(
Time timeout,
RpcService... rpcServices) throws InterruptedException, ExecutionException, TimeoutException {
final Collection<CompletableFuture<?>> terminationFutures = new ArrayList<>(rpcServices.length);
for (RpcService service : rpcServices) {
if (service != nul... | java | public static void terminateRpcServices(
Time timeout,
RpcService... rpcServices) throws InterruptedException, ExecutionException, TimeoutException {
final Collection<CompletableFuture<?>> terminationFutures = new ArrayList<>(rpcServices.length);
for (RpcService service : rpcServices) {
if (service != nul... | [
"public",
"static",
"void",
"terminateRpcServices",
"(",
"Time",
"timeout",
",",
"RpcService",
"...",
"rpcServices",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"final",
"Collection",
"<",
"CompletableFuture",
"<",
"... | Shuts the given rpc services down and waits for their termination.
@param rpcServices to shut down
@param timeout for this operation
@throws InterruptedException if the operation has been interrupted
@throws ExecutionException if a problem occurred
@throws TimeoutException if a timeout occurred | [
"Shuts",
"the",
"given",
"rpc",
"services",
"down",
"and",
"waits",
"for",
"their",
"termination",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java#L102-L114 |
124,112 | apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/PlanNode.java | PlanNode.setBroadcastInputs | public void setBroadcastInputs(List<NamedChannel> broadcastInputs) {
if (broadcastInputs != null) {
this.broadcastInputs = broadcastInputs;
// update the branch map
for (NamedChannel nc : broadcastInputs) {
PlanNode source = nc.getSource();
mergeBranchPlanMaps(branchPlan, source.branchPlan);... | java | public void setBroadcastInputs(List<NamedChannel> broadcastInputs) {
if (broadcastInputs != null) {
this.broadcastInputs = broadcastInputs;
// update the branch map
for (NamedChannel nc : broadcastInputs) {
PlanNode source = nc.getSource();
mergeBranchPlanMaps(branchPlan, source.branchPlan);... | [
"public",
"void",
"setBroadcastInputs",
"(",
"List",
"<",
"NamedChannel",
">",
"broadcastInputs",
")",
"{",
"if",
"(",
"broadcastInputs",
"!=",
"null",
")",
"{",
"this",
".",
"broadcastInputs",
"=",
"broadcastInputs",
";",
"// update the branch map",
"for",
"(",
... | Sets a list of all broadcast inputs attached to this node. | [
"Sets",
"a",
"list",
"of",
"all",
"broadcast",
"inputs",
"attached",
"to",
"this",
"node",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/PlanNode.java#L341-L366 |
124,113 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java | AsyncWaitOperator.stopResources | private void stopResources(boolean waitForShutdown) throws InterruptedException {
emitter.stop();
emitterThread.interrupt();
executor.shutdown();
if (waitForShutdown) {
try {
if (!executor.awaitTermination(365L, TimeUnit.DAYS)) {
executor.shutdownNow();
}
} catch (InterruptedException e) {
... | java | private void stopResources(boolean waitForShutdown) throws InterruptedException {
emitter.stop();
emitterThread.interrupt();
executor.shutdown();
if (waitForShutdown) {
try {
if (!executor.awaitTermination(365L, TimeUnit.DAYS)) {
executor.shutdownNow();
}
} catch (InterruptedException e) {
... | [
"private",
"void",
"stopResources",
"(",
"boolean",
"waitForShutdown",
")",
"throws",
"InterruptedException",
"{",
"emitter",
".",
"stop",
"(",
")",
";",
"emitterThread",
".",
"interrupt",
"(",
")",
";",
"executor",
".",
"shutdown",
"(",
")",
";",
"if",
"(",... | Close the operator's resources. They include the emitter thread and the executor to run
the queue's complete operation.
@param waitForShutdown is true if the method should wait for the resources to be freed;
otherwise false.
@throws InterruptedException if current thread has been interrupted | [
"Close",
"the",
"operator",
"s",
"resources",
".",
"They",
"include",
"the",
"emitter",
"thread",
"and",
"the",
"executor",
"to",
"run",
"the",
"queue",
"s",
"complete",
"operation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java#L350-L381 |
124,114 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java | AsyncWaitOperator.addAsyncBufferEntry | private <T> void addAsyncBufferEntry(StreamElementQueueEntry<T> streamElementQueueEntry) throws InterruptedException {
assert(Thread.holdsLock(checkpointingLock));
pendingStreamElementQueueEntry = streamElementQueueEntry;
while (!queue.tryPut(streamElementQueueEntry)) {
// we wait for the emitter to notify u... | java | private <T> void addAsyncBufferEntry(StreamElementQueueEntry<T> streamElementQueueEntry) throws InterruptedException {
assert(Thread.holdsLock(checkpointingLock));
pendingStreamElementQueueEntry = streamElementQueueEntry;
while (!queue.tryPut(streamElementQueueEntry)) {
// we wait for the emitter to notify u... | [
"private",
"<",
"T",
">",
"void",
"addAsyncBufferEntry",
"(",
"StreamElementQueueEntry",
"<",
"T",
">",
"streamElementQueueEntry",
")",
"throws",
"InterruptedException",
"{",
"assert",
"(",
"Thread",
".",
"holdsLock",
"(",
"checkpointingLock",
")",
")",
";",
"pend... | Add the given stream element queue entry to the operator's stream element queue. This
operation blocks until the element has been added.
<p>For that it tries to put the element into the queue and if not successful then it waits on
the checkpointing lock. The checkpointing lock is also used by the {@link Emitter} to ou... | [
"Add",
"the",
"given",
"stream",
"element",
"queue",
"entry",
"to",
"the",
"operator",
"s",
"stream",
"element",
"queue",
".",
"This",
"operation",
"blocks",
"until",
"the",
"element",
"has",
"been",
"added",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java#L396-L407 |
124,115 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/JobResultDeserializer.java | JobResultDeserializer.assertNotEndOfInput | private static void assertNotEndOfInput(
final JsonParser p,
@Nullable final JsonToken jsonToken) {
checkState(jsonToken != null, "Unexpected end of input at %s", p.getCurrentLocation());
} | java | private static void assertNotEndOfInput(
final JsonParser p,
@Nullable final JsonToken jsonToken) {
checkState(jsonToken != null, "Unexpected end of input at %s", p.getCurrentLocation());
} | [
"private",
"static",
"void",
"assertNotEndOfInput",
"(",
"final",
"JsonParser",
"p",
",",
"@",
"Nullable",
"final",
"JsonToken",
"jsonToken",
")",
"{",
"checkState",
"(",
"jsonToken",
"!=",
"null",
",",
"\"Unexpected end of input at %s\"",
",",
"p",
".",
"getCurre... | Asserts that the provided JsonToken is not null, i.e., not at the end of the input. | [
"Asserts",
"that",
"the",
"provided",
"JsonToken",
"is",
"not",
"null",
"i",
".",
"e",
".",
"not",
"at",
"the",
"end",
"of",
"the",
"input",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/JobResultDeserializer.java#L151-L155 |
124,116 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java | DualInputOperator.setFirstInputs | @Deprecated
public void setFirstInputs(List<Operator<IN1>> inputs) {
this.input1 = Operator.createUnionCascade(inputs);
} | java | @Deprecated
public void setFirstInputs(List<Operator<IN1>> inputs) {
this.input1 = Operator.createUnionCascade(inputs);
} | [
"@",
"Deprecated",
"public",
"void",
"setFirstInputs",
"(",
"List",
"<",
"Operator",
"<",
"IN1",
">",
">",
"inputs",
")",
"{",
"this",
".",
"input1",
"=",
"Operator",
".",
"createUnionCascade",
"(",
"inputs",
")",
";",
"}"
] | Sets the first input to the union of the given operators.
@param inputs The operator(s) that form the first inputs.
@deprecated This method will be removed in future versions. Use the {@link Union} operator instead. | [
"Sets",
"the",
"first",
"input",
"to",
"the",
"union",
"of",
"the",
"given",
"operators",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java#L184-L187 |
124,117 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java | DualInputOperator.setSecondInputs | @Deprecated
public void setSecondInputs(List<Operator<IN2>> inputs) {
this.input2 = Operator.createUnionCascade(inputs);
} | java | @Deprecated
public void setSecondInputs(List<Operator<IN2>> inputs) {
this.input2 = Operator.createUnionCascade(inputs);
} | [
"@",
"Deprecated",
"public",
"void",
"setSecondInputs",
"(",
"List",
"<",
"Operator",
"<",
"IN2",
">",
">",
"inputs",
")",
"{",
"this",
".",
"input2",
"=",
"Operator",
".",
"createUnionCascade",
"(",
"inputs",
")",
";",
"}"
] | Sets the second input to the union of the given operators.
@param inputs The operator(s) that form the second inputs.
@deprecated This method will be removed in future versions. Use the {@link Union} operator instead. | [
"Sets",
"the",
"second",
"input",
"to",
"the",
"union",
"of",
"the",
"given",
"operators",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java#L195-L198 |
124,118 | apache/flink | flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java | HistoryServerArchiveFetcher.updateJobOverview | private static void updateJobOverview(File webOverviewDir, File webDir) {
try (JsonGenerator gen = jacksonFactory.createGenerator(HistoryServer.createOrGetFile(webDir, JobsOverviewHeaders.URL))) {
File[] overviews = new File(webOverviewDir.getPath()).listFiles();
if (overviews != null) {
Collection<JobDetai... | java | private static void updateJobOverview(File webOverviewDir, File webDir) {
try (JsonGenerator gen = jacksonFactory.createGenerator(HistoryServer.createOrGetFile(webDir, JobsOverviewHeaders.URL))) {
File[] overviews = new File(webOverviewDir.getPath()).listFiles();
if (overviews != null) {
Collection<JobDetai... | [
"private",
"static",
"void",
"updateJobOverview",
"(",
"File",
"webOverviewDir",
",",
"File",
"webDir",
")",
"{",
"try",
"(",
"JsonGenerator",
"gen",
"=",
"jacksonFactory",
".",
"createGenerator",
"(",
"HistoryServer",
".",
"createOrGetFile",
"(",
"webDir",
",",
... | This method replicates the JSON response that would be given by the JobsOverviewHandler when
listing both running and finished jobs.
<p>Every job archive contains a joboverview.json file containing the same structure. Since jobs are archived on
their own however the list of finished jobs only contains a single job.
<... | [
"This",
"method",
"replicates",
"the",
"JSON",
"response",
"that",
"would",
"be",
"given",
"by",
"the",
"JobsOverviewHandler",
"when",
"listing",
"both",
"running",
"and",
"finished",
"jobs",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java#L285-L299 |
124,119 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/retriever/LeaderRetriever.java | LeaderRetriever.getLeaderNow | public Optional<Tuple2<String, UUID>> getLeaderNow() throws Exception {
CompletableFuture<Tuple2<String, UUID>> leaderFuture = this.atomicLeaderFuture.get();
if (leaderFuture != null) {
if (leaderFuture.isDone()) {
return Optional.of(leaderFuture.get());
} else {
return Optional.empty();
}
} else... | java | public Optional<Tuple2<String, UUID>> getLeaderNow() throws Exception {
CompletableFuture<Tuple2<String, UUID>> leaderFuture = this.atomicLeaderFuture.get();
if (leaderFuture != null) {
if (leaderFuture.isDone()) {
return Optional.of(leaderFuture.get());
} else {
return Optional.empty();
}
} else... | [
"public",
"Optional",
"<",
"Tuple2",
"<",
"String",
",",
"UUID",
">",
">",
"getLeaderNow",
"(",
")",
"throws",
"Exception",
"{",
"CompletableFuture",
"<",
"Tuple2",
"<",
"String",
",",
"UUID",
">",
">",
"leaderFuture",
"=",
"this",
".",
"atomicLeaderFuture",... | Returns the current leader information if available. Otherwise it returns an
empty optional.
@return The current leader information if available. Otherwise it returns an
empty optional.
@throws Exception if the leader future has been completed with an exception | [
"Returns",
"the",
"current",
"leader",
"information",
"if",
"available",
".",
"Otherwise",
"it",
"returns",
"an",
"empty",
"optional",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/retriever/LeaderRetriever.java#L52-L63 |
124,120 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java | Types.ENUM | public static <E extends Enum<E>> TypeInformation<E> ENUM(Class<E> enumType) {
return new EnumTypeInfo<>(enumType);
} | java | public static <E extends Enum<E>> TypeInformation<E> ENUM(Class<E> enumType) {
return new EnumTypeInfo<>(enumType);
} | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"TypeInformation",
"<",
"E",
">",
"ENUM",
"(",
"Class",
"<",
"E",
">",
"enumType",
")",
"{",
"return",
"new",
"EnumTypeInfo",
"<>",
"(",
"enumType",
")",
";",
"}"
] | Returns type information for Java enumerations. Null values are not supported.
@param enumType enumeration class extending {@link java.lang.Enum} | [
"Returns",
"type",
"information",
"for",
"Java",
"enumerations",
".",
"Null",
"values",
"are",
"not",
"supported",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java#L440-L442 |
124,121 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java | JoinOperatorSetsBase.where | public JoinOperatorSetsPredicateBase where(String... fields) {
return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType()));
} | java | public JoinOperatorSetsPredicateBase where(String... fields) {
return new JoinOperatorSetsPredicateBase(new Keys.ExpressionKeys<>(fields, input1.getType()));
} | [
"public",
"JoinOperatorSetsPredicateBase",
"where",
"(",
"String",
"...",
"fields",
")",
"{",
"return",
"new",
"JoinOperatorSetsPredicateBase",
"(",
"new",
"Keys",
".",
"ExpressionKeys",
"<>",
"(",
"fields",
",",
"input1",
".",
"getType",
"(",
")",
")",
")",
"... | Continues a Join transformation.
<p>Defines the fields of the first join {@link DataSet} that should be used as grouping keys. Fields
are the names of member fields of the underlying type of the data set.
@param fields The fields of the first join DataSets that should be used as keys.
@return An incomplete Join tran... | [
"Continues",
"a",
"Join",
"transformation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java#L109-L111 |
124,122 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java | InstanceManager.registerTaskManager | public InstanceID registerTaskManager(
TaskManagerGateway taskManagerGateway,
TaskManagerLocation taskManagerLocation,
HardwareDescription resources,
int numberOfSlots) {
synchronized (this.lock) {
if (this.isShutdown) {
throw new IllegalStateException("InstanceManager is shut down.");
}
... | java | public InstanceID registerTaskManager(
TaskManagerGateway taskManagerGateway,
TaskManagerLocation taskManagerLocation,
HardwareDescription resources,
int numberOfSlots) {
synchronized (this.lock) {
if (this.isShutdown) {
throw new IllegalStateException("InstanceManager is shut down.");
}
... | [
"public",
"InstanceID",
"registerTaskManager",
"(",
"TaskManagerGateway",
"taskManagerGateway",
",",
"TaskManagerLocation",
"taskManagerLocation",
",",
"HardwareDescription",
"resources",
",",
"int",
"numberOfSlots",
")",
"{",
"synchronized",
"(",
"this",
".",
"lock",
")"... | Registers a task manager. Registration of a task manager makes it available to be used
for the job execution.
@param taskManagerGateway gateway to the task manager
@param taskManagerLocation Location info of the TaskManager
@param resources Hardware description of the TaskManager
@param numberOfSlots Number of availab... | [
"Registers",
"a",
"task",
"manager",
".",
"Registration",
"of",
"a",
"task",
"manager",
"makes",
"it",
"available",
"to",
"be",
"used",
"for",
"the",
"job",
"execution",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java#L137-L193 |
124,123 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java | InstanceManager.unregisterAllTaskManagers | public void unregisterAllTaskManagers() {
for(Instance instance: registeredHostsById.values()) {
deadHosts.add(instance.getTaskManagerID());
instance.markDead();
totalNumberOfAliveTaskSlots -= instance.getTotalNumberOfSlots();
notifyDeadInstance(instance);
}
registeredHostsById.clear();
register... | java | public void unregisterAllTaskManagers() {
for(Instance instance: registeredHostsById.values()) {
deadHosts.add(instance.getTaskManagerID());
instance.markDead();
totalNumberOfAliveTaskSlots -= instance.getTotalNumberOfSlots();
notifyDeadInstance(instance);
}
registeredHostsById.clear();
register... | [
"public",
"void",
"unregisterAllTaskManagers",
"(",
")",
"{",
"for",
"(",
"Instance",
"instance",
":",
"registeredHostsById",
".",
"values",
"(",
")",
")",
"{",
"deadHosts",
".",
"add",
"(",
"instance",
".",
"getTaskManagerID",
"(",
")",
")",
";",
"instance"... | Unregisters all currently registered TaskManagers from the InstanceManager. | [
"Unregisters",
"all",
"currently",
"registered",
"TaskManagers",
"from",
"the",
"InstanceManager",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java#L230-L243 |
124,124 | apache/flink | flink-core/src/main/java/org/apache/flink/types/Row.java | Row.of | public static Row of(Object... values) {
Row row = new Row(values.length);
for (int i = 0; i < values.length; i++) {
row.setField(i, values[i]);
}
return row;
} | java | public static Row of(Object... values) {
Row row = new Row(values.length);
for (int i = 0; i < values.length; i++) {
row.setField(i, values[i]);
}
return row;
} | [
"public",
"static",
"Row",
"of",
"(",
"Object",
"...",
"values",
")",
"{",
"Row",
"row",
"=",
"new",
"Row",
"(",
"values",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values",
".",
"length",
";",
"i",
"++",
")",
... | Creates a new Row and assigns the given values to the Row's fields.
This is more convenient than using the constructor.
<p>For example:
<pre>
Row.of("hello", true, 1L);}
</pre>
instead of
<pre>
Row row = new Row(3);
row.setField(0, "hello");
row.setField(1, true);
row.setField(2, 1L);
</pre> | [
"Creates",
"a",
"new",
"Row",
"and",
"assigns",
"the",
"given",
"values",
"to",
"the",
"Row",
"s",
"fields",
".",
"This",
"is",
"more",
"convenient",
"than",
"using",
"the",
"constructor",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Row.java#L135-L141 |
124,125 | apache/flink | flink-core/src/main/java/org/apache/flink/types/Row.java | Row.copy | public static Row copy(Row row) {
final Row newRow = new Row(row.fields.length);
System.arraycopy(row.fields, 0, newRow.fields, 0, row.fields.length);
return newRow;
} | java | public static Row copy(Row row) {
final Row newRow = new Row(row.fields.length);
System.arraycopy(row.fields, 0, newRow.fields, 0, row.fields.length);
return newRow;
} | [
"public",
"static",
"Row",
"copy",
"(",
"Row",
"row",
")",
"{",
"final",
"Row",
"newRow",
"=",
"new",
"Row",
"(",
"row",
".",
"fields",
".",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"row",
".",
"fields",
",",
"0",
",",
"newRow",
".",
... | Creates a new Row which copied from another row.
This method does not perform a deep copy.
@param row The row being copied.
@return The cloned new Row | [
"Creates",
"a",
"new",
"Row",
"which",
"copied",
"from",
"another",
"row",
".",
"This",
"method",
"does",
"not",
"perform",
"a",
"deep",
"copy",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Row.java#L150-L154 |
124,126 | apache/flink | flink-core/src/main/java/org/apache/flink/types/Row.java | Row.project | public static Row project(Row row, int[] fields) {
final Row newRow = new Row(fields.length);
for (int i = 0; i < fields.length; i++) {
newRow.fields[i] = row.fields[fields[i]];
}
return newRow;
} | java | public static Row project(Row row, int[] fields) {
final Row newRow = new Row(fields.length);
for (int i = 0; i < fields.length; i++) {
newRow.fields[i] = row.fields[fields[i]];
}
return newRow;
} | [
"public",
"static",
"Row",
"project",
"(",
"Row",
"row",
",",
"int",
"[",
"]",
"fields",
")",
"{",
"final",
"Row",
"newRow",
"=",
"new",
"Row",
"(",
"fields",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fields",
"... | Creates a new Row with projected fields from another row.
This method does not perform a deep copy.
@param fields fields to be projected
@return the new projected Row | [
"Creates",
"a",
"new",
"Row",
"with",
"projected",
"fields",
"from",
"another",
"row",
".",
"This",
"method",
"does",
"not",
"perform",
"a",
"deep",
"copy",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Row.java#L163-L169 |
124,127 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.copyToUnsafe | public static void copyToUnsafe(
MemorySegment[] segments,
int offset,
Object target,
int pointer,
int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
segments[0].copyToUnsafe(offset, target, pointer, numBytes);
} else {
copyMultiSegmentsToUnsafe(segments, offset, target, pointer,... | java | public static void copyToUnsafe(
MemorySegment[] segments,
int offset,
Object target,
int pointer,
int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
segments[0].copyToUnsafe(offset, target, pointer, numBytes);
} else {
copyMultiSegmentsToUnsafe(segments, offset, target, pointer,... | [
"public",
"static",
"void",
"copyToUnsafe",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"Object",
"target",
",",
"int",
"pointer",
",",
"int",
"numBytes",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
","... | Copy segments to target unsafe pointer.
@param segments Source segments.
@param offset The position where the bytes are started to be read from these memory
segments.
@param target The unsafe memory to copy the bytes to.
@param pointer The position in the target unsafe memory to copy the chunk to.
@param numBytes... | [
"Copy",
"segments",
"to",
"target",
"unsafe",
"pointer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L160-L171 |
124,128 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getBytes | public static byte[] getBytes(MemorySegment[] segments, int baseOffset, int sizeInBytes) {
// avoid copy if `base` is `byte[]`
if (segments.length == 1) {
byte[] heapMemory = segments[0].getHeapMemory();
if (baseOffset == 0
&& heapMemory != null
&& heapMemory.length == sizeInBytes) {
return heapMe... | java | public static byte[] getBytes(MemorySegment[] segments, int baseOffset, int sizeInBytes) {
// avoid copy if `base` is `byte[]`
if (segments.length == 1) {
byte[] heapMemory = segments[0].getHeapMemory();
if (baseOffset == 0
&& heapMemory != null
&& heapMemory.length == sizeInBytes) {
return heapMe... | [
"public",
"static",
"byte",
"[",
"]",
"getBytes",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"sizeInBytes",
")",
"{",
"// avoid copy if `base` is `byte[]`",
"if",
"(",
"segments",
".",
"length",
"==",
"1",
")",
"{",
"by... | Maybe not copied, if want copy, please use copyTo. | [
"Maybe",
"not",
"copied",
"if",
"want",
"copy",
"please",
"use",
"copyTo",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L284-L302 |
124,129 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.hashByWords | public static int hashByWords(MemorySegment[] segments, int offset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
return MurmurHashUtil.hashBytesByWords(segments[0], offset, numBytes);
} else {
return hashMultiSegByWords(segments, offset, numBytes);
}
} | java | public static int hashByWords(MemorySegment[] segments, int offset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
return MurmurHashUtil.hashBytesByWords(segments[0], offset, numBytes);
} else {
return hashMultiSegByWords(segments, offset, numBytes);
}
} | [
"public",
"static",
"int",
"hashByWords",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"numBytes",
")",
")",
"{",
"return",
"MurmurHash... | hash segments to int, numBytes must be aligned to 4 bytes.
@param segments Source segments.
@param offset Source segments offset.
@param numBytes the number bytes to hash. | [
"hash",
"segments",
"to",
"int",
"numBytes",
"must",
"be",
"aligned",
"to",
"4",
"bytes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L370-L376 |
124,130 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.hash | public static int hash(MemorySegment[] segments, int offset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
return MurmurHashUtil.hashBytes(segments[0], offset, numBytes);
} else {
return hashMultiSeg(segments, offset, numBytes);
}
} | java | public static int hash(MemorySegment[] segments, int offset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
return MurmurHashUtil.hashBytes(segments[0], offset, numBytes);
} else {
return hashMultiSeg(segments, offset, numBytes);
}
} | [
"public",
"static",
"int",
"hash",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"numBytes",
")",
")",
"{",
"return",
"MurmurHashUtil",
... | hash segments to int.
@param segments Source segments.
@param offset Source segments offset.
@param numBytes the number bytes to hash. | [
"hash",
"segments",
"to",
"int",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L391-L397 |
124,131 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitUnSet | public static void bitUnSet(MemorySegment segment, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
current &= ~(1 << (index & BIT_BYTE_INDEX_MASK));
segment.put(offset, current);
} | java | public static void bitUnSet(MemorySegment segment, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
current &= ~(1 << (index & BIT_BYTE_INDEX_MASK));
segment.put(offset, current);
} | [
"public",
"static",
"void",
"bitUnSet",
"(",
"MemorySegment",
"segment",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"index",
"&",
"BIT_BYTE_POSITION_MASK",
")",
">>>",
"3",
")",
";",
"byte",
... | unset bit.
@param segment target segment.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"unset",
"bit",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L419-L424 |
124,132 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitGet | public static boolean bitGet(MemorySegment segment, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | java | public static boolean bitGet(MemorySegment segment, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | [
"public",
"static",
"boolean",
"bitGet",
"(",
"MemorySegment",
"segment",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"index",
"&",
"BIT_BYTE_POSITION_MASK",
")",
">>>",
"3",
")",
";",
"byte",... | read bit.
@param segment target segment.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"read",
"bit",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L447-L451 |
124,133 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitUnSet | public static void bitUnSet(MemorySegment[] segments, int baseOffset, int index) {
if (segments.length == 1) {
MemorySegment segment = segments[0];
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
current &= ~(1 << (index & BIT_BYTE_INDEX_MASK));
s... | java | public static void bitUnSet(MemorySegment[] segments, int baseOffset, int index) {
if (segments.length == 1) {
MemorySegment segment = segments[0];
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = segment.get(offset);
current &= ~(1 << (index & BIT_BYTE_INDEX_MASK));
s... | [
"public",
"static",
"void",
"bitUnSet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"if",
"(",
"segments",
".",
"length",
"==",
"1",
")",
"{",
"MemorySegment",
"segment",
"=",
"segments",
"[",
"0",... | unset bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"unset",
"bit",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L460-L470 |
124,134 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitSet | public static void bitSet(MemorySegment[] segments, int baseOffset, int index) {
if (segments.length == 1) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
MemorySegment segment = segments[0];
byte current = segment.get(offset);
current |= (1 << (index & BIT_BYTE_INDEX_MASK));
segm... | java | public static void bitSet(MemorySegment[] segments, int baseOffset, int index) {
if (segments.length == 1) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
MemorySegment segment = segments[0];
byte current = segment.get(offset);
current |= (1 << (index & BIT_BYTE_INDEX_MASK));
segm... | [
"public",
"static",
"void",
"bitSet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"if",
"(",
"segments",
".",
"length",
"==",
"1",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"... | set bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"set",
"bit",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L491-L501 |
124,135 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitGet | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = getByte(segments, offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | java | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = getByte(segments, offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | [
"public",
"static",
"boolean",
"bitGet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"index",
"&",
"BIT_BYTE_POSITION_MASK",
")",
">>>",
"3",
")",
... | read bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"read",
"bit",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L522-L526 |
124,136 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getBoolean | public static boolean getBoolean(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 1)) {
return segments[0].getBoolean(offset);
} else {
return getBooleanMultiSegments(segments, offset);
}
} | java | public static boolean getBoolean(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 1)) {
return segments[0].getBoolean(offset);
} else {
return getBooleanMultiSegments(segments, offset);
}
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"1",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"ge... | get boolean from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"boolean",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L534-L540 |
124,137 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setBoolean | public static void setBoolean(MemorySegment[] segments, int offset, boolean value) {
if (inFirstSegment(segments, offset, 1)) {
segments[0].putBoolean(offset, value);
} else {
setBooleanMultiSegments(segments, offset, value);
}
} | java | public static void setBoolean(MemorySegment[] segments, int offset, boolean value) {
if (inFirstSegment(segments, offset, 1)) {
segments[0].putBoolean(offset, value);
} else {
setBooleanMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setBoolean",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"1",
")",
")",
"{",
"segments",
"[",
"0",
"... | set boolean from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"boolean",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L555-L561 |
124,138 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getByte | public static byte getByte(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 1)) {
return segments[0].get(offset);
} else {
return getByteMultiSegments(segments, offset);
}
} | java | public static byte getByte(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 1)) {
return segments[0].get(offset);
} else {
return getByteMultiSegments(segments, offset);
}
} | [
"public",
"static",
"byte",
"getByte",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"1",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"get",
... | get byte from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"byte",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L576-L582 |
124,139 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setByte | public static void setByte(MemorySegment[] segments, int offset, byte value) {
if (inFirstSegment(segments, offset, 1)) {
segments[0].put(offset, value);
} else {
setByteMultiSegments(segments, offset, value);
}
} | java | public static void setByte(MemorySegment[] segments, int offset, byte value) {
if (inFirstSegment(segments, offset, 1)) {
segments[0].put(offset, value);
} else {
setByteMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setByte",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"byte",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"1",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set byte from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"byte",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L597-L603 |
124,140 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getInt | public static int getInt(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getInt(offset);
} else {
return getIntMultiSegments(segments, offset);
}
} | java | public static int getInt(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getInt(offset);
} else {
return getIntMultiSegments(segments, offset);
}
} | [
"public",
"static",
"int",
"getInt",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getInt",
... | get int from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"int",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L618-L624 |
124,141 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setInt | public static void setInt(MemorySegment[] segments, int offset, int value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putInt(offset, value);
} else {
setIntMultiSegments(segments, offset, value);
}
} | java | public static void setInt(MemorySegment[] segments, int offset, int value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putInt(offset, value);
} else {
setIntMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setInt",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"int",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"segments",
"[",
"0",
"]",
".... | set int from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"int",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L664-L670 |
124,142 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getLong | public static long getLong(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 8)) {
return segments[0].getLong(offset);
} else {
return getLongMultiSegments(segments, offset);
}
} | java | public static long getLong(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 8)) {
return segments[0].getLong(offset);
} else {
return getLongMultiSegments(segments, offset);
}
} | [
"public",
"static",
"long",
"getLong",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"8",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getLong"... | get long from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"long",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L709-L715 |
124,143 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setLong | public static void setLong(MemorySegment[] segments, int offset, long value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putLong(offset, value);
} else {
setLongMultiSegments(segments, offset, value);
}
} | java | public static void setLong(MemorySegment[] segments, int offset, long value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putLong(offset, value);
} else {
setLongMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setLong",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"long",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"8",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set long from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"long",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L755-L761 |
124,144 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getShort | public static short getShort(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getShort(offset);
} else {
return getShortMultiSegments(segments, offset);
}
} | java | public static short getShort(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getShort(offset);
} else {
return getShortMultiSegments(segments, offset);
}
} | [
"public",
"static",
"short",
"getShort",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getSho... | get short from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"short",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L800-L806 |
124,145 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setShort | public static void setShort(MemorySegment[] segments, int offset, short value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putShort(offset, value);
} else {
setShortMultiSegments(segments, offset, value);
}
} | java | public static void setShort(MemorySegment[] segments, int offset, short value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putShort(offset, value);
} else {
setShortMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setShort",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"short",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set short from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"short",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L826-L832 |
124,146 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getFloat | public static float getFloat(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset);
}
} | java | public static float getFloat(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset);
}
} | [
"public",
"static",
"float",
"getFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getFlo... | get float from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"float",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L852-L858 |
124,147 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setFloat | public static void setFloat(MemorySegment[] segments, int offset, float value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, offset, value);
}
} | java | public static void setFloat(MemorySegment[] segments, int offset, float value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"float",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set float from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"float",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L878-L884 |
124,148 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getDouble | public static double getDouble(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 8)) {
return segments[0].getDouble(offset);
} else {
return getDoubleMultiSegments(segments, offset);
}
} | java | public static double getDouble(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 8)) {
return segments[0].getDouble(offset);
} else {
return getDoubleMultiSegments(segments, offset);
}
} | [
"public",
"static",
"double",
"getDouble",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"8",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getD... | get double from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"double",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L904-L910 |
124,149 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setDouble | public static void setDouble(MemorySegment[] segments, int offset, double value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putDouble(offset, value);
} else {
setDoubleMultiSegments(segments, offset, value);
}
} | java | public static void setDouble(MemorySegment[] segments, int offset, double value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putDouble(offset, value);
} else {
setDoubleMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setDouble",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"double",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"8",
")",
")",
"{",
"segments",
"[",
"0",
"]"... | set double from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"double",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L930-L936 |
124,150 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getChar | public static char getChar(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getChar(offset);
} else {
return getCharMultiSegments(segments, offset);
}
} | java | public static char getChar(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 2)) {
return segments[0].getChar(offset);
} else {
return getCharMultiSegments(segments, offset);
}
} | [
"public",
"static",
"char",
"getChar",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getChar"... | get char from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"char",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L956-L962 |
124,151 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setChar | public static void setChar(MemorySegment[] segments, int offset, char value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putChar(offset, value);
} else {
setCharMultiSegments(segments, offset, value);
}
} | java | public static void setChar(MemorySegment[] segments, int offset, char value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putChar(offset, value);
} else {
setCharMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setChar",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"char",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set char from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"char",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L1002-L1008 |
124,152 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.find | public static int find(
MemorySegment[] segments1, int offset1, int numBytes1,
MemorySegment[] segments2, int offset2, int numBytes2) {
if (numBytes2 == 0) { // quick way 1.
return offset1;
}
if (inFirstSegment(segments1, offset1, numBytes1) &&
inFirstSegment(segments2, offset2, numBytes2)) {
byte fi... | java | public static int find(
MemorySegment[] segments1, int offset1, int numBytes1,
MemorySegment[] segments2, int offset2, int numBytes2) {
if (numBytes2 == 0) { // quick way 1.
return offset1;
}
if (inFirstSegment(segments1, offset1, numBytes1) &&
inFirstSegment(segments2, offset2, numBytes2)) {
byte fi... | [
"public",
"static",
"int",
"find",
"(",
"MemorySegment",
"[",
"]",
"segments1",
",",
"int",
"offset1",
",",
"int",
"numBytes1",
",",
"MemorySegment",
"[",
"]",
"segments2",
",",
"int",
"offset2",
",",
"int",
"numBytes2",
")",
"{",
"if",
"(",
"numBytes2",
... | Find equal segments2 in segments1.
@param segments1 segs to find.
@param segments2 sub segs.
@return Return the found offset, return -1 if not find. | [
"Find",
"equal",
"segments2",
"in",
"segments1",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L1040-L1061 |
124,153 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java | FileSystem.initialize | public static void initialize(
Configuration config,
PluginManager pluginManager) throws IllegalConfigurationException {
LOCK.lock();
try {
// make sure file systems are re-instantiated after re-configuration
CACHE.clear();
FS_FACTORIES.clear();
Collection<Supplier<Iterator<FileSystemFactory>>> fa... | java | public static void initialize(
Configuration config,
PluginManager pluginManager) throws IllegalConfigurationException {
LOCK.lock();
try {
// make sure file systems are re-instantiated after re-configuration
CACHE.clear();
FS_FACTORIES.clear();
Collection<Supplier<Iterator<FileSystemFactory>>> fa... | [
"public",
"static",
"void",
"initialize",
"(",
"Configuration",
"config",
",",
"PluginManager",
"pluginManager",
")",
"throws",
"IllegalConfigurationException",
"{",
"LOCK",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// make sure file systems are re-instantiated after re-co... | Initializes the shared file system settings.
<p>The given configuration is passed to each file system factory to initialize the respective
file systems. Because the configuration of file systems may be different subsequent to the call
of this method, this method clears the file system instance cache.
<p>This method a... | [
"Initializes",
"the",
"shared",
"file",
"system",
"settings",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java#L282-L331 |
124,154 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java | FileSystem.exists | public boolean exists(final Path f) throws IOException {
try {
return (getFileStatus(f) != null);
} catch (FileNotFoundException e) {
return false;
}
} | java | public boolean exists(final Path f) throws IOException {
try {
return (getFileStatus(f) != null);
} catch (FileNotFoundException e) {
return false;
}
} | [
"public",
"boolean",
"exists",
"(",
"final",
"Path",
"f",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"(",
"getFileStatus",
"(",
"f",
")",
"!=",
"null",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"return",
"false",
... | Check if exists.
@param f
source file | [
"Check",
"if",
"exists",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java#L583-L589 |
124,155 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java | FileSystem.loadHadoopFsFactory | private static FileSystemFactory loadHadoopFsFactory() {
final ClassLoader cl = FileSystem.class.getClassLoader();
// first, see if the Flink runtime classes are available
final Class<? extends FileSystemFactory> factoryClass;
try {
factoryClass = Class
.forName("org.apache.flink.runtime.fs.hdfs.Hadoop... | java | private static FileSystemFactory loadHadoopFsFactory() {
final ClassLoader cl = FileSystem.class.getClassLoader();
// first, see if the Flink runtime classes are available
final Class<? extends FileSystemFactory> factoryClass;
try {
factoryClass = Class
.forName("org.apache.flink.runtime.fs.hdfs.Hadoop... | [
"private",
"static",
"FileSystemFactory",
"loadHadoopFsFactory",
"(",
")",
"{",
"final",
"ClassLoader",
"cl",
"=",
"FileSystem",
".",
"class",
".",
"getClassLoader",
"(",
")",
";",
"// first, see if the Flink runtime classes are available",
"final",
"Class",
"<",
"?",
... | Utility loader for the Hadoop file system factory.
We treat the Hadoop FS factory in a special way, because we use it as a catch
all for file systems schemes not supported directly in Flink.
<p>This method does a set of eager checks for availability of certain classes, to
be able to give better error messages. | [
"Utility",
"loader",
"for",
"the",
"Hadoop",
"file",
"system",
"factory",
".",
"We",
"treat",
"the",
"Hadoop",
"FS",
"factory",
"in",
"a",
"special",
"way",
"because",
"we",
"use",
"it",
"as",
"a",
"catch",
"all",
"for",
"file",
"systems",
"schemes",
"no... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java#L1038-L1077 |
124,156 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java | RetryingRegistration.startRegistration | @SuppressWarnings("unchecked")
public void startRegistration() {
if (canceled) {
// we already got canceled
return;
}
try {
// trigger resolution of the target address to a callable gateway
final CompletableFuture<G> rpcGatewayFuture;
if (FencedRpcGateway.class.isAssignableFrom(targetType)) {
... | java | @SuppressWarnings("unchecked")
public void startRegistration() {
if (canceled) {
// we already got canceled
return;
}
try {
// trigger resolution of the target address to a callable gateway
final CompletableFuture<G> rpcGatewayFuture;
if (FencedRpcGateway.class.isAssignableFrom(targetType)) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"startRegistration",
"(",
")",
"{",
"if",
"(",
"canceled",
")",
"{",
"// we already got canceled",
"return",
";",
"}",
"try",
"{",
"// trigger resolution of the target address to a callable gateway",
... | This method resolves the target address to a callable gateway and starts the
registration after that. | [
"This",
"method",
"resolves",
"the",
"target",
"address",
"to",
"a",
"callable",
"gateway",
"and",
"starts",
"the",
"registration",
"after",
"that",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java#L132-L190 |
124,157 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java | RetryingRegistration.register | @SuppressWarnings("unchecked")
private void register(final G gateway, final int attempt, final long timeoutMillis) {
// eager check for canceling to avoid some unnecessary work
if (canceled) {
return;
}
try {
log.info("Registration at {} attempt {} (timeout={}ms)", targetName, attempt, timeoutMillis);
... | java | @SuppressWarnings("unchecked")
private void register(final G gateway, final int attempt, final long timeoutMillis) {
// eager check for canceling to avoid some unnecessary work
if (canceled) {
return;
}
try {
log.info("Registration at {} attempt {} (timeout={}ms)", targetName, attempt, timeoutMillis);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"register",
"(",
"final",
"G",
"gateway",
",",
"final",
"int",
"attempt",
",",
"final",
"long",
"timeoutMillis",
")",
"{",
"// eager check for canceling to avoid some unnecessary work",
"if",
"(",
... | This method performs a registration attempt and triggers either a success notification or a retry,
depending on the result. | [
"This",
"method",
"performs",
"a",
"registration",
"attempt",
"and",
"triggers",
"either",
"a",
"success",
"notification",
"or",
"a",
"retry",
"depending",
"on",
"the",
"result",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/registration/RetryingRegistration.java#L196-L263 |
124,158 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java | PartitionRequestClientHandler.exceptionCaught | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof TransportException) {
notifyAllChannelsOfErrorAndClose(cause);
}
else {
final SocketAddress remoteAddr = ctx.channel().remoteAddress();
final TransportException tex;
// Improve... | java | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof TransportException) {
notifyAllChannelsOfErrorAndClose(cause);
}
else {
final SocketAddress remoteAddr = ctx.channel().remoteAddress();
final TransportException tex;
// Improve... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cause",
"instanceof",
"TransportException",
")",
"{",
"notifyAllChannelsOfErrorAndClose",
"(",
"cause",
... | Called on exceptions in the client handler pipeline.
<p> Remote exceptions are received as regular payload. | [
"Called",
"on",
"exceptions",
"in",
"the",
"client",
"handler",
"pipeline",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java#L145-L174 |
124,159 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.extractTypeFromLambda | public static Type extractTypeFromLambda(
Class<?> baseClass,
LambdaExecutable exec,
int[] lambdaTypeArgumentIndices,
int paramLen,
int baseParametersLen) {
Type output = exec.getParameterTypes()[paramLen - baseParametersLen + lambdaTypeArgumentIndices[0]];
for (int i = 1; i < lambdaTypeArgumentIndices.le... | java | public static Type extractTypeFromLambda(
Class<?> baseClass,
LambdaExecutable exec,
int[] lambdaTypeArgumentIndices,
int paramLen,
int baseParametersLen) {
Type output = exec.getParameterTypes()[paramLen - baseParametersLen + lambdaTypeArgumentIndices[0]];
for (int i = 1; i < lambdaTypeArgumentIndices.le... | [
"public",
"static",
"Type",
"extractTypeFromLambda",
"(",
"Class",
"<",
"?",
">",
"baseClass",
",",
"LambdaExecutable",
"exec",
",",
"int",
"[",
"]",
"lambdaTypeArgumentIndices",
",",
"int",
"paramLen",
",",
"int",
"baseParametersLen",
")",
"{",
"Type",
"output"... | Extracts type from given index from lambda. It supports nested types.
@param baseClass SAM function that the lambda implements
@param exec lambda function to extract the type from
@param lambdaTypeArgumentIndices position of type to extract in type hierarchy
@param paramLen count of total parameters of the lambda (inc... | [
"Extracts",
"type",
"from",
"given",
"index",
"from",
"lambda",
".",
"It",
"supports",
"nested",
"types",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L168-L181 |
124,160 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.extractTypeArgument | public static Type extractTypeArgument(Type t, int index) throws InvalidTypesException {
if (t instanceof ParameterizedType) {
Type[] actualTypeArguments = ((ParameterizedType) t).getActualTypeArguments();
if (index < 0 || index >= actualTypeArguments.length) {
throw new InvalidTypesException("Cannot extra... | java | public static Type extractTypeArgument(Type t, int index) throws InvalidTypesException {
if (t instanceof ParameterizedType) {
Type[] actualTypeArguments = ((ParameterizedType) t).getActualTypeArguments();
if (index < 0 || index >= actualTypeArguments.length) {
throw new InvalidTypesException("Cannot extra... | [
"public",
"static",
"Type",
"extractTypeArgument",
"(",
"Type",
"t",
",",
"int",
"index",
")",
"throws",
"InvalidTypesException",
"{",
"if",
"(",
"t",
"instanceof",
"ParameterizedType",
")",
"{",
"Type",
"[",
"]",
"actualTypeArguments",
"=",
"(",
"(",
"Paramet... | This method extracts the n-th type argument from the given type. An InvalidTypesException
is thrown if the type does not have any type arguments or if the index exceeds the number
of type arguments.
@param t Type to extract the type arguments from
@param index Index of the type argument to extract
@return The extracte... | [
"This",
"method",
"extracts",
"the",
"n",
"-",
"th",
"type",
"argument",
"from",
"the",
"given",
"type",
".",
"An",
"InvalidTypesException",
"is",
"thrown",
"if",
"the",
"type",
"does",
"not",
"have",
"any",
"type",
"arguments",
"or",
"if",
"the",
"index",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L194-L208 |
124,161 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.getAllDeclaredMethods | public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
List<Method> result = new ArrayList<>();
while (clazz != null) {
Method[] methods = clazz.getDeclaredMethods();
Collections.addAll(result, methods);
clazz = clazz.getSuperclass();
}
return result;
} | java | public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
List<Method> result = new ArrayList<>();
while (clazz != null) {
Method[] methods = clazz.getDeclaredMethods();
Collections.addAll(result, methods);
clazz = clazz.getSuperclass();
}
return result;
} | [
"public",
"static",
"List",
"<",
"Method",
">",
"getAllDeclaredMethods",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"List",
"<",
"Method",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"while",
"(",
"clazz",
"!=",
"null",
")",
"{"... | Returns all declared methods of a class including methods of superclasses. | [
"Returns",
"all",
"declared",
"methods",
"of",
"a",
"class",
"including",
"methods",
"of",
"superclasses",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L247-L255 |
124,162 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.typeToClass | public static Class<?> typeToClass(Type t) {
if (t instanceof Class) {
return (Class<?>)t;
}
else if (t instanceof ParameterizedType) {
return ((Class<?>) ((ParameterizedType) t).getRawType());
}
throw new IllegalArgumentException("Cannot convert type to class");
} | java | public static Class<?> typeToClass(Type t) {
if (t instanceof Class) {
return (Class<?>)t;
}
else if (t instanceof ParameterizedType) {
return ((Class<?>) ((ParameterizedType) t).getRawType());
}
throw new IllegalArgumentException("Cannot convert type to class");
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"typeToClass",
"(",
"Type",
"t",
")",
"{",
"if",
"(",
"t",
"instanceof",
"Class",
")",
"{",
"return",
"(",
"Class",
"<",
"?",
">",
")",
"t",
";",
"}",
"else",
"if",
"(",
"t",
"instanceof",
"ParameterizedT... | Convert ParameterizedType or Class to a Class. | [
"Convert",
"ParameterizedType",
"or",
"Class",
"to",
"a",
"Class",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L260-L268 |
124,163 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.sameTypeVars | public static boolean sameTypeVars(Type t1, Type t2) {
return t1 instanceof TypeVariable &&
t2 instanceof TypeVariable &&
((TypeVariable<?>) t1).getName().equals(((TypeVariable<?>) t2).getName()) &&
((TypeVariable<?>) t1).getGenericDeclaration().equals(((TypeVariable<?>) t2).getGenericDeclaration());
} | java | public static boolean sameTypeVars(Type t1, Type t2) {
return t1 instanceof TypeVariable &&
t2 instanceof TypeVariable &&
((TypeVariable<?>) t1).getName().equals(((TypeVariable<?>) t2).getName()) &&
((TypeVariable<?>) t1).getGenericDeclaration().equals(((TypeVariable<?>) t2).getGenericDeclaration());
} | [
"public",
"static",
"boolean",
"sameTypeVars",
"(",
"Type",
"t1",
",",
"Type",
"t2",
")",
"{",
"return",
"t1",
"instanceof",
"TypeVariable",
"&&",
"t2",
"instanceof",
"TypeVariable",
"&&",
"(",
"(",
"TypeVariable",
"<",
"?",
">",
")",
"t1",
")",
".",
"ge... | Checks whether two types are type variables describing the same. | [
"Checks",
"whether",
"two",
"types",
"are",
"type",
"variables",
"describing",
"the",
"same",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L280-L285 |
124,164 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.getTypeHierarchy | public static Type getTypeHierarchy(List<Type> typeHierarchy, Type t, Class<?> stopAtClass) {
while (!(isClassType(t) && typeToClass(t).equals(stopAtClass))) {
typeHierarchy.add(t);
t = typeToClass(t).getGenericSuperclass();
if (t == null) {
break;
}
}
return t;
} | java | public static Type getTypeHierarchy(List<Type> typeHierarchy, Type t, Class<?> stopAtClass) {
while (!(isClassType(t) && typeToClass(t).equals(stopAtClass))) {
typeHierarchy.add(t);
t = typeToClass(t).getGenericSuperclass();
if (t == null) {
break;
}
}
return t;
} | [
"public",
"static",
"Type",
"getTypeHierarchy",
"(",
"List",
"<",
"Type",
">",
"typeHierarchy",
",",
"Type",
"t",
",",
"Class",
"<",
"?",
">",
"stopAtClass",
")",
"{",
"while",
"(",
"!",
"(",
"isClassType",
"(",
"t",
")",
"&&",
"typeToClass",
"(",
"t",... | Traverses the type hierarchy of a type up until a certain stop class is found.
@param t type for which a hierarchy need to be created
@return type of the immediate child of the stop class | [
"Traverses",
"the",
"type",
"hierarchy",
"of",
"a",
"type",
"up",
"until",
"a",
"certain",
"stop",
"class",
"is",
"found",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L293-L303 |
124,165 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.hasSuperclass | public static boolean hasSuperclass(Class<?> clazz, String superClassName) {
List<Type> hierarchy = new ArrayList<>();
getTypeHierarchy(hierarchy, clazz, Object.class);
for (Type t : hierarchy) {
if (isClassType(t) && typeToClass(t).getName().equals(superClassName)) {
return true;
}
}
return false;
... | java | public static boolean hasSuperclass(Class<?> clazz, String superClassName) {
List<Type> hierarchy = new ArrayList<>();
getTypeHierarchy(hierarchy, clazz, Object.class);
for (Type t : hierarchy) {
if (isClassType(t) && typeToClass(t).getName().equals(superClassName)) {
return true;
}
}
return false;
... | [
"public",
"static",
"boolean",
"hasSuperclass",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"superClassName",
")",
"{",
"List",
"<",
"Type",
">",
"hierarchy",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"getTypeHierarchy",
"(",
"hierarchy",
",",... | Returns true if the given class has a superclass of given name.
@param clazz class to be analyzed
@param superClassName class name of the super class | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"has",
"a",
"superclass",
"of",
"given",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L311-L320 |
124,166 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.getRawClass | public static Class<?> getRawClass(Type t) {
if (isClassType(t)) {
return typeToClass(t);
} else if (t instanceof GenericArrayType) {
Type component = ((GenericArrayType) t).getGenericComponentType();
return Array.newInstance(getRawClass(component), 0).getClass();
}
return Object.class;
} | java | public static Class<?> getRawClass(Type t) {
if (isClassType(t)) {
return typeToClass(t);
} else if (t instanceof GenericArrayType) {
Type component = ((GenericArrayType) t).getGenericComponentType();
return Array.newInstance(getRawClass(component), 0).getClass();
}
return Object.class;
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getRawClass",
"(",
"Type",
"t",
")",
"{",
"if",
"(",
"isClassType",
"(",
"t",
")",
")",
"{",
"return",
"typeToClass",
"(",
"t",
")",
";",
"}",
"else",
"if",
"(",
"t",
"instanceof",
"GenericArrayType",
")",... | Returns the raw class of both parameterized types and generic arrays.
Returns java.lang.Object for all other types. | [
"Returns",
"the",
"raw",
"class",
"of",
"both",
"parameterized",
"types",
"and",
"generic",
"arrays",
".",
"Returns",
"java",
".",
"lang",
".",
"Object",
"for",
"all",
"other",
"types",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L326-L334 |
124,167 | apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.validateLambdaType | public static void validateLambdaType(Class<?> baseClass, Type t) {
if (!(t instanceof Class)) {
return;
}
final Class<?> clazz = (Class<?>) t;
if (clazz.getTypeParameters().length > 0) {
throw new InvalidTypesException("The generic type parameters of '" + clazz.getSimpleName() + "' are missing. "
+ ... | java | public static void validateLambdaType(Class<?> baseClass, Type t) {
if (!(t instanceof Class)) {
return;
}
final Class<?> clazz = (Class<?>) t;
if (clazz.getTypeParameters().length > 0) {
throw new InvalidTypesException("The generic type parameters of '" + clazz.getSimpleName() + "' are missing. "
+ ... | [
"public",
"static",
"void",
"validateLambdaType",
"(",
"Class",
"<",
"?",
">",
"baseClass",
",",
"Type",
"t",
")",
"{",
"if",
"(",
"!",
"(",
"t",
"instanceof",
"Class",
")",
")",
"{",
"return",
";",
"}",
"final",
"Class",
"<",
"?",
">",
"clazz",
"=... | Checks whether the given type has the generic parameters declared in the class definition.
@param t type to be validated | [
"Checks",
"whether",
"the",
"given",
"type",
"has",
"the",
"generic",
"parameters",
"declared",
"in",
"the",
"class",
"definition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L341-L353 |
124,168 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.clear | public void clear() {
streamNodes = new HashMap<>();
virtualSelectNodes = new HashMap<>();
virtualSideOutputNodes = new HashMap<>();
virtualPartitionNodes = new HashMap<>();
vertexIDtoBrokerID = new HashMap<>();
vertexIDtoLoopTimeout = new HashMap<>();
iterationSourceSinkPairs = new HashSet<>();
source... | java | public void clear() {
streamNodes = new HashMap<>();
virtualSelectNodes = new HashMap<>();
virtualSideOutputNodes = new HashMap<>();
virtualPartitionNodes = new HashMap<>();
vertexIDtoBrokerID = new HashMap<>();
vertexIDtoLoopTimeout = new HashMap<>();
iterationSourceSinkPairs = new HashSet<>();
source... | [
"public",
"void",
"clear",
"(",
")",
"{",
"streamNodes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"virtualSelectNodes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"virtualSideOutputNodes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"virtualPartitionNo... | Remove all registered nodes etc. | [
"Remove",
"all",
"registered",
"nodes",
"etc",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L111-L121 |
124,169 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.addVirtualSelectNode | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | java | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | [
"public",
"void",
"addVirtualSelectNode",
"(",
"Integer",
"originalId",
",",
"Integer",
"virtualId",
",",
"List",
"<",
"String",
">",
"selectedNames",
")",
"{",
"if",
"(",
"virtualSelectNodes",
".",
"containsKey",
"(",
"virtualId",
")",
")",
"{",
"throw",
"new... | Adds a new virtual node that is used to connect a downstream vertex to only the outputs
with the selected names.
<p>When adding an edge from the virtual node to a downstream node the connection will be made
to the original node, only with the selected names given here.
@param originalId ID of the node that should be ... | [
"Adds",
"a",
"new",
"virtual",
"node",
"that",
"is",
"used",
"to",
"connect",
"a",
"downstream",
"vertex",
"to",
"only",
"the",
"outputs",
"with",
"the",
"selected",
"names",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L290-L298 |
124,170 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.addVirtualPartitionNode | public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) {
if (virtualPartitionNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual partition node with id " + virtualId);
}
virtualPartitionNodes.put(virtualId,
new Tuple2<... | java | public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) {
if (virtualPartitionNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual partition node with id " + virtualId);
}
virtualPartitionNodes.put(virtualId,
new Tuple2<... | [
"public",
"void",
"addVirtualPartitionNode",
"(",
"Integer",
"originalId",
",",
"Integer",
"virtualId",
",",
"StreamPartitioner",
"<",
"?",
">",
"partitioner",
")",
"{",
"if",
"(",
"virtualPartitionNodes",
".",
"containsKey",
"(",
"virtualId",
")",
")",
"{",
"th... | Adds a new virtual node that is used to connect a downstream vertex to an input with a
certain partitioning.
<p>When adding an edge from the virtual node to a downstream node the connection will be made
to the original node, but with the partitioning given here.
@param originalId ID of the node that should be connect... | [
"Adds",
"a",
"new",
"virtual",
"node",
"that",
"is",
"used",
"to",
"connect",
"a",
"downstream",
"vertex",
"to",
"an",
"input",
"with",
"a",
"certain",
"partitioning",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L347-L355 |
124,171 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.getSlotSharingGroup | public String getSlotSharingGroup(Integer id) {
if (virtualSideOutputNodes.containsKey(id)) {
Integer mappedId = virtualSideOutputNodes.get(id).f0;
return getSlotSharingGroup(mappedId);
} else if (virtualSelectNodes.containsKey(id)) {
Integer mappedId = virtualSelectNodes.get(id).f0;
return getSlotShari... | java | public String getSlotSharingGroup(Integer id) {
if (virtualSideOutputNodes.containsKey(id)) {
Integer mappedId = virtualSideOutputNodes.get(id).f0;
return getSlotSharingGroup(mappedId);
} else if (virtualSelectNodes.containsKey(id)) {
Integer mappedId = virtualSelectNodes.get(id).f0;
return getSlotShari... | [
"public",
"String",
"getSlotSharingGroup",
"(",
"Integer",
"id",
")",
"{",
"if",
"(",
"virtualSideOutputNodes",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"Integer",
"mappedId",
"=",
"virtualSideOutputNodes",
".",
"get",
"(",
"id",
")",
".",
"f0",
";",
... | Determines the slot sharing group of an operation across virtual nodes. | [
"Determines",
"the",
"slot",
"sharing",
"group",
"of",
"an",
"operation",
"across",
"virtual",
"nodes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L360-L374 |
124,172 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java | JobGraph.isCheckpointingEnabled | public boolean isCheckpointingEnabled() {
if (snapshotSettings == null) {
return false;
}
long checkpointInterval = snapshotSettings.getCheckpointCoordinatorConfiguration().getCheckpointInterval();
return checkpointInterval > 0 &&
checkpointInterval < Long.MAX_VALUE;
} | java | public boolean isCheckpointingEnabled() {
if (snapshotSettings == null) {
return false;
}
long checkpointInterval = snapshotSettings.getCheckpointCoordinatorConfiguration().getCheckpointInterval();
return checkpointInterval > 0 &&
checkpointInterval < Long.MAX_VALUE;
} | [
"public",
"boolean",
"isCheckpointingEnabled",
"(",
")",
"{",
"if",
"(",
"snapshotSettings",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"long",
"checkpointInterval",
"=",
"snapshotSettings",
".",
"getCheckpointCoordinatorConfiguration",
"(",
")",
".",
"g... | Checks if the checkpointing was enabled for this job graph
@return true if checkpointing enabled | [
"Checks",
"if",
"the",
"checkpointing",
"was",
"enabled",
"for",
"this",
"job",
"graph"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L353-L362 |
124,173 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java | JobGraph.getMaximumParallelism | public int getMaximumParallelism() {
int maxParallelism = -1;
for (JobVertex vertex : taskVertices.values()) {
maxParallelism = Math.max(vertex.getParallelism(), maxParallelism);
}
return maxParallelism;
} | java | public int getMaximumParallelism() {
int maxParallelism = -1;
for (JobVertex vertex : taskVertices.values()) {
maxParallelism = Math.max(vertex.getParallelism(), maxParallelism);
}
return maxParallelism;
} | [
"public",
"int",
"getMaximumParallelism",
"(",
")",
"{",
"int",
"maxParallelism",
"=",
"-",
"1",
";",
"for",
"(",
"JobVertex",
"vertex",
":",
"taskVertices",
".",
"values",
"(",
")",
")",
"{",
"maxParallelism",
"=",
"Math",
".",
"max",
"(",
"vertex",
"."... | Gets the maximum parallelism of all operations in this job graph.
@return The maximum parallelism of this job graph | [
"Gets",
"the",
"maximum",
"parallelism",
"of",
"all",
"operations",
"in",
"this",
"job",
"graph",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L393-L399 |
124,174 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java | JobGraph.addJar | public void addJar(Path jar) {
if (jar == null) {
throw new IllegalArgumentException();
}
if (!userJars.contains(jar)) {
userJars.add(jar);
}
} | java | public void addJar(Path jar) {
if (jar == null) {
throw new IllegalArgumentException();
}
if (!userJars.contains(jar)) {
userJars.add(jar);
}
} | [
"public",
"void",
"addJar",
"(",
"Path",
"jar",
")",
"{",
"if",
"(",
"jar",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"!",
"userJars",
".",
"contains",
"(",
"jar",
")",
")",
"{",
"userJars",
... | Adds the path of a JAR file required to run the job on a task manager.
@param jar
path of the JAR file required to run the job on a task manager | [
"Adds",
"the",
"path",
"of",
"a",
"JAR",
"file",
"required",
"to",
"run",
"the",
"job",
"on",
"a",
"task",
"manager",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L492-L500 |
124,175 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java | JobGraph.addUserArtifact | public void addUserArtifact(String name, DistributedCache.DistributedCacheEntry file) {
if (file == null) {
throw new IllegalArgumentException();
}
userArtifacts.putIfAbsent(name, file);
} | java | public void addUserArtifact(String name, DistributedCache.DistributedCacheEntry file) {
if (file == null) {
throw new IllegalArgumentException();
}
userArtifacts.putIfAbsent(name, file);
} | [
"public",
"void",
"addUserArtifact",
"(",
"String",
"name",
",",
"DistributedCache",
".",
"DistributedCacheEntry",
"file",
")",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"userArtifacts",
"."... | Adds the path of a custom file required to run the job on a task manager.
@param name a name under which this artifact will be accessible through {@link DistributedCache}
@param file path of a custom file required to run the job on a task manager | [
"Adds",
"the",
"path",
"of",
"a",
"custom",
"file",
"required",
"to",
"run",
"the",
"job",
"on",
"a",
"task",
"manager",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L517-L523 |
124,176 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java | JobGraph.addUserJarBlobKey | public void addUserJarBlobKey(PermanentBlobKey key) {
if (key == null) {
throw new IllegalArgumentException();
}
if (!userJarBlobKeys.contains(key)) {
userJarBlobKeys.add(key);
}
} | java | public void addUserJarBlobKey(PermanentBlobKey key) {
if (key == null) {
throw new IllegalArgumentException();
}
if (!userJarBlobKeys.contains(key)) {
userJarBlobKeys.add(key);
}
} | [
"public",
"void",
"addUserJarBlobKey",
"(",
"PermanentBlobKey",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"!",
"userJarBlobKeys",
".",
"contains",
"(",
"key",
")",
... | Adds the BLOB referenced by the key to the JobGraph's dependencies.
@param key
path of the JAR file required to run the job on a task manager | [
"Adds",
"the",
"BLOB",
"referenced",
"by",
"the",
"key",
"to",
"the",
"JobGraph",
"s",
"dependencies",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L540-L548 |
124,177 | apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ProgramTargetDescriptor.java | ProgramTargetDescriptor.of | public static <C> ProgramTargetDescriptor of(C clusterId, JobID jobId, String webInterfaceUrl) {
String clusterIdString;
try {
// check if cluster id has a toString method
clusterId.getClass().getDeclaredMethod("toString");
clusterIdString = clusterId.toString();
} catch (NoSuchMethodException e) {
cl... | java | public static <C> ProgramTargetDescriptor of(C clusterId, JobID jobId, String webInterfaceUrl) {
String clusterIdString;
try {
// check if cluster id has a toString method
clusterId.getClass().getDeclaredMethod("toString");
clusterIdString = clusterId.toString();
} catch (NoSuchMethodException e) {
cl... | [
"public",
"static",
"<",
"C",
">",
"ProgramTargetDescriptor",
"of",
"(",
"C",
"clusterId",
",",
"JobID",
"jobId",
",",
"String",
"webInterfaceUrl",
")",
"{",
"String",
"clusterIdString",
";",
"try",
"{",
"// check if cluster id has a toString method",
"clusterId",
"... | Creates a program target description from deployment classes.
@param clusterId cluster id
@param jobId job id
@param <C> cluster id type
@return program target descriptor | [
"Creates",
"a",
"program",
"target",
"description",
"from",
"deployment",
"classes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ProgramTargetDescriptor.java#L69-L79 |
124,178 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeOffsets.java | KeyGroupRangeOffsets.getIntersection | public KeyGroupRangeOffsets getIntersection(KeyGroupRange keyGroupRange) {
Preconditions.checkNotNull(keyGroupRange);
KeyGroupRange intersection = this.keyGroupRange.getIntersection(keyGroupRange);
long[] subOffsets = new long[intersection.getNumberOfKeyGroups()];
if(subOffsets.length > 0) {
System.arraycopy... | java | public KeyGroupRangeOffsets getIntersection(KeyGroupRange keyGroupRange) {
Preconditions.checkNotNull(keyGroupRange);
KeyGroupRange intersection = this.keyGroupRange.getIntersection(keyGroupRange);
long[] subOffsets = new long[intersection.getNumberOfKeyGroups()];
if(subOffsets.length > 0) {
System.arraycopy... | [
"public",
"KeyGroupRangeOffsets",
"getIntersection",
"(",
"KeyGroupRange",
"keyGroupRange",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"keyGroupRange",
")",
";",
"KeyGroupRange",
"intersection",
"=",
"this",
".",
"keyGroupRange",
".",
"getIntersection",
"(",
... | Returns a key-group range with offsets which is the intersection of the internal key-group range with the given
key-group range.
@param keyGroupRange Key-group range to intersect with the internal key-group range.
@return The key-group range with offsets for the intersection of the internal key-group range with the gi... | [
"Returns",
"a",
"key",
"-",
"group",
"range",
"with",
"offsets",
"which",
"is",
"the",
"intersection",
"of",
"the",
"internal",
"key",
"-",
"group",
"range",
"with",
"the",
"given",
"key",
"-",
"group",
"range",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRangeOffsets.java#L115-L128 |
124,179 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java | Decimal.fromBigDecimal | public static Decimal fromBigDecimal(BigDecimal bd, int precision, int scale) {
bd = bd.setScale(scale, RoundingMode.HALF_UP);
if (bd.precision() > precision) {
return null;
}
long longVal = -1;
if (precision <= MAX_COMPACT_PRECISION) {
longVal = bd.movePointRight(scale).longValueExact();
}
return ... | java | public static Decimal fromBigDecimal(BigDecimal bd, int precision, int scale) {
bd = bd.setScale(scale, RoundingMode.HALF_UP);
if (bd.precision() > precision) {
return null;
}
long longVal = -1;
if (precision <= MAX_COMPACT_PRECISION) {
longVal = bd.movePointRight(scale).longValueExact();
}
return ... | [
"public",
"static",
"Decimal",
"fromBigDecimal",
"(",
"BigDecimal",
"bd",
",",
"int",
"precision",
",",
"int",
"scale",
")",
"{",
"bd",
"=",
"bd",
".",
"setScale",
"(",
"scale",
",",
"RoundingMode",
".",
"HALF_UP",
")",
";",
"if",
"(",
"bd",
".",
"prec... | then `precision` is checked. if precision overflow, it will return `null` | [
"then",
"precision",
"is",
"checked",
".",
"if",
"precision",
"overflow",
"it",
"will",
"return",
"null"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java#L158-L169 |
124,180 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java | Decimal.floor | public Decimal floor() {
BigDecimal bd = toBigDecimal().setScale(0, RoundingMode.FLOOR);
return fromBigDecimal(bd, bd.precision(), 0);
} | java | public Decimal floor() {
BigDecimal bd = toBigDecimal().setScale(0, RoundingMode.FLOOR);
return fromBigDecimal(bd, bd.precision(), 0);
} | [
"public",
"Decimal",
"floor",
"(",
")",
"{",
"BigDecimal",
"bd",
"=",
"toBigDecimal",
"(",
")",
".",
"setScale",
"(",
"0",
",",
"RoundingMode",
".",
"FLOOR",
")",
";",
"return",
"fromBigDecimal",
"(",
"bd",
",",
"bd",
".",
"precision",
"(",
")",
",",
... | note that result may exceed the original precision. | [
"note",
"that",
"result",
"may",
"exceed",
"the",
"original",
"precision",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java#L258-L261 |
124,181 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java | Decimal.castToIntegral | public static long castToIntegral(Decimal dec) {
BigDecimal bd = dec.toBigDecimal();
// rounding down. This is consistent with float=>int,
// and consistent with SQLServer, Spark.
bd = bd.setScale(0, RoundingMode.DOWN);
return bd.longValue();
} | java | public static long castToIntegral(Decimal dec) {
BigDecimal bd = dec.toBigDecimal();
// rounding down. This is consistent with float=>int,
// and consistent with SQLServer, Spark.
bd = bd.setScale(0, RoundingMode.DOWN);
return bd.longValue();
} | [
"public",
"static",
"long",
"castToIntegral",
"(",
"Decimal",
"dec",
")",
"{",
"BigDecimal",
"bd",
"=",
"dec",
".",
"toBigDecimal",
"(",
")",
";",
"// rounding down. This is consistent with float=>int,",
"// and consistent with SQLServer, Spark.",
"bd",
"=",
"bd",
".",
... | to cast to floats, overflow will not happen, because precision<=38. | [
"to",
"cast",
"to",
"floats",
"overflow",
"will",
"not",
"happen",
"because",
"precision<",
"=",
"38",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java#L337-L343 |
124,182 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java | WindowedStream.aggregate | @PublicEvolving
public <ACC, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, R> function,
TypeInformation<ACC> accumulatorType,
TypeInformation<R> resultType) {
checkNotNull(function, "function");
checkNotNull(accumulatorType, "accumulatorType");
checkNotNull(resultType, "resultTy... | java | @PublicEvolving
public <ACC, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, R> function,
TypeInformation<ACC> accumulatorType,
TypeInformation<R> resultType) {
checkNotNull(function, "function");
checkNotNull(accumulatorType, "accumulatorType");
checkNotNull(resultType, "resultTy... | [
"@",
"PublicEvolving",
"public",
"<",
"ACC",
",",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"aggregate",
"(",
"AggregateFunction",
"<",
"T",
",",
"ACC",
",",
"R",
">",
"function",
",",
"TypeInformation",
"<",
"ACC",
">",
"accumulatorType",
",",
... | Applies the given aggregation function to each window. The aggregation function is called for
each element, aggregating values incrementally and keeping the state to one accumulator
per key and window.
@param function The aggregation function.
@return The data stream that is the result of applying the aggregation func... | [
"Applies",
"the",
"given",
"aggregation",
"function",
"to",
"each",
"window",
".",
"The",
"aggregation",
"function",
"is",
"called",
"for",
"each",
"element",
"aggregating",
"values",
"incrementally",
"and",
"keeping",
"the",
"state",
"to",
"one",
"accumulator",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java#L716-L732 |
124,183 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/iterative/concurrent/Broker.java | Broker.handIn | public void handIn(String key, V obj) {
if (!retrieveSharedQueue(key).offer(obj)) {
throw new RuntimeException("Could not register the given element, broker slot is already occupied.");
}
} | java | public void handIn(String key, V obj) {
if (!retrieveSharedQueue(key).offer(obj)) {
throw new RuntimeException("Could not register the given element, broker slot is already occupied.");
}
} | [
"public",
"void",
"handIn",
"(",
"String",
"key",
",",
"V",
"obj",
")",
"{",
"if",
"(",
"!",
"retrieveSharedQueue",
"(",
"key",
")",
".",
"offer",
"(",
"obj",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Could not register the given element, br... | Hand in the object to share. | [
"Hand",
"in",
"the",
"object",
"to",
"share",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/iterative/concurrent/Broker.java#L36-L40 |
124,184 | apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java | YarnResourceManager.getYarnStatus | private FinalApplicationStatus getYarnStatus(ApplicationStatus status) {
if (status == null) {
return FinalApplicationStatus.UNDEFINED;
}
else {
switch (status) {
case SUCCEEDED:
return FinalApplicationStatus.SUCCEEDED;
case FAILED:
return FinalApplicationStatus.FAILED;
case CANCELED:
... | java | private FinalApplicationStatus getYarnStatus(ApplicationStatus status) {
if (status == null) {
return FinalApplicationStatus.UNDEFINED;
}
else {
switch (status) {
case SUCCEEDED:
return FinalApplicationStatus.SUCCEEDED;
case FAILED:
return FinalApplicationStatus.FAILED;
case CANCELED:
... | [
"private",
"FinalApplicationStatus",
"getYarnStatus",
"(",
"ApplicationStatus",
"status",
")",
"{",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"return",
"FinalApplicationStatus",
".",
"UNDEFINED",
";",
"}",
"else",
"{",
"switch",
"(",
"status",
")",
"{",
"ca... | Converts a Flink application status enum to a YARN application status enum.
@param status The Flink application status.
@return The corresponding YARN application status. | [
"Converts",
"a",
"Flink",
"application",
"status",
"enum",
"to",
"a",
"YARN",
"application",
"status",
"enum",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java#L474-L490 |
124,185 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/ZooKeeperLeaderElectionService.java | ZooKeeperLeaderElectionService.writeLeaderInformation | protected void writeLeaderInformation(UUID leaderSessionID) {
// this method does not have to be synchronized because the curator framework client
// is thread-safe
try {
if (LOG.isDebugEnabled()) {
LOG.debug(
"Write leader information: Leader={}, session ID={}.",
leaderContender.getAddress(),
... | java | protected void writeLeaderInformation(UUID leaderSessionID) {
// this method does not have to be synchronized because the curator framework client
// is thread-safe
try {
if (LOG.isDebugEnabled()) {
LOG.debug(
"Write leader information: Leader={}, session ID={}.",
leaderContender.getAddress(),
... | [
"protected",
"void",
"writeLeaderInformation",
"(",
"UUID",
"leaderSessionID",
")",
"{",
"// this method does not have to be synchronized because the curator framework client",
"// is thread-safe",
"try",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LO... | Writes the current leader's address as well the given leader session ID to ZooKeeper.
@param leaderSessionID Leader session ID which is written to ZooKeeper | [
"Writes",
"the",
"current",
"leader",
"s",
"address",
"as",
"well",
"the",
"given",
"leader",
"session",
"ID",
"to",
"ZooKeeper",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/ZooKeeperLeaderElectionService.java#L326-L392 |
124,186 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java | MesosEntrypointUtils.createMesosSchedulerConfiguration | public static MesosConfiguration createMesosSchedulerConfiguration(Configuration flinkConfig, String hostname) {
Protos.FrameworkInfo.Builder frameworkInfo = Protos.FrameworkInfo.newBuilder()
.setHostname(hostname);
Protos.Credential.Builder credential = null;
if (!flinkConfig.contains(MesosOptions.MASTER_UR... | java | public static MesosConfiguration createMesosSchedulerConfiguration(Configuration flinkConfig, String hostname) {
Protos.FrameworkInfo.Builder frameworkInfo = Protos.FrameworkInfo.newBuilder()
.setHostname(hostname);
Protos.Credential.Builder credential = null;
if (!flinkConfig.contains(MesosOptions.MASTER_UR... | [
"public",
"static",
"MesosConfiguration",
"createMesosSchedulerConfiguration",
"(",
"Configuration",
"flinkConfig",
",",
"String",
"hostname",
")",
"{",
"Protos",
".",
"FrameworkInfo",
".",
"Builder",
"frameworkInfo",
"=",
"Protos",
".",
"FrameworkInfo",
".",
"newBuilde... | Loads and validates the Mesos scheduler configuration.
@param flinkConfig the global configuration.
@param hostname the hostname to advertise to the Mesos master. | [
"Loads",
"and",
"validates",
"the",
"Mesos",
"scheduler",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java#L58-L103 |
124,187 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java | MesosEntrypointUtils.applyOverlays | public static void applyOverlays(
Configuration configuration, ContainerSpecification containerSpec) throws IOException {
// create the overlays that will produce the specification
CompositeContainerOverlay overlay = new CompositeContainerOverlay(
FlinkDistributionOverlay.newBuilder().fromEnvironment(configur... | java | public static void applyOverlays(
Configuration configuration, ContainerSpecification containerSpec) throws IOException {
// create the overlays that will produce the specification
CompositeContainerOverlay overlay = new CompositeContainerOverlay(
FlinkDistributionOverlay.newBuilder().fromEnvironment(configur... | [
"public",
"static",
"void",
"applyOverlays",
"(",
"Configuration",
"configuration",
",",
"ContainerSpecification",
"containerSpec",
")",
"throws",
"IOException",
"{",
"// create the overlays that will produce the specification",
"CompositeContainerOverlay",
"overlay",
"=",
"new",... | Generate a container specification as a TaskManager template.
<p>This code is extremely Mesos-specific and registers all the artifacts that the TaskManager
needs (such as JAR file, config file, ...) and all environment variables into a container specification.
The Mesos fetcher then ensures that those artifacts will b... | [
"Generate",
"a",
"container",
"specification",
"as",
"a",
"TaskManager",
"template",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java#L144-L159 |
124,188 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java | MesosEntrypointUtils.loadConfiguration | public static Configuration loadConfiguration(Configuration dynamicProperties, Logger log) {
Configuration configuration =
GlobalConfiguration.loadConfigurationWithDynamicProperties(dynamicProperties);
// read the environment variables
final Map<String, String> envs = System.getenv();
final String tmpDirs =... | java | public static Configuration loadConfiguration(Configuration dynamicProperties, Logger log) {
Configuration configuration =
GlobalConfiguration.loadConfigurationWithDynamicProperties(dynamicProperties);
// read the environment variables
final Map<String, String> envs = System.getenv();
final String tmpDirs =... | [
"public",
"static",
"Configuration",
"loadConfiguration",
"(",
"Configuration",
"dynamicProperties",
",",
"Logger",
"log",
")",
"{",
"Configuration",
"configuration",
"=",
"GlobalConfiguration",
".",
"loadConfigurationWithDynamicProperties",
"(",
"dynamicProperties",
")",
"... | Loads the global configuration, adds the given dynamic properties configuration, and sets
the temp directory paths.
@param dynamicProperties dynamic properties to integrate
@param log logger instance
@return the loaded and adapted global configuration | [
"Loads",
"the",
"global",
"configuration",
"adds",
"the",
"given",
"dynamic",
"properties",
"configuration",
"and",
"sets",
"the",
"temp",
"directory",
"paths",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java#L169-L180 |
124,189 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactory.java | SummaryAggregatorFactory.create | @SuppressWarnings("unchecked")
public static <T, R> Aggregator<T, R> create(Class<T> type) {
if (type == Long.class) {
return (Aggregator<T, R>) new LongSummaryAggregator();
}
else if (type == LongValue.class) {
return (Aggregator<T, R>) new ValueSummaryAggregator.LongValueSummaryAggregator();
}
else i... | java | @SuppressWarnings("unchecked")
public static <T, R> Aggregator<T, R> create(Class<T> type) {
if (type == Long.class) {
return (Aggregator<T, R>) new LongSummaryAggregator();
}
else if (type == LongValue.class) {
return (Aggregator<T, R>) new ValueSummaryAggregator.LongValueSummaryAggregator();
}
else i... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
",",
"R",
">",
"Aggregator",
"<",
"T",
",",
"R",
">",
"create",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"Long",
".",
"class",
")",
"... | Create a SummaryAggregator for the supplied type.
@param <T> the type to aggregate
@param <R> the result type of the aggregation | [
"Create",
"a",
"SummaryAggregator",
"for",
"the",
"supplied",
"type",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/SummaryAggregatorFactory.java#L53-L101 |
124,190 | apache/flink | flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java | GlobalConfiguration.loadConfiguration | public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) {
if (configDir == null) {
throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration");
}
final File confDirFile = new File(configDir);
if (!(con... | java | public static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties) {
if (configDir == null) {
throw new IllegalArgumentException("Given configuration directory is null, cannot load configuration");
}
final File confDirFile = new File(configDir);
if (!(con... | [
"public",
"static",
"Configuration",
"loadConfiguration",
"(",
"final",
"String",
"configDir",
",",
"@",
"Nullable",
"final",
"Configuration",
"dynamicProperties",
")",
"{",
"if",
"(",
"configDir",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Loads the configuration files from the specified directory. If the dynamic properties
configuration is not null, then it is added to the loaded configuration.
@param configDir directory to load the configuration from
@param dynamicProperties configuration file containing the dynamic properties. Null if none.
@return T... | [
"Loads",
"the",
"configuration",
"files",
"from",
"the",
"specified",
"directory",
".",
"If",
"the",
"dynamic",
"properties",
"configuration",
"is",
"not",
"null",
"then",
"it",
"is",
"added",
"to",
"the",
"loaded",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L93-L122 |
124,191 | apache/flink | flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java | GlobalConfiguration.loadConfigurationWithDynamicProperties | public static Configuration loadConfigurationWithDynamicProperties(Configuration dynamicProperties) {
final String configDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
if (configDir == null) {
return new Configuration(dynamicProperties);
}
return loadConfiguration(configDir, dynamicProperties);
} | java | public static Configuration loadConfigurationWithDynamicProperties(Configuration dynamicProperties) {
final String configDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
if (configDir == null) {
return new Configuration(dynamicProperties);
}
return loadConfiguration(configDir, dynamicProperties);
} | [
"public",
"static",
"Configuration",
"loadConfigurationWithDynamicProperties",
"(",
"Configuration",
"dynamicProperties",
")",
"{",
"final",
"String",
"configDir",
"=",
"System",
".",
"getenv",
"(",
"ConfigConstants",
".",
"ENV_FLINK_CONF_DIR",
")",
";",
"if",
"(",
"c... | Loads the global configuration and adds the given dynamic properties
configuration.
@param dynamicProperties The given dynamic properties
@return Returns the loaded global configuration with dynamic properties | [
"Loads",
"the",
"global",
"configuration",
"and",
"adds",
"the",
"given",
"dynamic",
"properties",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L131-L138 |
124,192 | apache/flink | flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java | GlobalConfiguration.loadYAMLResource | private static Configuration loadYAMLResource(File file) {
final Configuration config = new Configuration();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)))){
String line;
int lineNo = 0;
while ((line = reader.readLine()) != null) {
lineNo++;
// 1... | java | private static Configuration loadYAMLResource(File file) {
final Configuration config = new Configuration();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)))){
String line;
int lineNo = 0;
while ((line = reader.readLine()) != null) {
lineNo++;
// 1... | [
"private",
"static",
"Configuration",
"loadYAMLResource",
"(",
"File",
"file",
")",
"{",
"final",
"Configuration",
"config",
"=",
"new",
"Configuration",
"(",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStrea... | Loads a YAML-file of key-value pairs.
<p>Colon and whitespace ": " separate key and value (one per line). The hash tag "#" starts a single-line comment.
<p>Example:
<pre>
jobmanager.rpc.address: localhost # network address for communication with the job manager
jobmanager.rpc.port : 6123 # network port to con... | [
"Loads",
"a",
"YAML",
"-",
"file",
"of",
"key",
"-",
"value",
"pairs",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L160-L201 |
124,193 | apache/flink | flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java | GlobalConfiguration.isSensitive | public static boolean isSensitive(String key) {
Preconditions.checkNotNull(key, "key is null");
final String keyInLower = key.toLowerCase();
for (String hideKey : SENSITIVE_KEYS) {
if (keyInLower.length() >= hideKey.length()
&& keyInLower.contains(hideKey)) {
return true;
}
}
return false;
} | java | public static boolean isSensitive(String key) {
Preconditions.checkNotNull(key, "key is null");
final String keyInLower = key.toLowerCase();
for (String hideKey : SENSITIVE_KEYS) {
if (keyInLower.length() >= hideKey.length()
&& keyInLower.contains(hideKey)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isSensitive",
"(",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
",",
"\"key is null\"",
")",
";",
"final",
"String",
"keyInLower",
"=",
"key",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"S... | Check whether the key is a hidden key.
@param key the config key | [
"Check",
"whether",
"the",
"key",
"is",
"a",
"hidden",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L208-L218 |
124,194 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.close | public boolean close() {
lock.lock();
try {
if (open) {
if (elements.isEmpty()) {
open = false;
nonEmpty.signalAll();
return true;
} else {
return false;
}
}
else {
// already closed
return true;
}
} finally {
lock.unlock();
}
} | java | public boolean close() {
lock.lock();
try {
if (open) {
if (elements.isEmpty()) {
open = false;
nonEmpty.signalAll();
return true;
} else {
return false;
}
}
else {
// already closed
return true;
}
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"close",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"if",
"(",
"elements",
".",
"isEmpty",
"(",
")",
")",
"{",
"open",
"=",
"false",
";",
"nonEmpty",
".",
"signalAll",
"(",
"... | Tries to close the queue. Closing the queue only succeeds when no elements are
in the queue when this method is called. Checking whether the queue is empty, and
marking the queue as closed is one atomic operation.
@return True, if the queue is closed, false if the queue remains open. | [
"Tries",
"to",
"close",
"the",
"queue",
".",
"Closing",
"the",
"queue",
"only",
"succeeds",
"when",
"no",
"elements",
"are",
"in",
"the",
"queue",
"when",
"this",
"method",
"is",
"called",
".",
"Checking",
"whether",
"the",
"queue",
"is",
"empty",
"and",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L140-L159 |
124,195 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.addIfOpen | public boolean addIfOpen(E element) {
requireNonNull(element);
lock.lock();
try {
if (open) {
elements.addLast(element);
if (elements.size() == 1) {
nonEmpty.signalAll();
}
}
return open;
} finally {
lock.unlock();
}
} | java | public boolean addIfOpen(E element) {
requireNonNull(element);
lock.lock();
try {
if (open) {
elements.addLast(element);
if (elements.size() == 1) {
nonEmpty.signalAll();
}
}
return open;
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"addIfOpen",
"(",
"E",
"element",
")",
"{",
"requireNonNull",
"(",
"element",
")",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"elements",
".",
"addLast",
"(",
"element",
")",
";",
"if",
"(... | Tries to add an element to the queue, if the queue is still open. Checking whether the queue
is open and adding the element is one atomic operation.
<p>Unlike the {@link #add(Object)} method, this method never throws an exception,
but only indicates via the return code if the element was added or the
queue was closed.... | [
"Tries",
"to",
"add",
"an",
"element",
"to",
"the",
"queue",
"if",
"the",
"queue",
"is",
"still",
"open",
".",
"Checking",
"whether",
"the",
"queue",
"is",
"open",
"and",
"adding",
"the",
"element",
"is",
"one",
"atomic",
"operation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L176-L191 |
124,196 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.add | public void add(E element) throws IllegalStateException {
requireNonNull(element);
lock.lock();
try {
if (open) {
elements.addLast(element);
if (elements.size() == 1) {
nonEmpty.signalAll();
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unloc... | java | public void add(E element) throws IllegalStateException {
requireNonNull(element);
lock.lock();
try {
if (open) {
elements.addLast(element);
if (elements.size() == 1) {
nonEmpty.signalAll();
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unloc... | [
"public",
"void",
"add",
"(",
"E",
"element",
")",
"throws",
"IllegalStateException",
"{",
"requireNonNull",
"(",
"element",
")",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"elements",
".",
"addLast",
"(",
"elemen... | Adds the element to the queue, or fails with an exception, if the queue is closed.
Checking whether the queue is open and adding the element is one atomic operation.
@param element The element to add.
@throws IllegalStateException Thrown, if the queue is closed. | [
"Adds",
"the",
"element",
"to",
"the",
"queue",
"or",
"fails",
"with",
"an",
"exception",
"if",
"the",
"queue",
"is",
"closed",
".",
"Checking",
"whether",
"the",
"queue",
"is",
"open",
"and",
"adding",
"the",
"element",
"is",
"one",
"atomic",
"operation",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L200-L216 |
124,197 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.peek | public E peek() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
return elements.getFirst();
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} | java | public E peek() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
return elements.getFirst();
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} | [
"public",
"E",
"peek",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"if",
"(",
"elements",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"return",
"elements",
".",
"getFirst",
"(",
")",
";",
"}",
... | Returns the queue's next element without removing it, if the queue is non-empty.
Otherwise, returns null.
<p>The method throws an {@code IllegalStateException} if the queue is closed.
Checking whether the queue is open and getting the next element is one atomic operation.
<p>This method never blocks.
@return The que... | [
"Returns",
"the",
"queue",
"s",
"next",
"element",
"without",
"removing",
"it",
"if",
"the",
"queue",
"is",
"non",
"-",
"empty",
".",
"Otherwise",
"returns",
"null",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L230-L245 |
124,198 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.poll | public E poll() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
return elements.removeFirst();
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} | java | public E poll() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
return elements.removeFirst();
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} | [
"public",
"E",
"poll",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"if",
"(",
"elements",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"return",
"elements",
".",
"removeFirst",
"(",
")",
";",
"}",... | Returns the queue's next element and removes it, the queue is non-empty.
Otherwise, this method returns null.
<p>The method throws an {@code IllegalStateException} if the queue is closed.
Checking whether the queue is open and removing the next element is one atomic operation.
<p>This method never blocks.
@return Th... | [
"Returns",
"the",
"queue",
"s",
"next",
"element",
"and",
"removes",
"it",
"the",
"queue",
"is",
"non",
"-",
"empty",
".",
"Otherwise",
"this",
"method",
"returns",
"null",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L259-L274 |
124,199 | apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java | ClosableBlockingQueue.pollBatch | public List<E> pollBatch() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
ArrayList<E> result = new ArrayList<>(elements);
elements.clear();
return result;
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
... | java | public List<E> pollBatch() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
ArrayList<E> result = new ArrayList<>(elements);
elements.clear();
return result;
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
... | [
"public",
"List",
"<",
"E",
">",
"pollBatch",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"open",
")",
"{",
"if",
"(",
"elements",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"ArrayList",
"<",
"E",
">",
"result",
... | Returns all of the queue's current elements in a list, if the queue is non-empty.
Otherwise, this method returns null.
<p>The method throws an {@code IllegalStateException} if the queue is closed.
Checking whether the queue is open and removing the elements is one atomic operation.
<p>This method never blocks.
@retu... | [
"Returns",
"all",
"of",
"the",
"queue",
"s",
"current",
"elements",
"in",
"a",
"list",
"if",
"the",
"queue",
"is",
"non",
"-",
"empty",
".",
"Otherwise",
"this",
"method",
"returns",
"null",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L288-L305 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.