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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
18,500 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java | AlluxioFuseFileSystem.truncate | @Override
public int truncate(String path, long size) {
LOG.error("Truncate is not supported {}", path);
return -ErrorCodes.EOPNOTSUPP();
} | java | @Override
public int truncate(String path, long size) {
LOG.error("Truncate is not supported {}", path);
return -ErrorCodes.EOPNOTSUPP();
} | [
"@",
"Override",
"public",
"int",
"truncate",
"(",
"String",
"path",
",",
"long",
"size",
")",
"{",
"LOG",
".",
"error",
"(",
"\"Truncate is not supported {}\"",
",",
"path",
")",
";",
"return",
"-",
"ErrorCodes",
".",
"EOPNOTSUPP",
"(",
")",
";",
"}"
] | Changes the size of a file. This operation would not succeed because of Alluxio's write-once
model. | [
"Changes",
"the",
"size",
"of",
"a",
"file",
".",
"This",
"operation",
"would",
"not",
"succeed",
"because",
"of",
"Alluxio",
"s",
"write",
"-",
"once",
"model",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java#L639-L643 |
18,501 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java | AlluxioFuseFileSystem.rmInternal | private int rmInternal(String path) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
try {
mFileSystem.delete(turi);
} catch (FileDoesNotExistException | InvalidPathException e) {
LOG.debug("Failed to remove {}, file does not exist or is invalid", path);
return -ErrorCodes... | java | private int rmInternal(String path) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
try {
mFileSystem.delete(turi);
} catch (FileDoesNotExistException | InvalidPathException e) {
LOG.debug("Failed to remove {}, file does not exist or is invalid", path);
return -ErrorCodes... | [
"private",
"int",
"rmInternal",
"(",
"String",
"path",
")",
"{",
"final",
"AlluxioURI",
"turi",
"=",
"mPathResolverCache",
".",
"getUnchecked",
"(",
"path",
")",
";",
"try",
"{",
"mFileSystem",
".",
"delete",
"(",
"turi",
")",
";",
"}",
"catch",
"(",
"Fi... | Convenience internal method to remove files or non-empty directories.
@param path The path to remove
@return 0 on success, a negative value on error | [
"Convenience",
"internal",
"method",
"to",
"remove",
"files",
"or",
"non",
"-",
"empty",
"directories",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java#L725-L739 |
18,502 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java | AlluxioFuseFileSystem.waitForFileCompleted | private boolean waitForFileCompleted(AlluxioURI uri) {
try {
CommonUtils.waitFor("file completed", () -> {
try {
return mFileSystem.getStatus(uri).isCompleted();
} catch (Exception e) {
throw new RuntimeException(e);
}
}, WaitForOptions.defaults().setTimeoutMs... | java | private boolean waitForFileCompleted(AlluxioURI uri) {
try {
CommonUtils.waitFor("file completed", () -> {
try {
return mFileSystem.getStatus(uri).isCompleted();
} catch (Exception e) {
throw new RuntimeException(e);
}
}, WaitForOptions.defaults().setTimeoutMs... | [
"private",
"boolean",
"waitForFileCompleted",
"(",
"AlluxioURI",
"uri",
")",
"{",
"try",
"{",
"CommonUtils",
".",
"waitFor",
"(",
"\"file completed\"",
",",
"(",
")",
"->",
"{",
"try",
"{",
"return",
"mFileSystem",
".",
"getStatus",
"(",
"uri",
")",
".",
"... | Waits for the file to complete before opening it.
@param uri the file path to check
@return whether the file is completed or not | [
"Waits",
"for",
"the",
"file",
"to",
"complete",
"before",
"opening",
"it",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseFileSystem.java#L747-L763 |
18,503 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/file/BaseFileSystem.java | BaseFileSystem.close | @Override
public synchronized void close() throws IOException {
// TODO(zac) Determine the behavior when closing the context during operations.
if (!mClosed) {
mClosed = true;
if (mCachingEnabled) {
Factory.FILESYSTEM_CACHE.remove(new FileSystemKey(mFsContext.getClientContext()));
}
... | java | @Override
public synchronized void close() throws IOException {
// TODO(zac) Determine the behavior when closing the context during operations.
if (!mClosed) {
mClosed = true;
if (mCachingEnabled) {
Factory.FILESYSTEM_CACHE.remove(new FileSystemKey(mFsContext.getClientContext()));
}
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// TODO(zac) Determine the behavior when closing the context during operations.",
"if",
"(",
"!",
"mClosed",
")",
"{",
"mClosed",
"=",
"true",
";",
"if",
"(",
"mCachin... | Shuts down the FileSystem. Closes all thread pools and resources used to perform operations. If
any operations are called after closing the context the behavior is undefined.
@throws IOException | [
"Shuts",
"down",
"the",
"FileSystem",
".",
"Closes",
"all",
"thread",
"pools",
"and",
"resources",
"used",
"to",
"perform",
"operations",
".",
"If",
"any",
"operations",
"are",
"called",
"after",
"closing",
"the",
"context",
"the",
"behavior",
"is",
"undefined... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/BaseFileSystem.java#L131-L141 |
18,504 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockWriteHandler.java | ShortCircuitBlockWriteHandler.onNext | @Override
public void onNext(CreateLocalBlockRequest request) {
final String methodName = request.getOnlyReserveSpace() ? "ReserveSpace" : "CreateBlock";
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<CreateLocalBlockResponse>() {
@Override
public CreateLocalBlockResponse call(... | java | @Override
public void onNext(CreateLocalBlockRequest request) {
final String methodName = request.getOnlyReserveSpace() ? "ReserveSpace" : "CreateBlock";
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<CreateLocalBlockResponse>() {
@Override
public CreateLocalBlockResponse call(... | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"CreateLocalBlockRequest",
"request",
")",
"{",
"final",
"String",
"methodName",
"=",
"request",
".",
"getOnlyReserveSpace",
"(",
")",
"?",
"\"ReserveSpace\"",
":",
"\"CreateBlock\"",
";",
"RpcUtils",
".",
"streami... | Handles request to create local block. No exceptions should be thrown.
@param request a create request | [
"Handles",
"request",
"to",
"create",
"local",
"block",
".",
"No",
"exceptions",
"should",
"be",
"thrown",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockWriteHandler.java#L76-L119 |
18,505 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockWriteHandler.java | ShortCircuitBlockWriteHandler.handleBlockCompleteRequest | public void handleBlockCompleteRequest(boolean isCanceled) {
final String methodName = isCanceled ? "AbortBlock" : "CommitBlock";
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<CreateLocalBlockResponse>() {
@Override
public CreateLocalBlockResponse call() throws Exception {
... | java | public void handleBlockCompleteRequest(boolean isCanceled) {
final String methodName = isCanceled ? "AbortBlock" : "CommitBlock";
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<CreateLocalBlockResponse>() {
@Override
public CreateLocalBlockResponse call() throws Exception {
... | [
"public",
"void",
"handleBlockCompleteRequest",
"(",
"boolean",
"isCanceled",
")",
"{",
"final",
"String",
"methodName",
"=",
"isCanceled",
"?",
"\"AbortBlock\"",
":",
"\"CommitBlock\"",
";",
"RpcUtils",
".",
"streamingRPCAndLog",
"(",
"LOG",
",",
"new",
"RpcUtils",... | Handles complete block request. No exceptions should be thrown. | [
"Handles",
"complete",
"block",
"request",
".",
"No",
"exceptions",
"should",
"be",
"thrown",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockWriteHandler.java#L155-L185 |
18,506 | Alluxio/alluxio | underfs/wasb/src/main/java/alluxio/underfs/wasb/WasbUnderFileSystem.java | WasbUnderFileSystem.createConfiguration | public static Configuration createConfiguration(UnderFileSystemConfiguration conf) {
Configuration wasbConf = HdfsUnderFileSystem.createConfiguration(conf);
for (Map.Entry<String, String> entry : conf.toMap().entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if (Prope... | java | public static Configuration createConfiguration(UnderFileSystemConfiguration conf) {
Configuration wasbConf = HdfsUnderFileSystem.createConfiguration(conf);
for (Map.Entry<String, String> entry : conf.toMap().entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if (Prope... | [
"public",
"static",
"Configuration",
"createConfiguration",
"(",
"UnderFileSystemConfiguration",
"conf",
")",
"{",
"Configuration",
"wasbConf",
"=",
"HdfsUnderFileSystem",
".",
"createConfiguration",
"(",
"conf",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Stri... | Prepares the configuration for this Wasb as an HDFS configuration.
@param conf the configuration for this UFS
@return the created configuration | [
"Prepares",
"the",
"configuration",
"for",
"this",
"Wasb",
"as",
"an",
"HDFS",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/wasb/src/main/java/alluxio/underfs/wasb/WasbUnderFileSystem.java#L48-L60 |
18,507 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.supplyAsync | public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier, Executor executor) {
return asyncSupplyStage(screenExecutor(executor), supplier);
} | java | public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier, Executor executor) {
return asyncSupplyStage(screenExecutor(executor), supplier);
} | [
"public",
"static",
"<",
"U",
">",
"CompletableFuture",
"<",
"U",
">",
"supplyAsync",
"(",
"Supplier",
"<",
"U",
">",
"supplier",
",",
"Executor",
"executor",
")",
"{",
"return",
"asyncSupplyStage",
"(",
"screenExecutor",
"(",
"executor",
")",
",",
"supplier... | Returns a new CompletableFuture that is asynchronously completed by a task running in the given
executor with the value obtained by calling the given Supplier.
@param supplier a function returning the value to be used to complete the returned
CompletableFuture
@param executor the executor to use for asynchronous execu... | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"asynchronously",
"completed",
"by",
"a",
"task",
"running",
"in",
"the",
"given",
"executor",
"with",
"the",
"value",
"obtained",
"by",
"calling",
"the",
"given",
"Supplier",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L410-L412 |
18,508 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.runAsync | public static CompletableFuture<Void> runAsync(Runnable runnable, Executor executor) {
return asyncRunStage(screenExecutor(executor), runnable);
} | java | public static CompletableFuture<Void> runAsync(Runnable runnable, Executor executor) {
return asyncRunStage(screenExecutor(executor), runnable);
} | [
"public",
"static",
"CompletableFuture",
"<",
"Void",
">",
"runAsync",
"(",
"Runnable",
"runnable",
",",
"Executor",
"executor",
")",
"{",
"return",
"asyncRunStage",
"(",
"screenExecutor",
"(",
"executor",
")",
",",
"runnable",
")",
";",
"}"
] | Returns a new CompletableFuture that is asynchronously completed by a task running in the given
executor after it runs the given action.
@param runnable the action to run before completing the returned CompletableFuture
@param executor the executor to use for asynchronous execution
@return the new CompletableFuture | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"asynchronously",
"completed",
"by",
"a",
"task",
"running",
"in",
"the",
"given",
"executor",
"after",
"it",
"runs",
"the",
"given",
"action",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L433-L435 |
18,509 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.completedFuture | public static <U> CompletableFuture<U> completedFuture(U value) {
return new CompletableFuture<U>((value == null) ? NIL : value);
} | java | public static <U> CompletableFuture<U> completedFuture(U value) {
return new CompletableFuture<U>((value == null) ? NIL : value);
} | [
"public",
"static",
"<",
"U",
">",
"CompletableFuture",
"<",
"U",
">",
"completedFuture",
"(",
"U",
"value",
")",
"{",
"return",
"new",
"CompletableFuture",
"<",
"U",
">",
"(",
"(",
"value",
"==",
"null",
")",
"?",
"NIL",
":",
"value",
")",
";",
"}"
... | Returns a new CompletableFuture that is already completed with the given value.
@param value the value
@param <U> the type of the value
@return the completed CompletableFuture | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"already",
"completed",
"with",
"the",
"given",
"value",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L444-L446 |
18,510 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.anyOf | public static CompletableFuture<Object> anyOf(CompletableFuture<?>... cfs) {
int n;
Object r;
if ((n = cfs.length) <= 1)
return (n == 0) ? new CompletableFuture<Object>()
: (CompletableFuture<Object>) uniCopyStage(cfs[0]);
for (CompletableFuture<?> cf : cfs)
if ((r = cf.result) != ... | java | public static CompletableFuture<Object> anyOf(CompletableFuture<?>... cfs) {
int n;
Object r;
if ((n = cfs.length) <= 1)
return (n == 0) ? new CompletableFuture<Object>()
: (CompletableFuture<Object>) uniCopyStage(cfs[0]);
for (CompletableFuture<?> cf : cfs)
if ((r = cf.result) != ... | [
"public",
"static",
"CompletableFuture",
"<",
"Object",
">",
"anyOf",
"(",
"CompletableFuture",
"<",
"?",
">",
"...",
"cfs",
")",
"{",
"int",
"n",
";",
"Object",
"r",
";",
"if",
"(",
"(",
"n",
"=",
"cfs",
".",
"length",
")",
"<=",
"1",
")",
"return... | Returns a new CompletableFuture that is completed when any of the given CompletableFutures
complete, with the same result. Otherwise, if it completed exceptionally, the returned
CompletableFuture also does so, with a CompletionException holding this exception as its cause.
If no CompletableFutures are provided, returns... | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"completed",
"when",
"any",
"of",
"the",
"given",
"CompletableFutures",
"complete",
"with",
"the",
"same",
"result",
".",
"Otherwise",
"if",
"it",
"completed",
"exceptionally",
"the",
"returned",
"Completab... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L484-L507 |
18,511 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.failedFuture | public static <U> CompletableFuture<U> failedFuture(Throwable ex) {
return new CompletableFuture<U>(new AltResult(Objects.requireNonNull(ex)));
} | java | public static <U> CompletableFuture<U> failedFuture(Throwable ex) {
return new CompletableFuture<U>(new AltResult(Objects.requireNonNull(ex)));
} | [
"public",
"static",
"<",
"U",
">",
"CompletableFuture",
"<",
"U",
">",
"failedFuture",
"(",
"Throwable",
"ex",
")",
"{",
"return",
"new",
"CompletableFuture",
"<",
"U",
">",
"(",
"new",
"AltResult",
"(",
"Objects",
".",
"requireNonNull",
"(",
"ex",
")",
... | Returns a new CompletableFuture that is already completed exceptionally with the given
exception.
@param ex the exception
@param <U> the type of the value
@return the exceptionally completed CompletableFuture
@since 9 | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"already",
"completed",
"exceptionally",
"with",
"the",
"given",
"exception",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L562-L564 |
18,512 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.tryPushStack | final boolean tryPushStack(Completion c) {
Completion h = stack;
lazySetNext(c, h);
return U.compareAndSwapObject(this, STACK, h, c);
} | java | final boolean tryPushStack(Completion c) {
Completion h = stack;
lazySetNext(c, h);
return U.compareAndSwapObject(this, STACK, h, c);
} | [
"final",
"boolean",
"tryPushStack",
"(",
"Completion",
"c",
")",
"{",
"Completion",
"h",
"=",
"stack",
";",
"lazySetNext",
"(",
"c",
",",
"h",
")",
";",
"return",
"U",
".",
"compareAndSwapObject",
"(",
"this",
",",
"STACK",
",",
"h",
",",
"c",
")",
"... | Returns true if successfully pushed c onto stack. | [
"Returns",
"true",
"if",
"successfully",
"pushed",
"c",
"onto",
"stack",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L588-L592 |
18,513 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.completeValue | final boolean completeValue(T t) {
return U.compareAndSwapObject(this, RESULT, null, (t == null) ? NIL : t);
} | java | final boolean completeValue(T t) {
return U.compareAndSwapObject(this, RESULT, null, (t == null) ? NIL : t);
} | [
"final",
"boolean",
"completeValue",
"(",
"T",
"t",
")",
"{",
"return",
"U",
".",
"compareAndSwapObject",
"(",
"this",
",",
"RESULT",
",",
"null",
",",
"(",
"t",
"==",
"null",
")",
"?",
"NIL",
":",
"t",
")",
";",
"}"
] | Completes with a non-exceptional result, unless already completed. | [
"Completes",
"with",
"a",
"non",
"-",
"exceptional",
"result",
"unless",
"already",
"completed",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L611-L613 |
18,514 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.cleanStack | final void cleanStack() {
boolean unlinked = false;
Completion p;
while ((p = stack) != null && !p.isLive()) // ensure head of stack live
unlinked = casStack(p, p.next);
if (p != null && !unlinked) { // try to unlink first nonlive
for (Completion q = p.next; q != null;) {
Completion ... | java | final void cleanStack() {
boolean unlinked = false;
Completion p;
while ((p = stack) != null && !p.isLive()) // ensure head of stack live
unlinked = casStack(p, p.next);
if (p != null && !unlinked) { // try to unlink first nonlive
for (Completion q = p.next; q != null;) {
Completion ... | [
"final",
"void",
"cleanStack",
"(",
")",
"{",
"boolean",
"unlinked",
"=",
"false",
";",
"Completion",
"p",
";",
"while",
"(",
"(",
"p",
"=",
"stack",
")",
"!=",
"null",
"&&",
"!",
"p",
".",
"isLive",
"(",
")",
")",
"// ensure head of stack live",
"unli... | Traverses stack and unlinks one or more dead Completions, if found. | [
"Traverses",
"stack",
"and",
"unlinks",
"one",
"or",
"more",
"dead",
"Completions",
"if",
"found",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L673-L690 |
18,515 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.unipush | final void unipush(Completion c) {
if (c != null) {
while (!tryPushStack(c)) {
if (result != null) {
lazySetNext(c, null);
break;
}
}
if (result != null)
c.tryFire(SYNC);
}
} | java | final void unipush(Completion c) {
if (c != null) {
while (!tryPushStack(c)) {
if (result != null) {
lazySetNext(c, null);
break;
}
}
if (result != null)
c.tryFire(SYNC);
}
} | [
"final",
"void",
"unipush",
"(",
"Completion",
"c",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"while",
"(",
"!",
"tryPushStack",
"(",
"c",
")",
")",
"{",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"lazySetNext",
"(",
"c",
",",
"null",
... | Pushes the given completion unless it completes while trying. Caller should first check that
result is null. | [
"Pushes",
"the",
"given",
"completion",
"unless",
"it",
"completes",
"while",
"trying",
".",
"Caller",
"should",
"first",
"check",
"that",
"result",
"is",
"null",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L696-L707 |
18,516 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.bipush | final void bipush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
if (c != null) {
while (result == null) {
if (tryPushStack(c)) {
if (b.result == null)
b.unipush(new CoCompletion(c));
else if (result != null)
c.tryFire(SYNC);
return;
}
... | java | final void bipush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
if (c != null) {
while (result == null) {
if (tryPushStack(c)) {
if (b.result == null)
b.unipush(new CoCompletion(c));
else if (result != null)
c.tryFire(SYNC);
return;
}
... | [
"final",
"void",
"bipush",
"(",
"CompletableFuture",
"<",
"?",
">",
"b",
",",
"BiCompletion",
"<",
"?",
",",
"?",
",",
"?",
">",
"c",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"while",
"(",
"result",
"==",
"null",
")",
"{",
"if",
"(",
... | Pushes completion to this and b unless both done. Caller should first check that either result
or b.result is null. | [
"Pushes",
"completion",
"to",
"this",
"and",
"b",
"unless",
"both",
"done",
".",
"Caller",
"should",
"first",
"check",
"that",
"either",
"result",
"or",
"b",
".",
"result",
"is",
"null",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1006-L1019 |
18,517 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.postFire | final CompletableFuture<T> postFire(CompletableFuture<?> a, CompletableFuture<?> b, int mode) {
if (b != null && b.stack != null) { // clean second source
Object r;
if ((r = b.result) == null)
b.cleanStack();
if (mode >= 0 && (r != null || b.result != null))
b.postComplete();
}... | java | final CompletableFuture<T> postFire(CompletableFuture<?> a, CompletableFuture<?> b, int mode) {
if (b != null && b.stack != null) { // clean second source
Object r;
if ((r = b.result) == null)
b.cleanStack();
if (mode >= 0 && (r != null || b.result != null))
b.postComplete();
}... | [
"final",
"CompletableFuture",
"<",
"T",
">",
"postFire",
"(",
"CompletableFuture",
"<",
"?",
">",
"a",
",",
"CompletableFuture",
"<",
"?",
">",
"b",
",",
"int",
"mode",
")",
"{",
"if",
"(",
"b",
"!=",
"null",
"&&",
"b",
".",
"stack",
"!=",
"null",
... | Post-processing after successful BiCompletion tryFire. | [
"Post",
"-",
"processing",
"after",
"successful",
"BiCompletion",
"tryFire",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1022-L1031 |
18,518 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.orpush | final void orpush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
if (c != null) {
while (!tryPushStack(c)) {
if (result != null) {
lazySetNext(c, null);
break;
}
}
if (result != null)
c.tryFire(SYNC);
else
b.unipush(new CoCompletion(c))... | java | final void orpush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
if (c != null) {
while (!tryPushStack(c)) {
if (result != null) {
lazySetNext(c, null);
break;
}
}
if (result != null)
c.tryFire(SYNC);
else
b.unipush(new CoCompletion(c))... | [
"final",
"void",
"orpush",
"(",
"CompletableFuture",
"<",
"?",
">",
"b",
",",
"BiCompletion",
"<",
"?",
",",
"?",
",",
"?",
">",
"c",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"while",
"(",
"!",
"tryPushStack",
"(",
"c",
")",
")",
"{",
... | Pushes completion to this and b unless either done. Caller should first check that result and
b.result are both null. | [
"Pushes",
"completion",
"to",
"this",
"and",
"b",
"unless",
"either",
"done",
".",
"Caller",
"should",
"first",
"check",
"that",
"result",
"and",
"b",
".",
"result",
"are",
"both",
"null",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1185-L1198 |
18,519 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.get | public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
long nanos = unit.toNanos(timeout);
Object r;
if ((r = result) == null)
r = timedGet(nanos);
return (T) reportGet(r);
} | java | public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
long nanos = unit.toNanos(timeout);
Object r;
if ((r = result) == null)
r = timedGet(nanos);
return (T) reportGet(r);
} | [
"public",
"T",
"get",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"long",
"nanos",
"=",
"unit",
".",
"toNanos",
"(",
"timeout",
")",
";",
"Object",
"r",
";",... | Waits if necessary for at most the given time for this future to complete, and then returns its
result, if available.
@param timeout the maximum time to wait
@param unit the time unit of the timeout argument
@return the result value
@throws CancellationException if this future was cancelled
@throws ExecutionException ... | [
"Waits",
"if",
"necessary",
"for",
"at",
"most",
"the",
"given",
"time",
"for",
"this",
"future",
"to",
"complete",
"and",
"then",
"returns",
"its",
"result",
"if",
"available",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1367-L1374 |
18,520 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.getNumberOfDependents | public int getNumberOfDependents() {
int count = 0;
for (Completion p = stack; p != null; p = p.next)
++count;
return count;
} | java | public int getNumberOfDependents() {
int count = 0;
for (Completion p = stack; p != null; p = p.next)
++count;
return count;
} | [
"public",
"int",
"getNumberOfDependents",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Completion",
"p",
"=",
"stack",
";",
"p",
"!=",
"null",
";",
"p",
"=",
"p",
".",
"next",
")",
"",
"++",
"count",
";",
"return",
"count",
";",
"}"... | Returns the estimated number of CompletableFutures whose completions are awaiting completion of
this CompletableFuture. This method is designed for use in monitoring system state, not for
synchronization control.
@return the number of dependent CompletableFutures | [
"Returns",
"the",
"estimated",
"number",
"of",
"CompletableFutures",
"whose",
"completions",
"are",
"awaiting",
"completion",
"of",
"this",
"CompletableFuture",
".",
"This",
"method",
"is",
"designed",
"for",
"use",
"in",
"monitoring",
"system",
"state",
"not",
"f... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1707-L1712 |
18,521 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.completeAsync | public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier, Executor executor) {
if (supplier == null || executor == null)
throw new NullPointerException();
executor.execute(new AsyncSupply<T>(this, supplier));
return this;
} | java | public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier, Executor executor) {
if (supplier == null || executor == null)
throw new NullPointerException();
executor.execute(new AsyncSupply<T>(this, supplier));
return this;
} | [
"public",
"CompletableFuture",
"<",
"T",
">",
"completeAsync",
"(",
"Supplier",
"<",
"?",
"extends",
"T",
">",
"supplier",
",",
"Executor",
"executor",
")",
"{",
"if",
"(",
"supplier",
"==",
"null",
"||",
"executor",
"==",
"null",
")",
"throw",
"new",
"N... | Completes this CompletableFuture with the result of the given Supplier function invoked from an
asynchronous task using the given executor.
@param supplier a function returning the value to be used to complete this CompletableFuture
@param executor the executor to use for asynchronous execution
@return this Completabl... | [
"Completes",
"this",
"CompletableFuture",
"with",
"the",
"result",
"of",
"the",
"given",
"Supplier",
"function",
"invoked",
"from",
"an",
"asynchronous",
"task",
"using",
"the",
"given",
"executor",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1808-L1813 |
18,522 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.completeOnTimeout | public CompletableFuture<T> completeOnTimeout(T value, long timeout, TimeUnit unit) {
Objects.requireNonNull(unit);
if (result == null)
whenComplete(
new Canceller(Delayer.delay(new DelayedCompleter<T>(this, value), timeout, unit)));
return this;
} | java | public CompletableFuture<T> completeOnTimeout(T value, long timeout, TimeUnit unit) {
Objects.requireNonNull(unit);
if (result == null)
whenComplete(
new Canceller(Delayer.delay(new DelayedCompleter<T>(this, value), timeout, unit)));
return this;
} | [
"public",
"CompletableFuture",
"<",
"T",
">",
"completeOnTimeout",
"(",
"T",
"value",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"unit",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"whenComplete"... | Completes this CompletableFuture with the given value if not otherwise completed before the
given timeout.
@param value the value to use upon timeout
@param timeout how long to wait before completing normally with the given value, in units of
{@code unit}
@param unit a {@code TimeUnit} determining how to interpret the... | [
"Completes",
"this",
"CompletableFuture",
"with",
"the",
"given",
"value",
"if",
"not",
"otherwise",
"completed",
"before",
"the",
"given",
"timeout",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1860-L1866 |
18,523 | Alluxio/alluxio | core/server/proxy/src/main/java/alluxio/proxy/AlluxioProxy.java | AlluxioProxy.main | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioProxy.class.getCanonicalName());
System.exit(-1);
}
if (!ConfigurationUtils.masterHostConfigured(ServerConfiguration.global())) {
ProcessUtils.fatalEr... | java | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioProxy.class.getCanonicalName());
System.exit(-1);
}
if (!ConfigurationUtils.masterHostConfigured(ServerConfiguration.global())) {
ProcessUtils.fatalEr... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"0",
")",
"{",
"LOG",
".",
"info",
"(",
"\"java -cp {} {}\"",
",",
"RuntimeConstants",
".",
"ALLUXIO_JAR",
",",
"AlluxioProxy",
".",
... | Starts the Alluxio proxy.
@param args command line arguments, should be empty | [
"Starts",
"the",
"Alluxio",
"proxy",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/proxy/src/main/java/alluxio/proxy/AlluxioProxy.java#L37-L52 |
18,524 | Alluxio/alluxio | core/base/src/main/java/alluxio/security/authorization/AclEntry.java | AclEntry.toDefault | public static String toDefault(String stringEntry) {
if (stringEntry == null) {
throw new IllegalArgumentException("Input acl string is null");
}
List<String> components = Arrays.stream(stringEntry.split(":")).map(String::trim).collect(
Collectors.toList());
if (components != null && compo... | java | public static String toDefault(String stringEntry) {
if (stringEntry == null) {
throw new IllegalArgumentException("Input acl string is null");
}
List<String> components = Arrays.stream(stringEntry.split(":")).map(String::trim).collect(
Collectors.toList());
if (components != null && compo... | [
"public",
"static",
"String",
"toDefault",
"(",
"String",
"stringEntry",
")",
"{",
"if",
"(",
"stringEntry",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Input acl string is null\"",
")",
";",
"}",
"List",
"<",
"String",
">",
"co... | Convert a normal ACL to a string representing a default ACL.
@param stringEntry normal ACL, if it is already default ACL, then return the default ACL
@return a default ACL | [
"Convert",
"a",
"normal",
"ACL",
"to",
"a",
"string",
"representing",
"a",
"default",
"ACL",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AclEntry.java#L148-L159 |
18,525 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/policy/RoundRobinPolicy.java | RoundRobinPolicy.getWorker | @Override
@Nullable
public WorkerNetAddress getWorker(GetWorkerOptions options) {
Set<WorkerNetAddress> eligibleAddresses = new HashSet<>();
for (BlockWorkerInfo info : options.getBlockWorkerInfos()) {
eligibleAddresses.add(info.getNetAddress());
}
WorkerNetAddress address = mBlockLocationCac... | java | @Override
@Nullable
public WorkerNetAddress getWorker(GetWorkerOptions options) {
Set<WorkerNetAddress> eligibleAddresses = new HashSet<>();
for (BlockWorkerInfo info : options.getBlockWorkerInfos()) {
eligibleAddresses.add(info.getNetAddress());
}
WorkerNetAddress address = mBlockLocationCac... | [
"@",
"Override",
"@",
"Nullable",
"public",
"WorkerNetAddress",
"getWorker",
"(",
"GetWorkerOptions",
"options",
")",
"{",
"Set",
"<",
"WorkerNetAddress",
">",
"eligibleAddresses",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"BlockWorkerInfo",
"info"... | The policy uses the first fetch of worker info list as the base, and visits each of them in a
round-robin manner in the subsequent calls. The policy doesn't assume the list of worker info
in the subsequent calls has the same order from the first, and it will skip the workers that
are no longer active.
@param options o... | [
"The",
"policy",
"uses",
"the",
"first",
"fetch",
"of",
"worker",
"info",
"list",
"as",
"the",
"base",
"and",
"visits",
"each",
"of",
"them",
"in",
"a",
"round",
"-",
"robin",
"manner",
"in",
"the",
"subsequent",
"calls",
".",
"The",
"policy",
"doesn",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/policy/RoundRobinPolicy.java#L60-L96 |
18,526 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/Inode.java | Inode.wrap | public static Inode wrap(InodeView delegate) {
if (delegate instanceof Inode) {
return (Inode) delegate;
}
if (delegate.isFile()) {
Preconditions.checkState(delegate instanceof InodeFileView);
return new InodeFile((InodeFileView) delegate);
} else {
Preconditions.checkState(deleg... | java | public static Inode wrap(InodeView delegate) {
if (delegate instanceof Inode) {
return (Inode) delegate;
}
if (delegate.isFile()) {
Preconditions.checkState(delegate instanceof InodeFileView);
return new InodeFile((InodeFileView) delegate);
} else {
Preconditions.checkState(deleg... | [
"public",
"static",
"Inode",
"wrap",
"(",
"InodeView",
"delegate",
")",
"{",
"if",
"(",
"delegate",
"instanceof",
"Inode",
")",
"{",
"return",
"(",
"Inode",
")",
"delegate",
";",
"}",
"if",
"(",
"delegate",
".",
"isFile",
"(",
")",
")",
"{",
"Precondit... | Wraps an InodeView, providing read-only access. Modifications to the underlying inode will
affect the created read-only inode.
@param delegate the delegate to wrap
@return the created read-only inode | [
"Wraps",
"an",
"InodeView",
"providing",
"read",
"-",
"only",
"access",
".",
"Modifications",
"to",
"the",
"underlying",
"inode",
"will",
"affect",
"the",
"created",
"read",
"-",
"only",
"inode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/Inode.java#L211-L222 |
18,527 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/AbstractReadHandler.java | AbstractReadHandler.validateReadRequest | private void validateReadRequest(alluxio.grpc.ReadRequest request)
throws InvalidArgumentException {
if (request.getBlockId() < 0) {
throw new InvalidArgumentException(
String.format("Invalid blockId (%d) in read request.", request.getBlockId()));
}
if (request.getOffset() < 0 || reque... | java | private void validateReadRequest(alluxio.grpc.ReadRequest request)
throws InvalidArgumentException {
if (request.getBlockId() < 0) {
throw new InvalidArgumentException(
String.format("Invalid blockId (%d) in read request.", request.getBlockId()));
}
if (request.getOffset() < 0 || reque... | [
"private",
"void",
"validateReadRequest",
"(",
"alluxio",
".",
"grpc",
".",
"ReadRequest",
"request",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"request",
".",
"getBlockId",
"(",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException... | Validates a read request.
@param request the block read request
@throws InvalidArgumentException if the request is invalid | [
"Validates",
"a",
"read",
"request",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractReadHandler.java#L163-L173 |
18,528 | Alluxio/alluxio | integration/yarn/src/main/java/alluxio/yarn/ContainerAllocator.java | ContainerAllocator.allocateContainers | public List<Container> allocateContainers() throws Exception {
for (int attempt = 0; attempt < MAX_WORKER_CONTAINER_REQUEST_ATTEMPTS; attempt++) {
LOG.debug("Attempt {} of {} to allocate containers",
attempt, MAX_WORKER_CONTAINER_REQUEST_ATTEMPTS);
int numContainersToRequest = mTargetNumContai... | java | public List<Container> allocateContainers() throws Exception {
for (int attempt = 0; attempt < MAX_WORKER_CONTAINER_REQUEST_ATTEMPTS; attempt++) {
LOG.debug("Attempt {} of {} to allocate containers",
attempt, MAX_WORKER_CONTAINER_REQUEST_ATTEMPTS);
int numContainersToRequest = mTargetNumContai... | [
"public",
"List",
"<",
"Container",
">",
"allocateContainers",
"(",
")",
"throws",
"Exception",
"{",
"for",
"(",
"int",
"attempt",
"=",
"0",
";",
"attempt",
"<",
"MAX_WORKER_CONTAINER_REQUEST_ATTEMPTS",
";",
"attempt",
"++",
")",
"{",
"LOG",
".",
"debug",
"(... | Allocates the containers specified by the constructor.
@return the allocated containers | [
"Allocates",
"the",
"containers",
"specified",
"by",
"the",
"constructor",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/yarn/src/main/java/alluxio/yarn/ContainerAllocator.java#L109-L128 |
18,529 | Alluxio/alluxio | core/base/src/main/java/alluxio/util/SleepUtils.java | SleepUtils.sleepMs | public static void sleepMs(Logger logger, long timeMs) {
try {
Thread.sleep(timeMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (logger != null) {
logger.warn(e.getMessage(), e);
}
}
} | java | public static void sleepMs(Logger logger, long timeMs) {
try {
Thread.sleep(timeMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (logger != null) {
logger.warn(e.getMessage(), e);
}
}
} | [
"public",
"static",
"void",
"sleepMs",
"(",
"Logger",
"logger",
",",
"long",
"timeMs",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"timeMs",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
".",
"currentThread",
"(",
... | Sleeps for the given number of milliseconds, reporting interruptions using the given logger.
Unlike Thread.sleep(), this method responds to interrupts by setting the thread interrupt
status. This means that callers must check the interrupt status if they need to handle
interrupts.
@param logger logger for reporting i... | [
"Sleeps",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"reporting",
"interruptions",
"using",
"the",
"given",
"logger",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/SleepUtils.java#L45-L54 |
18,530 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/cli/ValidateEnv.java | ValidateEnv.validateRemote | private static boolean validateRemote(String node, String target, String name, CommandLine cmd)
throws InterruptedException {
System.out.format("Validating %s environment on %s...%n", target, node);
if (!Utils.isAddressReachable(node, 22)) {
System.err.format("Unable to reach ssh port 22 on node %s.... | java | private static boolean validateRemote(String node, String target, String name, CommandLine cmd)
throws InterruptedException {
System.out.format("Validating %s environment on %s...%n", target, node);
if (!Utils.isAddressReachable(node, 22)) {
System.err.format("Unable to reach ssh port 22 on node %s.... | [
"private",
"static",
"boolean",
"validateRemote",
"(",
"String",
"node",
",",
"String",
"target",
",",
"String",
"name",
",",
"CommandLine",
"cmd",
")",
"throws",
"InterruptedException",
"{",
"System",
".",
"out",
".",
"format",
"(",
"\"Validating %s environment o... | validates environment on remote node | [
"validates",
"environment",
"on",
"remote",
"node"
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/cli/ValidateEnv.java#L206-L236 |
18,531 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/cli/ValidateEnv.java | ValidateEnv.validateLocal | private static boolean validateLocal(String target, String name, CommandLine cmd)
throws InterruptedException {
int validationCount = 0;
Map<ValidationTask.TaskResult, Integer> results = new HashMap<>();
Map<String, String> optionsMap = new HashMap<>();
for (Option opt : cmd.getOptions()) {
... | java | private static boolean validateLocal(String target, String name, CommandLine cmd)
throws InterruptedException {
int validationCount = 0;
Map<ValidationTask.TaskResult, Integer> results = new HashMap<>();
Map<String, String> optionsMap = new HashMap<>();
for (Option opt : cmd.getOptions()) {
... | [
"private",
"static",
"boolean",
"validateLocal",
"(",
"String",
"target",
",",
"String",
"name",
",",
"CommandLine",
"cmd",
")",
"throws",
"InterruptedException",
"{",
"int",
"validationCount",
"=",
"0",
";",
"Map",
"<",
"ValidationTask",
".",
"TaskResult",
",",... | runs validation tasks in local environment | [
"runs",
"validation",
"tasks",
"in",
"local",
"environment"
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/cli/ValidateEnv.java#L239-L296 |
18,532 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/cli/ValidateEnv.java | ValidateEnv.validate | public static int validate(String... argv) throws InterruptedException {
if (argv.length < 1) {
printHelp("Target not specified.");
return -2;
}
String command = argv[0];
String name = null;
String[] args;
int argsLength = 0;
// Find all non-option command line arguments.
whi... | java | public static int validate(String... argv) throws InterruptedException {
if (argv.length < 1) {
printHelp("Target not specified.");
return -2;
}
String command = argv[0];
String name = null;
String[] args;
int argsLength = 0;
// Find all non-option command line arguments.
whi... | [
"public",
"static",
"int",
"validate",
"(",
"String",
"...",
"argv",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"argv",
".",
"length",
"<",
"1",
")",
"{",
"printHelp",
"(",
"\"Target not specified.\"",
")",
";",
"return",
"-",
"2",
";",
"}",
... | Validates environment.
@param argv list of arguments
@return 0 on success, -1 on validation failures, -2 on invalid arguments | [
"Validates",
"environment",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/cli/ValidateEnv.java#L366-L398 |
18,533 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/TieredIdentityUtils.java | TieredIdentityUtils.matches | public static boolean matches(TieredIdentity.LocalityTier tier,
TieredIdentity.LocalityTier otherTier, boolean resolveIpAddress) {
String otherTierName = otherTier.getTierName();
if (!tier.getTierName().equals(otherTierName)) {
return false;
}
String otherTierValue = otherTier.getValue();
... | java | public static boolean matches(TieredIdentity.LocalityTier tier,
TieredIdentity.LocalityTier otherTier, boolean resolveIpAddress) {
String otherTierName = otherTier.getTierName();
if (!tier.getTierName().equals(otherTierName)) {
return false;
}
String otherTierValue = otherTier.getValue();
... | [
"public",
"static",
"boolean",
"matches",
"(",
"TieredIdentity",
".",
"LocalityTier",
"tier",
",",
"TieredIdentity",
".",
"LocalityTier",
"otherTier",
",",
"boolean",
"resolveIpAddress",
")",
"{",
"String",
"otherTierName",
"=",
"otherTier",
".",
"getTierName",
"(",... | Locality comparison for wire type locality tiers, two locality tiers matches if both name and
values are equal, or for the "node" tier, if the node names resolve to the same IP address.
@param tier a wire type locality tier
@param otherTier a wire type locality tier to compare to
@param resolveIpAddress whether or not... | [
"Locality",
"comparison",
"for",
"wire",
"type",
"locality",
"tiers",
"two",
"locality",
"tiers",
"matches",
"if",
"both",
"name",
"and",
"values",
"are",
"equal",
"or",
"for",
"the",
"node",
"tier",
"if",
"the",
"node",
"names",
"resolve",
"to",
"the",
"s... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/TieredIdentityUtils.java#L41-L68 |
18,534 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/JournalTool.java | JournalTool.main | public static void main(String[] args) throws IOException {
if (!parseInputArgs(args)) {
usage();
System.exit(EXIT_FAILED);
}
if (sHelp) {
usage();
System.exit(EXIT_SUCCEEDED);
}
dumpJournal();
} | java | public static void main(String[] args) throws IOException {
if (!parseInputArgs(args)) {
usage();
System.exit(EXIT_FAILED);
}
if (sHelp) {
usage();
System.exit(EXIT_SUCCEEDED);
}
dumpJournal();
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"parseInputArgs",
"(",
"args",
")",
")",
"{",
"usage",
"(",
")",
";",
"System",
".",
"exit",
"(",
"EXIT_FAILED",
")",
";",
"}",
... | Dumps a ufs journal in human-readable format.
@param args arguments passed to the tool | [
"Dumps",
"a",
"ufs",
"journal",
"in",
"human",
"-",
"readable",
"format",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalTool.java#L97-L108 |
18,535 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/ValidateConf.java | ValidateConf.main | public static void main(String[] args) {
LOG.info("Validating configuration.");
try {
new InstancedConfiguration(ConfigurationUtils.defaults()).validate();
LOG.info("Configuration is valid.");
} catch (IllegalStateException e) {
LOG.error("Configuration is invalid: {}", e.getMessage());
... | java | public static void main(String[] args) {
LOG.info("Validating configuration.");
try {
new InstancedConfiguration(ConfigurationUtils.defaults()).validate();
LOG.info("Configuration is valid.");
} catch (IllegalStateException e) {
LOG.error("Configuration is invalid: {}", e.getMessage());
... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Validating configuration.\"",
")",
";",
"try",
"{",
"new",
"InstancedConfiguration",
"(",
"ConfigurationUtils",
".",
"defaults",
"(",
")",
")",
".",
... | Console program that validates the configuration.
@param args there are no arguments needed | [
"Console",
"program",
"that",
"validates",
"the",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/ValidateConf.java#L34-L44 |
18,536 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/cli/extensions/ExtensionsShell.java | ExtensionsShell.main | public static void main(String[] args) {
ExtensionsShell extensionShell =
new ExtensionsShell(ServerConfiguration.global());
System.exit(extensionShell.run(args));
} | java | public static void main(String[] args) {
ExtensionsShell extensionShell =
new ExtensionsShell(ServerConfiguration.global());
System.exit(extensionShell.run(args));
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"ExtensionsShell",
"extensionShell",
"=",
"new",
"ExtensionsShell",
"(",
"ServerConfiguration",
".",
"global",
"(",
")",
")",
";",
"System",
".",
"exit",
"(",
"extensionShell",
".... | Manage Alluxio extensions.
@param args array of arguments given by the user's input from the terminal | [
"Manage",
"Alluxio",
"extensions",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/cli/extensions/ExtensionsShell.java#L39-L43 |
18,537 | Alluxio/alluxio | job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java | JobGrpcClientUtils.run | public static void run(JobConfig config, int attempts, AlluxioConfiguration alluxioConf)
throws InterruptedException {
CountingRetry retryPolicy = new CountingRetry(attempts);
while (retryPolicy.attempt()) {
long jobId;
try (JobMasterClient client = JobMasterClient.Factory.create(
Jo... | java | public static void run(JobConfig config, int attempts, AlluxioConfiguration alluxioConf)
throws InterruptedException {
CountingRetry retryPolicy = new CountingRetry(attempts);
while (retryPolicy.attempt()) {
long jobId;
try (JobMasterClient client = JobMasterClient.Factory.create(
Jo... | [
"public",
"static",
"void",
"run",
"(",
"JobConfig",
"config",
",",
"int",
"attempts",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"InterruptedException",
"{",
"CountingRetry",
"retryPolicy",
"=",
"new",
"CountingRetry",
"(",
"attempts",
")",
";",
"... | Runs the specified job and waits for it to finish. If the job fails, it is retried the given
number of times. If the job does not complete in the given number of attempts, an exception
is thrown.
@param config configuration for the job to run
@param attempts number of times to try running the job before giving up
@par... | [
"Runs",
"the",
"specified",
"job",
"and",
"waits",
"for",
"it",
"to",
"finish",
".",
"If",
"the",
"job",
"fails",
"it",
"is",
"retried",
"the",
"given",
"number",
"of",
"times",
".",
"If",
"the",
"job",
"does",
"not",
"complete",
"in",
"the",
"given",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java#L51-L75 |
18,538 | Alluxio/alluxio | job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java | JobGrpcClientUtils.createProgressThread | public static Thread createProgressThread(final long intervalMs, final PrintStream stream) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
CommonUtils.sleepMs(intervalMs);
if (Thread.interrupted()) {
return;
}
... | java | public static Thread createProgressThread(final long intervalMs, final PrintStream stream) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
CommonUtils.sleepMs(intervalMs);
if (Thread.interrupted()) {
return;
}
... | [
"public",
"static",
"Thread",
"createProgressThread",
"(",
"final",
"long",
"intervalMs",
",",
"final",
"PrintStream",
"stream",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"ru... | Creates a thread which will write "." to the given print stream at the given interval. The
created thread is not started by this method. The created thread will be daemonic and will
halt when interrupted.
@param intervalMs the time interval in milliseconds between writes
@param stream the print stream to write to
@ret... | [
"Creates",
"a",
"thread",
"which",
"will",
"write",
".",
"to",
"the",
"given",
"print",
"stream",
"at",
"the",
"given",
"interval",
".",
"The",
"created",
"thread",
"is",
"not",
"started",
"by",
"this",
"method",
".",
"The",
"created",
"thread",
"will",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java#L97-L112 |
18,539 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/allocator/RoundRobinAllocator.java | RoundRobinAllocator.getNextAvailDirInTier | private int getNextAvailDirInTier(StorageTierView tierView, long blockSize) {
int dirViewIndex = mTierAliasToLastDirMap.get(tierView.getTierViewAlias());
for (int i = 0; i < tierView.getDirViews().size(); i++) { // try this many times
dirViewIndex = (dirViewIndex + 1) % tierView.getDirViews().size();
... | java | private int getNextAvailDirInTier(StorageTierView tierView, long blockSize) {
int dirViewIndex = mTierAliasToLastDirMap.get(tierView.getTierViewAlias());
for (int i = 0; i < tierView.getDirViews().size(); i++) { // try this many times
dirViewIndex = (dirViewIndex + 1) % tierView.getDirViews().size();
... | [
"private",
"int",
"getNextAvailDirInTier",
"(",
"StorageTierView",
"tierView",
",",
"long",
"blockSize",
")",
"{",
"int",
"dirViewIndex",
"=",
"mTierAliasToLastDirMap",
".",
"get",
"(",
"tierView",
".",
"getTierViewAlias",
"(",
")",
")",
";",
"for",
"(",
"int",
... | Finds an available dir in a given tier for a block with blockSize.
@param tierView the tier to find a dir
@param blockSize the requested block size
@return the index of the dir if non-negative; -1 if fail to find a dir | [
"Finds",
"an",
"available",
"dir",
"in",
"a",
"given",
"tier",
"for",
"a",
"block",
"with",
"blockSize",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/allocator/RoundRobinAllocator.java#L109-L118 |
18,540 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.createBlockMetaInternal | private TempBlockMeta createBlockMetaInternal(long sessionId, long blockId,
BlockStoreLocation location, long initialBlockSize, boolean newBlock)
throws BlockAlreadyExistsException {
// NOTE: a temp block is supposed to be visible for its own writer, unnecessary to acquire
// block lock here sin... | java | private TempBlockMeta createBlockMetaInternal(long sessionId, long blockId,
BlockStoreLocation location, long initialBlockSize, boolean newBlock)
throws BlockAlreadyExistsException {
// NOTE: a temp block is supposed to be visible for its own writer, unnecessary to acquire
// block lock here sin... | [
"private",
"TempBlockMeta",
"createBlockMetaInternal",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
",",
"BlockStoreLocation",
"location",
",",
"long",
"initialBlockSize",
",",
"boolean",
"newBlock",
")",
"throws",
"BlockAlreadyExistsException",
"{",
"// NOTE: a temp... | Creates a temp block meta only if allocator finds available space. This method will not trigger
any eviction.
@param sessionId session id
@param blockId block id
@param location location to create the block
@param initialBlockSize initial block size in bytes
@param newBlock true if this temp block is created for a new... | [
"Creates",
"a",
"temp",
"block",
"meta",
"only",
"if",
"allocator",
"finds",
"available",
"space",
".",
"This",
"method",
"will",
"not",
"trigger",
"any",
"eviction",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L635-L665 |
18,541 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.requestSpaceInternal | private Pair<Boolean, BlockStoreLocation> requestSpaceInternal(long blockId, long additionalBytes)
throws BlockDoesNotExistException {
// NOTE: a temp block is supposed to be visible for its own writer, unnecessary to acquire
// block lock here since no sharing
try (LockResource r = new LockResource(m... | java | private Pair<Boolean, BlockStoreLocation> requestSpaceInternal(long blockId, long additionalBytes)
throws BlockDoesNotExistException {
// NOTE: a temp block is supposed to be visible for its own writer, unnecessary to acquire
// block lock here since no sharing
try (LockResource r = new LockResource(m... | [
"private",
"Pair",
"<",
"Boolean",
",",
"BlockStoreLocation",
">",
"requestSpaceInternal",
"(",
"long",
"blockId",
",",
"long",
"additionalBytes",
")",
"throws",
"BlockDoesNotExistException",
"{",
"// NOTE: a temp block is supposed to be visible for its own writer, unnecessary to... | Increases the temp block size only if this temp block's parent dir has enough available space.
@param blockId block id
@param additionalBytes additional bytes to request for this block
@return a pair of boolean and {@link BlockStoreLocation}. The boolean indicates if the
operation succeeds and the {@link BlockStoreLoc... | [
"Increases",
"the",
"temp",
"block",
"size",
"only",
"if",
"this",
"temp",
"block",
"s",
"parent",
"dir",
"has",
"enough",
"available",
"space",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L677-L695 |
18,542 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.removeBlockInternal | private void removeBlockInternal(long sessionId, long blockId, BlockStoreLocation location)
throws InvalidWorkerStateException, BlockDoesNotExistException, IOException {
long lockId = mLockManager.lockBlock(sessionId, blockId, BlockLockType.WRITE);
try {
String filePath;
BlockMeta blockMeta;
... | java | private void removeBlockInternal(long sessionId, long blockId, BlockStoreLocation location)
throws InvalidWorkerStateException, BlockDoesNotExistException, IOException {
long lockId = mLockManager.lockBlock(sessionId, blockId, BlockLockType.WRITE);
try {
String filePath;
BlockMeta blockMeta;
... | [
"private",
"void",
"removeBlockInternal",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
",",
"BlockStoreLocation",
"location",
")",
"throws",
"InvalidWorkerStateException",
",",
"BlockDoesNotExistException",
",",
"IOException",
"{",
"long",
"lockId",
"=",
"mLockMana... | Removes a block.
@param sessionId session id
@param blockId block id
@param location the source location of the block
@throws InvalidWorkerStateException if the block to remove is a temp block
@throws BlockDoesNotExistException if this block can not be found | [
"Removes",
"a",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L888-L917 |
18,543 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.updatePinnedInodes | @Override
public void updatePinnedInodes(Set<Long> inodes) {
LOG.debug("updatePinnedInodes: inodes={}", inodes);
synchronized (mPinnedInodes) {
mPinnedInodes.clear();
mPinnedInodes.addAll(Preconditions.checkNotNull(inodes));
}
} | java | @Override
public void updatePinnedInodes(Set<Long> inodes) {
LOG.debug("updatePinnedInodes: inodes={}", inodes);
synchronized (mPinnedInodes) {
mPinnedInodes.clear();
mPinnedInodes.addAll(Preconditions.checkNotNull(inodes));
}
} | [
"@",
"Override",
"public",
"void",
"updatePinnedInodes",
"(",
"Set",
"<",
"Long",
">",
"inodes",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"updatePinnedInodes: inodes={}\"",
",",
"inodes",
")",
";",
"synchronized",
"(",
"mPinnedInodes",
")",
"{",
"mPinnedInodes",
... | Updates the pinned blocks.
@param inodes a set of ids inodes that are pinned | [
"Updates",
"the",
"pinned",
"blocks",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L941-L948 |
18,544 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.removeDir | public void removeDir(StorageDir dir) {
// TODO(feng): Add a command for manually removing directory
try (LockResource r = new LockResource(mMetadataWriteLock)) {
String tierAlias = dir.getParentTier().getTierAlias();
dir.getParentTier().removeStorageDir(dir);
synchronized (mBlockStoreEventLis... | java | public void removeDir(StorageDir dir) {
// TODO(feng): Add a command for manually removing directory
try (LockResource r = new LockResource(mMetadataWriteLock)) {
String tierAlias = dir.getParentTier().getTierAlias();
dir.getParentTier().removeStorageDir(dir);
synchronized (mBlockStoreEventLis... | [
"public",
"void",
"removeDir",
"(",
"StorageDir",
"dir",
")",
"{",
"// TODO(feng): Add a command for manually removing directory",
"try",
"(",
"LockResource",
"r",
"=",
"new",
"LockResource",
"(",
"mMetadataWriteLock",
")",
")",
"{",
"String",
"tierAlias",
"=",
"dir",... | Removes a storage directory.
@param dir storage directory to be removed | [
"Removes",
"a",
"storage",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L973-L985 |
18,545 | Alluxio/alluxio | core/common/src/main/java/alluxio/conf/AlluxioProperties.java | AlluxioProperties.remove | public void remove(PropertyKey key) {
// remove is a nop if the key doesn't already exist
if (mUserProps.containsKey(key)) {
mUserProps.remove(key);
mSources.remove(key);
}
} | java | public void remove(PropertyKey key) {
// remove is a nop if the key doesn't already exist
if (mUserProps.containsKey(key)) {
mUserProps.remove(key);
mSources.remove(key);
}
} | [
"public",
"void",
"remove",
"(",
"PropertyKey",
"key",
")",
"{",
"// remove is a nop if the key doesn't already exist",
"if",
"(",
"mUserProps",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"mUserProps",
".",
"remove",
"(",
"key",
")",
";",
"mSources",
".",
... | Remove the value set for key.
@param key key to remove | [
"Remove",
"the",
"value",
"set",
"for",
"key",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/AlluxioProperties.java#L156-L162 |
18,546 | Alluxio/alluxio | core/common/src/main/java/alluxio/conf/AlluxioProperties.java | AlluxioProperties.isSet | public boolean isSet(PropertyKey key) {
if (isSetByUser(key)) {
return true;
}
// In case key is not the reference to the original key
return PropertyKey.fromString(key.toString()).getDefaultValue() != null;
} | java | public boolean isSet(PropertyKey key) {
if (isSetByUser(key)) {
return true;
}
// In case key is not the reference to the original key
return PropertyKey.fromString(key.toString()).getDefaultValue() != null;
} | [
"public",
"boolean",
"isSet",
"(",
"PropertyKey",
"key",
")",
"{",
"if",
"(",
"isSetByUser",
"(",
"key",
")",
")",
"{",
"return",
"true",
";",
"}",
"// In case key is not the reference to the original key",
"return",
"PropertyKey",
".",
"fromString",
"(",
"key",
... | Checks if there is a value set for the given key.
@param key the key to check
@return true if there is value for the key, false otherwise | [
"Checks",
"if",
"there",
"is",
"a",
"value",
"set",
"for",
"the",
"given",
"key",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/AlluxioProperties.java#L170-L176 |
18,547 | Alluxio/alluxio | core/common/src/main/java/alluxio/conf/AlluxioProperties.java | AlluxioProperties.forEach | public void forEach(BiConsumer<? super PropertyKey, ? super String> action) {
for (Map.Entry<PropertyKey, String> entry : entrySet()) {
action.accept(entry.getKey(), entry.getValue());
}
} | java | public void forEach(BiConsumer<? super PropertyKey, ? super String> action) {
for (Map.Entry<PropertyKey, String> entry : entrySet()) {
action.accept(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"forEach",
"(",
"BiConsumer",
"<",
"?",
"super",
"PropertyKey",
",",
"?",
"super",
"String",
">",
"action",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"PropertyKey",
",",
"String",
">",
"entry",
":",
"entrySet",
"(",
")",
")",
... | Iterates over all the key value pairs and performs the given action.
@param action the operation to perform on each key value pair | [
"Iterates",
"over",
"all",
"the",
"key",
"value",
"pairs",
"and",
"performs",
"the",
"given",
"action",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/AlluxioProperties.java#L219-L223 |
18,548 | Alluxio/alluxio | core/common/src/main/java/alluxio/conf/AlluxioProperties.java | AlluxioProperties.setSource | @VisibleForTesting
public void setSource(PropertyKey key, Source source) {
mSources.put(key, source);
} | java | @VisibleForTesting
public void setSource(PropertyKey key, Source source) {
mSources.put(key, source);
} | [
"@",
"VisibleForTesting",
"public",
"void",
"setSource",
"(",
"PropertyKey",
"key",
",",
"Source",
"source",
")",
"{",
"mSources",
".",
"put",
"(",
"key",
",",
"source",
")",
";",
"}"
] | Sets the source for a given key.
@param key property key
@param source the source | [
"Sets",
"the",
"source",
"for",
"a",
"given",
"key",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/AlluxioProperties.java#L240-L243 |
18,549 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/metrics/TimeSeriesStore.java | TimeSeriesStore.record | public void record(String metric, double value) {
mTimeSeries.compute(metric, (metricName, timeSeries) -> {
if (timeSeries == null) {
timeSeries = new TimeSeries(metricName);
}
timeSeries.record(value);
return timeSeries;
});
} | java | public void record(String metric, double value) {
mTimeSeries.compute(metric, (metricName, timeSeries) -> {
if (timeSeries == null) {
timeSeries = new TimeSeries(metricName);
}
timeSeries.record(value);
return timeSeries;
});
} | [
"public",
"void",
"record",
"(",
"String",
"metric",
",",
"double",
"value",
")",
"{",
"mTimeSeries",
".",
"compute",
"(",
"metric",
",",
"(",
"metricName",
",",
"timeSeries",
")",
"->",
"{",
"if",
"(",
"timeSeries",
"==",
"null",
")",
"{",
"timeSeries",... | Records a value for the given metric at the current time.
@param metric the name of the metric
@param value the value of the metric | [
"Records",
"a",
"value",
"for",
"the",
"given",
"metric",
"at",
"the",
"current",
"time",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/TimeSeriesStore.java#L44-L52 |
18,550 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java | UfsInputStreamManager.release | public void release(InputStream inputStream) throws IOException {
// for non-seekable input stream, close and return
if (!(inputStream instanceof CachedSeekableInputStream) || !CACHE_ENABLED) {
inputStream.close();
return;
}
synchronized (mFileIdToInputStreamIds) {
if (!mFileIdToInput... | java | public void release(InputStream inputStream) throws IOException {
// for non-seekable input stream, close and return
if (!(inputStream instanceof CachedSeekableInputStream) || !CACHE_ENABLED) {
inputStream.close();
return;
}
synchronized (mFileIdToInputStreamIds) {
if (!mFileIdToInput... | [
"public",
"void",
"release",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"// for non-seekable input stream, close and return",
"if",
"(",
"!",
"(",
"inputStream",
"instanceof",
"CachedSeekableInputStream",
")",
"||",
"!",
"CACHE_ENABLED",
")",
... | Releases an input stream. The input stream is closed if it's already expired.
@param inputStream the input stream to release
@throws IOException when input stream fails to close | [
"Releases",
"an",
"input",
"stream",
".",
"The",
"input",
"stream",
"is",
"closed",
"if",
"it",
"s",
"already",
"expired",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java#L134-L159 |
18,551 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java | UfsInputStreamManager.invalidate | public void invalidate(CachedSeekableInputStream inputStream) throws IOException {
mUnderFileInputStreamCache.invalidate(inputStream.getResourceId());
release(inputStream);
} | java | public void invalidate(CachedSeekableInputStream inputStream) throws IOException {
mUnderFileInputStreamCache.invalidate(inputStream.getResourceId());
release(inputStream);
} | [
"public",
"void",
"invalidate",
"(",
"CachedSeekableInputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"mUnderFileInputStreamCache",
".",
"invalidate",
"(",
"inputStream",
".",
"getResourceId",
"(",
")",
")",
";",
"release",
"(",
"inputStream",
")",
";"... | Invalidates an input stream from the cache.
@param inputStream the cached input stream
@throws IOException when the invalidated input stream fails to release | [
"Invalidates",
"an",
"input",
"stream",
"from",
"the",
"cache",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java#L167-L170 |
18,552 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java | UfsInputStreamManager.acquire | public InputStream acquire(UnderFileSystem ufs, String path, long fileId, OpenOptions openOptions)
throws IOException {
return acquire(ufs, path, fileId, openOptions, true);
} | java | public InputStream acquire(UnderFileSystem ufs, String path, long fileId, OpenOptions openOptions)
throws IOException {
return acquire(ufs, path, fileId, openOptions, true);
} | [
"public",
"InputStream",
"acquire",
"(",
"UnderFileSystem",
"ufs",
",",
"String",
"path",
",",
"long",
"fileId",
",",
"OpenOptions",
"openOptions",
")",
"throws",
"IOException",
"{",
"return",
"acquire",
"(",
"ufs",
",",
"path",
",",
"fileId",
",",
"openOption... | Acquires an input stream. For seekable input streams, if there is an available input stream in
the cache, reuse it and repositions the offset, otherwise the manager opens a new input stream.
@param ufs the under file system
@param path the path to the under storage file
@param fileId the file id
@param openOptions the... | [
"Acquires",
"an",
"input",
"stream",
".",
"For",
"seekable",
"input",
"streams",
"if",
"there",
"is",
"an",
"available",
"input",
"stream",
"in",
"the",
"cache",
"reuse",
"it",
"and",
"repositions",
"the",
"offset",
"otherwise",
"the",
"manager",
"opens",
"a... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java#L183-L186 |
18,553 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java | UfsInputStreamManager.acquire | public InputStream acquire(UnderFileSystem ufs, String path, long fileId, OpenOptions openOptions,
boolean reuse) throws IOException {
if (!ufs.isSeekable() || !CACHE_ENABLED) {
// not able to cache, always return a new input stream
return ufs.openExistingFile(path, openOptions);
}
// exp... | java | public InputStream acquire(UnderFileSystem ufs, String path, long fileId, OpenOptions openOptions,
boolean reuse) throws IOException {
if (!ufs.isSeekable() || !CACHE_ENABLED) {
// not able to cache, always return a new input stream
return ufs.openExistingFile(path, openOptions);
}
// exp... | [
"public",
"InputStream",
"acquire",
"(",
"UnderFileSystem",
"ufs",
",",
"String",
"path",
",",
"long",
"fileId",
",",
"OpenOptions",
"openOptions",
",",
"boolean",
"reuse",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"ufs",
".",
"isSeekable",
"(",
")"... | Acquires an input stream. For seekable input streams, if there is an available input stream in
the cache and reuse mode is specified, reuse it and repositions the offset, otherwise the
manager opens a new input stream.
@param ufs the under file system
@param path the path to the under storage file
@param fileId the fi... | [
"Acquires",
"an",
"input",
"stream",
".",
"For",
"seekable",
"input",
"streams",
"if",
"there",
"is",
"an",
"available",
"input",
"stream",
"in",
"the",
"cache",
"and",
"reuse",
"mode",
"is",
"specified",
"reuse",
"it",
"and",
"repositions",
"the",
"offset",... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamManager.java#L201-L262 |
18,554 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java | MetaMasterSync.heartbeat | @Override
public void heartbeat() {
MetaCommand command = null;
try {
if (mMasterId.get() == UNINITIALIZED_MASTER_ID) {
setIdAndRegister();
}
command = mMasterClient.heartbeat(mMasterId.get());
handleCommand(command);
} catch (IOException e) {
// An error occurred, lo... | java | @Override
public void heartbeat() {
MetaCommand command = null;
try {
if (mMasterId.get() == UNINITIALIZED_MASTER_ID) {
setIdAndRegister();
}
command = mMasterClient.heartbeat(mMasterId.get());
handleCommand(command);
} catch (IOException e) {
// An error occurred, lo... | [
"@",
"Override",
"public",
"void",
"heartbeat",
"(",
")",
"{",
"MetaCommand",
"command",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"mMasterId",
".",
"get",
"(",
")",
"==",
"UNINITIALIZED_MASTER_ID",
")",
"{",
"setIdAndRegister",
"(",
")",
";",
"}",
"comma... | Heartbeats to the leader master node. | [
"Heartbeats",
"to",
"the",
"leader",
"master",
"node",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java#L66-L84 |
18,555 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java | MetaMasterSync.handleCommand | private void handleCommand(MetaCommand cmd) throws IOException {
if (cmd == null) {
return;
}
switch (cmd) {
case MetaCommand_Nothing:
break;
// Leader master requests re-registration
case MetaCommand_Register:
setIdAndRegister();
break;
// Unknown reque... | java | private void handleCommand(MetaCommand cmd) throws IOException {
if (cmd == null) {
return;
}
switch (cmd) {
case MetaCommand_Nothing:
break;
// Leader master requests re-registration
case MetaCommand_Register:
setIdAndRegister();
break;
// Unknown reque... | [
"private",
"void",
"handleCommand",
"(",
"MetaCommand",
"cmd",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cmd",
"==",
"null",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"cmd",
")",
"{",
"case",
"MetaCommand_Nothing",
":",
"break",
";",
"// Leader mas... | Handles a leader master command.
@param cmd the command to execute | [
"Handles",
"a",
"leader",
"master",
"command",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java#L91-L109 |
18,556 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java | MetaMasterSync.setIdAndRegister | private void setIdAndRegister() throws IOException {
mMasterId.set(mMasterClient.getId(mMasterAddress));
mMasterClient.register(mMasterId.get(),
ConfigurationUtils.getConfiguration(ServerConfiguration.global(), Scope.MASTER));
} | java | private void setIdAndRegister() throws IOException {
mMasterId.set(mMasterClient.getId(mMasterAddress));
mMasterClient.register(mMasterId.get(),
ConfigurationUtils.getConfiguration(ServerConfiguration.global(), Scope.MASTER));
} | [
"private",
"void",
"setIdAndRegister",
"(",
")",
"throws",
"IOException",
"{",
"mMasterId",
".",
"set",
"(",
"mMasterClient",
".",
"getId",
"(",
"mMasterAddress",
")",
")",
";",
"mMasterClient",
".",
"register",
"(",
"mMasterId",
".",
"get",
"(",
")",
",",
... | Sets the master id and registers with the Alluxio leader master. | [
"Sets",
"the",
"master",
"id",
"and",
"registers",
"with",
"the",
"Alluxio",
"leader",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/MetaMasterSync.java#L114-L118 |
18,557 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/allocator/MaxFreeAllocator.java | MaxFreeAllocator.getCandidateDirInTier | private StorageDirView getCandidateDirInTier(StorageTierView tierView, long blockSize) {
StorageDirView candidateDirView = null;
long maxFreeBytes = blockSize - 1;
for (StorageDirView dirView : tierView.getDirViews()) {
if (dirView.getAvailableBytes() > maxFreeBytes) {
maxFreeBytes = dirView.g... | java | private StorageDirView getCandidateDirInTier(StorageTierView tierView, long blockSize) {
StorageDirView candidateDirView = null;
long maxFreeBytes = blockSize - 1;
for (StorageDirView dirView : tierView.getDirViews()) {
if (dirView.getAvailableBytes() > maxFreeBytes) {
maxFreeBytes = dirView.g... | [
"private",
"StorageDirView",
"getCandidateDirInTier",
"(",
"StorageTierView",
"tierView",
",",
"long",
"blockSize",
")",
"{",
"StorageDirView",
"candidateDirView",
"=",
"null",
";",
"long",
"maxFreeBytes",
"=",
"blockSize",
"-",
"1",
";",
"for",
"(",
"StorageDirView... | Finds a directory view in a tier view that has max free space and is able to store the block.
@param tierView the storage tier view
@param blockSize the size of block in bytes
@return the storage directory view if found, null otherwise | [
"Finds",
"a",
"directory",
"view",
"in",
"a",
"tier",
"view",
"that",
"has",
"max",
"free",
"space",
"and",
"is",
"able",
"to",
"store",
"the",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/allocator/MaxFreeAllocator.java#L91-L101 |
18,558 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/meta/StorageTier.java | StorageTier.removeStorageDir | public void removeStorageDir(StorageDir dir) {
if (mDirs.remove(dir)) {
mCapacityBytes -= dir.getCapacityBytes();
}
mLostStorage.add(dir.getDirPath());
} | java | public void removeStorageDir(StorageDir dir) {
if (mDirs.remove(dir)) {
mCapacityBytes -= dir.getCapacityBytes();
}
mLostStorage.add(dir.getDirPath());
} | [
"public",
"void",
"removeStorageDir",
"(",
"StorageDir",
"dir",
")",
"{",
"if",
"(",
"mDirs",
".",
"remove",
"(",
"dir",
")",
")",
"{",
"mCapacityBytes",
"-=",
"dir",
".",
"getCapacityBytes",
"(",
")",
";",
"}",
"mLostStorage",
".",
"add",
"(",
"dir",
... | Removes a directory.
@param dir directory to be removed | [
"Removes",
"a",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/StorageTier.java#L245-L250 |
18,559 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/RestUtils.java | RestUtils.call | public static <T> Response call(RestUtils.RestCallable<T> callable,
AlluxioConfiguration alluxioConf) {
return call(callable, alluxioConf, null);
} | java | public static <T> Response call(RestUtils.RestCallable<T> callable,
AlluxioConfiguration alluxioConf) {
return call(callable, alluxioConf, null);
} | [
"public",
"static",
"<",
"T",
">",
"Response",
"call",
"(",
"RestUtils",
".",
"RestCallable",
"<",
"T",
">",
"callable",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"return",
"call",
"(",
"callable",
",",
"alluxioConf",
",",
"null",
")",
";",
"}"... | Call response.
@param <T> the type parameter
@param callable the callable
@param alluxioConf the alluxio conf
@return the response | [
"Call",
"response",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/RestUtils.java#L77-L80 |
18,560 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/RestUtils.java | RestUtils.makeCORS | public static Response.ResponseBuilder makeCORS(Response.ResponseBuilder responseBuilder,
String returnMethod) {
// TODO(william): Make origin, methods, and headers configurable.
Response.ResponseBuilder rb = responseBuilder.header("Access-Control-Allow-Origin", "*")
.header("Access-Control-Allow-... | java | public static Response.ResponseBuilder makeCORS(Response.ResponseBuilder responseBuilder,
String returnMethod) {
// TODO(william): Make origin, methods, and headers configurable.
Response.ResponseBuilder rb = responseBuilder.header("Access-Control-Allow-Origin", "*")
.header("Access-Control-Allow-... | [
"public",
"static",
"Response",
".",
"ResponseBuilder",
"makeCORS",
"(",
"Response",
".",
"ResponseBuilder",
"responseBuilder",
",",
"String",
"returnMethod",
")",
"{",
"// TODO(william): Make origin, methods, and headers configurable.",
"Response",
".",
"ResponseBuilder",
"r... | Makes the responseBuilder CORS compatible.
@param responseBuilder the response builder
@param returnMethod the modified response builder
@return response builder | [
"Makes",
"the",
"responseBuilder",
"CORS",
"compatible",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/RestUtils.java#L193-L204 |
18,561 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioJobCluster.java | LocalAlluxioJobCluster.startMaster | private void startMaster() throws IOException, ConnectionFailedException {
mMaster = AlluxioJobMasterProcess.Factory.create();
ServerConfiguration
.set(PropertyKey.JOB_MASTER_RPC_PORT, String.valueOf(mMaster.getRpcAddress().getPort()));
Runnable runMaster = new Runnable() {
@Override
pu... | java | private void startMaster() throws IOException, ConnectionFailedException {
mMaster = AlluxioJobMasterProcess.Factory.create();
ServerConfiguration
.set(PropertyKey.JOB_MASTER_RPC_PORT, String.valueOf(mMaster.getRpcAddress().getPort()));
Runnable runMaster = new Runnable() {
@Override
pu... | [
"private",
"void",
"startMaster",
"(",
")",
"throws",
"IOException",
",",
"ConnectionFailedException",
"{",
"mMaster",
"=",
"AlluxioJobMasterProcess",
".",
"Factory",
".",
"create",
"(",
")",
";",
"ServerConfiguration",
".",
"set",
"(",
"PropertyKey",
".",
"JOB_MA... | Runs a master.
@throws IOException if an I/O error occurs
@throws ConnectionFailedException if network connection failed | [
"Runs",
"a",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioJobCluster.java#L154-L171 |
18,562 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioJobCluster.java | LocalAlluxioJobCluster.startWorker | private void startWorker() throws IOException, ConnectionFailedException {
mWorker = JobWorkerProcess.Factory.create();
Runnable runWorker = new Runnable() {
@Override
public void run() {
try {
mWorker.start();
} catch (Exception e) {
throw new RuntimeException(e ... | java | private void startWorker() throws IOException, ConnectionFailedException {
mWorker = JobWorkerProcess.Factory.create();
Runnable runWorker = new Runnable() {
@Override
public void run() {
try {
mWorker.start();
} catch (Exception e) {
throw new RuntimeException(e ... | [
"private",
"void",
"startWorker",
"(",
")",
"throws",
"IOException",
",",
"ConnectionFailedException",
"{",
"mWorker",
"=",
"JobWorkerProcess",
".",
"Factory",
".",
"create",
"(",
")",
";",
"Runnable",
"runWorker",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
... | Runs a worker.
@throws IOException if an I/O error occurs
@throws ConnectionFailedException if network connection failed | [
"Runs",
"a",
"worker",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioJobCluster.java#L179-L193 |
18,563 | Alluxio/alluxio | core/base/src/main/java/alluxio/security/authorization/ExtendedACLEntries.java | ExtendedACLEntries.setEntry | public void setEntry(AclEntry entry) {
// TODO(cc): when setting non-mask entries, the mask should be dynamically updated too.
switch (entry.getType()) {
case NAMED_USER:
mNamedUserActions.put(entry.getSubject(), entry.getActions());
return;
case NAMED_GROUP:
mNamedGroupActio... | java | public void setEntry(AclEntry entry) {
// TODO(cc): when setting non-mask entries, the mask should be dynamically updated too.
switch (entry.getType()) {
case NAMED_USER:
mNamedUserActions.put(entry.getSubject(), entry.getActions());
return;
case NAMED_GROUP:
mNamedGroupActio... | [
"public",
"void",
"setEntry",
"(",
"AclEntry",
"entry",
")",
"{",
"// TODO(cc): when setting non-mask entries, the mask should be dynamically updated too.",
"switch",
"(",
"entry",
".",
"getType",
"(",
")",
")",
"{",
"case",
"NAMED_USER",
":",
"mNamedUserActions",
".",
... | Sets an entry into the access control list.
If an entry with the same type and subject already exists, overwrites the existing entry;
Otherwise, adds this new entry.
@param entry the entry to be added or updated | [
"Sets",
"an",
"entry",
"into",
"the",
"access",
"control",
"list",
".",
"If",
"an",
"entry",
"with",
"the",
"same",
"type",
"and",
"subject",
"already",
"exists",
"overwrites",
"the",
"existing",
"entry",
";",
"Otherwise",
"adds",
"this",
"new",
"entry",
"... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/ExtendedACLEntries.java#L143-L163 |
18,564 | Alluxio/alluxio | core/base/src/main/java/alluxio/security/authorization/ExtendedACLEntries.java | ExtendedACLEntries.updateMask | public void updateMask(AclActions groupActions) {
AclActions result = new AclActions(groupActions);
for (Map.Entry<String, AclActions> kv : mNamedUserActions.entrySet()) {
AclActions userAction = kv.getValue();
result.merge(userAction);
for (AclAction action : AclAction.values()) {
i... | java | public void updateMask(AclActions groupActions) {
AclActions result = new AclActions(groupActions);
for (Map.Entry<String, AclActions> kv : mNamedUserActions.entrySet()) {
AclActions userAction = kv.getValue();
result.merge(userAction);
for (AclAction action : AclAction.values()) {
i... | [
"public",
"void",
"updateMask",
"(",
"AclActions",
"groupActions",
")",
"{",
"AclActions",
"result",
"=",
"new",
"AclActions",
"(",
"groupActions",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"AclActions",
">",
"kv",
":",
"mNamedUserAction... | Update the mask to be the union of owning group entry, named user entry and named group entry.
@param groupActions the group entry to be integrated into the mask | [
"Update",
"the",
"mask",
"to",
"be",
"the",
"union",
"of",
"owning",
"group",
"entry",
"named",
"user",
"entry",
"and",
"named",
"group",
"entry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/ExtendedACLEntries.java#L192-L218 |
18,565 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.run | private Status run(JavaSparkContext sc, PrintWriter reportWriter, AlluxioConfiguration conf) {
// Check whether Spark driver can recognize Alluxio classes and filesystem
Status driverStatus = CheckerUtils.performIntegrationChecks();
String driverAddress = sc.getConf().get("spark.driver.host");
switch (d... | java | private Status run(JavaSparkContext sc, PrintWriter reportWriter, AlluxioConfiguration conf) {
// Check whether Spark driver can recognize Alluxio classes and filesystem
Status driverStatus = CheckerUtils.performIntegrationChecks();
String driverAddress = sc.getConf().get("spark.driver.host");
switch (d... | [
"private",
"Status",
"run",
"(",
"JavaSparkContext",
"sc",
",",
"PrintWriter",
"reportWriter",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"// Check whether Spark driver can recognize Alluxio classes and filesystem",
"Status",
"driverStatus",
"=",
"CheckerUtils",
".",
"per... | Implements Spark with Alluxio integration checker.
@param sc current JavaSparkContext
@param reportWriter save user-facing messages to a generated file
@return performIntegrationChecks results | [
"Implements",
"Spark",
"with",
"Alluxio",
"integration",
"checker",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L77-L101 |
18,566 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.runSparkJob | private Status runSparkJob(JavaSparkContext sc, PrintWriter reportWriter) {
// Generate a list of integer for testing
List<Integer> nums = IntStream.rangeClosed(1, mPartitions).boxed().collect(Collectors.toList());
JavaRDD<Integer> dataSet = sc.parallelize(nums, mPartitions);
// Run a Spark job to che... | java | private Status runSparkJob(JavaSparkContext sc, PrintWriter reportWriter) {
// Generate a list of integer for testing
List<Integer> nums = IntStream.rangeClosed(1, mPartitions).boxed().collect(Collectors.toList());
JavaRDD<Integer> dataSet = sc.parallelize(nums, mPartitions);
// Run a Spark job to che... | [
"private",
"Status",
"runSparkJob",
"(",
"JavaSparkContext",
"sc",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"// Generate a list of integer for testing",
"List",
"<",
"Integer",
">",
"nums",
"=",
"IntStream",
".",
"rangeClosed",
"(",
"1",
",",
"mPartitions",
")"... | Spark job to check whether Spark executors can recognize Alluxio filesystem.
@param sc current JavaSparkContext
@param reportWriter save user-facing messages to a generated file
@return Spark job result | [
"Spark",
"job",
"to",
"check",
"whether",
"Spark",
"executors",
"can",
"recognize",
"Alluxio",
"filesystem",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L110-L136 |
18,567 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.printConfigInfo | private void printConfigInfo(SparkConf conf, PrintWriter reportWriter) {
// Get Spark configurations
if (conf.contains("spark.master")) {
reportWriter.printf("Spark master is: %s.%n%n", conf.get("spark.master"));
}
if (conf.contains("spark.submit.deployMode")) {
reportWriter.printf("spark-su... | java | private void printConfigInfo(SparkConf conf, PrintWriter reportWriter) {
// Get Spark configurations
if (conf.contains("spark.master")) {
reportWriter.printf("Spark master is: %s.%n%n", conf.get("spark.master"));
}
if (conf.contains("spark.submit.deployMode")) {
reportWriter.printf("spark-su... | [
"private",
"void",
"printConfigInfo",
"(",
"SparkConf",
"conf",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"// Get Spark configurations",
"if",
"(",
"conf",
".",
"contains",
"(",
"\"spark.master\"",
")",
")",
"{",
"reportWriter",
".",
"printf",
"(",
"\"Spark ma... | Saves related Spark and Alluxio configuration information.
@param conf the current SparkConf
@param reportWriter save user-facing messages to a generated file | [
"Saves",
"related",
"Spark",
"and",
"Alluxio",
"configuration",
"information",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L144-L161 |
18,568 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.printResultInfo | private void printResultInfo(Status resultStatus, PrintWriter reportWriter) {
switch (resultStatus) {
case FAIL_TO_FIND_CLASS:
reportWriter.println(FAIL_TO_FIND_CLASS_MESSAGE);
reportWriter.println(TEST_FAILED_MESSAGE);
break;
case FAIL_TO_FIND_FS:
reportWriter.println(FA... | java | private void printResultInfo(Status resultStatus, PrintWriter reportWriter) {
switch (resultStatus) {
case FAIL_TO_FIND_CLASS:
reportWriter.println(FAIL_TO_FIND_CLASS_MESSAGE);
reportWriter.println(TEST_FAILED_MESSAGE);
break;
case FAIL_TO_FIND_FS:
reportWriter.println(FA... | [
"private",
"void",
"printResultInfo",
"(",
"Status",
"resultStatus",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"switch",
"(",
"resultStatus",
")",
"{",
"case",
"FAIL_TO_FIND_CLASS",
":",
"reportWriter",
".",
"println",
"(",
"FAIL_TO_FIND_CLASS_MESSAGE",
")",
";"... | Saves Spark with Alluixo integration checker results.
@param resultStatus Spark job result status
@param reportWriter save user-facing messages to a generated file | [
"Saves",
"Spark",
"with",
"Alluixo",
"integration",
"checker",
"results",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L169-L187 |
18,569 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.main | public static void main(String[] args) throws Exception {
AlluxioConfiguration alluxioConf = new InstancedConfiguration(ConfigurationUtils.defaults());
SparkIntegrationChecker checker = new SparkIntegrationChecker();
JCommander jCommander = new JCommander(checker, args);
jCommander.setProgramName("Spark... | java | public static void main(String[] args) throws Exception {
AlluxioConfiguration alluxioConf = new InstancedConfiguration(ConfigurationUtils.defaults());
SparkIntegrationChecker checker = new SparkIntegrationChecker();
JCommander jCommander = new JCommander(checker, args);
jCommander.setProgramName("Spark... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"AlluxioConfiguration",
"alluxioConf",
"=",
"new",
"InstancedConfiguration",
"(",
"ConfigurationUtils",
".",
"defaults",
"(",
")",
")",
";",
"SparkIntegrationChec... | Main function will be triggered via spark-submit.
@param args optional argument mPartitions may be passed in | [
"Main",
"function",
"will",
"be",
"triggered",
"via",
"spark",
"-",
"submit",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L194-L212 |
18,570 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java | AlluxioFuse.parseOptions | private static AlluxioFuseOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {
final Options opts = new Options();
final Option mntPoint = Option.builder("m")
.hasArg()
.required(true)
.longOpt("mount-point")
.desc("Desired local mount point for alluxio-fuse.")... | java | private static AlluxioFuseOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {
final Options opts = new Options();
final Option mntPoint = Option.builder("m")
.hasArg()
.required(true)
.longOpt("mount-point")
.desc("Desired local mount point for alluxio-fuse.")... | [
"private",
"static",
"AlluxioFuseOptions",
"parseOptions",
"(",
"String",
"[",
"]",
"args",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"final",
"Options",
"opts",
"=",
"new",
"Options",
"(",
")",
";",
"final",
"Option",
"mntPoint",
"=",
"Option",
".... | Parses CLI options.
@param args CLI args
@return Alluxio-FUSE configuration options | [
"Parses",
"CLI",
"options",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java#L84-L159 |
18,571 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.add | public void add(T payload, List<T> parents) {
// This checks the payload doesn't exist in the graph, and therefore prevents cycles.
Preconditions.checkState(!contains(payload), "the payload already exists in the DAG");
// construct the new node
DirectedAcyclicGraphNode<T> newNode = new DirectedAcyclicG... | java | public void add(T payload, List<T> parents) {
// This checks the payload doesn't exist in the graph, and therefore prevents cycles.
Preconditions.checkState(!contains(payload), "the payload already exists in the DAG");
// construct the new node
DirectedAcyclicGraphNode<T> newNode = new DirectedAcyclicG... | [
"public",
"void",
"add",
"(",
"T",
"payload",
",",
"List",
"<",
"T",
">",
"parents",
")",
"{",
"// This checks the payload doesn't exist in the graph, and therefore prevents cycles.",
"Preconditions",
".",
"checkState",
"(",
"!",
"contains",
"(",
"payload",
")",
",",
... | Adds a node to the DAG, that takes the given payload and depends on the specified parents.
@param payload the payload
@param parents the parents of the created node | [
"Adds",
"a",
"node",
"to",
"the",
"DAG",
"that",
"takes",
"the",
"given",
"payload",
"and",
"depends",
"on",
"the",
"specified",
"parents",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L51-L72 |
18,572 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.deleteLeaf | public void deleteLeaf(T payload) {
Preconditions.checkState(contains(payload), "the node does not exist");
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
Preconditions.checkState(node.getChildren().isEmpty(), "the node is not a leaf");
// delete from parent
for (DirectedAcyclicGraphNode<T... | java | public void deleteLeaf(T payload) {
Preconditions.checkState(contains(payload), "the node does not exist");
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
Preconditions.checkState(node.getChildren().isEmpty(), "the node is not a leaf");
// delete from parent
for (DirectedAcyclicGraphNode<T... | [
"public",
"void",
"deleteLeaf",
"(",
"T",
"payload",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"contains",
"(",
"payload",
")",
",",
"\"the node does not exist\"",
")",
";",
"DirectedAcyclicGraphNode",
"<",
"T",
">",
"node",
"=",
"mIndex",
".",
"get",... | Deletes a leaf DAG node that carries the given payload.
@param payload the payload of the node to delete | [
"Deletes",
"a",
"leaf",
"DAG",
"node",
"that",
"carries",
"the",
"given",
"payload",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L79-L95 |
18,573 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.getChildren | public List<T> getChildren(T payload) {
List<T> children = new ArrayList<>();
if (!mIndex.containsKey(payload)) {
return children;
}
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
for (DirectedAcyclicGraphNode<T> child : node.getChildren()) {
children.add(child.getPayload());
... | java | public List<T> getChildren(T payload) {
List<T> children = new ArrayList<>();
if (!mIndex.containsKey(payload)) {
return children;
}
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
for (DirectedAcyclicGraphNode<T> child : node.getChildren()) {
children.add(child.getPayload());
... | [
"public",
"List",
"<",
"T",
">",
"getChildren",
"(",
"T",
"payload",
")",
"{",
"List",
"<",
"T",
">",
"children",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"mIndex",
".",
"containsKey",
"(",
"payload",
")",
")",
"{",
"return",
... | Gets the payloads for the children of the given node.
@param payload the payload of the parent node
@return the children's payloads, an empty list if the given payload doesn't exist in the DAG | [
"Gets",
"the",
"payloads",
"for",
"the",
"children",
"of",
"the",
"given",
"node",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L113-L123 |
18,574 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.getParents | public List<T> getParents(T payload) {
List<T> parents = new ArrayList<>();
if (!mIndex.containsKey(payload)) {
return parents;
}
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
for (DirectedAcyclicGraphNode<T> parent : node.getParents()) {
parents.add(parent.getPayload());
}... | java | public List<T> getParents(T payload) {
List<T> parents = new ArrayList<>();
if (!mIndex.containsKey(payload)) {
return parents;
}
DirectedAcyclicGraphNode<T> node = mIndex.get(payload);
for (DirectedAcyclicGraphNode<T> parent : node.getParents()) {
parents.add(parent.getPayload());
}... | [
"public",
"List",
"<",
"T",
">",
"getParents",
"(",
"T",
"payload",
")",
"{",
"List",
"<",
"T",
">",
"parents",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"mIndex",
".",
"containsKey",
"(",
"payload",
")",
")",
"{",
"return",
"... | Gets the payloads for the given nodes parents.
@param payload the payload of the children node
@return the parents' payloads, an empty list if the given payload doesn't exist in the DAG | [
"Gets",
"the",
"payloads",
"for",
"the",
"given",
"nodes",
"parents",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L131-L141 |
18,575 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.isRoot | public boolean isRoot(T payload) {
if (!contains(payload)) {
return false;
}
return mRoots.contains(mIndex.get(payload));
} | java | public boolean isRoot(T payload) {
if (!contains(payload)) {
return false;
}
return mRoots.contains(mIndex.get(payload));
} | [
"public",
"boolean",
"isRoot",
"(",
"T",
"payload",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"payload",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"mRoots",
".",
"contains",
"(",
"mIndex",
".",
"get",
"(",
"payload",
")",
")",
";",
"}"... | Checks if a given payload is in a root of the DAG.
@param payload the payload to check for root
@return true if the payload is in the root of the DAG, false otherwise | [
"Checks",
"if",
"a",
"given",
"payload",
"is",
"in",
"a",
"root",
"of",
"the",
"DAG",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L149-L154 |
18,576 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.getRoots | public List<T> getRoots() {
List<T> roots = new ArrayList<>();
for (DirectedAcyclicGraphNode<T> root : mRoots) {
roots.add(root.getPayload());
}
return roots;
} | java | public List<T> getRoots() {
List<T> roots = new ArrayList<>();
for (DirectedAcyclicGraphNode<T> root : mRoots) {
roots.add(root.getPayload());
}
return roots;
} | [
"public",
"List",
"<",
"T",
">",
"getRoots",
"(",
")",
"{",
"List",
"<",
"T",
">",
"roots",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"DirectedAcyclicGraphNode",
"<",
"T",
">",
"root",
":",
"mRoots",
")",
"{",
"roots",
".",
"add",
... | Gets the payloads of all the root nodes of the DAG.
@return all the root payloads | [
"Gets",
"the",
"payloads",
"of",
"all",
"the",
"root",
"nodes",
"of",
"the",
"DAG",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L161-L167 |
18,577 | Alluxio/alluxio | core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java | DirectedAcyclicGraph.sortTopologically | public List<T> sortTopologically(Set<T> payloads) {
List<T> result = new ArrayList<>();
Set<T> input = new HashSet<>(payloads);
Deque<DirectedAcyclicGraphNode<T>> toVisit = new ArrayDeque<>(mRoots);
while (!toVisit.isEmpty()) {
DirectedAcyclicGraphNode<T> visit = toVisit.removeFirst();
T pa... | java | public List<T> sortTopologically(Set<T> payloads) {
List<T> result = new ArrayList<>();
Set<T> input = new HashSet<>(payloads);
Deque<DirectedAcyclicGraphNode<T>> toVisit = new ArrayDeque<>(mRoots);
while (!toVisit.isEmpty()) {
DirectedAcyclicGraphNode<T> visit = toVisit.removeFirst();
T pa... | [
"public",
"List",
"<",
"T",
">",
"sortTopologically",
"(",
"Set",
"<",
"T",
">",
"payloads",
")",
"{",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Set",
"<",
"T",
">",
"input",
"=",
"new",
"HashSet",
"<>",
"(",... | Sorts a given set of payloads topologically based on the DAG. This method requires all the
payloads to be in the DAG.
@param payloads the set of input payloads
@return the payloads after topological sort | [
"Sorts",
"a",
"given",
"set",
"of",
"payloads",
"topologically",
"based",
"on",
"the",
"DAG",
".",
"This",
"method",
"requires",
"all",
"the",
"payloads",
"to",
"be",
"in",
"the",
"DAG",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraph.java#L176-L193 |
18,578 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/authentication/AuthenticatedUserInjector.java | AuthenticatedUserInjector.authenticateCall | private <ReqT, RespT> boolean authenticateCall(ServerCall<ReqT, RespT> call, Metadata headers) {
// Fail validation for cancelled server calls.
if (call.isCancelled()) {
LOG.debug("Server call has been cancelled: %s",
call.getMethodDescriptor().getFullMethodName());
return false;
}
... | java | private <ReqT, RespT> boolean authenticateCall(ServerCall<ReqT, RespT> call, Metadata headers) {
// Fail validation for cancelled server calls.
if (call.isCancelled()) {
LOG.debug("Server call has been cancelled: %s",
call.getMethodDescriptor().getFullMethodName());
return false;
}
... | [
"private",
"<",
"ReqT",
",",
"RespT",
">",
"boolean",
"authenticateCall",
"(",
"ServerCall",
"<",
"ReqT",
",",
"RespT",
">",
"call",
",",
"Metadata",
"headers",
")",
"{",
"// Fail validation for cancelled server calls.",
"if",
"(",
"call",
".",
"isCancelled",
"(... | Authenticates given call against auth-server state.
Fails the call if it's not originating from an authenticated client channel.
It sets thread-local authentication information for the call with the user information
that is kept on auth-server. | [
"Authenticates",
"given",
"call",
"against",
"auth",
"-",
"server",
"state",
".",
"Fails",
"the",
"call",
"if",
"it",
"s",
"not",
"originating",
"from",
"an",
"authenticated",
"client",
"channel",
".",
"It",
"sets",
"thread",
"-",
"local",
"authentication",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/authentication/AuthenticatedUserInjector.java#L79-L113 |
18,579 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/doctor/StorageCommand.java | StorageCommand.run | public int run() throws IOException {
List<WorkerLostStorageInfo> workerLostStorageList = mBlockMasterClient.getWorkerLostStorage();
if (workerLostStorageList.size() == 0) {
mPrintStream.println("All worker storage paths are in working state.");
return 0;
}
for (WorkerLostStorageInfo info : ... | java | public int run() throws IOException {
List<WorkerLostStorageInfo> workerLostStorageList = mBlockMasterClient.getWorkerLostStorage();
if (workerLostStorageList.size() == 0) {
mPrintStream.println("All worker storage paths are in working state.");
return 0;
}
for (WorkerLostStorageInfo info : ... | [
"public",
"int",
"run",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"WorkerLostStorageInfo",
">",
"workerLostStorageList",
"=",
"mBlockMasterClient",
".",
"getWorkerLostStorage",
"(",
")",
";",
"if",
"(",
"workerLostStorageList",
".",
"size",
"(",
")",
... | Runs doctor storage command.
@return 0 on success, 1 otherwise | [
"Runs",
"doctor",
"storage",
"command",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/doctor/StorageCommand.java#L46-L65 |
18,580 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/SetReplicationCommand.java | SetReplicationCommand.setReplication | private void setReplication(AlluxioURI path, Integer replicationMax, Integer replicationMin,
boolean recursive) throws AlluxioException, IOException {
SetAttributePOptions.Builder optionsBuilder =
SetAttributePOptions.newBuilder().setRecursive(recursive);
String message = "Changed the replication ... | java | private void setReplication(AlluxioURI path, Integer replicationMax, Integer replicationMin,
boolean recursive) throws AlluxioException, IOException {
SetAttributePOptions.Builder optionsBuilder =
SetAttributePOptions.newBuilder().setRecursive(recursive);
String message = "Changed the replication ... | [
"private",
"void",
"setReplication",
"(",
"AlluxioURI",
"path",
",",
"Integer",
"replicationMax",
",",
"Integer",
"replicationMin",
",",
"boolean",
"recursive",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"SetAttributePOptions",
".",
"Builder",
"option... | Changes the replication level of directory or file with the path specified in args.
@param path The {@link AlluxioURI} path as the input of the command
@param replicationMax the max replicas, null if not to set
@param replicationMin the min replicas, null if not to set
@param recursive Whether change the permission re... | [
"Changes",
"the",
"replication",
"level",
"of",
"directory",
"or",
"file",
"with",
"the",
"path",
"specified",
"in",
"args",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/SetReplicationCommand.java#L80-L95 |
18,581 | Alluxio/alluxio | minicluster/src/main/java/alluxio/multi/process/Utils.java | Utils.limitLife | public static void limitLife(final long lifetimeMs) {
new Thread(() -> {
CommonUtils.sleepMs(lifetimeMs);
LOG.info("Process has timed out after {}ms, exiting now", lifetimeMs);
System.exit(-1);
}, "life-limiter").start();
} | java | public static void limitLife(final long lifetimeMs) {
new Thread(() -> {
CommonUtils.sleepMs(lifetimeMs);
LOG.info("Process has timed out after {}ms, exiting now", lifetimeMs);
System.exit(-1);
}, "life-limiter").start();
} | [
"public",
"static",
"void",
"limitLife",
"(",
"final",
"long",
"lifetimeMs",
")",
"{",
"new",
"Thread",
"(",
"(",
")",
"->",
"{",
"CommonUtils",
".",
"sleepMs",
"(",
"lifetimeMs",
")",
";",
"LOG",
".",
"info",
"(",
"\"Process has timed out after {}ms, exiting ... | Launches a thread to terminate the current process after the specified period has elapsed.
@param lifetimeMs the time to wait before terminating the current process | [
"Launches",
"a",
"thread",
"to",
"terminate",
"the",
"current",
"process",
"after",
"the",
"specified",
"period",
"has",
"elapsed",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/Utils.java#L33-L39 |
18,582 | Alluxio/alluxio | core/common/src/main/java/alluxio/wire/MasterWebUIMetrics.java | MasterWebUIMetrics.setUfsOps | public MasterWebUIMetrics setUfsOps(Map<String, Map<String, Long>> UfsOps) {
mUfsOps = UfsOps;
return this;
} | java | public MasterWebUIMetrics setUfsOps(Map<String, Map<String, Long>> UfsOps) {
mUfsOps = UfsOps;
return this;
} | [
"public",
"MasterWebUIMetrics",
"setUfsOps",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Long",
">",
">",
"UfsOps",
")",
"{",
"mUfsOps",
"=",
"UfsOps",
";",
"return",
"this",
";",
"}"
] | Sets ufs ops.
@param UfsOps the ufs ops
@return the ufs ops | [
"Sets",
"ufs",
"ops",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/wire/MasterWebUIMetrics.java#L466-L469 |
18,583 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java | RaftJournalSystem.catchUp | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snapshotting to finish", () -> !stateMachine.isSnapshotting()... | java | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snapshotting to finish", () -> !stateMachine.isSnapshotting()... | [
"private",
"void",
"catchUp",
"(",
"JournalStateMachine",
"stateMachine",
",",
"CopycatClient",
"client",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// Wait for any... | Attempts to catch up. If the master loses leadership during this method, it will return early.
The caller is responsible for detecting and responding to leadership changes. | [
"Attempts",
"to",
"catch",
"up",
".",
"If",
"the",
"master",
"loses",
"leadership",
"during",
"this",
"method",
"it",
"will",
"return",
"early",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java#L335-L397 |
18,584 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/job/JobShell.java | JobShell.main | public static void main(String[] argv) throws IOException {
int ret;
InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
if (!ConfigurationUtils.masterHostConfigured(conf) && argv.length > 0) {
System.out.println(ConfigurationUtils
.getMasterHostNotConfi... | java | public static void main(String[] argv) throws IOException {
int ret;
InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
if (!ConfigurationUtils.masterHostConfigured(conf) && argv.length > 0) {
System.out.println(ConfigurationUtils
.getMasterHostNotConfi... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"argv",
")",
"throws",
"IOException",
"{",
"int",
"ret",
";",
"InstancedConfiguration",
"conf",
"=",
"new",
"InstancedConfiguration",
"(",
"ConfigurationUtils",
".",
"defaults",
"(",
")",
")",
";",
... | Main method, starts a new JobShell.
@param argv array of arguments given by the user's input from the terminal | [
"Main",
"method",
"starts",
"a",
"new",
"JobShell",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/job/JobShell.java#L45-L59 |
18,585 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockInodeInternal | private void lockInodeInternal(Inode inode, LockMode mode) {
Preconditions.checkState(!endsInInode());
String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName();
Preconditions.checkState(inode.getName().equals(lastEdgeName),
"Expected to lock inode %s but locked inode %s", lastEdgeName, in... | java | private void lockInodeInternal(Inode inode, LockMode mode) {
Preconditions.checkState(!endsInInode());
String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName();
Preconditions.checkState(inode.getName().equals(lastEdgeName),
"Expected to lock inode %s but locked inode %s", lastEdgeName, in... | [
"private",
"void",
"lockInodeInternal",
"(",
"Inode",
"inode",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"endsInInode",
"(",
")",
")",
";",
"String",
"lastEdgeName",
"=",
"(",
"(",
"EdgeEntry",
")",
"lastEntry",
"(",
... | Locks the next inode without checking or updating the mode.
@param inode the inode to lock
@param mode the mode to lock in | [
"Locks",
"the",
"next",
"inode",
"without",
"checking",
"or",
"updating",
"the",
"mode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L91-L99 |
18,586 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockEdge | public void lockEdge(String childName, LockMode mode) {
Preconditions.checkState(endsInInode());
Preconditions.checkState(mLockMode == LockMode.READ);
lockEdgeInternal(childName, mode);
mLockMode = mode;
} | java | public void lockEdge(String childName, LockMode mode) {
Preconditions.checkState(endsInInode());
Preconditions.checkState(mLockMode == LockMode.READ);
lockEdgeInternal(childName, mode);
mLockMode = mode;
} | [
"public",
"void",
"lockEdge",
"(",
"String",
"childName",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"mLockMode",
"==",
"LockMode",
".",
"READ",
")",... | Locks an edge leading out of the last inode in the list.
For example, if the lock list is [a, a->b, b], lockEdge(c) will add b->c to the list, resulting
in [a, a->b, b, b->c].
@param childName the child to lock
@param mode the mode to lock in | [
"Locks",
"an",
"edge",
"leading",
"out",
"of",
"the",
"last",
"inode",
"in",
"the",
"list",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L110-L116 |
18,587 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockEdgeInternal | public void lockEdgeInternal(String childName, LockMode mode) {
Preconditions.checkState(endsInInode());
Inode lastInode = get(numLockedInodes() - 1);
Edge edge = new Edge(lastInode.getId(), childName);
mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(edge, mode), edge));
} | java | public void lockEdgeInternal(String childName, LockMode mode) {
Preconditions.checkState(endsInInode());
Inode lastInode = get(numLockedInodes() - 1);
Edge edge = new Edge(lastInode.getId(), childName);
mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(edge, mode), edge));
} | [
"public",
"void",
"lockEdgeInternal",
"(",
"String",
"childName",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Inode",
"lastInode",
"=",
"get",
"(",
"numLockedInodes",
"(",
")",
"-",
"1",
"... | Locks the next edge without checking or updating the mode.
@param childName the child to lock
@param mode the mode to lock in | [
"Locks",
"the",
"next",
"edge",
"without",
"checking",
"or",
"updating",
"the",
"mode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L124-L130 |
18,588 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.lockRootEdge | public void lockRootEdge(LockMode mode) {
Preconditions.checkState(mEntries.isEmpty());
mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(ROOT_EDGE, mode), ROOT_EDGE));
mLockMode = mode;
} | java | public void lockRootEdge(LockMode mode) {
Preconditions.checkState(mEntries.isEmpty());
mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(ROOT_EDGE, mode), ROOT_EDGE));
mLockMode = mode;
} | [
"public",
"void",
"lockRootEdge",
"(",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"mEntries",
".",
"isEmpty",
"(",
")",
")",
";",
"mEntries",
".",
"add",
"(",
"new",
"EdgeEntry",
"(",
"mInodeLockManager",
".",
"lockEdge",
"(",
"... | Locks the root edge in the specified mode.
@param mode the mode to lock in | [
"Locks",
"the",
"root",
"edge",
"in",
"the",
"specified",
"mode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L137-L142 |
18,589 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.pushWriteLockedEdge | public void pushWriteLockedEdge(Inode inode, String childName) {
Preconditions.checkState(!endsInInode());
Preconditions.checkState(mLockMode == LockMode.WRITE);
if (mEntries.isEmpty()) {
// Cannot modify the base lock list, and the new inode is already implicitly locked.
return;
}
int... | java | public void pushWriteLockedEdge(Inode inode, String childName) {
Preconditions.checkState(!endsInInode());
Preconditions.checkState(mLockMode == LockMode.WRITE);
if (mEntries.isEmpty()) {
// Cannot modify the base lock list, and the new inode is already implicitly locked.
return;
}
int... | [
"public",
"void",
"pushWriteLockedEdge",
"(",
"Inode",
"inode",
",",
"String",
"childName",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"mLockMode",
"==",
"LockMode",
".",
... | Leapfrogs the edge write lock forward, reducing the lock list's write-locked scope.
For example, if the lock list is in write mode with entries [a, a->b, b, b->c],
pushWriteLockedEdge(c, d) will change the list to [a, a->b, b, b->c, c, c->d]. The c->d edge
will be write locked instead of the b->c edge. At least a read... | [
"Leapfrogs",
"the",
"edge",
"write",
"lock",
"forward",
"reducing",
"the",
"lock",
"list",
"s",
"write",
"-",
"locked",
"scope",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L158-L171 |
18,590 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.unlockLastInode | public void unlockLastInode() {
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
mLockedInodes.remove(mLockedInodes.size() - 1);
mEntries.remove(mEntries.size() - 1).mLock.close();
mLockMode = LockMode.READ;
} | java | public void unlockLastInode() {
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
mLockedInodes.remove(mLockedInodes.size() - 1);
mEntries.remove(mEntries.size() - 1).mLock.close();
mLockMode = LockMode.READ;
} | [
"public",
"void",
"unlockLastInode",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"mEntries",
".",
"isEmpty",
"(",
")",
")",
";",
"mLockedInodes",
".",
"remove",
"(... | Unlocks the last locked inode. | [
"Unlocks",
"the",
"last",
"locked",
"inode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L183-L190 |
18,591 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.downgradeLastInode | public void downgradeLastInode() {
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
InodeEntry last = (InodeEntry) mEntries.get(mEntries.size() - 1);
LockResource lock = mInodeLockManager.lockInode(last.ge... | java | public void downgradeLastInode() {
Preconditions.checkState(endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
InodeEntry last = (InodeEntry) mEntries.get(mEntries.size() - 1);
LockResource lock = mInodeLockManager.lockInode(last.ge... | [
"public",
"void",
"downgradeLastInode",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"mEntries",
".",
"isEmpty",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState... | Downgrades the last inode from a write lock to a read lock. The read lock is acquired before
releasing the write lock. | [
"Downgrades",
"the",
"last",
"inode",
"from",
"a",
"write",
"lock",
"to",
"a",
"read",
"lock",
".",
"The",
"read",
"lock",
"is",
"acquired",
"before",
"releasing",
"the",
"write",
"lock",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L207-L217 |
18,592 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.downgradeLastEdge | public void downgradeLastEdge() {
Preconditions.checkNotNull(!endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
downgradeEdge(mEntries.size() - 1);
mLockMode = LockMode.READ;
} | java | public void downgradeLastEdge() {
Preconditions.checkNotNull(!endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
downgradeEdge(mEntries.size() - 1);
mLockMode = LockMode.READ;
} | [
"public",
"void",
"downgradeLastEdge",
"(",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"!",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"mEntries",
".",
"isEmpty",
"(",
")",
")",
";",
"Preconditions",
".",
"ch... | Downgrades the last edge lock in the lock list from WRITE lock to READ lock. | [
"Downgrades",
"the",
"last",
"edge",
"lock",
"in",
"the",
"lock",
"list",
"from",
"WRITE",
"lock",
"to",
"READ",
"lock",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L222-L229 |
18,593 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.downgradeEdgeToInode | public void downgradeEdgeToInode(Inode inode, LockMode mode) {
Preconditions.checkState(!endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
EdgeEntry last = (EdgeEntry) mEntries.get(mEntries.size() - 1);
LockResource inodeLock = mIn... | java | public void downgradeEdgeToInode(Inode inode, LockMode mode) {
Preconditions.checkState(!endsInInode());
Preconditions.checkState(!mEntries.isEmpty());
Preconditions.checkState(mLockMode == LockMode.WRITE);
EdgeEntry last = (EdgeEntry) mEntries.get(mEntries.size() - 1);
LockResource inodeLock = mIn... | [
"public",
"void",
"downgradeEdgeToInode",
"(",
"Inode",
"inode",
",",
"LockMode",
"mode",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"endsInInode",
"(",
")",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"mEntries",
".",
"isEmpty",
"("... | Downgrades from edge write-locking to inode write-locking. This reduces the scope of the write
lock by pushing it forward one entry.
For example, if the lock list is in write mode with entries [a, a->b, b, b->c],
downgradeEdgeToInode(c, mode) will change the list to [a, a->b, b, b->c, c], with b->c
downgraded to a rea... | [
"Downgrades",
"from",
"edge",
"write",
"-",
"locking",
"to",
"inode",
"write",
"-",
"locking",
".",
"This",
"reduces",
"the",
"scope",
"of",
"the",
"write",
"lock",
"by",
"pushing",
"it",
"forward",
"one",
"entry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L244-L257 |
18,594 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java | InodeLockList.downgradeEdge | private void downgradeEdge(int edgeEntryIndex) {
EdgeEntry entry = (EdgeEntry) mEntries.get(edgeEntryIndex);
LockResource lock = mInodeLockManager.lockEdge(entry.mEdge, LockMode.READ);
entry.getLock().close();
mEntries.set(edgeEntryIndex, new EdgeEntry(lock, entry.getEdge()));
} | java | private void downgradeEdge(int edgeEntryIndex) {
EdgeEntry entry = (EdgeEntry) mEntries.get(edgeEntryIndex);
LockResource lock = mInodeLockManager.lockEdge(entry.mEdge, LockMode.READ);
entry.getLock().close();
mEntries.set(edgeEntryIndex, new EdgeEntry(lock, entry.getEdge()));
} | [
"private",
"void",
"downgradeEdge",
"(",
"int",
"edgeEntryIndex",
")",
"{",
"EdgeEntry",
"entry",
"=",
"(",
"EdgeEntry",
")",
"mEntries",
".",
"get",
"(",
"edgeEntryIndex",
")",
";",
"LockResource",
"lock",
"=",
"mInodeLockManager",
".",
"lockEdge",
"(",
"entr... | Downgrades the edge at the specified entry index. | [
"Downgrades",
"the",
"edge",
"at",
"the",
"specified",
"entry",
"index",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockList.java#L262-L267 |
18,595 | Alluxio/alluxio | core/base/src/main/java/alluxio/AlluxioURI.java | AlluxioURI.hasWindowsDrive | public static boolean hasWindowsDrive(String path, boolean slashed) {
int start = slashed ? 1 : 0;
return path.length() >= start + 2
&& (!slashed || path.charAt(0) == '/')
&& path.charAt(start + 1) == ':'
&& ((path.charAt(start) >= 'A' && path.charAt(start) <= 'Z') || (path.charAt(start)... | java | public static boolean hasWindowsDrive(String path, boolean slashed) {
int start = slashed ? 1 : 0;
return path.length() >= start + 2
&& (!slashed || path.charAt(0) == '/')
&& path.charAt(start + 1) == ':'
&& ((path.charAt(start) >= 'A' && path.charAt(start) <= 'Z') || (path.charAt(start)... | [
"public",
"static",
"boolean",
"hasWindowsDrive",
"(",
"String",
"path",
",",
"boolean",
"slashed",
")",
"{",
"int",
"start",
"=",
"slashed",
"?",
"1",
":",
"0",
";",
"return",
"path",
".",
"length",
"(",
")",
">=",
"start",
"+",
"2",
"&&",
"(",
"!",... | Checks if the path is a windows path. This should be platform independent.
@param path the path to check
@param slashed if the path starts with a slash
@return true if it is a windows path, false otherwise | [
"Checks",
"if",
"the",
"path",
"is",
"a",
"windows",
"path",
".",
"This",
"should",
"be",
"platform",
"independent",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/AlluxioURI.java#L335-L342 |
18,596 | Alluxio/alluxio | core/base/src/main/java/alluxio/AlluxioURI.java | AlluxioURI.isAncestorOf | public boolean isAncestorOf(AlluxioURI alluxioURI) throws InvalidPathException {
// To be an ancestor of another URI, authority and scheme must match
if (!Objects.equals(getAuthority(), alluxioURI.getAuthority())) {
return false;
}
if (!Objects.equals(getScheme(), alluxioURI.getScheme())) {
... | java | public boolean isAncestorOf(AlluxioURI alluxioURI) throws InvalidPathException {
// To be an ancestor of another URI, authority and scheme must match
if (!Objects.equals(getAuthority(), alluxioURI.getAuthority())) {
return false;
}
if (!Objects.equals(getScheme(), alluxioURI.getScheme())) {
... | [
"public",
"boolean",
"isAncestorOf",
"(",
"AlluxioURI",
"alluxioURI",
")",
"throws",
"InvalidPathException",
"{",
"// To be an ancestor of another URI, authority and scheme must match",
"if",
"(",
"!",
"Objects",
".",
"equals",
"(",
"getAuthority",
"(",
")",
",",
"alluxio... | Returns true if the current AlluxioURI is an ancestor of another AlluxioURI.
otherwise, return false.
@param alluxioURI potential children to check
@return true the current alluxioURI is an ancestor of the AlluxioURI | [
"Returns",
"true",
"if",
"the",
"current",
"AlluxioURI",
"is",
"an",
"ancestor",
"of",
"another",
"AlluxioURI",
".",
"otherwise",
"return",
"false",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/AlluxioURI.java#L454-L465 |
18,597 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/stream/LocalFileDataWriter.java | LocalFileDataWriter.ensureReserved | private void ensureReserved(long pos) throws IOException {
if (pos <= mPosReserved) {
return;
}
long toReserve = Math.max(pos - mPosReserved, mFileBufferBytes);
CreateLocalBlockRequest request = mCreateRequest.toBuilder().setSpaceToReserve(toReserve)
.setOnlyReserveSpace(true).build();
... | java | private void ensureReserved(long pos) throws IOException {
if (pos <= mPosReserved) {
return;
}
long toReserve = Math.max(pos - mPosReserved, mFileBufferBytes);
CreateLocalBlockRequest request = mCreateRequest.toBuilder().setSpaceToReserve(toReserve)
.setOnlyReserveSpace(true).build();
... | [
"private",
"void",
"ensureReserved",
"(",
"long",
"pos",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pos",
"<=",
"mPosReserved",
")",
"{",
"return",
";",
"}",
"long",
"toReserve",
"=",
"Math",
".",
"max",
"(",
"pos",
"-",
"mPosReserved",
",",
"mFileBu... | Reserves enough space in the block worker.
@param pos the pos of the file/block to reserve to | [
"Reserves",
"enough",
"space",
"in",
"the",
"block",
"worker",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/LocalFileDataWriter.java#L198-L212 |
18,598 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/LogLevel.java | LogLevel.logLevel | public static void logLevel(String[] args, AlluxioConfiguration alluxioConf)
throws ParseException, IOException {
CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(OPTIONS, args, true /* stopAtNonOption */);
List<TargetInfo> targets = parseOptTarget(cmd, alluxioConf);
... | java | public static void logLevel(String[] args, AlluxioConfiguration alluxioConf)
throws ParseException, IOException {
CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(OPTIONS, args, true /* stopAtNonOption */);
List<TargetInfo> targets = parseOptTarget(cmd, alluxioConf);
... | [
"public",
"static",
"void",
"logLevel",
"(",
"String",
"[",
"]",
"args",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"CommandLineParser",
"parser",
"=",
"new",
"DefaultParser",
"(",
")",
";",
"CommandLine",... | Implements log level setting and getting.
@param args list of arguments contains target, logName and level
@param alluxioConf Alluxio configuration
@exception ParseException if there is an error in parsing | [
"Implements",
"log",
"level",
"setting",
"and",
"getting",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/LogLevel.java#L106-L118 |
18,599 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/LogLevel.java | LogLevel.main | public static void main(String[] args) {
int exitCode = 1;
try {
logLevel(args, new InstancedConfiguration(ConfigurationUtils.defaults()));
exitCode = 0;
} catch (ParseException e) {
printHelp("Unable to parse input args: " + e.getMessage());
} catch (IOException e) {
e.printStac... | java | public static void main(String[] args) {
int exitCode = 1;
try {
logLevel(args, new InstancedConfiguration(ConfigurationUtils.defaults()));
exitCode = 0;
} catch (ParseException e) {
printHelp("Unable to parse input args: " + e.getMessage());
} catch (IOException e) {
e.printStac... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"int",
"exitCode",
"=",
"1",
";",
"try",
"{",
"logLevel",
"(",
"args",
",",
"new",
"InstancedConfiguration",
"(",
"ConfigurationUtils",
".",
"defaults",
"(",
")",
")",
")",
... | Sets or gets log level of master and worker through their REST API.
@param args same arguments as {@link LogLevel} | [
"Sets",
"or",
"gets",
"log",
"level",
"of",
"master",
"and",
"worker",
"through",
"their",
"REST",
"API",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/LogLevel.java#L210-L222 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.