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,300 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.initMultiPartUpload | private void initMultiPartUpload() throws IOException {
// Generate the object metadata by setting server side encryption, md5 checksum,
// and encoding as octet stream since no assumptions are made about the file type
ObjectMetadata meta = new ObjectMetadata();
if (mSseEnabled) {
meta.setSSEAlgor... | java | private void initMultiPartUpload() throws IOException {
// Generate the object metadata by setting server side encryption, md5 checksum,
// and encoding as octet stream since no assumptions are made about the file type
ObjectMetadata meta = new ObjectMetadata();
if (mSseEnabled) {
meta.setSSEAlgor... | [
"private",
"void",
"initMultiPartUpload",
"(",
")",
"throws",
"IOException",
"{",
"// Generate the object metadata by setting server side encryption, md5 checksum,",
"// and encoding as octet stream since no assumptions are made about the file type",
"ObjectMetadata",
"meta",
"=",
"new",
... | Initializes multipart upload. | [
"Initializes",
"multipart",
"upload",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L278-L304 |
18,301 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.initNewFile | private void initNewFile() throws IOException {
mFile = new File(PathUtils.concatPath(CommonUtils.getTmpDir(mTmpDirs), UUID.randomUUID()));
if (mHash != null) {
mLocalOutputStream =
new BufferedOutputStream(new DigestOutputStream(new FileOutputStream(mFile), mHash));
} else {
mLocalOut... | java | private void initNewFile() throws IOException {
mFile = new File(PathUtils.concatPath(CommonUtils.getTmpDir(mTmpDirs), UUID.randomUUID()));
if (mHash != null) {
mLocalOutputStream =
new BufferedOutputStream(new DigestOutputStream(new FileOutputStream(mFile), mHash));
} else {
mLocalOut... | [
"private",
"void",
"initNewFile",
"(",
")",
"throws",
"IOException",
"{",
"mFile",
"=",
"new",
"File",
"(",
"PathUtils",
".",
"concatPath",
"(",
"CommonUtils",
".",
"getTmpDir",
"(",
"mTmpDirs",
")",
",",
"UUID",
".",
"randomUUID",
"(",
")",
")",
")",
";... | Creates a new temp file to write to. | [
"Creates",
"a",
"new",
"temp",
"file",
"to",
"write",
"to",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L309-L319 |
18,302 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.uploadPart | private void uploadPart() throws IOException {
if (mFile == null) {
return;
}
mLocalOutputStream.close();
int partNumber = mPartNumber.getAndIncrement();
File newFileToUpload = new File(mFile.getPath());
mFile = null;
mLocalOutputStream = null;
UploadPartRequest uploadRequest = new... | java | private void uploadPart() throws IOException {
if (mFile == null) {
return;
}
mLocalOutputStream.close();
int partNumber = mPartNumber.getAndIncrement();
File newFileToUpload = new File(mFile.getPath());
mFile = null;
mLocalOutputStream = null;
UploadPartRequest uploadRequest = new... | [
"private",
"void",
"uploadPart",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mFile",
"==",
"null",
")",
"{",
"return",
";",
"}",
"mLocalOutputStream",
".",
"close",
"(",
")",
";",
"int",
"partNumber",
"=",
"mPartNumber",
".",
"getAndIncrement",
"("... | Uploads part async. | [
"Uploads",
"part",
"async",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L324-L341 |
18,303 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.execUpload | private void execUpload(UploadPartRequest request) {
File file = request.getFile();
ListenableFuture<PartETag> futureTag =
mExecutor.submit((Callable) () -> {
PartETag partETag;
AmazonClientException lastException;
try {
do {
try {
... | java | private void execUpload(UploadPartRequest request) {
File file = request.getFile();
ListenableFuture<PartETag> futureTag =
mExecutor.submit((Callable) () -> {
PartETag partETag;
AmazonClientException lastException;
try {
do {
try {
... | [
"private",
"void",
"execUpload",
"(",
"UploadPartRequest",
"request",
")",
"{",
"File",
"file",
"=",
"request",
".",
"getFile",
"(",
")",
";",
"ListenableFuture",
"<",
"PartETag",
">",
"futureTag",
"=",
"mExecutor",
".",
"submit",
"(",
"(",
"Callable",
")",
... | Executes the upload part request.
@param request the upload part request | [
"Executes",
"the",
"upload",
"part",
"request",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L348-L375 |
18,304 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.waitForAllPartsUpload | private void waitForAllPartsUpload() throws IOException {
int beforeSize = mTags.size();
try {
for (ListenableFuture<PartETag> future : mTagFutures) {
mTags.add(future.get());
}
} catch (ExecutionException e) {
// No recover ways so that we need to cancel all the upload tasks
... | java | private void waitForAllPartsUpload() throws IOException {
int beforeSize = mTags.size();
try {
for (ListenableFuture<PartETag> future : mTagFutures) {
mTags.add(future.get());
}
} catch (ExecutionException e) {
// No recover ways so that we need to cancel all the upload tasks
... | [
"private",
"void",
"waitForAllPartsUpload",
"(",
")",
"throws",
"IOException",
"{",
"int",
"beforeSize",
"=",
"mTags",
".",
"size",
"(",
")",
";",
"try",
"{",
"for",
"(",
"ListenableFuture",
"<",
"PartETag",
">",
"future",
":",
"mTagFutures",
")",
"{",
"mT... | Waits for the submitted upload tasks to finish. | [
"Waits",
"for",
"the",
"submitted",
"upload",
"tasks",
"to",
"finish",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L380-L403 |
18,305 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.completeMultiPartUpload | private void completeMultiPartUpload() throws IOException {
AmazonClientException lastException;
CompleteMultipartUploadRequest completeRequest = new CompleteMultipartUploadRequest(mBucketName,
mKey, mUploadId, mTags);
do {
try {
mClient.completeMultipartUpload(completeRequest);
... | java | private void completeMultiPartUpload() throws IOException {
AmazonClientException lastException;
CompleteMultipartUploadRequest completeRequest = new CompleteMultipartUploadRequest(mBucketName,
mKey, mUploadId, mTags);
do {
try {
mClient.completeMultipartUpload(completeRequest);
... | [
"private",
"void",
"completeMultiPartUpload",
"(",
")",
"throws",
"IOException",
"{",
"AmazonClientException",
"lastException",
";",
"CompleteMultipartUploadRequest",
"completeRequest",
"=",
"new",
"CompleteMultipartUploadRequest",
"(",
"mBucketName",
",",
"mKey",
",",
"mUp... | Completes multipart upload. | [
"Completes",
"multipart",
"upload",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L408-L426 |
18,306 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java | S3ALowLevelOutputStream.abortMultiPartUpload | private void abortMultiPartUpload() {
AmazonClientException lastException;
do {
try {
mClient.abortMultipartUpload(new AbortMultipartUploadRequest(mBucketName,
mKey, mUploadId));
LOG.warn("Aborted multipart upload for key {} and id '{}' to bucket {}",
mKey, mUploadI... | java | private void abortMultiPartUpload() {
AmazonClientException lastException;
do {
try {
mClient.abortMultipartUpload(new AbortMultipartUploadRequest(mBucketName,
mKey, mUploadId));
LOG.warn("Aborted multipart upload for key {} and id '{}' to bucket {}",
mKey, mUploadI... | [
"private",
"void",
"abortMultiPartUpload",
"(",
")",
"{",
"AmazonClientException",
"lastException",
";",
"do",
"{",
"try",
"{",
"mClient",
".",
"abortMultipartUpload",
"(",
"new",
"AbortMultipartUploadRequest",
"(",
"mBucketName",
",",
"mKey",
",",
"mUploadId",
")",... | Aborts multipart upload. | [
"Aborts",
"multipart",
"upload",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3ALowLevelOutputStream.java#L431-L451 |
18,307 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getGidFromGroupName | public static long getGidFromGroupName(String groupName) throws IOException {
String result = "";
if (OSUtils.isLinux()) {
String script = "getent group " + groupName + " | cut -d: -f3";
result = ShellUtils.execCommand("bash", "-c", script).trim();
} else if (OSUtils.isMacOS()) {
String sc... | java | public static long getGidFromGroupName(String groupName) throws IOException {
String result = "";
if (OSUtils.isLinux()) {
String script = "getent group " + groupName + " | cut -d: -f3";
result = ShellUtils.execCommand("bash", "-c", script).trim();
} else if (OSUtils.isMacOS()) {
String sc... | [
"public",
"static",
"long",
"getGidFromGroupName",
"(",
"String",
"groupName",
")",
"throws",
"IOException",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"OSUtils",
".",
"isLinux",
"(",
")",
")",
"{",
"String",
"script",
"=",
"\"getent group \"",
"+... | Retrieves the gid of the given group.
@param groupName the group name
@return gid | [
"Retrieves",
"the",
"gid",
"of",
"the",
"given",
"group",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L69-L85 |
18,308 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getUserName | public static String getUserName(long uid) throws IOException {
return ShellUtils.execCommand("id", "-nu", Long.toString(uid)).trim();
} | java | public static String getUserName(long uid) throws IOException {
return ShellUtils.execCommand("id", "-nu", Long.toString(uid)).trim();
} | [
"public",
"static",
"String",
"getUserName",
"(",
"long",
"uid",
")",
"throws",
"IOException",
"{",
"return",
"ShellUtils",
".",
"execCommand",
"(",
"\"id\"",
",",
"\"-nu\"",
",",
"Long",
".",
"toString",
"(",
"uid",
")",
")",
".",
"trim",
"(",
")",
";",... | Gets the user name from the user id.
@param uid user id
@return user name | [
"Gets",
"the",
"user",
"name",
"from",
"the",
"user",
"id",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L93-L95 |
18,309 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getGroupName | public static String getGroupName(long gid) throws IOException {
if (OSUtils.isLinux()) {
String script = "getent group " + gid + " | cut -d: -f1";
return ShellUtils.execCommand("bash", "-c", script).trim();
} else if (OSUtils.isMacOS()) {
String script = "dscl . list /Groups PrimaryGroupID | ... | java | public static String getGroupName(long gid) throws IOException {
if (OSUtils.isLinux()) {
String script = "getent group " + gid + " | cut -d: -f1";
return ShellUtils.execCommand("bash", "-c", script).trim();
} else if (OSUtils.isMacOS()) {
String script = "dscl . list /Groups PrimaryGroupID | ... | [
"public",
"static",
"String",
"getGroupName",
"(",
"long",
"gid",
")",
"throws",
"IOException",
"{",
"if",
"(",
"OSUtils",
".",
"isLinux",
"(",
")",
")",
"{",
"String",
"script",
"=",
"\"getent group \"",
"+",
"gid",
"+",
"\" | cut -d: -f1\"",
";",
"return",... | Gets the group name from the group id.
@param gid the group id
@return group name | [
"Gets",
"the",
"group",
"name",
"from",
"the",
"group",
"id",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L113-L123 |
18,310 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.isFuseInstalled | public static boolean isFuseInstalled() {
try {
if (OSUtils.isLinux()) {
String result = ShellUtils.execCommand("fusermount", "-V");
return !result.isEmpty();
} else if (OSUtils.isMacOS()) {
String result = ShellUtils.execCommand("bash", "-c", "mount | grep FUSE");
return... | java | public static boolean isFuseInstalled() {
try {
if (OSUtils.isLinux()) {
String result = ShellUtils.execCommand("fusermount", "-V");
return !result.isEmpty();
} else if (OSUtils.isMacOS()) {
String result = ShellUtils.execCommand("bash", "-c", "mount | grep FUSE");
return... | [
"public",
"static",
"boolean",
"isFuseInstalled",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"OSUtils",
".",
"isLinux",
"(",
")",
")",
"{",
"String",
"result",
"=",
"ShellUtils",
".",
"execCommand",
"(",
"\"fusermount\"",
",",
"\"-V\"",
")",
";",
"return",
"!... | Checks whether fuse is installed in local file system.
Alluxio-Fuse only support mac and linux.
@return true if fuse is installed, false otherwise | [
"Checks",
"whether",
"fuse",
"is",
"installed",
"in",
"local",
"file",
"system",
".",
"Alluxio",
"-",
"Fuse",
"only",
"support",
"mac",
"and",
"linux",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L131-L144 |
18,311 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getIdInfo | private static long getIdInfo(String option, String username) {
String output;
try {
output = ShellUtils.execCommand("id", option, username).trim();
} catch (IOException e) {
LOG.error("Failed to get id from {} with option {}", username, option);
return -1;
}
return Long.parseLong(... | java | private static long getIdInfo(String option, String username) {
String output;
try {
output = ShellUtils.execCommand("id", option, username).trim();
} catch (IOException e) {
LOG.error("Failed to get id from {} with option {}", username, option);
return -1;
}
return Long.parseLong(... | [
"private",
"static",
"long",
"getIdInfo",
"(",
"String",
"option",
",",
"String",
"username",
")",
"{",
"String",
"output",
";",
"try",
"{",
"output",
"=",
"ShellUtils",
".",
"execCommand",
"(",
"\"id\"",
",",
"option",
",",
"username",
")",
".",
"trim",
... | Runs the "id" command with the given options on the passed username.
@param option option to pass to id (either -u or -g)
@param username the username on which to run the command
@return the uid (-u) or gid (-g) of username | [
"Runs",
"the",
"id",
"command",
"with",
"the",
"given",
"options",
"on",
"the",
"passed",
"username",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L153-L162 |
18,312 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getErrorCode | public static int getErrorCode(Throwable t) {
// Error codes and their explanations are described in
// the Errno.java in jnr-constants
if (t instanceof AlluxioException) {
return getAlluxioErrorCode((AlluxioException) t);
} else if (t instanceof IOException) {
return -ErrorCodes.EIO();
... | java | public static int getErrorCode(Throwable t) {
// Error codes and their explanations are described in
// the Errno.java in jnr-constants
if (t instanceof AlluxioException) {
return getAlluxioErrorCode((AlluxioException) t);
} else if (t instanceof IOException) {
return -ErrorCodes.EIO();
... | [
"public",
"static",
"int",
"getErrorCode",
"(",
"Throwable",
"t",
")",
"{",
"// Error codes and their explanations are described in",
"// the Errno.java in jnr-constants",
"if",
"(",
"t",
"instanceof",
"AlluxioException",
")",
"{",
"return",
"getAlluxioErrorCode",
"(",
"(",... | Gets the corresponding error code of a throwable.
@param t throwable
@return the corresponding error code | [
"Gets",
"the",
"corresponding",
"error",
"code",
"of",
"a",
"throwable",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L170-L180 |
18,313 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java | AlluxioFuseUtils.getAlluxioErrorCode | private static int getAlluxioErrorCode(AlluxioException e) {
try {
throw e;
} catch (FileDoesNotExistException ex) {
return -ErrorCodes.ENOENT();
} catch (FileAlreadyExistsException ex) {
return -ErrorCodes.EEXIST();
} catch (InvalidPathException ex) {
return -ErrorCodes.EFAULT()... | java | private static int getAlluxioErrorCode(AlluxioException e) {
try {
throw e;
} catch (FileDoesNotExistException ex) {
return -ErrorCodes.ENOENT();
} catch (FileAlreadyExistsException ex) {
return -ErrorCodes.EEXIST();
} catch (InvalidPathException ex) {
return -ErrorCodes.EFAULT()... | [
"private",
"static",
"int",
"getAlluxioErrorCode",
"(",
"AlluxioException",
"e",
")",
"{",
"try",
"{",
"throw",
"e",
";",
"}",
"catch",
"(",
"FileDoesNotExistException",
"ex",
")",
"{",
"return",
"-",
"ErrorCodes",
".",
"ENOENT",
"(",
")",
";",
"}",
"catch... | Gets the corresponding error code of an Alluxio exception.
@param e an Alluxio exception
@return the corresponding error code | [
"Gets",
"the",
"corresponding",
"error",
"code",
"of",
"an",
"Alluxio",
"exception",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuseUtils.java#L188-L210 |
18,314 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/TimeSeries.java | TimeSeries.record | public void record(long timeNano, int numEvents) {
long leftEndPoint = bucket(timeNano);
mSeries.put(leftEndPoint, mSeries.getOrDefault(leftEndPoint, 0) + numEvents);
} | java | public void record(long timeNano, int numEvents) {
long leftEndPoint = bucket(timeNano);
mSeries.put(leftEndPoint, mSeries.getOrDefault(leftEndPoint, 0) + numEvents);
} | [
"public",
"void",
"record",
"(",
"long",
"timeNano",
",",
"int",
"numEvents",
")",
"{",
"long",
"leftEndPoint",
"=",
"bucket",
"(",
"timeNano",
")",
";",
"mSeries",
".",
"put",
"(",
"leftEndPoint",
",",
"mSeries",
".",
"getOrDefault",
"(",
"leftEndPoint",
... | Record events at a timestamp into the time series.
@param timeNano the time in nano seconds
@param numEvents the number of events happened at timeNano | [
"Record",
"events",
"at",
"a",
"timestamp",
"into",
"the",
"time",
"series",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/TimeSeries.java#L81-L84 |
18,315 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/TimeSeries.java | TimeSeries.add | public void add(TimeSeries other) {
TreeMap<Long, Integer> otherSeries = other.getSeries();
for (Map.Entry<Long, Integer> event : otherSeries.entrySet()) {
record(event.getKey() + other.getWidthNano() / 2, event.getValue());
}
} | java | public void add(TimeSeries other) {
TreeMap<Long, Integer> otherSeries = other.getSeries();
for (Map.Entry<Long, Integer> event : otherSeries.entrySet()) {
record(event.getKey() + other.getWidthNano() / 2, event.getValue());
}
} | [
"public",
"void",
"add",
"(",
"TimeSeries",
"other",
")",
"{",
"TreeMap",
"<",
"Long",
",",
"Integer",
">",
"otherSeries",
"=",
"other",
".",
"getSeries",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Long",
",",
"Integer",
">",
"event",
":",... | Add one histogram to the current one. We preserve the width in the current TimeSeries.
@param other the TimeSeries instance to add | [
"Add",
"one",
"histogram",
"to",
"the",
"current",
"one",
".",
"We",
"preserve",
"the",
"width",
"in",
"the",
"current",
"TimeSeries",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/TimeSeries.java#L114-L119 |
18,316 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/TimeSeries.java | TimeSeries.sparsePrint | public void sparsePrint(PrintStream stream) {
if (mSeries.isEmpty()) {
return;
}
long start = mSeries.firstKey();
stream.printf("Time series starts at %d with width %d.%n", start, mWidthNano);
for (Map.Entry<Long, Integer> entry : mSeries.entrySet()) {
stream.printf("%d %d%n", (entry.ge... | java | public void sparsePrint(PrintStream stream) {
if (mSeries.isEmpty()) {
return;
}
long start = mSeries.firstKey();
stream.printf("Time series starts at %d with width %d.%n", start, mWidthNano);
for (Map.Entry<Long, Integer> entry : mSeries.entrySet()) {
stream.printf("%d %d%n", (entry.ge... | [
"public",
"void",
"sparsePrint",
"(",
"PrintStream",
"stream",
")",
"{",
"if",
"(",
"mSeries",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"long",
"start",
"=",
"mSeries",
".",
"firstKey",
"(",
")",
";",
"stream",
".",
"printf",
"(",
"\"T... | Print the time series sparsely, i.e. it ignores buckets with 0 events.
@param stream the print stream | [
"Print",
"the",
"time",
"series",
"sparsely",
"i",
".",
"e",
".",
"it",
"ignores",
"buckets",
"with",
"0",
"events",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/TimeSeries.java#L171-L181 |
18,317 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/TimeSeries.java | TimeSeries.print | public void print(PrintStream stream) {
if (mSeries.isEmpty()) {
return;
}
long start = mSeries.firstKey();
stream.printf("Time series starts at %d with width %d.%n", start, mWidthNano);
int bucketIndex = 0;
Iterator<Map.Entry<Long, Integer>> it = mSeries.entrySet().iterator();
Map.En... | java | public void print(PrintStream stream) {
if (mSeries.isEmpty()) {
return;
}
long start = mSeries.firstKey();
stream.printf("Time series starts at %d with width %d.%n", start, mWidthNano);
int bucketIndex = 0;
Iterator<Map.Entry<Long, Integer>> it = mSeries.entrySet().iterator();
Map.En... | [
"public",
"void",
"print",
"(",
"PrintStream",
"stream",
")",
"{",
"if",
"(",
"mSeries",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"long",
"start",
"=",
"mSeries",
".",
"firstKey",
"(",
")",
";",
"stream",
".",
"printf",
"(",
"\"Time se... | Print the time series densely, i.e. it doesn't ignore buckets with 0 events.
@param stream the print stream | [
"Print",
"the",
"time",
"series",
"densely",
"i",
".",
"e",
".",
"it",
"doesn",
"t",
"ignore",
"buckets",
"with",
"0",
"events",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/TimeSeries.java#L188-L210 |
18,318 | Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java | S3AUnderFileSystem.memoize | private static <T> Supplier<T> memoize(Supplier<T> original) {
return new Supplier<T>() {
Supplier<T> mDelegate = this::firstTime;
boolean mInitialized;
public T get() {
return mDelegate.get();
}
private synchronized T firstTime() {
if (!mInitialized) {
T val... | java | private static <T> Supplier<T> memoize(Supplier<T> original) {
return new Supplier<T>() {
Supplier<T> mDelegate = this::firstTime;
boolean mInitialized;
public T get() {
return mDelegate.get();
}
private synchronized T firstTime() {
if (!mInitialized) {
T val... | [
"private",
"static",
"<",
"T",
">",
"Supplier",
"<",
"T",
">",
"memoize",
"(",
"Supplier",
"<",
"T",
">",
"original",
")",
"{",
"return",
"new",
"Supplier",
"<",
"T",
">",
"(",
")",
"{",
"Supplier",
"<",
"T",
">",
"mDelegate",
"=",
"this",
"::",
... | Memoize implementation for java.util.function.supplier. | [
"Memoize",
"implementation",
"for",
"java",
".",
"util",
".",
"function",
".",
"supplier",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java#L111-L128 |
18,319 | Alluxio/alluxio | underfs/swift/src/main/java/alluxio/underfs/swift/http/SwiftDirectClient.java | SwiftDirectClient.put | public static SwiftOutputStream put(Access access, String objectName) throws IOException {
LOG.debug("PUT method, object : {}", objectName);
URL url = new URL(access.getPublicURL() + "/" + objectName);
URLConnection connection = url.openConnection();
if (!(connection instanceof HttpURLConnection)) {
... | java | public static SwiftOutputStream put(Access access, String objectName) throws IOException {
LOG.debug("PUT method, object : {}", objectName);
URL url = new URL(access.getPublicURL() + "/" + objectName);
URLConnection connection = url.openConnection();
if (!(connection instanceof HttpURLConnection)) {
... | [
"public",
"static",
"SwiftOutputStream",
"put",
"(",
"Access",
"access",
",",
"String",
"objectName",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"PUT method, object : {}\"",
",",
"objectName",
")",
";",
"URL",
"url",
"=",
"new",
"URL",
"(",... | Swift HTTP PUT request.
@param access JOSS access object
@param objectName name of the object to create
@return SwiftOutputStream that will be used to upload data to Swift | [
"Swift",
"HTTP",
"PUT",
"request",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/swift/src/main/java/alluxio/underfs/swift/http/SwiftDirectClient.java#L50-L70 |
18,320 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/authentication/DefaultAuthenticationServer.java | DefaultAuthenticationServer.cleanupStaleClients | private void cleanupStaleClients() {
LocalTime cleanupTime = LocalTime.now();
LOG.debug("Starting cleanup authentication registry at {}", cleanupTime);
// Get a list of stale clients under read lock.
List<UUID> staleChannels = new ArrayList<>();
for (Map.Entry<UUID, AuthenticatedChannelInfo> clientE... | java | private void cleanupStaleClients() {
LocalTime cleanupTime = LocalTime.now();
LOG.debug("Starting cleanup authentication registry at {}", cleanupTime);
// Get a list of stale clients under read lock.
List<UUID> staleChannels = new ArrayList<>();
for (Map.Entry<UUID, AuthenticatedChannelInfo> clientE... | [
"private",
"void",
"cleanupStaleClients",
"(",
")",
"{",
"LocalTime",
"cleanupTime",
"=",
"LocalTime",
".",
"now",
"(",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Starting cleanup authentication registry at {}\"",
",",
"cleanupTime",
")",
";",
"// Get a list of stale clie... | Primitive that is invoked periodically for cleaning the registry from clients that has become
stale. | [
"Primitive",
"that",
"is",
"invoked",
"periodically",
"for",
"cleaning",
"the",
"registry",
"from",
"clients",
"that",
"has",
"become",
"stale",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/authentication/DefaultAuthenticationServer.java#L148-L166 |
18,321 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/authentication/DefaultAuthenticationServer.java | DefaultAuthenticationServer.checkSupported | protected void checkSupported(AuthType authType) {
switch (authType) {
case NOSASL:
case SIMPLE:
case CUSTOM:
return;
default:
throw new RuntimeException("Authentication type not supported:" + authType.name());
}
} | java | protected void checkSupported(AuthType authType) {
switch (authType) {
case NOSASL:
case SIMPLE:
case CUSTOM:
return;
default:
throw new RuntimeException("Authentication type not supported:" + authType.name());
}
} | [
"protected",
"void",
"checkSupported",
"(",
"AuthType",
"authType",
")",
"{",
"switch",
"(",
"authType",
")",
"{",
"case",
"NOSASL",
":",
"case",
"SIMPLE",
":",
"case",
"CUSTOM",
":",
"return",
";",
"default",
":",
"throw",
"new",
"RuntimeException",
"(",
... | Used to check if given authentication is supported by the server.
@param authType authentication type
@throws RuntimeException if not supported | [
"Used",
"to",
"check",
"if",
"given",
"authentication",
"is",
"supported",
"by",
"the",
"server",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/authentication/DefaultAuthenticationServer.java#L174-L183 |
18,322 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/AsyncBlockRemover.java | AsyncBlockRemover.addBlocksToDelete | public void addBlocksToDelete(List<Long> blocks) {
for (long id : blocks) {
if (mRemovingBlocks.contains(id)) {
LOG.debug("{} is being removed. Current queue size is {}.", id, mBlocksToRemove.size());
continue;
}
try {
mBlocksToRemove.put(id);
mRemovingBlocks.add(id... | java | public void addBlocksToDelete(List<Long> blocks) {
for (long id : blocks) {
if (mRemovingBlocks.contains(id)) {
LOG.debug("{} is being removed. Current queue size is {}.", id, mBlocksToRemove.size());
continue;
}
try {
mBlocksToRemove.put(id);
mRemovingBlocks.add(id... | [
"public",
"void",
"addBlocksToDelete",
"(",
"List",
"<",
"Long",
">",
"blocks",
")",
"{",
"for",
"(",
"long",
"id",
":",
"blocks",
")",
"{",
"if",
"(",
"mRemovingBlocks",
".",
"contains",
"(",
"id",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"{} is b... | Put blocks into async block remover. This method will take care of the duplicate blocks.
@param blocks blocks to be deleted | [
"Put",
"blocks",
"into",
"async",
"block",
"remover",
".",
"This",
"method",
"will",
"take",
"care",
"of",
"the",
"duplicate",
"blocks",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/AsyncBlockRemover.java#L69-L83 |
18,323 | Alluxio/alluxio | underfs/local/src/main/java/alluxio/underfs/local/LocalUnderFileSystem.java | LocalUnderFileSystem.rename | private boolean rename(String src, String dst) throws IOException {
src = stripPath(src);
dst = stripPath(dst);
File file = new File(src);
return file.renameTo(new File(dst));
} | java | private boolean rename(String src, String dst) throws IOException {
src = stripPath(src);
dst = stripPath(dst);
File file = new File(src);
return file.renameTo(new File(dst));
} | [
"private",
"boolean",
"rename",
"(",
"String",
"src",
",",
"String",
"dst",
")",
"throws",
"IOException",
"{",
"src",
"=",
"stripPath",
"(",
"src",
")",
";",
"dst",
"=",
"stripPath",
"(",
"dst",
")",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"src... | Rename a file to a file or a directory to a directory.
@param src path of source file or directory
@param dst path of destination file or directory
@return true if rename succeeds | [
"Rename",
"a",
"file",
"to",
"a",
"file",
"or",
"a",
"directory",
"to",
"a",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/local/src/main/java/alluxio/underfs/local/LocalUnderFileSystem.java#L426-L431 |
18,324 | Alluxio/alluxio | core/server/proxy/src/main/java/alluxio/proxy/s3/S3RestServiceHandler.java | S3RestServiceHandler.completeMultipartUpload | private Response completeMultipartUpload(final String bucket, final String object,
final long uploadId) {
return S3RestUtils.call(bucket, new S3RestUtils.RestCallable<CompleteMultipartUploadResult>() {
@Override
public CompleteMultipartUploadResult call() throws S3Exception {
String bucket... | java | private Response completeMultipartUpload(final String bucket, final String object,
final long uploadId) {
return S3RestUtils.call(bucket, new S3RestUtils.RestCallable<CompleteMultipartUploadResult>() {
@Override
public CompleteMultipartUploadResult call() throws S3Exception {
String bucket... | [
"private",
"Response",
"completeMultipartUpload",
"(",
"final",
"String",
"bucket",
",",
"final",
"String",
"object",
",",
"final",
"long",
"uploadId",
")",
"{",
"return",
"S3RestUtils",
".",
"call",
"(",
"bucket",
",",
"new",
"S3RestUtils",
".",
"RestCallable",... | under the temporary multipart upload directory are combined into the final object. | [
"under",
"the",
"temporary",
"multipart",
"upload",
"directory",
"are",
"combined",
"into",
"the",
"final",
"object",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/proxy/src/main/java/alluxio/proxy/s3/S3RestServiceHandler.java#L330-L372 |
18,325 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getMasterRpcAddresses | public static List<InetSocketAddress> getMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(conf.getList(PropertyKey.MASTER_RPC_ADDRESSES, ","));
}
// F... | java | public static List<InetSocketAddress> getMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(conf.getList(PropertyKey.MASTER_RPC_ADDRESSES, ","));
}
// F... | [
"public",
"static",
"List",
"<",
"InetSocketAddress",
">",
"getMasterRpcAddresses",
"(",
"AlluxioConfiguration",
"conf",
")",
"{",
"// First check whether rpc addresses are explicitly configured.",
"if",
"(",
"conf",
".",
"isSet",
"(",
"PropertyKey",
".",
"MASTER_RPC_ADDRES... | Gets the RPC addresses of all masters based on the configuration.
@param conf the configuration to use
@return the master rpc addresses | [
"Gets",
"the",
"RPC",
"addresses",
"of",
"all",
"masters",
"based",
"on",
"the",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L136-L145 |
18,326 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getJobMasterRpcAddresses | public static List<InetSocketAddress> getJobMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether job rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.JOB_MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(
conf.getList(PropertyKey.JOB_MASTER_RPC_ADDRESS... | java | public static List<InetSocketAddress> getJobMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether job rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.JOB_MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(
conf.getList(PropertyKey.JOB_MASTER_RPC_ADDRESS... | [
"public",
"static",
"List",
"<",
"InetSocketAddress",
">",
"getJobMasterRpcAddresses",
"(",
"AlluxioConfiguration",
"conf",
")",
"{",
"// First check whether job rpc addresses are explicitly configured.",
"if",
"(",
"conf",
".",
"isSet",
"(",
"PropertyKey",
".",
"JOB_MASTER... | Gets the RPC addresses of all job masters based on the configuration.
@param conf the configuration to use
@return the job master rpc addresses | [
"Gets",
"the",
"RPC",
"addresses",
"of",
"all",
"job",
"masters",
"based",
"on",
"the",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L153-L171 |
18,327 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadPropertiesFromResource | @Nullable
public static Properties loadPropertiesFromResource(URL resource) {
try (InputStream stream = resource.openStream()) {
return loadProperties(stream);
} catch (IOException e) {
LOG.warn("Failed to read properties from {}: {}", resource, e.toString());
return null;
}
} | java | @Nullable
public static Properties loadPropertiesFromResource(URL resource) {
try (InputStream stream = resource.openStream()) {
return loadProperties(stream);
} catch (IOException e) {
LOG.warn("Failed to read properties from {}: {}", resource, e.toString());
return null;
}
} | [
"@",
"Nullable",
"public",
"static",
"Properties",
"loadPropertiesFromResource",
"(",
"URL",
"resource",
")",
"{",
"try",
"(",
"InputStream",
"stream",
"=",
"resource",
".",
"openStream",
"(",
")",
")",
"{",
"return",
"loadProperties",
"(",
"stream",
")",
";",... | Loads properties from a resource.
@param resource url of the properties file
@return a set of properties on success, or null if failed | [
"Loads",
"properties",
"from",
"a",
"resource",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L199-L207 |
18,328 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadPropertiesFromFile | @Nullable
public static Properties loadPropertiesFromFile(String filePath) {
try (FileInputStream fileInputStream = new FileInputStream(filePath)) {
return loadProperties(fileInputStream);
} catch (FileNotFoundException e) {
return null;
} catch (IOException e) {
LOG.warn("Failed to clos... | java | @Nullable
public static Properties loadPropertiesFromFile(String filePath) {
try (FileInputStream fileInputStream = new FileInputStream(filePath)) {
return loadProperties(fileInputStream);
} catch (FileNotFoundException e) {
return null;
} catch (IOException e) {
LOG.warn("Failed to clos... | [
"@",
"Nullable",
"public",
"static",
"Properties",
"loadPropertiesFromFile",
"(",
"String",
"filePath",
")",
"{",
"try",
"(",
"FileInputStream",
"fileInputStream",
"=",
"new",
"FileInputStream",
"(",
"filePath",
")",
")",
"{",
"return",
"loadProperties",
"(",
"fil... | Loads properties from the given file.
@param filePath the absolute path of the file to load properties
@return a set of properties on success, or null if failed | [
"Loads",
"properties",
"from",
"the",
"given",
"file",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L215-L225 |
18,329 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.searchPropertiesFile | @Nullable
public static String searchPropertiesFile(String propertiesFile,
String[] confPathList) {
if (propertiesFile == null || confPathList == null) {
return null;
}
for (String path : confPathList) {
String file = PathUtils.concatPath(path, propertiesFile);
Properties propertie... | java | @Nullable
public static String searchPropertiesFile(String propertiesFile,
String[] confPathList) {
if (propertiesFile == null || confPathList == null) {
return null;
}
for (String path : confPathList) {
String file = PathUtils.concatPath(path, propertiesFile);
Properties propertie... | [
"@",
"Nullable",
"public",
"static",
"String",
"searchPropertiesFile",
"(",
"String",
"propertiesFile",
",",
"String",
"[",
"]",
"confPathList",
")",
"{",
"if",
"(",
"propertiesFile",
"==",
"null",
"||",
"confPathList",
"==",
"null",
")",
"{",
"return",
"null"... | Searches the given properties file from a list of paths.
@param propertiesFile the file to load properties
@param confPathList a list of paths to search the propertiesFile
@return the site properties file on success search, or null if failed | [
"Searches",
"the",
"given",
"properties",
"file",
"from",
"a",
"list",
"of",
"paths",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L250-L265 |
18,330 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getMasterHostNotConfiguredMessage | public static String getMasterHostNotConfiguredMessage(String serviceName) {
return getHostNotConfiguredMessage(serviceName, "master", PropertyKey.MASTER_HOSTNAME,
PropertyKey.MASTER_EMBEDDED_JOURNAL_ADDRESSES);
} | java | public static String getMasterHostNotConfiguredMessage(String serviceName) {
return getHostNotConfiguredMessage(serviceName, "master", PropertyKey.MASTER_HOSTNAME,
PropertyKey.MASTER_EMBEDDED_JOURNAL_ADDRESSES);
} | [
"public",
"static",
"String",
"getMasterHostNotConfiguredMessage",
"(",
"String",
"serviceName",
")",
"{",
"return",
"getHostNotConfiguredMessage",
"(",
"serviceName",
",",
"\"master\"",
",",
"PropertyKey",
".",
"MASTER_HOSTNAME",
",",
"PropertyKey",
".",
"MASTER_EMBEDDED... | Returns a unified message for cases when the master hostname cannot be determined.
@param serviceName the name of the service that couldn't run. i.e. Alluxio worker, fsadmin
shell, etc.
@return a string with the message | [
"Returns",
"a",
"unified",
"message",
"for",
"cases",
"when",
"the",
"master",
"hostname",
"cannot",
"be",
"determined",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L286-L289 |
18,331 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getJobMasterHostNotConfiguredMessage | public static String getJobMasterHostNotConfiguredMessage(String serviceName) {
return getHostNotConfiguredMessage(serviceName, "job master", PropertyKey.JOB_MASTER_HOSTNAME,
PropertyKey.JOB_MASTER_EMBEDDED_JOURNAL_ADDRESSES);
} | java | public static String getJobMasterHostNotConfiguredMessage(String serviceName) {
return getHostNotConfiguredMessage(serviceName, "job master", PropertyKey.JOB_MASTER_HOSTNAME,
PropertyKey.JOB_MASTER_EMBEDDED_JOURNAL_ADDRESSES);
} | [
"public",
"static",
"String",
"getJobMasterHostNotConfiguredMessage",
"(",
"String",
"serviceName",
")",
"{",
"return",
"getHostNotConfiguredMessage",
"(",
"serviceName",
",",
"\"job master\"",
",",
"PropertyKey",
".",
"JOB_MASTER_HOSTNAME",
",",
"PropertyKey",
".",
"JOB_... | Returns a unified message for cases when the job master hostname cannot be determined.
@param serviceName the name of the service that couldn't run. i.e. Alluxio worker, fsadmin
shell, etc.
@return a string with the message | [
"Returns",
"a",
"unified",
"message",
"for",
"cases",
"when",
"the",
"job",
"master",
"hostname",
"cannot",
"be",
"determined",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L298-L301 |
18,332 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.checkRatio | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
float value = conf.getFloat(key);
Preconditions.checkState(value <= 1.0, "Property %s must not exceed 1, but it is set to %s",
key.getName(), value);
Preconditions.checkState(value >= 0.0, "Property %s must be non-negative,... | java | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
float value = conf.getFloat(key);
Preconditions.checkState(value <= 1.0, "Property %s must not exceed 1, but it is set to %s",
key.getName(), value);
Preconditions.checkState(value >= 0.0, "Property %s must be non-negative,... | [
"public",
"static",
"float",
"checkRatio",
"(",
"AlluxioConfiguration",
"conf",
",",
"PropertyKey",
"key",
")",
"{",
"float",
"value",
"=",
"conf",
".",
"getFloat",
"(",
"key",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"value",
"<=",
"1.0",
",",
"... | Checks that the given property key is a ratio from 0.0 and 1.0, throwing an exception if it is
not.
@param conf the configuration for looking up the property key
@param key the property key
@return the property value | [
"Checks",
"that",
"the",
"given",
"property",
"key",
"is",
"a",
"ratio",
"from",
"0",
".",
"0",
"and",
"1",
".",
"0",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"not",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L318-L325 |
18,333 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getConfiguration | public static List<ConfigProperty> getConfiguration(AlluxioConfiguration conf, Scope scope) {
ConfigurationValueOptions useRawDisplayValue =
ConfigurationValueOptions.defaults().useDisplayValue(true).useRawValue(true);
List<ConfigProperty> configs = new ArrayList<>();
List<PropertyKey> selectedKeys... | java | public static List<ConfigProperty> getConfiguration(AlluxioConfiguration conf, Scope scope) {
ConfigurationValueOptions useRawDisplayValue =
ConfigurationValueOptions.defaults().useDisplayValue(true).useRawValue(true);
List<ConfigProperty> configs = new ArrayList<>();
List<PropertyKey> selectedKeys... | [
"public",
"static",
"List",
"<",
"ConfigProperty",
">",
"getConfiguration",
"(",
"AlluxioConfiguration",
"conf",
",",
"Scope",
"scope",
")",
"{",
"ConfigurationValueOptions",
"useRawDisplayValue",
"=",
"ConfigurationValueOptions",
".",
"defaults",
"(",
")",
".",
"useD... | Gets all configuration properties filtered by the specified scope.
@param conf the configuration to use
@param scope the scope to filter by
@return the properties | [
"Gets",
"all",
"configuration",
"properties",
"filtered",
"by",
"the",
"specified",
"scope",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L354-L374 |
18,334 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.reloadProperties | public static void reloadProperties() {
synchronized (DEFAULT_PROPERTIES_LOCK) {
// Step1: bootstrap the configuration. This is necessary because we need to resolve alluxio
// .home (likely to be in system properties) to locate the conf dir to search for the site
// property file.
AlluxioPro... | java | public static void reloadProperties() {
synchronized (DEFAULT_PROPERTIES_LOCK) {
// Step1: bootstrap the configuration. This is necessary because we need to resolve alluxio
// .home (likely to be in system properties) to locate the conf dir to search for the site
// property file.
AlluxioPro... | [
"public",
"static",
"void",
"reloadProperties",
"(",
")",
"{",
"synchronized",
"(",
"DEFAULT_PROPERTIES_LOCK",
")",
"{",
"// Step1: bootstrap the configuration. This is necessary because we need to resolve alluxio",
"// .home (likely to be in system properties) to locate the conf dir to se... | Reloads site properties from disk. | [
"Reloads",
"site",
"properties",
"from",
"disk",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L406-L446 |
18,335 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadConfiguration | private static GetConfigurationPResponse loadConfiguration(InetSocketAddress address,
AlluxioConfiguration conf) throws AlluxioStatusException {
GrpcChannel channel = null;
try {
LOG.info("Alluxio client (version {}) is trying to load configuration from meta master {}",
RuntimeConstants.VE... | java | private static GetConfigurationPResponse loadConfiguration(InetSocketAddress address,
AlluxioConfiguration conf) throws AlluxioStatusException {
GrpcChannel channel = null;
try {
LOG.info("Alluxio client (version {}) is trying to load configuration from meta master {}",
RuntimeConstants.VE... | [
"private",
"static",
"GetConfigurationPResponse",
"loadConfiguration",
"(",
"InetSocketAddress",
"address",
",",
"AlluxioConfiguration",
"conf",
")",
"throws",
"AlluxioStatusException",
"{",
"GrpcChannel",
"channel",
"=",
"null",
";",
"try",
"{",
"LOG",
".",
"info",
"... | Loads configuration from meta master.
@param address the meta master address
@return the RPC response | [
"Loads",
"configuration",
"from",
"meta",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L471-L498 |
18,336 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadClientProperties | private static Properties loadClientProperties(List<ConfigProperty> properties,
BiFunction<PropertyKey, String, String> logMessage) {
Properties props = new Properties();
for (ConfigProperty property : properties) {
String name = property.getName();
// TODO(binfan): support propagating unsetti... | java | private static Properties loadClientProperties(List<ConfigProperty> properties,
BiFunction<PropertyKey, String, String> logMessage) {
Properties props = new Properties();
for (ConfigProperty property : properties) {
String name = property.getName();
// TODO(binfan): support propagating unsetti... | [
"private",
"static",
"Properties",
"loadClientProperties",
"(",
"List",
"<",
"ConfigProperty",
">",
"properties",
",",
"BiFunction",
"<",
"PropertyKey",
",",
"String",
",",
"String",
">",
"logMessage",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"... | Loads client scope properties from the property list returned by grpc.
@param properties the property list returned by grpc
@param logMessage a function with key and value as parameter and returns debug log message
@return the loaded properties | [
"Loads",
"client",
"scope",
"properties",
"from",
"the",
"property",
"list",
"returned",
"by",
"grpc",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L507-L525 |
18,337 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadClusterConfiguration | private static AlluxioConfiguration loadClusterConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration conf) {
String clientVersion = conf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load cluster level configurations",
clientVersion);
List<alluxi... | java | private static AlluxioConfiguration loadClusterConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration conf) {
String clientVersion = conf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load cluster level configurations",
clientVersion);
List<alluxi... | [
"private",
"static",
"AlluxioConfiguration",
"loadClusterConfiguration",
"(",
"GetConfigurationPResponse",
"response",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"String",
"clientVersion",
"=",
"conf",
".",
"get",
"(",
"PropertyKey",
".",
"VERSION",
")",
";",
"LOG... | Loads the cluster level configuration from the get configuration response, and merges it with
the existing configuration.
@param response the get configuration RPC response
@param conf the existing configuration
@return the merged configuration | [
"Loads",
"the",
"cluster",
"level",
"configuration",
"from",
"the",
"get",
"configuration",
"response",
"and",
"merges",
"it",
"with",
"the",
"existing",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L535-L558 |
18,338 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadPathConfiguration | private static PathConfiguration loadPathConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration clusterConf) {
String clientVersion = clusterConf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load path level configurations",
clientVersion);
Map<St... | java | private static PathConfiguration loadPathConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration clusterConf) {
String clientVersion = clusterConf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load path level configurations",
clientVersion);
Map<St... | [
"private",
"static",
"PathConfiguration",
"loadPathConfiguration",
"(",
"GetConfigurationPResponse",
"response",
",",
"AlluxioConfiguration",
"clusterConf",
")",
"{",
"String",
"clientVersion",
"=",
"clusterConf",
".",
"get",
"(",
"PropertyKey",
".",
"VERSION",
")",
";"... | Loads the path level configuration from the get configuration response.
Only client scope properties will be loaded.
@param response the get configuration RPC response
@param clusterConf cluster level configuration
@return the loaded path level configuration | [
"Loads",
"the",
"path",
"level",
"configuration",
"from",
"the",
"get",
"configuration",
"response",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L569-L585 |
18,339 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadClusterAndPathDefaults | public static Pair<AlluxioConfiguration, PathConfiguration> loadClusterAndPathDefaults(
InetSocketAddress address, AlluxioConfiguration clusterConf, PathConfiguration pathConf)
throws AlluxioStatusException {
if (shouldLoadClusterConfiguration(clusterConf)) {
GetConfigurationPResponse response = l... | java | public static Pair<AlluxioConfiguration, PathConfiguration> loadClusterAndPathDefaults(
InetSocketAddress address, AlluxioConfiguration clusterConf, PathConfiguration pathConf)
throws AlluxioStatusException {
if (shouldLoadClusterConfiguration(clusterConf)) {
GetConfigurationPResponse response = l... | [
"public",
"static",
"Pair",
"<",
"AlluxioConfiguration",
",",
"PathConfiguration",
">",
"loadClusterAndPathDefaults",
"(",
"InetSocketAddress",
"address",
",",
"AlluxioConfiguration",
"clusterConf",
",",
"PathConfiguration",
"pathConf",
")",
"throws",
"AlluxioStatusException"... | Loads both cluster and path level configurations from meta master.
Only client scope properties will be loaded.
If cluster level configuration has been loaded or the feature of loading configuration from
meta master is disabled, then no RPC is issued, and both cluster and path level configuration
is kept as original
... | [
"Loads",
"both",
"cluster",
"and",
"path",
"level",
"configurations",
"from",
"meta",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L626-L635 |
18,340 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.createLogFile | static UfsJournalFile createLogFile(URI location, long start, long end) {
return new UfsJournalFile(location, start, end, false);
} | java | static UfsJournalFile createLogFile(URI location, long start, long end) {
return new UfsJournalFile(location, start, end, false);
} | [
"static",
"UfsJournalFile",
"createLogFile",
"(",
"URI",
"location",
",",
"long",
"start",
",",
"long",
"end",
")",
"{",
"return",
"new",
"UfsJournalFile",
"(",
"location",
",",
"start",
",",
"end",
",",
"false",
")",
";",
"}"
] | Creates a journal log file.
@param location the file location
@param start the start sequence number (inclusive)
@param end the end sequence number (exclusive)
@return the file | [
"Creates",
"a",
"journal",
"log",
"file",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L91-L93 |
18,341 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.createTmpCheckpointFile | static UfsJournalFile createTmpCheckpointFile(URI location) {
return new UfsJournalFile(location, UfsJournal.UNKNOWN_SEQUENCE_NUMBER,
UfsJournal.UNKNOWN_SEQUENCE_NUMBER, false);
} | java | static UfsJournalFile createTmpCheckpointFile(URI location) {
return new UfsJournalFile(location, UfsJournal.UNKNOWN_SEQUENCE_NUMBER,
UfsJournal.UNKNOWN_SEQUENCE_NUMBER, false);
} | [
"static",
"UfsJournalFile",
"createTmpCheckpointFile",
"(",
"URI",
"location",
")",
"{",
"return",
"new",
"UfsJournalFile",
"(",
"location",
",",
"UfsJournal",
".",
"UNKNOWN_SEQUENCE_NUMBER",
",",
"UfsJournal",
".",
"UNKNOWN_SEQUENCE_NUMBER",
",",
"false",
")",
";",
... | Creates a temporary checkpoint file.
@param location the file location
@return the file | [
"Creates",
"a",
"temporary",
"checkpoint",
"file",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L101-L104 |
18,342 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.encodeCheckpointFileLocation | static URI encodeCheckpointFileLocation(UfsJournal journal, long end) {
String filename = String.format("0x%x-0x%x", 0, end);
URI location = URIUtils.appendPathOrDie(journal.getCheckpointDir(), filename);
return location;
} | java | static URI encodeCheckpointFileLocation(UfsJournal journal, long end) {
String filename = String.format("0x%x-0x%x", 0, end);
URI location = URIUtils.appendPathOrDie(journal.getCheckpointDir(), filename);
return location;
} | [
"static",
"URI",
"encodeCheckpointFileLocation",
"(",
"UfsJournal",
"journal",
",",
"long",
"end",
")",
"{",
"String",
"filename",
"=",
"String",
".",
"format",
"(",
"\"0x%x-0x%x\"",
",",
"0",
",",
"end",
")",
";",
"URI",
"location",
"=",
"URIUtils",
".",
... | Encodes a checkpoint location under the checkpoint directory.
@param journal the UFS journal instance
@param end the end sequence number (exclusive)
@return the location | [
"Encodes",
"a",
"checkpoint",
"location",
"under",
"the",
"checkpoint",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L113-L117 |
18,343 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.encodeLogFileLocation | static URI encodeLogFileLocation(UfsJournal journal, long start, long end) {
String filename = String.format("0x%x-0x%x", start, end);
URI location = URIUtils.appendPathOrDie(journal.getLogDir(), filename);
return location;
} | java | static URI encodeLogFileLocation(UfsJournal journal, long start, long end) {
String filename = String.format("0x%x-0x%x", start, end);
URI location = URIUtils.appendPathOrDie(journal.getLogDir(), filename);
return location;
} | [
"static",
"URI",
"encodeLogFileLocation",
"(",
"UfsJournal",
"journal",
",",
"long",
"start",
",",
"long",
"end",
")",
"{",
"String",
"filename",
"=",
"String",
".",
"format",
"(",
"\"0x%x-0x%x\"",
",",
"start",
",",
"end",
")",
";",
"URI",
"location",
"="... | Encodes a log location under the log directory.
@param journal the UFS journal instance
@param start the start sequence number (inclusive)
@param end the end sequence number (exclusive)
@return the location | [
"Encodes",
"a",
"log",
"location",
"under",
"the",
"log",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L127-L131 |
18,344 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.encodeTemporaryCheckpointFileLocation | static URI encodeTemporaryCheckpointFileLocation(UfsJournal journal) {
return URIUtils.appendPathOrDie(journal.getTmpDir(), UUID.randomUUID().toString());
} | java | static URI encodeTemporaryCheckpointFileLocation(UfsJournal journal) {
return URIUtils.appendPathOrDie(journal.getTmpDir(), UUID.randomUUID().toString());
} | [
"static",
"URI",
"encodeTemporaryCheckpointFileLocation",
"(",
"UfsJournal",
"journal",
")",
"{",
"return",
"URIUtils",
".",
"appendPathOrDie",
"(",
"journal",
".",
"getTmpDir",
"(",
")",
",",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")"... | Encodes a temporary location under the temporary directory.
@param journal the UFS journal instance*
@return the location | [
"Encodes",
"a",
"temporary",
"location",
"under",
"the",
"temporary",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L139-L141 |
18,345 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java | UfsFallbackBlockWriteHandler.createUfsBlock | private void createUfsBlock(BlockWriteRequestContext context)
throws Exception {
BlockWriteRequest request = context.getRequest();
Protocol.CreateUfsBlockOptions createUfsBlockOptions = request.getCreateUfsBlockOptions();
UfsManager.UfsClient ufsClient = mUfsManager.get(createUfsBlockOptions.getMountI... | java | private void createUfsBlock(BlockWriteRequestContext context)
throws Exception {
BlockWriteRequest request = context.getRequest();
Protocol.CreateUfsBlockOptions createUfsBlockOptions = request.getCreateUfsBlockOptions();
UfsManager.UfsClient ufsClient = mUfsManager.get(createUfsBlockOptions.getMountI... | [
"private",
"void",
"createUfsBlock",
"(",
"BlockWriteRequestContext",
"context",
")",
"throws",
"Exception",
"{",
"BlockWriteRequest",
"request",
"=",
"context",
".",
"getRequest",
"(",
")",
";",
"Protocol",
".",
"CreateUfsBlockOptions",
"createUfsBlockOptions",
"=",
... | Creates a UFS block and initialize it with bytes read from block store.
@param context context of this request | [
"Creates",
"a",
"UFS",
"block",
"and",
"initialize",
"it",
"with",
"bytes",
"read",
"from",
"block",
"store",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java#L209-L234 |
18,346 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java | UfsFallbackBlockWriteHandler.transferToUfsBlock | private void transferToUfsBlock(BlockWriteRequestContext context, long pos) throws Exception {
OutputStream ufsOutputStream = context.getOutputStream();
long sessionId = context.getRequest().getSessionId();
long blockId = context.getRequest().getId();
TempBlockMeta block = mWorker.getBlockStore().getTe... | java | private void transferToUfsBlock(BlockWriteRequestContext context, long pos) throws Exception {
OutputStream ufsOutputStream = context.getOutputStream();
long sessionId = context.getRequest().getSessionId();
long blockId = context.getRequest().getId();
TempBlockMeta block = mWorker.getBlockStore().getTe... | [
"private",
"void",
"transferToUfsBlock",
"(",
"BlockWriteRequestContext",
"context",
",",
"long",
"pos",
")",
"throws",
"Exception",
"{",
"OutputStream",
"ufsOutputStream",
"=",
"context",
".",
"getOutputStream",
"(",
")",
";",
"long",
"sessionId",
"=",
"context",
... | Transfers data from block store to UFS.
@param context context of this request
@param pos number of bytes in block store to write in the UFS block | [
"Transfers",
"data",
"from",
"block",
"store",
"to",
"UFS",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/UfsFallbackBlockWriteHandler.java#L242-L252 |
18,347 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journalv0/AsyncJournalWriter.java | AsyncJournalWriter.flush | public void flush(final long targetCounter) throws IOException {
if (targetCounter <= mFlushCounter.get()) {
return;
}
// Using reentrant lock, since it seems to result in higher throughput than using 'synchronized'
mFlushLock.lock();
try {
long startTime = System.nanoTime();
long ... | java | public void flush(final long targetCounter) throws IOException {
if (targetCounter <= mFlushCounter.get()) {
return;
}
// Using reentrant lock, since it seems to result in higher throughput than using 'synchronized'
mFlushLock.lock();
try {
long startTime = System.nanoTime();
long ... | [
"public",
"void",
"flush",
"(",
"final",
"long",
"targetCounter",
")",
"throws",
"IOException",
"{",
"if",
"(",
"targetCounter",
"<=",
"mFlushCounter",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Using reentrant lock, since it seems to result in higher t... | Flushes and waits until the specified counter is flushed to the journal. If the specified
counter is already flushed, this is essentially a no-op.
@param targetCounter the counter to flush | [
"Flushes",
"and",
"waits",
"until",
"the",
"specified",
"counter",
"is",
"flushed",
"to",
"the",
"journal",
".",
"If",
"the",
"specified",
"counter",
"is",
"already",
"flushed",
"this",
"is",
"essentially",
"a",
"no",
"-",
"op",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journalv0/AsyncJournalWriter.java#L105-L146 |
18,348 | Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/OpenFileEntry.java | OpenFileEntry.close | @Override
public void close() throws IOException {
if (mIn != null) {
mIn.close();
}
if (mOut != null) {
mOut.close();
}
mOffset = -1;
} | java | @Override
public void close() throws IOException {
if (mIn != null) {
mIn.close();
}
if (mOut != null) {
mOut.close();
}
mOffset = -1;
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mIn",
"!=",
"null",
")",
"{",
"mIn",
".",
"close",
"(",
")",
";",
"}",
"if",
"(",
"mOut",
"!=",
"null",
")",
"{",
"mOut",
".",
"close",
"(",
")",
";... | Closes the underlying open streams. | [
"Closes",
"the",
"underlying",
"open",
"streams",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/OpenFileEntry.java#L127-L137 |
18,349 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/conf/ServerConfiguration.java | ServerConfiguration.getList | public static List<String> getList(PropertyKey key, String delimiter) {
return sConf.getList(key, delimiter);
} | java | public static List<String> getList(PropertyKey key, String delimiter) {
return sConf.getList(key, delimiter);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getList",
"(",
"PropertyKey",
"key",
",",
"String",
"delimiter",
")",
"{",
"return",
"sConf",
".",
"getList",
"(",
"key",
",",
"delimiter",
")",
";",
"}"
] | Gets the value for the given key as a list.
@param key the key to get the value for
@param delimiter the delimiter to split the values
@return the list of values for the given key | [
"Gets",
"the",
"value",
"for",
"the",
"given",
"key",
"as",
"a",
"list",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/conf/ServerConfiguration.java#L241-L243 |
18,350 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/conf/ServerConfiguration.java | ServerConfiguration.getEnum | public static <T extends Enum<T>> T getEnum(PropertyKey key, Class<T> enumType) {
return sConf.getEnum(key, enumType);
} | java | public static <T extends Enum<T>> T getEnum(PropertyKey key, Class<T> enumType) {
return sConf.getEnum(key, enumType);
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnum",
"(",
"PropertyKey",
"key",
",",
"Class",
"<",
"T",
">",
"enumType",
")",
"{",
"return",
"sConf",
".",
"getEnum",
"(",
"key",
",",
"enumType",
")",
";",
"}"
] | Gets the value for the given key as an enum value.
@param key the key to get the value for
@param enumType the type of the enum
@param <T> the type of the enum
@return the value for the given key as an enum value | [
"Gets",
"the",
"value",
"for",
"the",
"given",
"key",
"as",
"an",
"enum",
"value",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/conf/ServerConfiguration.java#L253-L255 |
18,351 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/CheckerUtils.java | CheckerUtils.supportAlluxioHA | public static boolean supportAlluxioHA(PrintWriter reportWriter,
AlluxioConfiguration alluxioConf) {
if (alluxioConf.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)) {
reportWriter.println("Alluixo is running in high availability mode.\n");
if (!alluxioConf.isSet(PropertyKey.ZOOKEEPER_ADDRESS)) {
... | java | public static boolean supportAlluxioHA(PrintWriter reportWriter,
AlluxioConfiguration alluxioConf) {
if (alluxioConf.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)) {
reportWriter.println("Alluixo is running in high availability mode.\n");
if (!alluxioConf.isSet(PropertyKey.ZOOKEEPER_ADDRESS)) {
... | [
"public",
"static",
"boolean",
"supportAlluxioHA",
"(",
"PrintWriter",
"reportWriter",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"if",
"(",
"alluxioConf",
".",
"getBoolean",
"(",
"PropertyKey",
".",
"ZOOKEEPER_ENABLED",
")",
")",
"{",
"reportWriter",
"."... | Checks if the Zookeeper address has been set when running the Alluxio HA mode.
@param reportWriter save user-facing messages to a generated file
@param alluxioConf Alluxio configuration
@return true if Alluxio HA mode is supported, false otherwise | [
"Checks",
"if",
"the",
"Zookeeper",
"address",
"has",
"been",
"set",
"when",
"running",
"the",
"Alluxio",
"HA",
"mode",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/CheckerUtils.java#L104-L118 |
18,352 | Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/CheckerUtils.java | CheckerUtils.printNodesResults | public static Status printNodesResults(Map<Status, List<String>> map, PrintWriter reportWriter) {
boolean canFindClass = true;
boolean canFindFS = true;
for (Map.Entry<Status, List<String>> entry : map.entrySet()) {
String nodeAddresses = String.join(" ", entry.getValue());
switch (entry.getKey... | java | public static Status printNodesResults(Map<Status, List<String>> map, PrintWriter reportWriter) {
boolean canFindClass = true;
boolean canFindFS = true;
for (Map.Entry<Status, List<String>> entry : map.entrySet()) {
String nodeAddresses = String.join(" ", entry.getValue());
switch (entry.getKey... | [
"public",
"static",
"Status",
"printNodesResults",
"(",
"Map",
"<",
"Status",
",",
"List",
"<",
"String",
">",
">",
"map",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"boolean",
"canFindClass",
"=",
"true",
";",
"boolean",
"canFindFS",
"=",
"true",
";",
... | Collects and saves the Status of checked nodes.
@param map the transformed integration checker results
@param reportWriter save the result to corresponding checker report
@return the result information of the checked nodes | [
"Collects",
"and",
"saves",
"the",
"Status",
"of",
"checked",
"nodes",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/CheckerUtils.java#L141-L165 |
18,353 | Alluxio/alluxio | core/common/src/main/java/alluxio/wire/MasterWebUIConfiguration.java | MasterWebUIConfiguration.setConfiguration | public MasterWebUIConfiguration setConfiguration(
TreeSet<Triple<String, String, String>> configuration) {
mConfiguration = configuration;
return this;
} | java | public MasterWebUIConfiguration setConfiguration(
TreeSet<Triple<String, String, String>> configuration) {
mConfiguration = configuration;
return this;
} | [
"public",
"MasterWebUIConfiguration",
"setConfiguration",
"(",
"TreeSet",
"<",
"Triple",
"<",
"String",
",",
"String",
",",
"String",
">",
">",
"configuration",
")",
"{",
"mConfiguration",
"=",
"configuration",
";",
"return",
"this",
";",
"}"
] | Sets configuration.
@param configuration the configuration
@return the configuration | [
"Sets",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/wire/MasterWebUIConfiguration.java#L63-L67 |
18,354 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeDirectory.java | MutableInodeDirectory.generateClientFileInfo | @Override
public FileInfo generateClientFileInfo(String path) {
FileInfo ret = new FileInfo();
ret.setFileId(getId());
ret.setName(getName());
ret.setPath(path);
ret.setBlockSizeBytes(0);
ret.setCreationTimeMs(getCreationTimeMs());
ret.setCompleted(true);
ret.setFolder(isDirectory());
... | java | @Override
public FileInfo generateClientFileInfo(String path) {
FileInfo ret = new FileInfo();
ret.setFileId(getId());
ret.setName(getName());
ret.setPath(path);
ret.setBlockSizeBytes(0);
ret.setCreationTimeMs(getCreationTimeMs());
ret.setCompleted(true);
ret.setFolder(isDirectory());
... | [
"@",
"Override",
"public",
"FileInfo",
"generateClientFileInfo",
"(",
"String",
"path",
")",
"{",
"FileInfo",
"ret",
"=",
"new",
"FileInfo",
"(",
")",
";",
"ret",
".",
"setFileId",
"(",
"getId",
"(",
")",
")",
";",
"ret",
".",
"setName",
"(",
"getName",
... | Generates client file info for a folder.
@param path the path of the folder in the filesystem
@return the generated {@link FileInfo} | [
"Generates",
"client",
"file",
"info",
"for",
"a",
"folder",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeDirectory.java#L117-L142 |
18,355 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeDirectory.java | MutableInodeDirectory.updateFromEntry | public void updateFromEntry(UpdateInodeDirectoryEntry entry) {
if (entry.hasDefaultAcl()) {
setDefaultACL(
(DefaultAccessControlList) ProtoUtils.fromProto(entry.getDefaultAcl()));
}
if (entry.hasDirectChildrenLoaded()) {
setDirectChildrenLoaded(entry.getDirectChildrenLoaded());
}
... | java | public void updateFromEntry(UpdateInodeDirectoryEntry entry) {
if (entry.hasDefaultAcl()) {
setDefaultACL(
(DefaultAccessControlList) ProtoUtils.fromProto(entry.getDefaultAcl()));
}
if (entry.hasDirectChildrenLoaded()) {
setDirectChildrenLoaded(entry.getDirectChildrenLoaded());
}
... | [
"public",
"void",
"updateFromEntry",
"(",
"UpdateInodeDirectoryEntry",
"entry",
")",
"{",
"if",
"(",
"entry",
".",
"hasDefaultAcl",
"(",
")",
")",
"{",
"setDefaultACL",
"(",
"(",
"DefaultAccessControlList",
")",
"ProtoUtils",
".",
"fromProto",
"(",
"entry",
".",... | Updates this inode directory's state from the given entry.
@param entry the entry | [
"Updates",
"this",
"inode",
"directory",
"s",
"state",
"from",
"the",
"given",
"entry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeDirectory.java#L149-L160 |
18,356 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/policy/LocalFirstAvoidEvictionPolicy.java | LocalFirstAvoidEvictionPolicy.getAvailableBytes | private long getAvailableBytes(BlockWorkerInfo workerInfo) {
long mCapacityBytes = workerInfo.getCapacityBytes();
long mUsedBytes = workerInfo.getUsedBytes();
return mCapacityBytes - mUsedBytes - mBlockCapacityReserved;
} | java | private long getAvailableBytes(BlockWorkerInfo workerInfo) {
long mCapacityBytes = workerInfo.getCapacityBytes();
long mUsedBytes = workerInfo.getUsedBytes();
return mCapacityBytes - mUsedBytes - mBlockCapacityReserved;
} | [
"private",
"long",
"getAvailableBytes",
"(",
"BlockWorkerInfo",
"workerInfo",
")",
"{",
"long",
"mCapacityBytes",
"=",
"workerInfo",
".",
"getCapacityBytes",
"(",
")",
";",
"long",
"mUsedBytes",
"=",
"workerInfo",
".",
"getUsedBytes",
"(",
")",
";",
"return",
"m... | The information of BlockWorkerInfo is update after a file complete write. To avoid evict,
user should configure "alluxio.user.file.write.avoid.eviction.policy.reserved.size.bytes"
to reserve some space to store the block.
@param workerInfo BlockWorkerInfo of the worker
@return the available bytes of the worker | [
"The",
"information",
"of",
"BlockWorkerInfo",
"is",
"update",
"after",
"a",
"file",
"complete",
"write",
".",
"To",
"avoid",
"evict",
"user",
"should",
"configure",
"alluxio",
".",
"user",
".",
"file",
".",
"write",
".",
"avoid",
".",
"eviction",
".",
"po... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/policy/LocalFirstAvoidEvictionPolicy.java#L88-L92 |
18,357 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/RpcUtils.java | RpcUtils.streamingRPCAndLog | @Nullable
public static <T> T streamingRPCAndLog(Logger logger, StreamingRpcCallable<T> callable,
String methodName, String description, Object... args) {
// avoid string format for better performance if debug is off
String debugDesc = logger.isDebugEnabled() ? String.format(description, args) : null;
... | java | @Nullable
public static <T> T streamingRPCAndLog(Logger logger, StreamingRpcCallable<T> callable,
String methodName, String description, Object... args) {
// avoid string format for better performance if debug is off
String debugDesc = logger.isDebugEnabled() ? String.format(description, args) : null;
... | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"T",
"streamingRPCAndLog",
"(",
"Logger",
"logger",
",",
"StreamingRpcCallable",
"<",
"T",
">",
"callable",
",",
"String",
"methodName",
",",
"String",
"description",
",",
"Object",
"...",
"args",
")",
"{",... | Handles a streaming RPC callable with logging.
@param logger the logger to use for this call
@param callable the callable to call
@param methodName the name of the method, used for metrics
@param description the format string of the description, used for logging
@param args the arguments for the description
@param <T>... | [
"Handles",
"a",
"streaming",
"RPC",
"callable",
"with",
"logging",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/RpcUtils.java#L293-L310 |
18,358 | Alluxio/alluxio | minicluster/src/main/java/alluxio/multi/process/Master.java | Master.start | public synchronized void start() {
Preconditions.checkState(mProcess == null, "Master is already running");
LOG.info("Starting master with port {}", mProperties.get(PropertyKey.MASTER_RPC_PORT));
mProcess = new ExternalProcess(mProperties, LimitedLifeMasterProcess.class,
new File(mLogsDir, "master.o... | java | public synchronized void start() {
Preconditions.checkState(mProcess == null, "Master is already running");
LOG.info("Starting master with port {}", mProperties.get(PropertyKey.MASTER_RPC_PORT));
mProcess = new ExternalProcess(mProperties, LimitedLifeMasterProcess.class,
new File(mLogsDir, "master.o... | [
"public",
"synchronized",
"void",
"start",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"mProcess",
"==",
"null",
",",
"\"Master is already running\"",
")",
";",
"LOG",
".",
"info",
"(",
"\"Starting master with port {}\"",
",",
"mProperties",
".",
"get"... | Launches the master process. | [
"Launches",
"the",
"master",
"process",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/Master.java#L68-L78 |
18,359 | Alluxio/alluxio | examples/src/main/java/alluxio/cli/MiniBenchmark.java | MiniBenchmark.usage | private static void usage() {
new HelpFormatter().printHelp(String.format(
"java -cp %s %s -type <[READ, WRITE]> -fileSize <fileSize> -iterations <iterations> "
+ "-concurrency <concurrency>",
RuntimeConstants.ALLUXIO_JAR, MiniBenchmark.class.getCanonicalName()),
"run a mini benc... | java | private static void usage() {
new HelpFormatter().printHelp(String.format(
"java -cp %s %s -type <[READ, WRITE]> -fileSize <fileSize> -iterations <iterations> "
+ "-concurrency <concurrency>",
RuntimeConstants.ALLUXIO_JAR, MiniBenchmark.class.getCanonicalName()),
"run a mini benc... | [
"private",
"static",
"void",
"usage",
"(",
")",
"{",
"new",
"HelpFormatter",
"(",
")",
".",
"printHelp",
"(",
"String",
".",
"format",
"(",
"\"java -cp %s %s -type <[READ, WRITE]> -fileSize <fileSize> -iterations <iterations> \"",
"+",
"\"-concurrency <concurrency>\"",
",",... | Prints the usage. | [
"Prints",
"the",
"usage",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/cli/MiniBenchmark.java#L72-L79 |
18,360 | Alluxio/alluxio | examples/src/main/java/alluxio/cli/MiniBenchmark.java | MiniBenchmark.writeFile | private static void writeFile(CyclicBarrier barrier, AtomicLong runtime, int count,
AlluxioConfiguration alluxioConf)
throws Exception {
FileSystem fileSystem = FileSystem.Factory.create(alluxioConf);
byte[] buffer = new byte[(int) Math.min(sFileSize, 4 * Constants.MB)];
Arrays.fill(buffer, (byt... | java | private static void writeFile(CyclicBarrier barrier, AtomicLong runtime, int count,
AlluxioConfiguration alluxioConf)
throws Exception {
FileSystem fileSystem = FileSystem.Factory.create(alluxioConf);
byte[] buffer = new byte[(int) Math.min(sFileSize, 4 * Constants.MB)];
Arrays.fill(buffer, (byt... | [
"private",
"static",
"void",
"writeFile",
"(",
"CyclicBarrier",
"barrier",
",",
"AtomicLong",
"runtime",
",",
"int",
"count",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"Exception",
"{",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"Factory",
... | Writes a file.
@param count the count to determine the filename
@throws Exception if it fails to write | [
"Writes",
"a",
"file",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/cli/MiniBenchmark.java#L203-L225 |
18,361 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/block/meta/MasterBlockInfo.java | MasterBlockInfo.updateLength | public synchronized void updateLength(long length) {
if (mLength == Constants.UNKNOWN_SIZE) {
mLength = length;
} else if (mLength != length) {
LOG.warn("Attempting to update block length ({}) to a different length ({}).", mLength,
length);
}
} | java | public synchronized void updateLength(long length) {
if (mLength == Constants.UNKNOWN_SIZE) {
mLength = length;
} else if (mLength != length) {
LOG.warn("Attempting to update block length ({}) to a different length ({}).", mLength,
length);
}
} | [
"public",
"synchronized",
"void",
"updateLength",
"(",
"long",
"length",
")",
"{",
"if",
"(",
"mLength",
"==",
"Constants",
".",
"UNKNOWN_SIZE",
")",
"{",
"mLength",
"=",
"length",
";",
"}",
"else",
"if",
"(",
"mLength",
"!=",
"length",
")",
"{",
"LOG",
... | Updates the length, if and only if the length was previously unknown.
@param length the updated length | [
"Updates",
"the",
"length",
"if",
"and",
"only",
"if",
"the",
"length",
"was",
"previously",
"unknown",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterBlockInfo.java#L75-L82 |
18,362 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/block/meta/MasterBlockInfo.java | MasterBlockInfo.getBlockLocations | public List<MasterBlockLocation> getBlockLocations() {
List<MasterBlockLocation> ret = new ArrayList<>(mWorkerIdToAlias.size());
for (Map.Entry<Long, String> entry : mWorkerIdToAlias.entrySet()) {
ret.add(new MasterBlockLocation(entry.getKey(), entry.getValue()));
}
return ret;
} | java | public List<MasterBlockLocation> getBlockLocations() {
List<MasterBlockLocation> ret = new ArrayList<>(mWorkerIdToAlias.size());
for (Map.Entry<Long, String> entry : mWorkerIdToAlias.entrySet()) {
ret.add(new MasterBlockLocation(entry.getKey(), entry.getValue()));
}
return ret;
} | [
"public",
"List",
"<",
"MasterBlockLocation",
">",
"getBlockLocations",
"(",
")",
"{",
"List",
"<",
"MasterBlockLocation",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
"mWorkerIdToAlias",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Map",
".",
"Entry",... | Gets the net addresses for all workers which have the block's data in their tiered storage.
@return the net addresses of the workers | [
"Gets",
"the",
"net",
"addresses",
"for",
"all",
"workers",
"which",
"have",
"the",
"block",
"s",
"data",
"in",
"their",
"tiered",
"storage",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterBlockInfo.java#L129-L135 |
18,363 | Alluxio/alluxio | underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoOutputStream.java | KodoOutputStream.close | @Override
public void close() {
if (mClosed.getAndSet(true)) {
return;
}
try {
mLocalOutputStream.close();
mKodoClient.uploadFile(mKey, mFile);
} catch (Exception e) {
e.printStackTrace();
}
mFile.delete();
} | java | @Override
public void close() {
if (mClosed.getAndSet(true)) {
return;
}
try {
mLocalOutputStream.close();
mKodoClient.uploadFile(mKey, mFile);
} catch (Exception e) {
e.printStackTrace();
}
mFile.delete();
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"mClosed",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"mLocalOutputStream",
".",
"close",
"(",
")",
";",
"mKodoClient",
".",
"uploadFile",
"(",
"... | Closes this output stream. When an output stream is closed, the local temporary file is
uploaded to KODO Service. Once the file is uploaded, the temporary file is deleted. | [
"Closes",
"this",
"output",
"stream",
".",
"When",
"an",
"output",
"stream",
"is",
"closed",
"the",
"local",
"temporary",
"file",
"is",
"uploaded",
"to",
"KODO",
"Service",
".",
"Once",
"the",
"file",
"is",
"uploaded",
"the",
"temporary",
"file",
"is",
"de... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoOutputStream.java#L107-L119 |
18,364 | Alluxio/alluxio | shell/src/main/java/alluxio/proxy/AlluxioProxyMonitor.java | AlluxioProxyMonitor.main | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioProxyMonitor.class.getCanonicalName());
LOG.warn("ignoring arguments");
}
HealthCheckClient client = new ProxyHealthCheckClient(
NetworkAddressUtils... | java | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioProxyMonitor.class.getCanonicalName());
LOG.warn("ignoring arguments");
}
HealthCheckClient client = new ProxyHealthCheckClient(
NetworkAddressUtils... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"0",
")",
"{",
"LOG",
".",
"info",
"(",
"\"java -cp {} {}\"",
",",
"RuntimeConstants",
".",
"ALLUXIO_JAR",
",",
"AlluxioProxyMonitor",
... | Starts the Alluxio proxy monitor.
@param args command line arguments, should be empty | [
"Starts",
"the",
"Alluxio",
"proxy",
"monitor",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/proxy/AlluxioProxyMonitor.java#L35-L50 |
18,365 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/DuCommand.java | DuCommand.getSizeInfo | private void getSizeInfo(AlluxioURI path, List<URIStatus> statuses,
boolean readable, boolean summarize, boolean addMemory) {
if (summarize) {
long totalSize = 0;
long sizeInAlluxio = 0;
long sizeInMem = 0;
for (URIStatus status : statuses) {
if (!status.isFolder()) {
... | java | private void getSizeInfo(AlluxioURI path, List<URIStatus> statuses,
boolean readable, boolean summarize, boolean addMemory) {
if (summarize) {
long totalSize = 0;
long sizeInAlluxio = 0;
long sizeInMem = 0;
for (URIStatus status : statuses) {
if (!status.isFolder()) {
... | [
"private",
"void",
"getSizeInfo",
"(",
"AlluxioURI",
"path",
",",
"List",
"<",
"URIStatus",
">",
"statuses",
",",
"boolean",
"readable",
",",
"boolean",
"summarize",
",",
"boolean",
"addMemory",
")",
"{",
"if",
"(",
"summarize",
")",
"{",
"long",
"totalSize"... | Gets and prints the size information of the input path according to options.
@param path the path to get size info of
@param statuses the statuses of files and folders
@param readable whether to print info of human readable format
@param summarize whether to display the aggregate summary lengths
@param addMemory wheth... | [
"Gets",
"and",
"prints",
"the",
"size",
"information",
"of",
"the",
"input",
"path",
"according",
"to",
"options",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/DuCommand.java#L111-L145 |
18,366 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/DuCommand.java | DuCommand.getFormattedValues | private String getFormattedValues(boolean readable, long size, long totalSize) {
// If size is 1, total size is 5, and readable is true, it will
// return a string as "1B (20%)"
int percent = totalSize == 0 ? 0 : (int) (size * 100 / totalSize);
String subSizeMessage = readable ? FormatUtils.getSizeFromB... | java | private String getFormattedValues(boolean readable, long size, long totalSize) {
// If size is 1, total size is 5, and readable is true, it will
// return a string as "1B (20%)"
int percent = totalSize == 0 ? 0 : (int) (size * 100 / totalSize);
String subSizeMessage = readable ? FormatUtils.getSizeFromB... | [
"private",
"String",
"getFormattedValues",
"(",
"boolean",
"readable",
",",
"long",
"size",
",",
"long",
"totalSize",
")",
"{",
"// If size is 1, total size is 5, and readable is true, it will",
"// return a string as \"1B (20%)\"",
"int",
"percent",
"=",
"totalSize",
"==",
... | Gets the size and its percentage information, if readable option is provided,
get the size in human readable format.
@param readable whether to print info of human readable format
@param size the size to get information from
@param totalSize the total size to calculate percentage information
@return the formatted valu... | [
"Gets",
"the",
"size",
"and",
"its",
"percentage",
"information",
"if",
"readable",
"option",
"is",
"provided",
"get",
"the",
"size",
"in",
"human",
"readable",
"format",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/DuCommand.java#L156-L163 |
18,367 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/DuCommand.java | DuCommand.printInfo | private void printInfo(String sizeMessage,
String inAlluxioMessage, String inMemMessage, String path) {
System.out.println(inMemMessage.isEmpty()
? String.format(SHORT_INFO_FORMAT, sizeMessage, inAlluxioMessage, path)
: String.format(LONG_INFO_FORMAT, sizeMessage, inAlluxioMessage, inMemMessag... | java | private void printInfo(String sizeMessage,
String inAlluxioMessage, String inMemMessage, String path) {
System.out.println(inMemMessage.isEmpty()
? String.format(SHORT_INFO_FORMAT, sizeMessage, inAlluxioMessage, path)
: String.format(LONG_INFO_FORMAT, sizeMessage, inAlluxioMessage, inMemMessag... | [
"private",
"void",
"printInfo",
"(",
"String",
"sizeMessage",
",",
"String",
"inAlluxioMessage",
",",
"String",
"inMemMessage",
",",
"String",
"path",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"inMemMessage",
".",
"isEmpty",
"(",
")",
"?",
"String... | Prints the size messages.
@param sizeMessage the total size message to print
@param inAlluxioMessage the in Alluxio size message to print
@param inMemMessage the in memory size message to print
@param path the path to print | [
"Prints",
"the",
"size",
"messages",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/DuCommand.java#L173-L178 |
18,368 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/LogUtils.java | LogUtils.setLogLevel | public static LogInfo setLogLevel(String logName, String level) throws IOException {
LogInfo result = new LogInfo();
if (StringUtils.isNotBlank(logName)) {
result.setLogName(logName);
Log log = LogFactory.getLog(logName);
Logger logger = LoggerFactory.getLogger(logName);
if (log instance... | java | public static LogInfo setLogLevel(String logName, String level) throws IOException {
LogInfo result = new LogInfo();
if (StringUtils.isNotBlank(logName)) {
result.setLogName(logName);
Log log = LogFactory.getLog(logName);
Logger logger = LoggerFactory.getLogger(logName);
if (log instance... | [
"public",
"static",
"LogInfo",
"setLogLevel",
"(",
"String",
"logName",
",",
"String",
"level",
")",
"throws",
"IOException",
"{",
"LogInfo",
"result",
"=",
"new",
"LogInfo",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"logName",
")",
... | Gets a logger's level with specify name, if the level argument is not null, it will set to
specify level first.
@param logName logger's name
@param level logger's level
@return an entity object about the log info
@throws IOException if an I/O error occurs | [
"Gets",
"a",
"logger",
"s",
"level",
"with",
"specify",
"name",
"if",
"the",
"level",
"argument",
"is",
"not",
"null",
"it",
"will",
"set",
"to",
"specify",
"level",
"first",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/LogUtils.java#L47-L73 |
18,369 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/LogUtils.java | LogUtils.warnWithException | public static void warnWithException(Logger logger, String message, Object ...args) {
if (logger.isDebugEnabled()) {
logger.debug(message, args);
} else {
if (args.length > 0 && args[args.length - 1] instanceof Throwable) {
args[args.length - 1] = ((Throwable) args[args.length - 1]).getMessa... | java | public static void warnWithException(Logger logger, String message, Object ...args) {
if (logger.isDebugEnabled()) {
logger.debug(message, args);
} else {
if (args.length > 0 && args[args.length - 1] instanceof Throwable) {
args[args.length - 1] = ((Throwable) args[args.length - 1]).getMessa... | [
"public",
"static",
"void",
"warnWithException",
"(",
"Logger",
"logger",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"message",
",",
"args... | Log a warning message with full exception if debug logging is enabled,
or just the message otherwise.
@param logger the logger to be used
@param message the message to be logged
@param args the arguments for the message | [
"Log",
"a",
"warning",
"message",
"with",
"full",
"exception",
"if",
"debug",
"logging",
"is",
"enabled",
"or",
"just",
"the",
"message",
"otherwise",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/LogUtils.java#L125-L134 |
18,370 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/LoginUser.java | LoginUser.get | public static User get(AlluxioConfiguration conf) throws UnauthenticatedException {
if (sLoginUser == null) {
synchronized (LoginUser.class) {
if (sLoginUser == null) {
sLoginUser = login(conf);
}
}
}
return sLoginUser;
} | java | public static User get(AlluxioConfiguration conf) throws UnauthenticatedException {
if (sLoginUser == null) {
synchronized (LoginUser.class) {
if (sLoginUser == null) {
sLoginUser = login(conf);
}
}
}
return sLoginUser;
} | [
"public",
"static",
"User",
"get",
"(",
"AlluxioConfiguration",
"conf",
")",
"throws",
"UnauthenticatedException",
"{",
"if",
"(",
"sLoginUser",
"==",
"null",
")",
"{",
"synchronized",
"(",
"LoginUser",
".",
"class",
")",
"{",
"if",
"(",
"sLoginUser",
"==",
... | Gets current singleton login user. This method is called to identify the singleton user who
runs Alluxio client. When Alluxio client gets a user by this method and connects to Alluxio
service, this user represents the client and is maintained in service.
Note that until if the authentication type or login user changes... | [
"Gets",
"current",
"singleton",
"login",
"user",
".",
"This",
"method",
"is",
"called",
"to",
"identify",
"the",
"singleton",
"user",
"who",
"runs",
"Alluxio",
"client",
".",
"When",
"Alluxio",
"client",
"gets",
"a",
"user",
"by",
"this",
"method",
"and",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/LoginUser.java#L61-L70 |
18,371 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/LoginUser.java | LoginUser.login | private static User login(AlluxioConfiguration conf) throws UnauthenticatedException {
AuthType authType = conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class);
checkSecurityEnabled(authType);
Subject subject = new Subject();
try {
// Use the class loader of User.class to constr... | java | private static User login(AlluxioConfiguration conf) throws UnauthenticatedException {
AuthType authType = conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class);
checkSecurityEnabled(authType);
Subject subject = new Subject();
try {
// Use the class loader of User.class to constr... | [
"private",
"static",
"User",
"login",
"(",
"AlluxioConfiguration",
"conf",
")",
"throws",
"UnauthenticatedException",
"{",
"AuthType",
"authType",
"=",
"conf",
".",
"getEnum",
"(",
"PropertyKey",
".",
"SECURITY_AUTHENTICATION_TYPE",
",",
"AuthType",
".",
"class",
")... | Logs in based on the LoginModules.
@return the login user | [
"Logs",
"in",
"based",
"on",
"the",
"LoginModules",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/LoginUser.java#L77-L107 |
18,372 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/PrimarySelectorClient.java | PrimarySelectorClient.start | @Override
public void start(InetSocketAddress address) throws IOException {
mName = address.getHostName() + ":" + address.getPort();
mLeaderSelector.setId(mName);
mLeaderSelector.start();
} | java | @Override
public void start(InetSocketAddress address) throws IOException {
mName = address.getHostName() + ":" + address.getPort();
mLeaderSelector.setId(mName);
mLeaderSelector.start();
} | [
"@",
"Override",
"public",
"void",
"start",
"(",
"InetSocketAddress",
"address",
")",
"throws",
"IOException",
"{",
"mName",
"=",
"address",
".",
"getHostName",
"(",
")",
"+",
"\":\"",
"+",
"address",
".",
"getPort",
"(",
")",
";",
"mLeaderSelector",
".",
... | Starts the leader selection. If the leader selector client loses connection to Zookeeper or
gets closed, the calling thread will be interrupted. | [
"Starts",
"the",
"leader",
"selection",
".",
"If",
"the",
"leader",
"selector",
"client",
"loses",
"connection",
"to",
"Zookeeper",
"or",
"gets",
"closed",
"the",
"calling",
"thread",
"will",
"be",
"interrupted",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/PrimarySelectorClient.java#L126-L131 |
18,373 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/PrimarySelectorClient.java | PrimarySelectorClient.getNewCuratorClient | private CuratorFramework getNewCuratorClient() {
CuratorFramework client = CuratorFrameworkFactory.newClient(mZookeeperAddress,
(int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_SESSION_TIMEOUT),
(int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_CONNECTION_TIMEOUT),
new ExponentialBa... | java | private CuratorFramework getNewCuratorClient() {
CuratorFramework client = CuratorFrameworkFactory.newClient(mZookeeperAddress,
(int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_SESSION_TIMEOUT),
(int) ServerConfiguration.getMs(PropertyKey.ZOOKEEPER_CONNECTION_TIMEOUT),
new ExponentialBa... | [
"private",
"CuratorFramework",
"getNewCuratorClient",
"(",
")",
"{",
"CuratorFramework",
"client",
"=",
"CuratorFrameworkFactory",
".",
"newClient",
"(",
"mZookeeperAddress",
",",
"(",
"int",
")",
"ServerConfiguration",
".",
"getMs",
"(",
"PropertyKey",
".",
"ZOOKEEPE... | Returns a new client for the zookeeper connection. The client is already started before
returning.
@return a new {@link CuratorFramework} client to use for leader selection | [
"Returns",
"a",
"new",
"client",
"for",
"the",
"zookeeper",
"connection",
".",
"The",
"client",
"is",
"already",
"started",
"before",
"returning",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/PrimarySelectorClient.java#L176-L193 |
18,374 | Alluxio/alluxio | core/common/src/main/java/alluxio/metrics/MetricsConfig.java | MetricsConfig.subProperties | public static Map<String, Properties> subProperties(Properties prop, String regex) {
Map<String, Properties> subProperties = new HashMap<>();
Pattern pattern = Pattern.compile(regex);
for (Map.Entry<Object, Object> entry : prop.entrySet()) {
Matcher m = pattern.matcher(entry.getKey().toString());
... | java | public static Map<String, Properties> subProperties(Properties prop, String regex) {
Map<String, Properties> subProperties = new HashMap<>();
Pattern pattern = Pattern.compile(regex);
for (Map.Entry<Object, Object> entry : prop.entrySet()) {
Matcher m = pattern.matcher(entry.getKey().toString());
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Properties",
">",
"subProperties",
"(",
"Properties",
"prop",
",",
"String",
"regex",
")",
"{",
"Map",
"<",
"String",
",",
"Properties",
">",
"subProperties",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Pa... | Uses regex to parse every original property key to a prefix and a suffix. Creates sub
properties that are grouped by the prefix.
@param prop the original properties
@param regex prefix and suffix pattern
@return a {@code Map} from the prefix to its properties | [
"Uses",
"regex",
"to",
"parse",
"every",
"original",
"property",
"key",
"to",
"a",
"prefix",
"and",
"a",
"suffix",
".",
"Creates",
"sub",
"properties",
"that",
"are",
"grouped",
"by",
"the",
"prefix",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsConfig.java#L76-L92 |
18,375 | Alluxio/alluxio | core/common/src/main/java/alluxio/metrics/MetricsConfig.java | MetricsConfig.loadConfigFile | private void loadConfigFile(String configFile) {
try (InputStream is = new FileInputStream(configFile)) {
mProperties.load(is);
} catch (Exception e) {
LOG.error("Error loading metrics configuration file.", e);
}
} | java | private void loadConfigFile(String configFile) {
try (InputStream is = new FileInputStream(configFile)) {
mProperties.load(is);
} catch (Exception e) {
LOG.error("Error loading metrics configuration file.", e);
}
} | [
"private",
"void",
"loadConfigFile",
"(",
"String",
"configFile",
")",
"{",
"try",
"(",
"InputStream",
"is",
"=",
"new",
"FileInputStream",
"(",
"configFile",
")",
")",
"{",
"mProperties",
".",
"load",
"(",
"is",
")",
";",
"}",
"catch",
"(",
"Exception",
... | Loads the metrics configuration file.
@param configFile the metrics config file | [
"Loads",
"the",
"metrics",
"configuration",
"file",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsConfig.java#L99-L105 |
18,376 | Alluxio/alluxio | core/common/src/main/java/alluxio/metrics/MetricsConfig.java | MetricsConfig.removeInstancePrefix | private void removeInstancePrefix() {
Properties newProperties = new Properties();
for (Map.Entry<Object, Object> entry : mProperties.entrySet()) {
String key = entry.getKey().toString();
if (key.startsWith("*") || key.startsWith("worker") || key.startsWith("master")) {
String newKey = key.... | java | private void removeInstancePrefix() {
Properties newProperties = new Properties();
for (Map.Entry<Object, Object> entry : mProperties.entrySet()) {
String key = entry.getKey().toString();
if (key.startsWith("*") || key.startsWith("worker") || key.startsWith("master")) {
String newKey = key.... | [
"private",
"void",
"removeInstancePrefix",
"(",
")",
"{",
"Properties",
"newProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
":",
"mProperties",
".",
"entrySet",
"(",
")",
... | Removes the instance prefix in the properties. This is to make the configuration
parsing logic backward compatible with old configuration format. | [
"Removes",
"the",
"instance",
"prefix",
"in",
"the",
"properties",
".",
"This",
"is",
"to",
"make",
"the",
"configuration",
"parsing",
"logic",
"backward",
"compatible",
"with",
"old",
"configuration",
"format",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsConfig.java#L111-L124 |
18,377 | Alluxio/alluxio | examples/src/main/java/alluxio/examples/Performance.java | Performance.logPerIteration | public static void logPerIteration(long startTimeMs, int times, String msg, int workerId) {
long takenTimeMs = System.currentTimeMillis() - startTimeMs;
double result = 1000.0 * sFileBytes / takenTimeMs / 1024 / 1024;
LOG.info(times + msg + workerId + " : " + result + " Mb/sec. Took " + takenTimeMs + " ms. ... | java | public static void logPerIteration(long startTimeMs, int times, String msg, int workerId) {
long takenTimeMs = System.currentTimeMillis() - startTimeMs;
double result = 1000.0 * sFileBytes / takenTimeMs / 1024 / 1024;
LOG.info(times + msg + workerId + " : " + result + " Mb/sec. Took " + takenTimeMs + " ms. ... | [
"public",
"static",
"void",
"logPerIteration",
"(",
"long",
"startTimeMs",
",",
"int",
"times",
",",
"String",
"msg",
",",
"int",
"workerId",
")",
"{",
"long",
"takenTimeMs",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"startTimeMs",
";",
"double... | Writes log information.
@param startTimeMs the start time in milliseconds
@param times the number of the iteration
@param msg the message
@param workerId the id of the worker | [
"Writes",
"log",
"information",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/examples/Performance.java#L75-L79 |
18,378 | Alluxio/alluxio | core/common/src/main/java/alluxio/metrics/sink/CsvSink.java | CsvSink.getPollDir | private String getPollDir() {
String pollDir = mProperties.getProperty(CSV_KEY_DIR);
return pollDir != null ? pollDir : CSV_DEFAULT_DIR;
} | java | private String getPollDir() {
String pollDir = mProperties.getProperty(CSV_KEY_DIR);
return pollDir != null ? pollDir : CSV_DEFAULT_DIR;
} | [
"private",
"String",
"getPollDir",
"(",
")",
"{",
"String",
"pollDir",
"=",
"mProperties",
".",
"getProperty",
"(",
"CSV_KEY_DIR",
")",
";",
"return",
"pollDir",
"!=",
"null",
"?",
"pollDir",
":",
"CSV_DEFAULT_DIR",
";",
"}"
] | Gets the directory where the CSV files are created.
@return the polling directory set by properties. If it is not set, a default value /tmp/ is
returned. | [
"Gets",
"the",
"directory",
"where",
"the",
"CSV",
"files",
"are",
"created",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/sink/CsvSink.java#L79-L82 |
18,379 | Alluxio/alluxio | core/common/src/main/java/alluxio/retry/RetryUtils.java | RetryUtils.retry | public static void retry(String action, RunnableThrowsIOException f, RetryPolicy policy)
throws IOException {
IOException e = null;
while (policy.attempt()) {
try {
f.run();
return;
} catch (IOException ioe) {
e = ioe;
LOG.warn("Failed to {} (attempt {}): {}", a... | java | public static void retry(String action, RunnableThrowsIOException f, RetryPolicy policy)
throws IOException {
IOException e = null;
while (policy.attempt()) {
try {
f.run();
return;
} catch (IOException ioe) {
e = ioe;
LOG.warn("Failed to {} (attempt {}): {}", a... | [
"public",
"static",
"void",
"retry",
"(",
"String",
"action",
",",
"RunnableThrowsIOException",
"f",
",",
"RetryPolicy",
"policy",
")",
"throws",
"IOException",
"{",
"IOException",
"e",
"=",
"null",
";",
"while",
"(",
"policy",
".",
"attempt",
"(",
")",
")",... | Retries the given method until it doesn't throw an IO exception or the retry policy expires. If
the retry policy expires, the last exception generated will be rethrown.
@param action a description of the action that fits the phrase "Failed to ${action}"
@param f the function to retry
@param policy the retry policy to ... | [
"Retries",
"the",
"given",
"method",
"until",
"it",
"doesn",
"t",
"throw",
"an",
"IO",
"exception",
"or",
"the",
"retry",
"policy",
"expires",
".",
"If",
"the",
"retry",
"policy",
"expires",
"the",
"last",
"exception",
"generated",
"will",
"be",
"rethrown",
... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/retry/RetryUtils.java#L34-L47 |
18,380 | Alluxio/alluxio | core/common/src/main/java/alluxio/retry/RetryUtils.java | RetryUtils.defaultClientRetry | public static RetryPolicy defaultClientRetry(Duration maxRetryDuration, Duration baseSleepMs,
Duration maxSleepMs) {
return ExponentialTimeBoundedRetry.builder()
.withMaxDuration(maxRetryDuration)
.withInitialSleep(baseSleepMs)
.withMaxSleep(maxSleepMs)
.build();
} | java | public static RetryPolicy defaultClientRetry(Duration maxRetryDuration, Duration baseSleepMs,
Duration maxSleepMs) {
return ExponentialTimeBoundedRetry.builder()
.withMaxDuration(maxRetryDuration)
.withInitialSleep(baseSleepMs)
.withMaxSleep(maxSleepMs)
.build();
} | [
"public",
"static",
"RetryPolicy",
"defaultClientRetry",
"(",
"Duration",
"maxRetryDuration",
",",
"Duration",
"baseSleepMs",
",",
"Duration",
"maxSleepMs",
")",
"{",
"return",
"ExponentialTimeBoundedRetry",
".",
"builder",
"(",
")",
".",
"withMaxDuration",
"(",
"maxR... | Gives a ClientRetry based on the given parameters.
@param maxRetryDuration the maximum total duration to retry for
@param baseSleepMs initial sleep time in milliseconds
@param maxSleepMs max sleep time in milliseconds
@return the default client retry | [
"Gives",
"a",
"ClientRetry",
"based",
"on",
"the",
"given",
"parameters",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/retry/RetryUtils.java#L57-L64 |
18,381 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/MultiMasterLocalAlluxioCluster.java | MultiMasterLocalAlluxioCluster.stopStandby | public boolean stopStandby() {
for (int k = 0; k < mNumOfMasters; k++) {
if (!mMasters.get(k).isServing()) {
try {
LOG.info("master {} is a standby. stopping it...", k);
mMasters.get(k).stop();
LOG.info("master {} stopped.", k);
} catch (Exception e) {
L... | java | public boolean stopStandby() {
for (int k = 0; k < mNumOfMasters; k++) {
if (!mMasters.get(k).isServing()) {
try {
LOG.info("master {} is a standby. stopping it...", k);
mMasters.get(k).stop();
LOG.info("master {} stopped.", k);
} catch (Exception e) {
L... | [
"public",
"boolean",
"stopStandby",
"(",
")",
"{",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"mNumOfMasters",
";",
"k",
"++",
")",
"{",
"if",
"(",
"!",
"mMasters",
".",
"get",
"(",
"k",
")",
".",
"isServing",
"(",
")",
")",
"{",
"try",
... | Iterates over the masters in the order of master creation, stops the first standby master.
@return true if a standby master is successfully stopped, otherwise, false | [
"Iterates",
"over",
"the",
"masters",
"in",
"the",
"order",
"of",
"master",
"creation",
"stops",
"the",
"first",
"standby",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/MultiMasterLocalAlluxioCluster.java#L154-L169 |
18,382 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/MultiMasterLocalAlluxioCluster.java | MultiMasterLocalAlluxioCluster.waitForNewMaster | public void waitForNewMaster(int timeoutMs) throws TimeoutException, InterruptedException {
CommonUtils.waitFor("the new leader master to start", () -> getLeaderIndex() != -1,
WaitForOptions.defaults().setTimeoutMs(timeoutMs));
} | java | public void waitForNewMaster(int timeoutMs) throws TimeoutException, InterruptedException {
CommonUtils.waitFor("the new leader master to start", () -> getLeaderIndex() != -1,
WaitForOptions.defaults().setTimeoutMs(timeoutMs));
} | [
"public",
"void",
"waitForNewMaster",
"(",
"int",
"timeoutMs",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
"{",
"CommonUtils",
".",
"waitFor",
"(",
"\"the new leader master to start\"",
",",
"(",
")",
"->",
"getLeaderIndex",
"(",
")",
"!=",
"-",
... | Waits for a new master to start until a timeout occurs.
@param timeoutMs the number of milliseconds to wait before giving up and throwing an exception | [
"Waits",
"for",
"a",
"new",
"master",
"to",
"start",
"until",
"a",
"timeout",
"occurs",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/MultiMasterLocalAlluxioCluster.java#L198-L201 |
18,383 | Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcUtils.java | GrpcUtils.toGetStatusOptions | public static GetStatusPOptions toGetStatusOptions(ExistsPOptions existsOptions) {
GetStatusPOptions.Builder getStatusOptionsBuilder = GetStatusPOptions.newBuilder();
if (existsOptions.hasCommonOptions()) {
getStatusOptionsBuilder.setCommonOptions(existsOptions.getCommonOptions());
}
if (existsOpt... | java | public static GetStatusPOptions toGetStatusOptions(ExistsPOptions existsOptions) {
GetStatusPOptions.Builder getStatusOptionsBuilder = GetStatusPOptions.newBuilder();
if (existsOptions.hasCommonOptions()) {
getStatusOptionsBuilder.setCommonOptions(existsOptions.getCommonOptions());
}
if (existsOpt... | [
"public",
"static",
"GetStatusPOptions",
"toGetStatusOptions",
"(",
"ExistsPOptions",
"existsOptions",
")",
"{",
"GetStatusPOptions",
".",
"Builder",
"getStatusOptionsBuilder",
"=",
"GetStatusPOptions",
".",
"newBuilder",
"(",
")",
";",
"if",
"(",
"existsOptions",
".",
... | Converts from proto type to options.
@param existsOptions the proto options to convert
@return the converted proto options | [
"Converts",
"from",
"proto",
"type",
"to",
"options",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcUtils.java#L59-L68 |
18,384 | Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcUtils.java | GrpcUtils.toProto | public static alluxio.grpc.FileInfo toProto(FileInfo fileInfo) {
List<alluxio.grpc.FileBlockInfo> fileBlockInfos = new ArrayList<>();
for (FileBlockInfo fileBlockInfo : fileInfo.getFileBlockInfos()) {
fileBlockInfos.add(toProto(fileBlockInfo));
}
alluxio.grpc.FileInfo.Builder builder = alluxio.grp... | java | public static alluxio.grpc.FileInfo toProto(FileInfo fileInfo) {
List<alluxio.grpc.FileBlockInfo> fileBlockInfos = new ArrayList<>();
for (FileBlockInfo fileBlockInfo : fileInfo.getFileBlockInfos()) {
fileBlockInfos.add(toProto(fileBlockInfo));
}
alluxio.grpc.FileInfo.Builder builder = alluxio.grp... | [
"public",
"static",
"alluxio",
".",
"grpc",
".",
"FileInfo",
"toProto",
"(",
"FileInfo",
"fileInfo",
")",
"{",
"List",
"<",
"alluxio",
".",
"grpc",
".",
"FileBlockInfo",
">",
"fileBlockInfos",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Fi... | Converts a wire type to a proto type.
@param fileInfo the wire representation of a file information
@return proto representation of the file information | [
"Converts",
"a",
"wire",
"type",
"to",
"a",
"proto",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcUtils.java#L434-L465 |
18,385 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/FileSystemCommandUtils.java | FileSystemCommandUtils.setTtl | public static void setTtl(FileSystem fs, AlluxioURI path, long ttlMs,
TtlAction ttlAction) throws AlluxioException, IOException {
SetAttributePOptions options = SetAttributePOptions.newBuilder().setRecursive(true)
.setCommonOptions(FileSystemMasterCommonPOptions.newBuilder()
.setTtl(ttlMs)... | java | public static void setTtl(FileSystem fs, AlluxioURI path, long ttlMs,
TtlAction ttlAction) throws AlluxioException, IOException {
SetAttributePOptions options = SetAttributePOptions.newBuilder().setRecursive(true)
.setCommonOptions(FileSystemMasterCommonPOptions.newBuilder()
.setTtl(ttlMs)... | [
"public",
"static",
"void",
"setTtl",
"(",
"FileSystem",
"fs",
",",
"AlluxioURI",
"path",
",",
"long",
"ttlMs",
",",
"TtlAction",
"ttlAction",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"SetAttributePOptions",
"options",
"=",
"SetAttributePOptions",... | Sets a new TTL value or unsets an existing TTL value for file at path.
@param fs the file system for Alluxio
@param path the file path
@param ttlMs the TTL (time to live) value to use; it identifies duration (in milliseconds) the
created file should be kept around before it is automatically deleted, irrespective of
wh... | [
"Sets",
"a",
"new",
"TTL",
"value",
"or",
"unsets",
"an",
"existing",
"TTL",
"value",
"for",
"file",
"at",
"path",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/FileSystemCommandUtils.java#L44-L51 |
18,386 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/FileSystemCommandUtils.java | FileSystemCommandUtils.setPinned | public static void setPinned(FileSystem fs, AlluxioURI path, boolean pinned)
throws AlluxioException, IOException {
SetAttributePOptions options = SetAttributePOptions.newBuilder().setPinned(pinned).build();
fs.setAttribute(path, options);
} | java | public static void setPinned(FileSystem fs, AlluxioURI path, boolean pinned)
throws AlluxioException, IOException {
SetAttributePOptions options = SetAttributePOptions.newBuilder().setPinned(pinned).build();
fs.setAttribute(path, options);
} | [
"public",
"static",
"void",
"setPinned",
"(",
"FileSystem",
"fs",
",",
"AlluxioURI",
"path",
",",
"boolean",
"pinned",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"SetAttributePOptions",
"options",
"=",
"SetAttributePOptions",
".",
"newBuilder",
"(",... | Sets pin state for the input path.
@param fs The {@link FileSystem} client
@param path The {@link AlluxioURI} path as the input of the command
@param pinned the state to be set | [
"Sets",
"pin",
"state",
"for",
"the",
"input",
"path",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/FileSystemCommandUtils.java#L60-L64 |
18,387 | Alluxio/alluxio | core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java | AlluxioStatusException.fromCheckedException | public static AlluxioStatusException fromCheckedException(Throwable throwable) {
try {
throw throwable;
} catch (IOException e) {
return fromIOException(e);
} catch (AlluxioException e) {
return fromAlluxioException(e);
} catch (InterruptedException e) {
return new CancelledExcep... | java | public static AlluxioStatusException fromCheckedException(Throwable throwable) {
try {
throw throwable;
} catch (IOException e) {
return fromIOException(e);
} catch (AlluxioException e) {
return fromAlluxioException(e);
} catch (InterruptedException e) {
return new CancelledExcep... | [
"public",
"static",
"AlluxioStatusException",
"fromCheckedException",
"(",
"Throwable",
"throwable",
")",
"{",
"try",
"{",
"throw",
"throwable",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"return",
"fromIOException",
"(",
"e",
")",
";",
"}",
"catch"... | Converts checked throwables to Alluxio status exceptions. Unchecked throwables should not be
passed to this method. Use Throwables.propagateIfPossible before passing a Throwable to this
method.
@param throwable a throwable
@return the converted {@link AlluxioStatusException} | [
"Converts",
"checked",
"throwables",
"to",
"Alluxio",
"status",
"exceptions",
".",
"Unchecked",
"throwables",
"should",
"not",
"be",
"passed",
"to",
"this",
"method",
".",
"Use",
"Throwables",
".",
"propagateIfPossible",
"before",
"passing",
"a",
"Throwable",
"to"... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java#L166-L182 |
18,388 | Alluxio/alluxio | core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java | AlluxioStatusException.fromStatusRuntimeException | public static AlluxioStatusException fromStatusRuntimeException(StatusRuntimeException e) {
return AlluxioStatusException.from(e.getStatus().withCause(e));
} | java | public static AlluxioStatusException fromStatusRuntimeException(StatusRuntimeException e) {
return AlluxioStatusException.from(e.getStatus().withCause(e));
} | [
"public",
"static",
"AlluxioStatusException",
"fromStatusRuntimeException",
"(",
"StatusRuntimeException",
"e",
")",
"{",
"return",
"AlluxioStatusException",
".",
"from",
"(",
"e",
".",
"getStatus",
"(",
")",
".",
"withCause",
"(",
"e",
")",
")",
";",
"}"
] | Converts a gRPC StatusRuntimeException to an Alluxio status exception.
@param e a gRPC StatusRuntimeException
@return the converted {@link AlluxioStatusException} | [
"Converts",
"a",
"gRPC",
"StatusRuntimeException",
"to",
"an",
"Alluxio",
"status",
"exception",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java#L208-L210 |
18,389 | Alluxio/alluxio | core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java | AlluxioStatusException.fromAlluxioException | public static AlluxioStatusException fromAlluxioException(AlluxioException ae) {
try {
throw ae;
} catch (AccessControlException e) {
return new PermissionDeniedException(e);
} catch (BlockAlreadyExistsException | FileAlreadyCompletedException
| FileAlreadyExistsException e) {
retu... | java | public static AlluxioStatusException fromAlluxioException(AlluxioException ae) {
try {
throw ae;
} catch (AccessControlException e) {
return new PermissionDeniedException(e);
} catch (BlockAlreadyExistsException | FileAlreadyCompletedException
| FileAlreadyExistsException e) {
retu... | [
"public",
"static",
"AlluxioStatusException",
"fromAlluxioException",
"(",
"AlluxioException",
"ae",
")",
"{",
"try",
"{",
"throw",
"ae",
";",
"}",
"catch",
"(",
"AccessControlException",
"e",
")",
"{",
"return",
"new",
"PermissionDeniedException",
"(",
"e",
")",
... | Converts checked Alluxio exceptions to Alluxio status exceptions.
@param ae the Alluxio exception to convert
@return the converted {@link AlluxioStatusException} | [
"Converts",
"checked",
"Alluxio",
"exceptions",
"to",
"Alluxio",
"status",
"exceptions",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/exception/status/AlluxioStatusException.java#L218-L241 |
18,390 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/ProtobufUtils.java | ProtobufUtils.fromProtobuf | public static TtlAction fromProtobuf(PTtlAction pTtlAction) {
if (pTtlAction == null) {
return TtlAction.DELETE;
}
switch (pTtlAction) {
case DELETE:
return TtlAction.DELETE;
case FREE:
return TtlAction.FREE;
default:
throw new IllegalStateException("Unknown p... | java | public static TtlAction fromProtobuf(PTtlAction pTtlAction) {
if (pTtlAction == null) {
return TtlAction.DELETE;
}
switch (pTtlAction) {
case DELETE:
return TtlAction.DELETE;
case FREE:
return TtlAction.FREE;
default:
throw new IllegalStateException("Unknown p... | [
"public",
"static",
"TtlAction",
"fromProtobuf",
"(",
"PTtlAction",
"pTtlAction",
")",
"{",
"if",
"(",
"pTtlAction",
"==",
"null",
")",
"{",
"return",
"TtlAction",
".",
"DELETE",
";",
"}",
"switch",
"(",
"pTtlAction",
")",
"{",
"case",
"DELETE",
":",
"retu... | Converts Protobuf type to Wire type.
@param pTtlAction {@link PTtlAction}
@return {@link TtlAction} equivalent | [
"Converts",
"Protobuf",
"type",
"to",
"Wire",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/ProtobufUtils.java#L33-L45 |
18,391 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/ProtobufUtils.java | ProtobufUtils.toProtobuf | public static PTtlAction toProtobuf(TtlAction ttlAction) {
if (ttlAction == null) {
return PTtlAction.DELETE;
}
switch (ttlAction) {
case DELETE:
return PTtlAction.DELETE;
case FREE:
return PTtlAction.FREE;
default:
throw new IllegalStateException("Unknown ttl... | java | public static PTtlAction toProtobuf(TtlAction ttlAction) {
if (ttlAction == null) {
return PTtlAction.DELETE;
}
switch (ttlAction) {
case DELETE:
return PTtlAction.DELETE;
case FREE:
return PTtlAction.FREE;
default:
throw new IllegalStateException("Unknown ttl... | [
"public",
"static",
"PTtlAction",
"toProtobuf",
"(",
"TtlAction",
"ttlAction",
")",
"{",
"if",
"(",
"ttlAction",
"==",
"null",
")",
"{",
"return",
"PTtlAction",
".",
"DELETE",
";",
"}",
"switch",
"(",
"ttlAction",
")",
"{",
"case",
"DELETE",
":",
"return",... | Converts Wire type to Protobuf type.
@param ttlAction {@link PTtlAction}
@return {@link TtlAction} equivalent | [
"Converts",
"Wire",
"type",
"to",
"Protobuf",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/ProtobufUtils.java#L53-L65 |
18,392 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/cli/validation/HadoopConfigurationFileParser.java | HadoopConfigurationFileParser.parseXmlConfiguration | public Map<String, String> parseXmlConfiguration(final String path) {
File xmlFile;
xmlFile = new File(path);
if (!xmlFile.exists()) {
System.err.format("File %s does not exist.", path);
return null;
}
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
D... | java | public Map<String, String> parseXmlConfiguration(final String path) {
File xmlFile;
xmlFile = new File(path);
if (!xmlFile.exists()) {
System.err.format("File %s does not exist.", path);
return null;
}
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
D... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"parseXmlConfiguration",
"(",
"final",
"String",
"path",
")",
"{",
"File",
"xmlFile",
";",
"xmlFile",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"!",
"xmlFile",
".",
"exists",
"(",
")",
"... | Parse an xml configuration file into a map.
Referred to https://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/
@param path path to the xml file
@return Map from property names to values | [
"Parse",
"an",
"xml",
"configuration",
"file",
"into",
"a",
"map",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/cli/validation/HadoopConfigurationFileParser.java#L47-L87 |
18,393 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/AlluxioWorker.java | AlluxioWorker.main | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioWorker.class.getCanonicalName());
System.exit(-1);
}
if (!ConfigurationUtils.masterHostConfigured(ServerConfiguration.global())) {
ProcessUtils.fatalE... | java | public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR,
AlluxioWorker.class.getCanonicalName());
System.exit(-1);
}
if (!ConfigurationUtils.masterHostConfigured(ServerConfiguration.global())) {
ProcessUtils.fatalE... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"0",
")",
"{",
"LOG",
".",
"info",
"(",
"\"java -cp {} {}\"",
",",
"RuntimeConstants",
".",
"ALLUXIO_JAR",
",",
"AlluxioWorker",
".",
... | Starts the Alluxio worker.
@param args command line arguments, should be empty | [
"Starts",
"the",
"Alluxio",
"worker",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/AlluxioWorker.java#L43-L70 |
18,394 | Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcManagedChannelPool.java | GrpcManagedChannelPool.shutdownManagedChannel | private void shutdownManagedChannel(ChannelKey channelKey, long shutdownTimeoutMs) {
ManagedChannel managedChannel = mChannels.get(channelKey).get();
managedChannel.shutdown();
try {
managedChannel.awaitTermination(shutdownTimeoutMs, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
... | java | private void shutdownManagedChannel(ChannelKey channelKey, long shutdownTimeoutMs) {
ManagedChannel managedChannel = mChannels.get(channelKey).get();
managedChannel.shutdown();
try {
managedChannel.awaitTermination(shutdownTimeoutMs, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
... | [
"private",
"void",
"shutdownManagedChannel",
"(",
"ChannelKey",
"channelKey",
",",
"long",
"shutdownTimeoutMs",
")",
"{",
"ManagedChannel",
"managedChannel",
"=",
"mChannels",
".",
"get",
"(",
"channelKey",
")",
".",
"get",
"(",
")",
";",
"managedChannel",
".",
... | Shuts down the managed channel for given key.
(Should be called with {@code mLock} acquired.)
@param channelKey channel key
@param shutdownTimeoutMs shutdown timeout in miliseconds | [
"Shuts",
"down",
"the",
"managed",
"channel",
"for",
"given",
"key",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcManagedChannelPool.java#L96-L109 |
18,395 | Alluxio/alluxio | core/common/src/main/java/alluxio/resource/DynamicResourcePool.java | DynamicResourcePool.close | @Override
public void close() throws IOException {
try {
mLock.lock();
if (mAvailableResources.size() != mResources.size()) {
LOG.warn("{} resources are not released when closing the resource pool.",
mResources.size() - mAvailableResources.size());
}
for (ResourceIntern... | java | @Override
public void close() throws IOException {
try {
mLock.lock();
if (mAvailableResources.size() != mResources.size()) {
LOG.warn("{} resources are not released when closing the resource pool.",
mResources.size() - mAvailableResources.size());
}
for (ResourceIntern... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"mAvailableResources",
".",
"size",
"(",
")",
"!=",
"mResources",
".",
"size",
"(",
")",
")",
"{",
"LOG",
... | Closes the pool and clears all the resources. The resource pool should not be used after this. | [
"Closes",
"the",
"pool",
"and",
"clears",
"all",
"the",
"resources",
".",
"The",
"resource",
"pool",
"should",
"not",
"be",
"used",
"after",
"this",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/resource/DynamicResourcePool.java#L389-L405 |
18,396 | Alluxio/alluxio | core/common/src/main/java/alluxio/resource/DynamicResourcePool.java | DynamicResourcePool.add | private boolean add(ResourceInternal<T> resource) {
try {
mLock.lock();
if (mResources.size() >= mMaxCapacity) {
return false;
} else {
mResources.put(resource.mResource, resource);
return true;
}
} finally {
mLock.unlock();
}
} | java | private boolean add(ResourceInternal<T> resource) {
try {
mLock.lock();
if (mResources.size() >= mMaxCapacity) {
return false;
} else {
mResources.put(resource.mResource, resource);
return true;
}
} finally {
mLock.unlock();
}
} | [
"private",
"boolean",
"add",
"(",
"ResourceInternal",
"<",
"T",
">",
"resource",
")",
"{",
"try",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"mResources",
".",
"size",
"(",
")",
">=",
"mMaxCapacity",
")",
"{",
"return",
"false",
";",
"}",
... | Adds a newly created resource to the pool. The resource is not available when it is added.
@param resource
@return true if the resource is successfully added | [
"Adds",
"a",
"newly",
"created",
"resource",
"to",
"the",
"pool",
".",
"The",
"resource",
"is",
"not",
"available",
"when",
"it",
"is",
"added",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/resource/DynamicResourcePool.java#L425-L437 |
18,397 | Alluxio/alluxio | core/common/src/main/java/alluxio/resource/DynamicResourcePool.java | DynamicResourcePool.remove | private void remove(T resource) {
try {
mLock.lock();
mResources.remove(resource);
} finally {
mLock.unlock();
}
} | java | private void remove(T resource) {
try {
mLock.lock();
mResources.remove(resource);
} finally {
mLock.unlock();
}
} | [
"private",
"void",
"remove",
"(",
"T",
"resource",
")",
"{",
"try",
"{",
"mLock",
".",
"lock",
"(",
")",
";",
"mResources",
".",
"remove",
"(",
"resource",
")",
";",
"}",
"finally",
"{",
"mLock",
".",
"unlock",
"(",
")",
";",
"}",
"}"
] | Removes an existing resource from the pool.
@param resource | [
"Removes",
"an",
"existing",
"resource",
"from",
"the",
"pool",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/resource/DynamicResourcePool.java#L444-L451 |
18,398 | Alluxio/alluxio | core/common/src/main/java/alluxio/resource/DynamicResourcePool.java | DynamicResourcePool.checkHealthyAndRetry | private T checkHealthyAndRetry(T resource, long endTimeMs) throws TimeoutException, IOException {
if (isHealthy(resource)) {
return resource;
} else {
LOG.info("Clearing unhealthy resource {}.", resource);
remove(resource);
closeResource(resource);
return acquire(endTimeMs - mClock... | java | private T checkHealthyAndRetry(T resource, long endTimeMs) throws TimeoutException, IOException {
if (isHealthy(resource)) {
return resource;
} else {
LOG.info("Clearing unhealthy resource {}.", resource);
remove(resource);
closeResource(resource);
return acquire(endTimeMs - mClock... | [
"private",
"T",
"checkHealthyAndRetry",
"(",
"T",
"resource",
",",
"long",
"endTimeMs",
")",
"throws",
"TimeoutException",
",",
"IOException",
"{",
"if",
"(",
"isHealthy",
"(",
"resource",
")",
")",
"{",
"return",
"resource",
";",
"}",
"else",
"{",
"LOG",
... | Checks whether the resource is healthy. If not retry. When this called, the resource
is not in mAvailableResources.
@param resource the resource to check
@param endTimeMs the end time to wait till
@return the resource
@throws TimeoutException if it times out to wait for a resource | [
"Checks",
"whether",
"the",
"resource",
"is",
"healthy",
".",
"If",
"not",
"retry",
".",
"When",
"this",
"called",
"the",
"resource",
"is",
"not",
"in",
"mAvailableResources",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/resource/DynamicResourcePool.java#L474-L483 |
18,399 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ShellUtils.java | ShellUtils.getSetPermissionCommand | public static String[] getSetPermissionCommand(String perm, String filePath) {
return new String[] {SET_PERMISSION_COMMAND, perm, filePath};
} | java | public static String[] getSetPermissionCommand(String perm, String filePath) {
return new String[] {SET_PERMISSION_COMMAND, perm, filePath};
} | [
"public",
"static",
"String",
"[",
"]",
"getSetPermissionCommand",
"(",
"String",
"perm",
",",
"String",
"filePath",
")",
"{",
"return",
"new",
"String",
"[",
"]",
"{",
"SET_PERMISSION_COMMAND",
",",
"perm",
",",
"filePath",
"}",
";",
"}"
] | Returns a Unix command to set permission.
@param perm the permission of file
@param filePath the file path
@return the Unix command to set permission | [
"Returns",
"a",
"Unix",
"command",
"to",
"set",
"permission",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ShellUtils.java#L68-L70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.