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,800
Alluxio/alluxio
integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java
MapReduceIntegrationChecker.run
private int run(String[] args) throws Exception { Configuration conf = new Configuration(); String numMaps = new GenericOptionsParser(conf, args).getRemainingArgs()[0]; conf.set(MRJobConfig.NUM_MAPS, numMaps); createHdfsFilesystem(conf); Job job = Job.getInstance(conf, "MapReduceIntegrationChecker...
java
private int run(String[] args) throws Exception { Configuration conf = new Configuration(); String numMaps = new GenericOptionsParser(conf, args).getRemainingArgs()[0]; conf.set(MRJobConfig.NUM_MAPS, numMaps); createHdfsFilesystem(conf); Job job = Job.getInstance(conf, "MapReduceIntegrationChecker...
[ "private", "int", "run", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "Configuration", "conf", "=", "new", "Configuration", "(", ")", ";", "String", "numMaps", "=", "new", "GenericOptionsParser", "(", "conf", ",", "args", ")", ".", "...
Implements MapReduce with Alluxio integration checker. @return 0 for success, 2 for unable to find Alluxio classes, 1 otherwise
[ "Implements", "MapReduce", "with", "Alluxio", "integration", "checker", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java#L267-L296
18,801
Alluxio/alluxio
integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java
MapReduceIntegrationChecker.main
public static void main(String[] args) throws Exception { MapReduceIntegrationChecker checker = new MapReduceIntegrationChecker(); System.exit(checker.run(args)); }
java
public static void main(String[] args) throws Exception { MapReduceIntegrationChecker checker = new MapReduceIntegrationChecker(); System.exit(checker.run(args)); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "MapReduceIntegrationChecker", "checker", "=", "new", "MapReduceIntegrationChecker", "(", ")", ";", "System", ".", "exit", "(", "checker", ".", "run", "(", ...
Main function will be triggered via hadoop jar. @param args numMaps will be passed in
[ "Main", "function", "will", "be", "triggered", "via", "hadoop", "jar", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/MapReduceIntegrationChecker.java#L303-L306
18,802
Alluxio/alluxio
core/common/src/main/java/alluxio/util/JvmPauseMonitor.java
JvmPauseMonitor.stop
public void stop() { Preconditions.checkState(mJvmMonitorThread != null, "JVM monitor thread does not start"); mJvmMonitorThread.interrupt(); try { mJvmMonitorThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } reset(); }
java
public void stop() { Preconditions.checkState(mJvmMonitorThread != null, "JVM monitor thread does not start"); mJvmMonitorThread.interrupt(); try { mJvmMonitorThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } reset(); }
[ "public", "void", "stop", "(", ")", "{", "Preconditions", ".", "checkState", "(", "mJvmMonitorThread", "!=", "null", ",", "\"JVM monitor thread does not start\"", ")", ";", "mJvmMonitorThread", ".", "interrupt", "(", ")", ";", "try", "{", "mJvmMonitorThread", ".",...
Stops jvm monitor.
[ "Stops", "jvm", "monitor", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/JvmPauseMonitor.java#L83-L93
18,803
Alluxio/alluxio
underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUtils.java
S3AUtils.translateBucketAcl
public static short translateBucketAcl(AccessControlList acl, String userId) { short mode = (short) 0; for (Grant grant : acl.getGrantsAsList()) { Permission perm = grant.getPermission(); Grantee grantee = grant.getGrantee(); if (perm.equals(Permission.Read)) { if (isUserIdInGrantee(gr...
java
public static short translateBucketAcl(AccessControlList acl, String userId) { short mode = (short) 0; for (Grant grant : acl.getGrantsAsList()) { Permission perm = grant.getPermission(); Grantee grantee = grant.getGrantee(); if (perm.equals(Permission.Read)) { if (isUserIdInGrantee(gr...
[ "public", "static", "short", "translateBucketAcl", "(", "AccessControlList", "acl", ",", "String", "userId", ")", "{", "short", "mode", "=", "(", "short", ")", "0", ";", "for", "(", "Grant", "grant", ":", "acl", ".", "getGrantsAsList", "(", ")", ")", "{"...
Translates S3 bucket ACL to Alluxio owner mode. @param acl the acl of S3 bucket @param userId the S3 user id of the Alluxio owner @return the translated posix mode in short format
[ "Translates", "S3", "bucket", "ACL", "to", "Alluxio", "owner", "mode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUtils.java#L31-L54
18,804
Alluxio/alluxio
core/base/src/main/java/alluxio/uri/StandardURI.java
StandardURI.compareScheme
private int compareScheme(URI other) { String scheme = getScheme(); String otherScheme = other.getScheme(); if (scheme == null && otherScheme == null) { return 0; } if (scheme != null) { if (otherScheme != null) { return scheme.compareToIgnoreCase(otherScheme); } // ...
java
private int compareScheme(URI other) { String scheme = getScheme(); String otherScheme = other.getScheme(); if (scheme == null && otherScheme == null) { return 0; } if (scheme != null) { if (otherScheme != null) { return scheme.compareToIgnoreCase(otherScheme); } // ...
[ "private", "int", "compareScheme", "(", "URI", "other", ")", "{", "String", "scheme", "=", "getScheme", "(", ")", ";", "String", "otherScheme", "=", "other", ".", "getScheme", "(", ")", ";", "if", "(", "scheme", "==", "null", "&&", "otherScheme", "==", ...
Compares the schemes of this URI and a given URI. @param other the other {@link URI} to compare the scheme @return a negative integer, zero, or a positive integer if this scheme is respectively less than, equal to, or greater than the full scheme of the other URI.
[ "Compares", "the", "schemes", "of", "this", "URI", "and", "a", "given", "URI", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/uri/StandardURI.java#L163-L179
18,805
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public long applyAndJournal(Supplier<JournalContext> context, NewBlockEntry entry) { try { long id = applyNewBlock(entry); context.get().append(JournalEntry.newBuilder().setNewBlock(entry).build()); return id; } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", ...
java
public long applyAndJournal(Supplier<JournalContext> context, NewBlockEntry entry) { try { long id = applyNewBlock(entry); context.get().append(JournalEntry.newBuilder().setNewBlock(entry).build()); return id; } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", ...
[ "public", "long", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "NewBlockEntry", "entry", ")", "{", "try", "{", "long", "id", "=", "applyNewBlock", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", ...
Allocates and returns the next block ID for the indicated inode. @param context journal context supplier @param entry new block entry @return the new block id
[ "Allocates", "and", "returns", "the", "next", "block", "ID", "for", "the", "indicated", "inode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L185-L194
18,806
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, RenameEntry entry) { try { applyRename(entry); context.get().append(JournalEntry.newBuilder().setRename(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); throw t; // fatalEr...
java
public void applyAndJournal(Supplier<JournalContext> context, RenameEntry entry) { try { applyRename(entry); context.get().append(JournalEntry.newBuilder().setRename(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); throw t; // fatalEr...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "RenameEntry", "entry", ")", "{", "try", "{", "applyRename", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", "(", "JournalEntry", ".",...
Renames an inode. @param context journal context supplier @param entry rename entry
[ "Renames", "an", "inode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L202-L210
18,807
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, SetAclEntry entry) { try { applySetAcl(entry); context.get().append(JournalEntry.newBuilder().setSetAcl(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); throw t; // fatalEr...
java
public void applyAndJournal(Supplier<JournalContext> context, SetAclEntry entry) { try { applySetAcl(entry); context.get().append(JournalEntry.newBuilder().setSetAcl(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); throw t; // fatalEr...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "SetAclEntry", "entry", ")", "{", "try", "{", "applySetAcl", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", "(", "JournalEntry", ".",...
Sets an ACL for an inode. @param context journal context supplier @param entry set acl entry
[ "Sets", "an", "ACL", "for", "an", "inode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L218-L226
18,808
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeEntry entry) { try { applyUpdateInode(entry); context.get().append(JournalEntry.newBuilder().setUpdateInode(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); thro...
java
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeEntry entry) { try { applyUpdateInode(entry); context.get().append(JournalEntry.newBuilder().setUpdateInode(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry); thro...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "UpdateInodeEntry", "entry", ")", "{", "try", "{", "applyUpdateInode", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", "(", "JournalEntr...
Updates an inode's state. This is used for state common to both files and directories. @param context journal context supplier @param entry update inode entry
[ "Updates", "an", "inode", "s", "state", ".", "This", "is", "used", "for", "state", "common", "to", "both", "files", "and", "directories", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L234-L242
18,809
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeDirectoryEntry entry) { try { applyUpdateInodeDirectory(entry); context.get().append(JournalEntry.newBuilder().setUpdateInodeDirectory(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to ap...
java
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeDirectoryEntry entry) { try { applyUpdateInodeDirectory(entry); context.get().append(JournalEntry.newBuilder().setUpdateInodeDirectory(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to ap...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "UpdateInodeDirectoryEntry", "entry", ")", "{", "try", "{", "applyUpdateInodeDirectory", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", "...
Updates an inode directory's state. @param context journal context supplier @param entry update inode directory entry
[ "Updates", "an", "inode", "directory", "s", "state", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L250-L258
18,810
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeFileEntry entry) { try { applyUpdateInodeFile(entry); context.get().append(JournalEntry.newBuilder().setUpdateInodeFile(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry)...
java
public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeFileEntry entry) { try { applyUpdateInodeFile(entry); context.get().append(JournalEntry.newBuilder().setUpdateInodeFile(entry).build()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", entry)...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "UpdateInodeFileEntry", "entry", ")", "{", "try", "{", "applyUpdateInodeFile", "(", "entry", ")", ";", "context", ".", "get", "(", ")", ".", "append", "(", "Jou...
Updates an inode file's state. @param context journal context supplier @param entry update inode file entry
[ "Updates", "an", "inode", "file", "s", "state", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L266-L274
18,811
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, MutableInode<?> inode) { try { applyCreateInode(inode); context.get().append(inode.toJournalEntry()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", inode); throw t; // fatalError will usually sy...
java
public void applyAndJournal(Supplier<JournalContext> context, MutableInode<?> inode) { try { applyCreateInode(inode); context.get().append(inode.toJournalEntry()); } catch (Throwable t) { ProcessUtils.fatalError(LOG, t, "Failed to apply %s", inode); throw t; // fatalError will usually sy...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "MutableInode", "<", "?", ">", "inode", ")", "{", "try", "{", "applyCreateInode", "(", "inode", ")", ";", "context", ".", "get", "(", ")", ".", "append", "(...
Adds an inode to the inode tree. @param context journal context supplier @param inode an inode to add and create a journal entry for
[ "Adds", "an", "inode", "to", "the", "inode", "tree", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L282-L290
18,812
Alluxio/alluxio
core/common/src/main/java/alluxio/heartbeat/SleepingTimer.java
SleepingTimer.tick
public void tick() throws InterruptedException { if (mPreviousTickMs != 0) { long executionTimeMs = mClock.millis() - mPreviousTickMs; if (executionTimeMs > mIntervalMs) { mLogger.warn("{} last execution took {} ms. Longer than the interval {}", mThreadName, executionTimeMs, mInterva...
java
public void tick() throws InterruptedException { if (mPreviousTickMs != 0) { long executionTimeMs = mClock.millis() - mPreviousTickMs; if (executionTimeMs > mIntervalMs) { mLogger.warn("{} last execution took {} ms. Longer than the interval {}", mThreadName, executionTimeMs, mInterva...
[ "public", "void", "tick", "(", ")", "throws", "InterruptedException", "{", "if", "(", "mPreviousTickMs", "!=", "0", ")", "{", "long", "executionTimeMs", "=", "mClock", ".", "millis", "(", ")", "-", "mPreviousTickMs", ";", "if", "(", "executionTimeMs", ">", ...
Enforces the thread waits for the given interval between consecutive ticks. @throws InterruptedException if the thread is interrupted while waiting
[ "Enforces", "the", "thread", "waits", "for", "the", "given", "interval", "between", "consecutive", "ticks", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/heartbeat/SleepingTimer.java#L74-L85
18,813
Alluxio/alluxio
core/common/src/main/java/alluxio/heartbeat/HeartbeatContext.java
HeartbeatContext.setTimerClass
@SuppressWarnings("unused") private static synchronized void setTimerClass(String name, Class<? extends HeartbeatTimer> timerClass) { if (timerClass == null) { sTimerClasses.remove(name); } else { sTimerClasses.put(name, timerClass); } }
java
@SuppressWarnings("unused") private static synchronized void setTimerClass(String name, Class<? extends HeartbeatTimer> timerClass) { if (timerClass == null) { sTimerClasses.remove(name); } else { sTimerClasses.put(name, timerClass); } }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "private", "static", "synchronized", "void", "setTimerClass", "(", "String", "name", ",", "Class", "<", "?", "extends", "HeartbeatTimer", ">", "timerClass", ")", "{", "if", "(", "timerClass", "==", "null", ")", ...
Sets the timer class to use for the specified executor thread. This method should only be used by tests. @param name a name of a heartbeat executor thread @param timerClass the timer class to use for the executor thread
[ "Sets", "the", "timer", "class", "to", "use", "for", "the", "specified", "executor", "thread", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/heartbeat/HeartbeatContext.java#L116-L124
18,814
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java
JournalUtils.getJournalLocation
public static URI getJournalLocation() { String journalDirectory = ServerConfiguration.get(PropertyKey.MASTER_JOURNAL_FOLDER); if (!journalDirectory.endsWith(AlluxioURI.SEPARATOR)) { journalDirectory += AlluxioURI.SEPARATOR; } try { return new URI(journalDirectory); } catch (URISyntaxExc...
java
public static URI getJournalLocation() { String journalDirectory = ServerConfiguration.get(PropertyKey.MASTER_JOURNAL_FOLDER); if (!journalDirectory.endsWith(AlluxioURI.SEPARATOR)) { journalDirectory += AlluxioURI.SEPARATOR; } try { return new URI(journalDirectory); } catch (URISyntaxExc...
[ "public", "static", "URI", "getJournalLocation", "(", ")", "{", "String", "journalDirectory", "=", "ServerConfiguration", ".", "get", "(", "PropertyKey", ".", "MASTER_JOURNAL_FOLDER", ")", ";", "if", "(", "!", "journalDirectory", ".", "endsWith", "(", "AlluxioURI"...
Returns a URI for the configured location for the specified journal. @return the journal location
[ "Returns", "a", "URI", "for", "the", "configured", "location", "for", "the", "specified", "journal", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L53-L63
18,815
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java
JournalUtils.writeJournalEntryCheckpoint
public static void writeJournalEntryCheckpoint(OutputStream output, JournalEntryIterable iterable) throws IOException, InterruptedException { output = new CheckpointOutputStream(output, CheckpointType.JOURNAL_ENTRY); Iterator<JournalEntry> it = iterable.getJournalEntryIterator(); LOG.info("Write journ...
java
public static void writeJournalEntryCheckpoint(OutputStream output, JournalEntryIterable iterable) throws IOException, InterruptedException { output = new CheckpointOutputStream(output, CheckpointType.JOURNAL_ENTRY); Iterator<JournalEntry> it = iterable.getJournalEntryIterator(); LOG.info("Write journ...
[ "public", "static", "void", "writeJournalEntryCheckpoint", "(", "OutputStream", "output", ",", "JournalEntryIterable", "iterable", ")", "throws", "IOException", ",", "InterruptedException", "{", "output", "=", "new", "CheckpointOutputStream", "(", "output", ",", "Checkp...
Writes a checkpoint of the entries in the given iterable. This is the complement of {@link #restoreJournalEntryCheckpoint(CheckpointInputStream, Journaled)}. @param output the stream to write to @param iterable the iterable for fetching journal entries
[ "Writes", "a", "checkpoint", "of", "the", "entries", "in", "the", "given", "iterable", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L74-L86
18,816
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java
JournalUtils.restoreJournalEntryCheckpoint
public static void restoreJournalEntryCheckpoint(CheckpointInputStream input, Journaled journaled) throws IOException { Preconditions.checkState(input.getType() == CheckpointType.JOURNAL_ENTRY, "Unrecognized checkpoint type when restoring %s: %s", journaled.getCheckpointName(), input.getType()...
java
public static void restoreJournalEntryCheckpoint(CheckpointInputStream input, Journaled journaled) throws IOException { Preconditions.checkState(input.getType() == CheckpointType.JOURNAL_ENTRY, "Unrecognized checkpoint type when restoring %s: %s", journaled.getCheckpointName(), input.getType()...
[ "public", "static", "void", "restoreJournalEntryCheckpoint", "(", "CheckpointInputStream", "input", ",", "Journaled", "journaled", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "input", ".", "getType", "(", ")", "==", "CheckpointType", ...
Restores the given journaled object from the journal entries in the input stream. This is the complement of {@link #writeJournalEntryCheckpoint(OutputStream, JournalEntryIterable)}. @param input the stream to read from @param journaled the object to restore
[ "Restores", "the", "given", "journaled", "object", "from", "the", "journal", "entries", "in", "the", "input", "stream", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L97-L114
18,817
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java
JournalUtils.writeToCheckpoint
public static void writeToCheckpoint(OutputStream output, List<? extends Checkpointed> components) throws IOException, InterruptedException { OutputChunked chunked = new OutputChunked( new CheckpointOutputStream(output, CheckpointType.COMPOUND), 64 * Constants.KB); for (Checkpointed component : co...
java
public static void writeToCheckpoint(OutputStream output, List<? extends Checkpointed> components) throws IOException, InterruptedException { OutputChunked chunked = new OutputChunked( new CheckpointOutputStream(output, CheckpointType.COMPOUND), 64 * Constants.KB); for (Checkpointed component : co...
[ "public", "static", "void", "writeToCheckpoint", "(", "OutputStream", "output", ",", "List", "<", "?", "extends", "Checkpointed", ">", "components", ")", "throws", "IOException", ",", "InterruptedException", "{", "OutputChunked", "chunked", "=", "new", "OutputChunke...
Writes a composite checkpoint for the given checkpointed components. This is the complement of {@link #restoreFromCheckpoint(CheckpointInputStream, List)}. @param output the stream to write to @param components the components to checkpoint
[ "Writes", "a", "composite", "checkpoint", "for", "the", "given", "checkpointed", "components", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L124-L134
18,818
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java
JournalUtils.restoreFromCheckpoint
public static void restoreFromCheckpoint(CheckpointInputStream input, List<? extends Checkpointed> components) throws IOException { CompoundCheckpointReader reader = new CompoundCheckpointReader(input); Optional<Entry> next; while ((next = reader.nextCheckpoint()).isPresent()) { Entry nextEntry ...
java
public static void restoreFromCheckpoint(CheckpointInputStream input, List<? extends Checkpointed> components) throws IOException { CompoundCheckpointReader reader = new CompoundCheckpointReader(input); Optional<Entry> next; while ((next = reader.nextCheckpoint()).isPresent()) { Entry nextEntry ...
[ "public", "static", "void", "restoreFromCheckpoint", "(", "CheckpointInputStream", "input", ",", "List", "<", "?", "extends", "Checkpointed", ">", "components", ")", "throws", "IOException", "{", "CompoundCheckpointReader", "reader", "=", "new", "CompoundCheckpointReade...
Restores the given checkpointed components from a composite checkpoint. This is the complement of {@link #writeToCheckpoint(OutputStream, List)}. @param input the stream to read from @param components the components to restore
[ "Restores", "the", "given", "checkpointed", "components", "from", "a", "composite", "checkpoint", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L144-L164
18,819
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java
MetricsCommand.printMetric
private void printMetric(String metricName, String nickName, boolean valueIsBytes) { if (mMetricsMap == null || !mMetricsMap.containsKey(metricName)) { return; } MetricValue metricValue = mMetricsMap.get(metricName); String formattedValue = valueIsBytes ? FormatUtils.getSizeFromBytes(metricValue.g...
java
private void printMetric(String metricName, String nickName, boolean valueIsBytes) { if (mMetricsMap == null || !mMetricsMap.containsKey(metricName)) { return; } MetricValue metricValue = mMetricsMap.get(metricName); String formattedValue = valueIsBytes ? FormatUtils.getSizeFromBytes(metricValue.g...
[ "private", "void", "printMetric", "(", "String", "metricName", ",", "String", "nickName", ",", "boolean", "valueIsBytes", ")", "{", "if", "(", "mMetricsMap", "==", "null", "||", "!", "mMetricsMap", ".", "containsKey", "(", "metricName", ")", ")", "{", "retur...
Prints the metrics information. @param metricName the metric name to get a metric value @param nickName the metric name to print @param valueIsBytes whether the metric value is bytes
[ "Prints", "the", "metrics", "information", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java#L160-L170
18,820
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java
MetricsCommand.getFormattedValue
private String getFormattedValue(MetricValue metricValue) { if (metricValue.hasDoubleValue()) { return DECIMAL_FORMAT.format(metricValue.getDoubleValue()); } else { return DECIMAL_FORMAT.format(metricValue.getLongValue()); } }
java
private String getFormattedValue(MetricValue metricValue) { if (metricValue.hasDoubleValue()) { return DECIMAL_FORMAT.format(metricValue.getDoubleValue()); } else { return DECIMAL_FORMAT.format(metricValue.getLongValue()); } }
[ "private", "String", "getFormattedValue", "(", "MetricValue", "metricValue", ")", "{", "if", "(", "metricValue", ".", "hasDoubleValue", "(", ")", ")", "{", "return", "DECIMAL_FORMAT", ".", "format", "(", "metricValue", ".", "getDoubleValue", "(", ")", ")", ";"...
Gets the formatted metric value. @param metricValue the metricValue to transform @return the formatted metric value
[ "Gets", "the", "formatted", "metric", "value", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java#L178-L184
18,821
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/Sessions.java
Sessions.getTimedOutSessions
public List<Long> getTimedOutSessions() { List<Long> ret = new ArrayList<>(); synchronized (mSessions) { for (Entry<Long, SessionInfo> entry : mSessions.entrySet()) { if (entry.getValue().timeout()) { ret.add(entry.getKey()); } } } return ret; }
java
public List<Long> getTimedOutSessions() { List<Long> ret = new ArrayList<>(); synchronized (mSessions) { for (Entry<Long, SessionInfo> entry : mSessions.entrySet()) { if (entry.getValue().timeout()) { ret.add(entry.getKey()); } } } return ret; }
[ "public", "List", "<", "Long", ">", "getTimedOutSessions", "(", ")", "{", "List", "<", "Long", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "synchronized", "(", "mSessions", ")", "{", "for", "(", "Entry", "<", "Long", ",", "SessionInfo", ...
Gets the sessions that timed out. @return the list of session ids of sessions that timed out
[ "Gets", "the", "sessions", "that", "timed", "out", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/Sessions.java#L61-L71
18,822
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/Sessions.java
Sessions.sessionHeartbeat
public void sessionHeartbeat(long sessionId) { synchronized (mSessions) { if (mSessions.containsKey(sessionId)) { mSessions.get(sessionId).heartbeat(); } else { int sessionTimeoutMs = (int) ServerConfiguration .getMs(PropertyKey.WORKER_SESSION_TIMEOUT_MS); mSessions.p...
java
public void sessionHeartbeat(long sessionId) { synchronized (mSessions) { if (mSessions.containsKey(sessionId)) { mSessions.get(sessionId).heartbeat(); } else { int sessionTimeoutMs = (int) ServerConfiguration .getMs(PropertyKey.WORKER_SESSION_TIMEOUT_MS); mSessions.p...
[ "public", "void", "sessionHeartbeat", "(", "long", "sessionId", ")", "{", "synchronized", "(", "mSessions", ")", "{", "if", "(", "mSessions", ".", "containsKey", "(", "sessionId", ")", ")", "{", "mSessions", ".", "get", "(", "sessionId", ")", ".", "heartbe...
Performs session heartbeat. @param sessionId the id of the session
[ "Performs", "session", "heartbeat", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/Sessions.java#L90-L100
18,823
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.lookupRecursively
private String lookupRecursively(String base, Set<String> seen) throws UnresolvablePropertyException { // check argument if (base == null) { throw new UnresolvablePropertyException("Can't resolve property with null value"); } String resolved = base; // Lets find pattern match to ${key}....
java
private String lookupRecursively(String base, Set<String> seen) throws UnresolvablePropertyException { // check argument if (base == null) { throw new UnresolvablePropertyException("Can't resolve property with null value"); } String resolved = base; // Lets find pattern match to ${key}....
[ "private", "String", "lookupRecursively", "(", "String", "base", ",", "Set", "<", "String", ">", "seen", ")", "throws", "UnresolvablePropertyException", "{", "// check argument", "if", "(", "base", "==", "null", ")", "{", "throw", "new", "UnresolvablePropertyExcep...
Actual recursive lookup replacement. @param base the string to resolve @param seen strings already seen during this lookup, used to prevent unbound recursion @return the resolved string
[ "Actual", "recursive", "lookup", "replacement", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L387-L416
18,824
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkWorkerPorts
private void checkWorkerPorts() { int maxWorkersPerHost = getInt(PropertyKey.INTEGRATION_YARN_WORKERS_PER_HOST_MAX); if (maxWorkersPerHost > 1) { String message = "%s cannot be specified when allowing multiple workers per host with " + PropertyKey.Name.INTEGRATION_YARN_WORKERS_PER_HOST_MAX + "="...
java
private void checkWorkerPorts() { int maxWorkersPerHost = getInt(PropertyKey.INTEGRATION_YARN_WORKERS_PER_HOST_MAX); if (maxWorkersPerHost > 1) { String message = "%s cannot be specified when allowing multiple workers per host with " + PropertyKey.Name.INTEGRATION_YARN_WORKERS_PER_HOST_MAX + "="...
[ "private", "void", "checkWorkerPorts", "(", ")", "{", "int", "maxWorkersPerHost", "=", "getInt", "(", "PropertyKey", ".", "INTEGRATION_YARN_WORKERS_PER_HOST_MAX", ")", ";", "if", "(", "maxWorkersPerHost", ">", "1", ")", "{", "String", "message", "=", "\"%s cannot ...
Validates worker port configuration. @throws IllegalStateException if invalid worker port configuration is encountered
[ "Validates", "worker", "port", "configuration", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L423-L433
18,825
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkTimeouts
private void checkTimeouts() { long waitTime = getMs(PropertyKey.MASTER_WORKER_CONNECT_WAIT_TIME); long retryInterval = getMs(PropertyKey.USER_RPC_RETRY_MAX_SLEEP_MS); if (waitTime < retryInterval) { LOG.warn("{}={}ms is smaller than {}={}ms. Workers might not have enough time to register. " ...
java
private void checkTimeouts() { long waitTime = getMs(PropertyKey.MASTER_WORKER_CONNECT_WAIT_TIME); long retryInterval = getMs(PropertyKey.USER_RPC_RETRY_MAX_SLEEP_MS); if (waitTime < retryInterval) { LOG.warn("{}={}ms is smaller than {}={}ms. Workers might not have enough time to register. " ...
[ "private", "void", "checkTimeouts", "(", ")", "{", "long", "waitTime", "=", "getMs", "(", "PropertyKey", ".", "MASTER_WORKER_CONNECT_WAIT_TIME", ")", ";", "long", "retryInterval", "=", "getMs", "(", "PropertyKey", ".", "USER_RPC_RETRY_MAX_SLEEP_MS", ")", ";", "if"...
Validates timeout related configuration.
[ "Validates", "timeout", "related", "configuration", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L438-L453
18,826
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkHeartbeatTimeout
private void checkHeartbeatTimeout(PropertyKey intervalKey, PropertyKey timeoutKey) { long interval = getMs(intervalKey); long timeout = getMs(timeoutKey); Preconditions.checkState(interval < timeout, "heartbeat interval (%s=%s) must be less than heartbeat timeout (%s=%s)", intervalKey, inte...
java
private void checkHeartbeatTimeout(PropertyKey intervalKey, PropertyKey timeoutKey) { long interval = getMs(intervalKey); long timeout = getMs(timeoutKey); Preconditions.checkState(interval < timeout, "heartbeat interval (%s=%s) must be less than heartbeat timeout (%s=%s)", intervalKey, inte...
[ "private", "void", "checkHeartbeatTimeout", "(", "PropertyKey", "intervalKey", ",", "PropertyKey", "timeoutKey", ")", "{", "long", "interval", "=", "getMs", "(", "intervalKey", ")", ";", "long", "timeout", "=", "getMs", "(", "timeoutKey", ")", ";", "Precondition...
Checks that the interval is shorter than the timeout. @param intervalKey property key for an interval @param timeoutKey property key for a timeout
[ "Checks", "that", "the", "interval", "is", "shorter", "than", "the", "timeout", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L461-L467
18,827
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkUserFileBufferBytes
private void checkUserFileBufferBytes() { if (!isSet(PropertyKey.USER_FILE_BUFFER_BYTES)) { // load from hadoop conf return; } long usrFileBufferBytes = getBytes(PropertyKey.USER_FILE_BUFFER_BYTES); Preconditions.checkState((usrFileBufferBytes & Integer.MAX_VALUE) == usrFileBufferBytes, Pr...
java
private void checkUserFileBufferBytes() { if (!isSet(PropertyKey.USER_FILE_BUFFER_BYTES)) { // load from hadoop conf return; } long usrFileBufferBytes = getBytes(PropertyKey.USER_FILE_BUFFER_BYTES); Preconditions.checkState((usrFileBufferBytes & Integer.MAX_VALUE) == usrFileBufferBytes, Pr...
[ "private", "void", "checkUserFileBufferBytes", "(", ")", "{", "if", "(", "!", "isSet", "(", "PropertyKey", ".", "USER_FILE_BUFFER_BYTES", ")", ")", "{", "// load from hadoop conf", "return", ";", "}", "long", "usrFileBufferBytes", "=", "getBytes", "(", "PropertyKe...
Validates the user file buffer size is a non-negative number. @throws IllegalStateException if invalid user file buffer size configuration is encountered
[ "Validates", "the", "user", "file", "buffer", "size", "is", "a", "non", "-", "negative", "number", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L474-L482
18,828
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkZkConfiguration
private void checkZkConfiguration() { Preconditions.checkState( isSet(PropertyKey.ZOOKEEPER_ADDRESS) == getBoolean(PropertyKey.ZOOKEEPER_ENABLED), PreconditionMessage.INCONSISTENT_ZK_CONFIGURATION.toString(), PropertyKey.Name.ZOOKEEPER_ADDRESS, PropertyKey.Name.ZOOKEEPER_ENABLED); }
java
private void checkZkConfiguration() { Preconditions.checkState( isSet(PropertyKey.ZOOKEEPER_ADDRESS) == getBoolean(PropertyKey.ZOOKEEPER_ENABLED), PreconditionMessage.INCONSISTENT_ZK_CONFIGURATION.toString(), PropertyKey.Name.ZOOKEEPER_ADDRESS, PropertyKey.Name.ZOOKEEPER_ENABLED); }
[ "private", "void", "checkZkConfiguration", "(", ")", "{", "Preconditions", ".", "checkState", "(", "isSet", "(", "PropertyKey", ".", "ZOOKEEPER_ADDRESS", ")", "==", "getBoolean", "(", "PropertyKey", ".", "ZOOKEEPER_ENABLED", ")", ",", "PreconditionMessage", ".", "...
Validates Zookeeper-related configuration and prints warnings for possible sources of error. @throws IllegalStateException if invalid Zookeeper configuration is encountered
[ "Validates", "Zookeeper", "-", "related", "configuration", "and", "prints", "warnings", "for", "possible", "sources", "of", "error", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L489-L494
18,829
Alluxio/alluxio
core/common/src/main/java/alluxio/conf/InstancedConfiguration.java
InstancedConfiguration.checkTieredLocality
private void checkTieredLocality() { // Check that any custom tiers set by alluxio.locality.{custom_tier}=value are also defined in // the tier ordering defined by alluxio.locality.order. Set<String> tiers = Sets.newHashSet(getList(PropertyKey.LOCALITY_ORDER, ",")); Set<PropertyKey> predefinedKeys = new...
java
private void checkTieredLocality() { // Check that any custom tiers set by alluxio.locality.{custom_tier}=value are also defined in // the tier ordering defined by alluxio.locality.order. Set<String> tiers = Sets.newHashSet(getList(PropertyKey.LOCALITY_ORDER, ",")); Set<PropertyKey> predefinedKeys = new...
[ "private", "void", "checkTieredLocality", "(", ")", "{", "// Check that any custom tiers set by alluxio.locality.{custom_tier}=value are also defined in", "// the tier ordering defined by alluxio.locality.order.", "Set", "<", "String", ">", "tiers", "=", "Sets", ".", "newHashSet", ...
Checks that tiered locality configuration is consistent. @throws IllegalStateException if invalid tiered locality configuration is encountered
[ "Checks", "that", "tiered", "locality", "configuration", "is", "consistent", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/conf/InstancedConfiguration.java#L501-L521
18,830
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.changeLocalFileGroup
public static void changeLocalFileGroup(String path, String group) throws IOException { UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); PosixFileAttributeView view = Files.getFileAttributeView(Paths.get(path), PosixFileAttributeView.class, ...
java
public static void changeLocalFileGroup(String path, String group) throws IOException { UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); PosixFileAttributeView view = Files.getFileAttributeView(Paths.get(path), PosixFileAttributeView.class, ...
[ "public", "static", "void", "changeLocalFileGroup", "(", "String", "path", ",", "String", "group", ")", "throws", "IOException", "{", "UserPrincipalLookupService", "lookupService", "=", "FileSystems", ".", "getDefault", "(", ")", ".", "getUserPrincipalLookupService", ...
Changes the local file's group. @param path that will change owner @param group the new group
[ "Changes", "the", "local", "file", "s", "group", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L57-L65
18,831
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.changeLocalFilePermission
public static void changeLocalFilePermission(String filePath, String perms) throws IOException { Files.setPosixFilePermissions(Paths.get(filePath), PosixFilePermissions.fromString(perms)); }
java
public static void changeLocalFilePermission(String filePath, String perms) throws IOException { Files.setPosixFilePermissions(Paths.get(filePath), PosixFilePermissions.fromString(perms)); }
[ "public", "static", "void", "changeLocalFilePermission", "(", "String", "filePath", ",", "String", "perms", ")", "throws", "IOException", "{", "Files", ".", "setPosixFilePermissions", "(", "Paths", ".", "get", "(", "filePath", ")", ",", "PosixFilePermissions", "."...
Changes local file's permission. @param filePath that will change permission @param perms the permission, e.g. "rwxr--r--"
[ "Changes", "local", "file", "s", "permission", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L73-L75
18,832
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.getLocalFileOwner
public static String getLocalFileOwner(String filePath) throws IOException { PosixFileAttributes attr = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class); return attr.owner().getName(); }
java
public static String getLocalFileOwner(String filePath) throws IOException { PosixFileAttributes attr = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class); return attr.owner().getName(); }
[ "public", "static", "String", "getLocalFileOwner", "(", "String", "filePath", ")", "throws", "IOException", "{", "PosixFileAttributes", "attr", "=", "Files", ".", "readAttributes", "(", "Paths", ".", "get", "(", "filePath", ")", ",", "PosixFileAttributes", ".", ...
Gets local file's owner. @param filePath the file path @return the owner of the local file
[ "Gets", "local", "file", "s", "owner", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L92-L96
18,833
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.getLocalFileGroup
public static String getLocalFileGroup(String filePath) throws IOException { PosixFileAttributes attr = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class); return attr.group().getName(); }
java
public static String getLocalFileGroup(String filePath) throws IOException { PosixFileAttributes attr = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class); return attr.group().getName(); }
[ "public", "static", "String", "getLocalFileGroup", "(", "String", "filePath", ")", "throws", "IOException", "{", "PosixFileAttributes", "attr", "=", "Files", ".", "readAttributes", "(", "Paths", ".", "get", "(", "filePath", ")", ",", "PosixFileAttributes", ".", ...
Gets local file's group. @param filePath the file path @return the group of the local file
[ "Gets", "local", "file", "s", "group", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L104-L108
18,834
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.getLocalFileMode
public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); }
java
public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); }
[ "public", "static", "short", "getLocalFileMode", "(", "String", "filePath", ")", "throws", "IOException", "{", "Set", "<", "PosixFilePermission", ">", "permission", "=", "Files", ".", "readAttributes", "(", "Paths", ".", "get", "(", "filePath", ")", ",", "Posi...
Gets local file's permission mode. @param filePath the file path @return the file mode in short, e.g. 0777
[ "Gets", "local", "file", "s", "permission", "mode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L116-L120
18,835
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.translatePosixPermissionToMode
public static short translatePosixPermissionToMode(Set<PosixFilePermission> permission) { int mode = 0; for (PosixFilePermission action : PosixFilePermission.values()) { mode = mode << 1; mode += permission.contains(action) ? 1 : 0; } return (short) mode; }
java
public static short translatePosixPermissionToMode(Set<PosixFilePermission> permission) { int mode = 0; for (PosixFilePermission action : PosixFilePermission.values()) { mode = mode << 1; mode += permission.contains(action) ? 1 : 0; } return (short) mode; }
[ "public", "static", "short", "translatePosixPermissionToMode", "(", "Set", "<", "PosixFilePermission", ">", "permission", ")", "{", "int", "mode", "=", "0", ";", "for", "(", "PosixFilePermission", "action", ":", "PosixFilePermission", ".", "values", "(", ")", ")...
Translate posix file permissions to short mode. @param permission posix file permission @return mode for file
[ "Translate", "posix", "file", "permissions", "to", "short", "mode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L128-L135
18,836
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.changeLocalFileUser
public static void changeLocalFileUser(String path, String user) throws IOException { UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); PosixFileAttributeView view = Files.getFileAttributeView(Paths.get(path), PosixFileAttributeView.class, ...
java
public static void changeLocalFileUser(String path, String user) throws IOException { UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); PosixFileAttributeView view = Files.getFileAttributeView(Paths.get(path), PosixFileAttributeView.class, ...
[ "public", "static", "void", "changeLocalFileUser", "(", "String", "path", ",", "String", "user", ")", "throws", "IOException", "{", "UserPrincipalLookupService", "lookupService", "=", "FileSystems", ".", "getDefault", "(", ")", ".", "getUserPrincipalLookupService", "(...
Changes the local file's user. @param path that will change owner @param user the new user
[ "Changes", "the", "local", "file", "s", "user", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L143-L151
18,837
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.createBlockPath
public static void createBlockPath(String path, String workerDataFolderPermissions) throws IOException { try { createStorageDirPath(PathUtils.getParent(path), workerDataFolderPermissions); } catch (InvalidPathException e) { throw new IOException("Failed to create block path, get parent path of...
java
public static void createBlockPath(String path, String workerDataFolderPermissions) throws IOException { try { createStorageDirPath(PathUtils.getParent(path), workerDataFolderPermissions); } catch (InvalidPathException e) { throw new IOException("Failed to create block path, get parent path of...
[ "public", "static", "void", "createBlockPath", "(", "String", "path", ",", "String", "workerDataFolderPermissions", ")", "throws", "IOException", "{", "try", "{", "createStorageDirPath", "(", "PathUtils", ".", "getParent", "(", "path", ")", ",", "workerDataFolderPer...
Creates the local block path and all the parent directories. Also, sets the appropriate permissions. @param path the path of the block @param workerDataFolderPermissions The permissions to set on the worker's data folder
[ "Creates", "the", "local", "block", "path", "and", "all", "the", "parent", "directories", ".", "Also", "sets", "the", "appropriate", "permissions", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L187-L197
18,838
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.delete
public static void delete(String path) throws IOException { if (!Files.deleteIfExists(Paths.get(path))) { throw new IOException("Failed to delete " + path); } }
java
public static void delete(String path) throws IOException { if (!Files.deleteIfExists(Paths.get(path))) { throw new IOException("Failed to delete " + path); } }
[ "public", "static", "void", "delete", "(", "String", "path", ")", "throws", "IOException", "{", "if", "(", "!", "Files", ".", "deleteIfExists", "(", "Paths", ".", "get", "(", "path", ")", ")", ")", "{", "throw", "new", "IOException", "(", "\"Failed to de...
Deletes the file or directory. @param path pathname string of file or directory
[ "Deletes", "the", "file", "or", "directory", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L215-L219
18,839
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.deletePathRecursively
public static void deletePathRecursively(String path) throws IOException { if (!exists(path)) { return; } Path root = Paths.get(path); Files.walkFileTree(root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOExce...
java
public static void deletePathRecursively(String path) throws IOException { if (!exists(path)) { return; } Path root = Paths.get(path); Files.walkFileTree(root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOExce...
[ "public", "static", "void", "deletePathRecursively", "(", "String", "path", ")", "throws", "IOException", "{", "if", "(", "!", "exists", "(", "path", ")", ")", "{", "return", ";", "}", "Path", "root", "=", "Paths", ".", "get", "(", "path", ")", ";", ...
Deletes a file or a directory, recursively if it is a directory. If the path does not exist, nothing happens. @param path pathname to be deleted
[ "Deletes", "a", "file", "or", "a", "directory", "recursively", "if", "it", "is", "a", "directory", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L228-L250
18,840
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.createStorageDirPath
public static boolean createStorageDirPath(String path, String workerDataFolderPermissions) throws IOException { if (Files.exists(Paths.get(path))) { return false; } Path storagePath; try { storagePath = Files.createDirectories(Paths.get(path)); } catch (UnsupportedOperationExcepti...
java
public static boolean createStorageDirPath(String path, String workerDataFolderPermissions) throws IOException { if (Files.exists(Paths.get(path))) { return false; } Path storagePath; try { storagePath = Files.createDirectories(Paths.get(path)); } catch (UnsupportedOperationExcepti...
[ "public", "static", "boolean", "createStorageDirPath", "(", "String", "path", ",", "String", "workerDataFolderPermissions", ")", "throws", "IOException", "{", "if", "(", "Files", ".", "exists", "(", "Paths", ".", "get", "(", "path", ")", ")", ")", "{", "retu...
Creates the storage directory path, including any necessary but nonexistent parent directories. If the directory already exists, do nothing. Also, appropriate directory permissions (w/ StickyBit) are set. @param path storage directory path to create @param workerDataFolderPermissions the permissions to set for the wo...
[ "Creates", "the", "storage", "directory", "path", "including", "any", "necessary", "but", "nonexistent", "parent", "directories", ".", "If", "the", "directory", "already", "exists", "do", "nothing", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L262-L277
18,841
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.createFile
public static void createFile(String filePath) throws IOException { Path storagePath = Paths.get(filePath); Files.createDirectories(storagePath.getParent()); Files.createFile(storagePath); }
java
public static void createFile(String filePath) throws IOException { Path storagePath = Paths.get(filePath); Files.createDirectories(storagePath.getParent()); Files.createFile(storagePath); }
[ "public", "static", "void", "createFile", "(", "String", "filePath", ")", "throws", "IOException", "{", "Path", "storagePath", "=", "Paths", ".", "get", "(", "filePath", ")", ";", "Files", ".", "createDirectories", "(", "storagePath", ".", "getParent", "(", ...
Creates an empty file and its intermediate directories if necessary. @param filePath pathname string of the file to create
[ "Creates", "an", "empty", "file", "and", "its", "intermediate", "directories", "if", "necessary", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L284-L288
18,842
Alluxio/alluxio
core/common/src/main/java/alluxio/util/io/FileUtils.java
FileUtils.isStorageDirAccessible
public static boolean isStorageDirAccessible(String path) { Path filePath = Paths.get(path); return Files.exists(filePath) && Files.isReadable(filePath) && Files.isWritable(filePath) && Files.isExecutable(filePath); }
java
public static boolean isStorageDirAccessible(String path) { Path filePath = Paths.get(path); return Files.exists(filePath) && Files.isReadable(filePath) && Files.isWritable(filePath) && Files.isExecutable(filePath); }
[ "public", "static", "boolean", "isStorageDirAccessible", "(", "String", "path", ")", "{", "Path", "filePath", "=", "Paths", ".", "get", "(", "path", ")", ";", "return", "Files", ".", "exists", "(", "filePath", ")", "&&", "Files", ".", "isReadable", "(", ...
Checks if a storage directory path is accessible. @param path the given path @return true if path exists, false otherwise
[ "Checks", "if", "a", "storage", "directory", "path", "is", "accessible", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L315-L321
18,843
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/BackupManager.java
BackupManager.backup
public void backup(OutputStream os) throws IOException { int count = 0; GzipCompressorOutputStream zipStream = new GzipCompressorOutputStream(os); for (Master master : mRegistry.getServers()) { Iterator<JournalEntry> it = master.getJournalEntryIterator(); while (it.hasNext()) { it.next()...
java
public void backup(OutputStream os) throws IOException { int count = 0; GzipCompressorOutputStream zipStream = new GzipCompressorOutputStream(os); for (Master master : mRegistry.getServers()) { Iterator<JournalEntry> it = master.getJournalEntryIterator(); while (it.hasNext()) { it.next()...
[ "public", "void", "backup", "(", "OutputStream", "os", ")", "throws", "IOException", "{", "int", "count", "=", "0", ";", "GzipCompressorOutputStream", "zipStream", "=", "new", "GzipCompressorOutputStream", "(", "os", ")", ";", "for", "(", "Master", "master", "...
Writes a backup to the specified stream. @param os the stream to write to
[ "Writes", "a", "backup", "to", "the", "specified", "stream", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/BackupManager.java#L65-L78
18,844
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/BackupManager.java
BackupManager.initFromBackup
public void initFromBackup(InputStream is) throws IOException { int count = 0; try (GzipCompressorInputStream gzIn = new GzipCompressorInputStream(is); JournalEntryStreamReader reader = new JournalEntryStreamReader(gzIn)) { List<Master> masters = mRegistry.getServers(); JournalEntry entry; ...
java
public void initFromBackup(InputStream is) throws IOException { int count = 0; try (GzipCompressorInputStream gzIn = new GzipCompressorInputStream(is); JournalEntryStreamReader reader = new JournalEntryStreamReader(gzIn)) { List<Master> masters = mRegistry.getServers(); JournalEntry entry; ...
[ "public", "void", "initFromBackup", "(", "InputStream", "is", ")", "throws", "IOException", "{", "int", "count", "=", "0", ";", "try", "(", "GzipCompressorInputStream", "gzIn", "=", "new", "GzipCompressorInputStream", "(", "is", ")", ";", "JournalEntryStreamReader...
Restores master state from the specified backup. @param is an input stream to read from the backup
[ "Restores", "master", "state", "from", "the", "specified", "backup", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/BackupManager.java#L85-L108
18,845
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java
Cache.get
public Optional<V> get(K key) { if (cacheIsFull()) { Entry entry = mMap.get(key); if (entry == null) { return load(key); } return Optional.ofNullable(entry.mValue); } Entry result = mMap.compute(key, (k, entry) -> { if (entry != null) { entry.mReferenced = true;...
java
public Optional<V> get(K key) { if (cacheIsFull()) { Entry entry = mMap.get(key); if (entry == null) { return load(key); } return Optional.ofNullable(entry.mValue); } Entry result = mMap.compute(key, (k, entry) -> { if (entry != null) { entry.mReferenced = true;...
[ "public", "Optional", "<", "V", ">", "get", "(", "K", "key", ")", "{", "if", "(", "cacheIsFull", "(", ")", ")", "{", "Entry", "entry", "=", "mMap", ".", "get", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "return", "load", ...
Retrieves a value from the cache, loading it from the backing store if necessary. If the value needs to be loaded, concurrent calls to get(key) will block while waiting for the first call to finish loading the value. @param key the key to get the value for @return the value, or empty if the key doesn't exist in the c...
[ "Retrieves", "a", "value", "from", "the", "cache", "loading", "it", "from", "the", "backing", "store", "if", "necessary", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java#L100-L127
18,846
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java
Cache.remove
public void remove(K key) { // Set the entry so that it will be removed from the backing store when it is encountered by // the eviction thread. mMap.compute(key, (k, entry) -> { onRemove(key); if (entry == null && cacheIsFull()) { removeFromBackingStore(k); return null; } ...
java
public void remove(K key) { // Set the entry so that it will be removed from the backing store when it is encountered by // the eviction thread. mMap.compute(key, (k, entry) -> { onRemove(key); if (entry == null && cacheIsFull()) { removeFromBackingStore(k); return null; } ...
[ "public", "void", "remove", "(", "K", "key", ")", "{", "// Set the entry so that it will be removed from the backing store when it is encountered by", "// the eviction thread.", "mMap", ".", "compute", "(", "key", ",", "(", "k", ",", "entry", ")", "->", "{", "onRemove",...
Removes a key from the cache. The key is not immediately removed from the backing store. Instead, we set the entry's value to null to indicate to the eviction thread that to evict the entry, it must first remove the key from the backing store. However, if the cache is full we must synchronously write to the backing st...
[ "Removes", "a", "key", "from", "the", "cache", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java#L164-L184
18,847
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java
Cache.flush
public void flush() throws InterruptedException { List<Entry> toFlush = new ArrayList<>(mEvictBatchSize); Iterator<Entry> it = mMap.values().iterator(); while (it.hasNext()) { if (Thread.interrupted()) { throw new InterruptedException(); } while (toFlush.size() < mEvictBatchSize &&...
java
public void flush() throws InterruptedException { List<Entry> toFlush = new ArrayList<>(mEvictBatchSize); Iterator<Entry> it = mMap.values().iterator(); while (it.hasNext()) { if (Thread.interrupted()) { throw new InterruptedException(); } while (toFlush.size() < mEvictBatchSize &&...
[ "public", "void", "flush", "(", ")", "throws", "InterruptedException", "{", "List", "<", "Entry", ">", "toFlush", "=", "new", "ArrayList", "<>", "(", "mEvictBatchSize", ")", ";", "Iterator", "<", "Entry", ">", "it", "=", "mMap", ".", "values", "(", ")", ...
Flushes all data to the backing store.
[ "Flushes", "all", "data", "to", "the", "backing", "store", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java#L189-L205
18,848
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java
Cache.clear
public void clear() { mMap.forEach((key, value) -> { onCacheUpdate(key, value.mValue); onRemove(key); }); mMap.clear(); }
java
public void clear() { mMap.forEach((key, value) -> { onCacheUpdate(key, value.mValue); onRemove(key); }); mMap.clear(); }
[ "public", "void", "clear", "(", ")", "{", "mMap", ".", "forEach", "(", "(", "key", ",", "value", ")", "->", "{", "onCacheUpdate", "(", "key", ",", "value", ".", "mValue", ")", ";", "onRemove", "(", "key", ")", ";", "}", ")", ";", "mMap", ".", "...
Clears all entries from the map. This is not threadsafe, and requires external synchronization to prevent concurrent modifications to the cache.
[ "Clears", "all", "entries", "from", "the", "map", ".", "This", "is", "not", "threadsafe", "and", "requires", "external", "synchronization", "to", "prevent", "concurrent", "modifications", "to", "the", "cache", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/caching/Cache.java#L211-L217
18,849
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.removeLastInode
public void removeLastInode() { Preconditions.checkState(fullPathExists()); if (!isImplicitlyLocked()) { // WRITE_EDGE pattern always implicitly locks the list when the full path exists, so the lock // list must end with an inode. mLockList.unlockLastInode(); mLockList.unlockLastEdge();...
java
public void removeLastInode() { Preconditions.checkState(fullPathExists()); if (!isImplicitlyLocked()) { // WRITE_EDGE pattern always implicitly locks the list when the full path exists, so the lock // list must end with an inode. mLockList.unlockLastInode(); mLockList.unlockLastEdge();...
[ "public", "void", "removeLastInode", "(", ")", "{", "Preconditions", ".", "checkState", "(", "fullPathExists", "(", ")", ")", ";", "if", "(", "!", "isImplicitlyLocked", "(", ")", ")", "{", "// WRITE_EDGE pattern always implicitly locks the list when the full path exists...
Removes the last inode from the list. This is necessary when the last inode is deleted and we want to continue using the inodepath. This operation is only supported when the path is complete.
[ "Removes", "the", "last", "inode", "from", "the", "list", ".", "This", "is", "necessary", "when", "the", "last", "inode", "is", "deleted", "and", "we", "want", "to", "continue", "using", "the", "inodepath", ".", "This", "operation", "is", "only", "supporte...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L256-L266
18,850
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.addNextInode
public void addNextInode(Inode inode) { Preconditions.checkState(mLockPattern == LockPattern.WRITE_EDGE); Preconditions.checkState(!fullPathExists()); Preconditions.checkState(inode.getName().equals(mPathComponents[mExistingInodes.size()])); if (!isImplicitlyLocked() && mExistingInodes.size() < mPathCo...
java
public void addNextInode(Inode inode) { Preconditions.checkState(mLockPattern == LockPattern.WRITE_EDGE); Preconditions.checkState(!fullPathExists()); Preconditions.checkState(inode.getName().equals(mPathComponents[mExistingInodes.size()])); if (!isImplicitlyLocked() && mExistingInodes.size() < mPathCo...
[ "public", "void", "addNextInode", "(", "Inode", "inode", ")", "{", "Preconditions", ".", "checkState", "(", "mLockPattern", "==", "LockPattern", ".", "WRITE_EDGE", ")", ";", "Preconditions", ".", "checkState", "(", "!", "fullPathExists", "(", ")", ")", ";", ...
Adds the next inode to the path. This tries to reduce the scope of locking by moving the write lock forward to the new final edge, downgrading the previous write lock to a read lock. If the path is implicitly locked, the inode is added but no downgrade occurs. @param inode the inode to add
[ "Adds", "the", "next", "inode", "to", "the", "path", ".", "This", "tries", "to", "reduce", "the", "scope", "of", "locking", "by", "moving", "the", "write", "lock", "forward", "to", "the", "new", "final", "edge", "downgrading", "the", "previous", "write", ...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L275-L284
18,851
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.downgradeToPattern
public void downgradeToPattern(LockPattern desiredLockPattern) { switch (desiredLockPattern) { case READ: if (mLockPattern == LockPattern.WRITE_INODE) { Preconditions.checkState(!isImplicitlyLocked()); mLockList.downgradeLastInode(); } else if (mLockPattern == LockPattern.W...
java
public void downgradeToPattern(LockPattern desiredLockPattern) { switch (desiredLockPattern) { case READ: if (mLockPattern == LockPattern.WRITE_INODE) { Preconditions.checkState(!isImplicitlyLocked()); mLockList.downgradeLastInode(); } else if (mLockPattern == LockPattern.W...
[ "public", "void", "downgradeToPattern", "(", "LockPattern", "desiredLockPattern", ")", "{", "switch", "(", "desiredLockPattern", ")", "{", "case", "READ", ":", "if", "(", "mLockPattern", "==", "LockPattern", ".", "WRITE_INODE", ")", "{", "Preconditions", ".", "c...
Downgrades from the current locking scheme to the desired locking scheme. @param desiredLockPattern the pattern to downgrade to
[ "Downgrades", "from", "the", "current", "locking", "scheme", "to", "the", "desired", "locking", "scheme", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L291-L315
18,852
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.lockDescendant
public LockedInodePath lockDescendant(AlluxioURI descendantUri, LockPattern lockPattern) throws InvalidPathException { LockedInodePath path = new LockedInodePath(descendantUri, this, PathUtils.getPathComponents(descendantUri.getPath()), lockPattern); path.traverseOrClose(); return path; }
java
public LockedInodePath lockDescendant(AlluxioURI descendantUri, LockPattern lockPattern) throws InvalidPathException { LockedInodePath path = new LockedInodePath(descendantUri, this, PathUtils.getPathComponents(descendantUri.getPath()), lockPattern); path.traverseOrClose(); return path; }
[ "public", "LockedInodePath", "lockDescendant", "(", "AlluxioURI", "descendantUri", ",", "LockPattern", "lockPattern", ")", "throws", "InvalidPathException", "{", "LockedInodePath", "path", "=", "new", "LockedInodePath", "(", "descendantUri", ",", "this", ",", "PathUtils...
Locks a descendant of the current path and returns a new locked inode path. The path is traversed according to the lock pattern. Closing the new path will have no effect on the current path. On failure, all locks taken by this method will be released. @param descendantUri the full descendent uri starting from the roo...
[ "Locks", "a", "descendant", "of", "the", "current", "path", "and", "returns", "a", "new", "locked", "inode", "path", ".", "The", "path", "is", "traversed", "according", "to", "the", "lock", "pattern", ".", "Closing", "the", "new", "path", "will", "have", ...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L360-L366
18,853
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.lockChild
public LockedInodePath lockChild(Inode child, LockPattern lockPattern) throws InvalidPathException { return lockChild(child, lockPattern, addComponent(mPathComponents, child.getName())); }
java
public LockedInodePath lockChild(Inode child, LockPattern lockPattern) throws InvalidPathException { return lockChild(child, lockPattern, addComponent(mPathComponents, child.getName())); }
[ "public", "LockedInodePath", "lockChild", "(", "Inode", "child", ",", "LockPattern", "lockPattern", ")", "throws", "InvalidPathException", "{", "return", "lockChild", "(", "child", ",", "lockPattern", ",", "addComponent", "(", "mPathComponents", ",", "child", ".", ...
Returns a new locked inode path composed of the current path plus the child inode. The path is traversed according to the lock pattern. The original locked inode path is unaffected. childComponentsHint can be used to save the work of computing path components when the path components for the new path are already known...
[ "Returns", "a", "new", "locked", "inode", "path", "composed", "of", "the", "current", "path", "plus", "the", "child", "inode", ".", "The", "path", "is", "traversed", "according", "to", "the", "lock", "pattern", ".", "The", "original", "locked", "inode", "p...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L381-L384
18,854
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.lockFinalEdgeWrite
public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE); newPath.traverse(); return newPath; }
java
public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException { Preconditions.checkState(!fullPathExists()); LockedInodePath newPath = new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE); newPath.traverse(); return newPath; }
[ "public", "LockedInodePath", "lockFinalEdgeWrite", "(", ")", "throws", "InvalidPathException", "{", "Preconditions", ".", "checkState", "(", "!", "fullPathExists", "(", ")", ")", ";", "LockedInodePath", "newPath", "=", "new", "LockedInodePath", "(", "mUri", ",", "...
Returns a copy of the path with the final edge write locked. This requires that we haven't already locked the final edge, i.e. the path is incomplete. @return the new locked path
[ "Returns", "a", "copy", "of", "the", "path", "with", "the", "final", "edge", "write", "locked", ".", "This", "requires", "that", "we", "haven", "t", "already", "locked", "the", "final", "edge", "i", ".", "e", ".", "the", "path", "is", "incomplete", "."...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L416-L423
18,855
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java
LockedInodePath.traverse
public void traverse() throws InvalidPathException { if (mLockList.getLockMode() == LockMode.WRITE) { traverseWithoutLocking(); return; } // This locks the root edge and inode if necessary. bootstrapTraversal(); // Each iteration either locks a new inode/edge or hits a missing inode an...
java
public void traverse() throws InvalidPathException { if (mLockList.getLockMode() == LockMode.WRITE) { traverseWithoutLocking(); return; } // This locks the root edge and inode if necessary. bootstrapTraversal(); // Each iteration either locks a new inode/edge or hits a missing inode an...
[ "public", "void", "traverse", "(", ")", "throws", "InvalidPathException", "{", "if", "(", "mLockList", ".", "getLockMode", "(", ")", "==", "LockMode", ".", "WRITE", ")", "{", "traverseWithoutLocking", "(", ")", ";", "return", ";", "}", "// This locks the root ...
Traverses the inode path according to its lock pattern. If the inode path is already partially traversed, this method will pick up where the previous traversal left off. If the path already ends in a write lock, traverse will populate the inodes list without taking any additional locks. On return, all existing inodes ...
[ "Traverses", "the", "inode", "path", "according", "to", "its", "lock", "pattern", ".", "If", "the", "inode", "path", "is", "already", "partially", "traversed", "this", "method", "will", "pick", "up", "where", "the", "previous", "traversal", "left", "off", "....
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/LockedInodePath.java#L443-L516
18,856
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java
MetricsStore.getFullInstanceId
private static String getFullInstanceId(String hostname, String id) { String str = hostname == null ? "" : hostname; str = str.replace('.', '_'); str += (id == null ? "" : "-" + id); return str; }
java
private static String getFullInstanceId(String hostname, String id) { String str = hostname == null ? "" : hostname; str = str.replace('.', '_'); str += (id == null ? "" : "-" + id); return str; }
[ "private", "static", "String", "getFullInstanceId", "(", "String", "hostname", ",", "String", "id", ")", "{", "String", "str", "=", "hostname", "==", "null", "?", "\"\"", ":", "hostname", ";", "str", "=", "str", ".", "replace", "(", "'", "'", ",", "'",...
Gets the full instance id of the concatenation of hostname and the id. The dots in the hostname replaced by underscores. @param hostname the hostname @param id the instance id @return the full instance id of hostname[:id]
[ "Gets", "the", "full", "instance", "id", "of", "the", "concatenation", "of", "hostname", "and", "the", "id", ".", "The", "dots", "in", "the", "hostname", "replaced", "by", "underscores", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java#L68-L73
18,857
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java
MetricsStore.putWorkerMetrics
public void putWorkerMetrics(String hostname, List<Metric> metrics) { if (metrics.isEmpty()) { return; } synchronized (mWorkerMetrics) { mWorkerMetrics.removeByField(ID_INDEX, getFullInstanceId(hostname, null)); for (Metric metric : metrics) { if (metric.getHostname() == null) { ...
java
public void putWorkerMetrics(String hostname, List<Metric> metrics) { if (metrics.isEmpty()) { return; } synchronized (mWorkerMetrics) { mWorkerMetrics.removeByField(ID_INDEX, getFullInstanceId(hostname, null)); for (Metric metric : metrics) { if (metric.getHostname() == null) { ...
[ "public", "void", "putWorkerMetrics", "(", "String", "hostname", ",", "List", "<", "Metric", ">", "metrics", ")", "{", "if", "(", "metrics", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "synchronized", "(", "mWorkerMetrics", ")", "{", "mWorker...
Put the metrics from a worker with a hostname. If all the old metrics associated with this instance will be removed and then replaced by the latest. @param hostname the hostname of the instance @param metrics the new worker metrics
[ "Put", "the", "metrics", "from", "a", "worker", "with", "a", "hostname", ".", "If", "all", "the", "old", "metrics", "associated", "with", "this", "instance", "will", "be", "removed", "and", "then", "replaced", "by", "the", "latest", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java#L91-L104
18,858
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java
MetricsStore.putClientMetrics
public void putClientMetrics(String hostname, String clientId, List<Metric> metrics) { if (metrics.isEmpty()) { return; } LOG.debug("Removing metrics for id {} to replace with {}", clientId, metrics); synchronized (mClientMetrics) { mClientMetrics.removeByField(ID_INDEX, getFullInstanc...
java
public void putClientMetrics(String hostname, String clientId, List<Metric> metrics) { if (metrics.isEmpty()) { return; } LOG.debug("Removing metrics for id {} to replace with {}", clientId, metrics); synchronized (mClientMetrics) { mClientMetrics.removeByField(ID_INDEX, getFullInstanc...
[ "public", "void", "putClientMetrics", "(", "String", "hostname", ",", "String", "clientId", ",", "List", "<", "Metric", ">", "metrics", ")", "{", "if", "(", "metrics", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "LOG", ".", "debug", "(", ...
Put the metrics from a client with a hostname and a client id. If all the old metrics associated with this instance will be removed and then replaced by the latest. @param hostname the hostname of the client @param clientId the id of the client @param metrics the new metrics
[ "Put", "the", "metrics", "from", "a", "client", "with", "a", "hostname", "and", "a", "client", "id", ".", "If", "all", "the", "old", "metrics", "associated", "with", "this", "instance", "will", "be", "removed", "and", "then", "replaced", "by", "the", "la...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java#L114-L129
18,859
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java
MetricsStore.getMetricsByInstanceTypeAndName
public Set<Metric> getMetricsByInstanceTypeAndName( MetricsSystem.InstanceType instanceType, String name) { if (instanceType == InstanceType.MASTER) { return getMasterMetrics(name); } if (instanceType == InstanceType.WORKER) { synchronized (mWorkerMetrics) { return mWorkerMetrics....
java
public Set<Metric> getMetricsByInstanceTypeAndName( MetricsSystem.InstanceType instanceType, String name) { if (instanceType == InstanceType.MASTER) { return getMasterMetrics(name); } if (instanceType == InstanceType.WORKER) { synchronized (mWorkerMetrics) { return mWorkerMetrics....
[ "public", "Set", "<", "Metric", ">", "getMetricsByInstanceTypeAndName", "(", "MetricsSystem", ".", "InstanceType", "instanceType", ",", "String", "name", ")", "{", "if", "(", "instanceType", "==", "InstanceType", ".", "MASTER", ")", "{", "return", "getMasterMetric...
Gets all the metrics by instance type and the metric name. The supported instance types are worker and client. @param instanceType the instance type @param name the metric name @return the set of matched metrics
[ "Gets", "all", "the", "metrics", "by", "instance", "type", "and", "the", "metric", "name", ".", "The", "supported", "instance", "types", "are", "worker", "and", "client", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java#L139-L156
18,860
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.create
@Override public FSDataOutputStream create(Path path, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { LOG.debug("create({}, {}, {}, {}, {}, {}, {})", path, permission, overwrite, bufferSize, replication, block...
java
@Override public FSDataOutputStream create(Path path, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { LOG.debug("create({}, {}, {}, {}, {}, {}, {})", path, permission, overwrite, bufferSize, replication, block...
[ "@", "Override", "public", "FSDataOutputStream", "create", "(", "Path", "path", ",", "FsPermission", "permission", ",", "boolean", "overwrite", ",", "int", "bufferSize", ",", "short", "replication", ",", "long", "blockSize", ",", "Progressable", "progress", ")", ...
Attempts to create a file. Overwrite will not succeed if the path exists and is a folder. @param path path to create @param permission permissions of the created file/folder @param overwrite overwrite if file exists @param bufferSize the size in bytes of the buffer to be used @param replication under filesystem replic...
[ "Attempts", "to", "create", "a", "file", ".", "Overwrite", "will", "not", "succeed", "if", "the", "path", "exists", "and", "is", "a", "folder", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L157-L192
18,861
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.delete
@Override public boolean delete(Path path, boolean recursive) throws IOException { LOG.debug("delete({}, {})", path, recursive); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); DeletePOptions options = De...
java
@Override public boolean delete(Path path, boolean recursive) throws IOException { LOG.debug("delete({}, {})", path, recursive); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); DeletePOptions options = De...
[ "@", "Override", "public", "boolean", "delete", "(", "Path", "path", ",", "boolean", "recursive", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"delete({}, {})\"", ",", "path", ",", "recursive", ")", ";", "if", "(", "mStatistics", "!=", "n...
Attempts to delete the file or directory with the specified path. @param path path to delete @param recursive if true, will attempt to delete all children of the path @return true if one or more files/directories were deleted; false otherwise
[ "Attempts", "to", "delete", "the", "file", "or", "directory", "with", "the", "specified", "path", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L241-L258
18,862
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.setPermission
@Override public void setPermission(Path path, FsPermission permission) throws IOException { LOG.debug("setMode({},{})", path, permission.toString()); AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); SetAttributePOptions options = SetAttributePOptions.newBuilder() .setMode(...
java
@Override public void setPermission(Path path, FsPermission permission) throws IOException { LOG.debug("setMode({},{})", path, permission.toString()); AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); SetAttributePOptions options = SetAttributePOptions.newBuilder() .setMode(...
[ "@", "Override", "public", "void", "setPermission", "(", "Path", "path", ",", "FsPermission", "permission", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"setMode({},{})\"", ",", "path", ",", "permission", ".", "toString", "(", ")", ")", ";"...
Changes permission of a path. @param path path to set permission @param permission permission set to path
[ "Changes", "permission", "of", "a", "path", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L404-L415
18,863
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.getConfigurationFromUri
private Map<String, Object> getConfigurationFromUri(URI uri) { AlluxioURI alluxioUri = new AlluxioURI(uri.toString()); Map<String, Object> alluxioConfProperties = new HashMap<>(); if (alluxioUri.getAuthority() instanceof ZookeeperAuthority) { ZookeeperAuthority authority = (ZookeeperAuthority) alluxi...
java
private Map<String, Object> getConfigurationFromUri(URI uri) { AlluxioURI alluxioUri = new AlluxioURI(uri.toString()); Map<String, Object> alluxioConfProperties = new HashMap<>(); if (alluxioUri.getAuthority() instanceof ZookeeperAuthority) { ZookeeperAuthority authority = (ZookeeperAuthority) alluxi...
[ "private", "Map", "<", "String", ",", "Object", ">", "getConfigurationFromUri", "(", "URI", "uri", ")", "{", "AlluxioURI", "alluxioUri", "=", "new", "AlluxioURI", "(", "uri", ".", "toString", "(", ")", ")", ";", "Map", "<", "String", ",", "Object", ">", ...
Gets the connection configuration from the input uri. @param uri a Alluxio Uri that may contain connection configuration
[ "Gets", "the", "connection", "configuration", "from", "the", "input", "uri", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L537-L565
18,864
Alluxio/alluxio
core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java
AbstractFileSystem.mkdirs
@Override public boolean mkdirs(Path path, FsPermission permission) throws IOException { LOG.debug("mkdirs({}, {})", path, permission); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); CreateDirectoryPOpti...
java
@Override public boolean mkdirs(Path path, FsPermission permission) throws IOException { LOG.debug("mkdirs({}, {})", path, permission); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); CreateDirectoryPOpti...
[ "@", "Override", "public", "boolean", "mkdirs", "(", "Path", "path", ",", "FsPermission", "permission", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"mkdirs({}, {})\"", ",", "path", ",", "permission", ")", ";", "if", "(", "mStatistics", "!=...
Attempts to create a folder with the specified path. Parent directories will be created. @param path path to create @param permission permissions to grant the created folder @return true if the indicated folder is created successfully or already exists
[ "Attempts", "to", "create", "a", "folder", "with", "the", "specified", "path", ".", "Parent", "directories", "will", "be", "created", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/hdfs/src/main/java/alluxio/hadoop/AbstractFileSystem.java#L637-L652
18,865
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/ModeParser.java
ModeParser.parse
public static Mode parse(String value) { if (StringUtils.isBlank(value)) { throw new IllegalArgumentException(ExceptionMessage.INVALID_MODE.getMessage(value)); } try { return parseNumeric(value); } catch (NumberFormatException e) { // Treat as symbolic return parseSymbolic(value...
java
public static Mode parse(String value) { if (StringUtils.isBlank(value)) { throw new IllegalArgumentException(ExceptionMessage.INVALID_MODE.getMessage(value)); } try { return parseNumeric(value); } catch (NumberFormatException e) { // Treat as symbolic return parseSymbolic(value...
[ "public", "static", "Mode", "parse", "(", "String", "value", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "value", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "ExceptionMessage", ".", "INVALID_MODE", ".", "getMessage", "(", "v...
Parses the given value as a mode. @param value Value @return Mode
[ "Parses", "the", "given", "value", "as", "a", "mode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/ModeParser.java#L39-L50
18,866
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/SessionCleaner.java
SessionCleaner.run
@Override public void run() { long lastCheckMs = System.currentTimeMillis(); while (mRunning) { // Check the time since last check, and wait until it is within check interval long lastIntervalMs = System.currentTimeMillis() - lastCheckMs; long toSleepMs = mCheckIntervalMs - lastIntervalMs; ...
java
@Override public void run() { long lastCheckMs = System.currentTimeMillis(); while (mRunning) { // Check the time since last check, and wait until it is within check interval long lastIntervalMs = System.currentTimeMillis() - lastCheckMs; long toSleepMs = mCheckIntervalMs - lastIntervalMs; ...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "long", "lastCheckMs", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "while", "(", "mRunning", ")", "{", "// Check the time since last check, and wait until it is within check interval", "long", "lastI...
Main loop for the cleanup, continuously looks for zombie sessions.
[ "Main", "loop", "for", "the", "cleanup", "continuously", "looks", "for", "zombie", "sessions", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/SessionCleaner.java#L64-L86
18,867
Alluxio/alluxio
integration/yarn/src/main/java/alluxio/yarn/CommandBuilder.java
CommandBuilder.addArg
public CommandBuilder addArg(String opt, Object arg) { mArgs.add(opt + " " + String.valueOf(arg)); return this; }
java
public CommandBuilder addArg(String opt, Object arg) { mArgs.add(opt + " " + String.valueOf(arg)); return this; }
[ "public", "CommandBuilder", "addArg", "(", "String", "opt", ",", "Object", "arg", ")", "{", "mArgs", ".", "add", "(", "opt", "+", "\" \"", "+", "String", ".", "valueOf", "(", "arg", ")", ")", ";", "return", "this", ";", "}" ]
Adds the string value of the given option argument to the command. For example, to add "-name myFile" to construct the command "find . -name myFile", opt should be "-name" and arg should be "myFile". @param opt the option flag @param arg the argument @return the {@link CommandBuilder} with the argument added
[ "Adds", "the", "string", "value", "of", "the", "given", "option", "argument", "to", "the", "command", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/yarn/src/main/java/alluxio/yarn/CommandBuilder.java#L59-L62
18,868
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fs/FileSystemShell.java
FileSystemShell.main
public static void main(String[] argv) throws IOException { int ret; InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); if (!ConfigurationUtils.masterHostConfigured(conf) && argv.length > 0 && !argv[0].equals("help")) { System.out.println(ConfigurationUtil...
java
public static void main(String[] argv) throws IOException { int ret; InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); if (!ConfigurationUtils.masterHostConfigured(conf) && argv.length > 0 && !argv[0].equals("help")) { System.out.println(ConfigurationUtil...
[ "public", "static", "void", "main", "(", "String", "[", "]", "argv", ")", "throws", "IOException", "{", "int", "ret", ";", "InstancedConfiguration", "conf", "=", "new", "InstancedConfiguration", "(", "ConfigurationUtils", ".", "defaults", "(", ")", ")", ";", ...
Main method, starts a new FileSystemShell. @param argv array of arguments given by the user's input from the terminal
[ "Main", "method", "starts", "a", "new", "FileSystemShell", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShell.java#L54-L69
18,869
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java
StorageDirView.getEvictableBlocks
public List<BlockMeta> getEvictableBlocks() { List<BlockMeta> filteredList = new ArrayList<>(); for (BlockMeta blockMeta : mDir.getBlocks()) { long blockId = blockMeta.getBlockId(); if (mManagerView.isBlockEvictable(blockId)) { filteredList.add(blockMeta); } } return filteredL...
java
public List<BlockMeta> getEvictableBlocks() { List<BlockMeta> filteredList = new ArrayList<>(); for (BlockMeta blockMeta : mDir.getBlocks()) { long blockId = blockMeta.getBlockId(); if (mManagerView.isBlockEvictable(blockId)) { filteredList.add(blockMeta); } } return filteredL...
[ "public", "List", "<", "BlockMeta", ">", "getEvictableBlocks", "(", ")", "{", "List", "<", "BlockMeta", ">", "filteredList", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "BlockMeta", "blockMeta", ":", "mDir", ".", "getBlocks", "(", ")", ")",...
Gets a filtered list of block metadata, for blocks that are neither pinned or being blocked. @return a list of metadata for all evictable blocks
[ "Gets", "a", "filtered", "list", "of", "block", "metadata", "for", "blocks", "that", "are", "neither", "pinned", "or", "being", "blocked", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java#L76-L86
18,870
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java
StorageDirView.getEvitableBytes
public long getEvitableBytes() { long bytes = 0; for (BlockMeta blockMeta : mDir.getBlocks()) { long blockId = blockMeta.getBlockId(); if (mManagerView.isBlockEvictable(blockId)) { bytes += blockMeta.getBlockSize(); } } return bytes; }
java
public long getEvitableBytes() { long bytes = 0; for (BlockMeta blockMeta : mDir.getBlocks()) { long blockId = blockMeta.getBlockId(); if (mManagerView.isBlockEvictable(blockId)) { bytes += blockMeta.getBlockSize(); } } return bytes; }
[ "public", "long", "getEvitableBytes", "(", ")", "{", "long", "bytes", "=", "0", ";", "for", "(", "BlockMeta", "blockMeta", ":", "mDir", ".", "getBlocks", "(", ")", ")", "{", "long", "blockId", "=", "blockMeta", ".", "getBlockId", "(", ")", ";", "if", ...
Gets evictable bytes for this dir, i.e., the total bytes of total evictable blocks. @return evictable bytes for this dir
[ "Gets", "evictable", "bytes", "for", "this", "dir", "i", ".", "e", ".", "the", "total", "bytes", "of", "total", "evictable", "blocks", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java#L120-L129
18,871
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.add
public void add(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, AlluxioURI ufsUri, long mountId, MountPOptions options) throws FileAlreadyExistsException, InvalidPathException { String alluxioPath = alluxioUri.getPath().isEmpty() ? "/" : alluxioUri.getPath(); LOG.info("Mounting {} at {}", ...
java
public void add(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, AlluxioURI ufsUri, long mountId, MountPOptions options) throws FileAlreadyExistsException, InvalidPathException { String alluxioPath = alluxioUri.getPath().isEmpty() ? "/" : alluxioUri.getPath(); LOG.info("Mounting {} at {}", ...
[ "public", "void", "add", "(", "Supplier", "<", "JournalContext", ">", "journalContext", ",", "AlluxioURI", "alluxioUri", ",", "AlluxioURI", "ufsUri", ",", "long", "mountId", ",", "MountPOptions", "options", ")", "throws", "FileAlreadyExistsException", ",", "InvalidP...
Mounts the given UFS path at the given Alluxio path. The Alluxio path should not be nested under an existing mount point. @param journalContext the journal context @param alluxioUri an Alluxio path URI @param ufsUri a UFS path URI @param mountId the mount id @param options the mount options @throws FileAlreadyExistsEx...
[ "Mounts", "the", "given", "UFS", "path", "at", "the", "given", "Alluxio", "path", ".", "The", "Alluxio", "path", "should", "not", "be", "nested", "under", "an", "existing", "mount", "point", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L106-L148
18,872
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.delete
public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) { String path = uri.getPath(); LOG.info("Unmounting {}", path); if (path.equals(ROOT)) { LOG.warn("Cannot unmount the root mount point."); return false; } try (LockResource r = new LockResource(mWriteLock)) {...
java
public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) { String path = uri.getPath(); LOG.info("Unmounting {}", path); if (path.equals(ROOT)) { LOG.warn("Cannot unmount the root mount point."); return false; } try (LockResource r = new LockResource(mWriteLock)) {...
[ "public", "boolean", "delete", "(", "Supplier", "<", "JournalContext", ">", "journalContext", ",", "AlluxioURI", "uri", ")", "{", "String", "path", "=", "uri", ".", "getPath", "(", ")", ";", "LOG", ".", "info", "(", "\"Unmounting {}\"", ",", "path", ")", ...
Unmounts the given Alluxio path. The path should match an existing mount point. @param journalContext journal context @param uri an Alluxio path URI @return whether the operation succeeded or not
[ "Unmounts", "the", "given", "Alluxio", "path", ".", "The", "path", "should", "match", "an", "existing", "mount", "point", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L157-L187
18,873
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.getMountPoint
public String getMountPoint(AlluxioURI uri) throws InvalidPathException { String path = uri.getPath(); String lastMount = ROOT; try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { String mount = entry.getKey(); ...
java
public String getMountPoint(AlluxioURI uri) throws InvalidPathException { String path = uri.getPath(); String lastMount = ROOT; try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { String mount = entry.getKey(); ...
[ "public", "String", "getMountPoint", "(", "AlluxioURI", "uri", ")", "throws", "InvalidPathException", "{", "String", "path", "=", "uri", ".", "getPath", "(", ")", ";", "String", "lastMount", "=", "ROOT", ";", "try", "(", "LockResource", "r", "=", "new", "L...
Returns the closest ancestor mount point the given path is nested under. @param uri an Alluxio path URI @return mount point the given Alluxio path is nested under @throws InvalidPathException if an invalid path is encountered
[ "Returns", "the", "closest", "ancestor", "mount", "point", "the", "given", "path", "is", "nested", "under", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L196-L211
18,874
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.getMountTable
public Map<String, MountInfo> getMountTable() { try (LockResource r = new LockResource(mReadLock)) { return new HashMap<>(mState.getMountTable()); } }
java
public Map<String, MountInfo> getMountTable() { try (LockResource r = new LockResource(mReadLock)) { return new HashMap<>(mState.getMountTable()); } }
[ "public", "Map", "<", "String", ",", "MountInfo", ">", "getMountTable", "(", ")", "{", "try", "(", "LockResource", "r", "=", "new", "LockResource", "(", "mReadLock", ")", ")", "{", "return", "new", "HashMap", "<>", "(", "mState", ".", "getMountTable", "(...
Returns a copy of the current mount table, the mount table is a map from Alluxio file system URIs to the corresponding mount point information. @return a copy of the current mount table
[ "Returns", "a", "copy", "of", "the", "current", "mount", "table", "the", "mount", "table", "is", "a", "map", "from", "Alluxio", "file", "system", "URIs", "to", "the", "corresponding", "mount", "point", "information", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L219-L223
18,875
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.reverseResolve
public AlluxioURI reverseResolve(AlluxioURI ufsUri) { AlluxioURI returnVal = null; for (Map.Entry<String, MountInfo> mountInfoEntry : getMountTable().entrySet()) { try { if (mountInfoEntry.getValue().getUfsUri().isAncestorOf(ufsUri)) { returnVal = reverseResolve(mountInfoEntry.getValue()...
java
public AlluxioURI reverseResolve(AlluxioURI ufsUri) { AlluxioURI returnVal = null; for (Map.Entry<String, MountInfo> mountInfoEntry : getMountTable().entrySet()) { try { if (mountInfoEntry.getValue().getUfsUri().isAncestorOf(ufsUri)) { returnVal = reverseResolve(mountInfoEntry.getValue()...
[ "public", "AlluxioURI", "reverseResolve", "(", "AlluxioURI", "ufsUri", ")", "{", "AlluxioURI", "returnVal", "=", "null", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "MountInfo", ">", "mountInfoEntry", ":", "getMountTable", "(", ")", ".", "entry...
REsolves the given Ufs path. If the given UFs path is mounted in Alluxio space, it returns the associated Alluxio path. @param ufsUri an Ufs path URI @return an Alluxio path URI
[ "REsolves", "the", "given", "Ufs", "path", ".", "If", "the", "given", "UFs", "path", "is", "mounted", "in", "Alluxio", "space", "it", "returns", "the", "associated", "Alluxio", "path", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L272-L289
18,876
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.getUfsClient
public UfsManager.UfsClient getUfsClient(long mountId) { try { return mUfsManager.get(mountId); } catch (NotFoundException | UnavailableException e) { LOG.warn("failed to get ufsclient for mountid {}, exception {}", mountId, e); } return null; }
java
public UfsManager.UfsClient getUfsClient(long mountId) { try { return mUfsManager.get(mountId); } catch (NotFoundException | UnavailableException e) { LOG.warn("failed to get ufsclient for mountid {}, exception {}", mountId, e); } return null; }
[ "public", "UfsManager", ".", "UfsClient", "getUfsClient", "(", "long", "mountId", ")", "{", "try", "{", "return", "mUfsManager", ".", "get", "(", "mountId", ")", ";", "}", "catch", "(", "NotFoundException", "|", "UnavailableException", "e", ")", "{", "LOG", ...
Get the associated ufs client with the mount id. @param mountId mount id to look up ufs client @return ufsClient
[ "Get", "the", "associated", "ufs", "client", "with", "the", "mount", "id", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L296-L303
18,877
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.resolve
public Resolution resolve(AlluxioURI uri) throws InvalidPathException { try (LockResource r = new LockResource(mReadLock)) { String path = uri.getPath(); LOG.debug("Resolving {}", path); // This will re-acquire the read lock, but that is allowed. String mountPoint = getMountPoint(uri); ...
java
public Resolution resolve(AlluxioURI uri) throws InvalidPathException { try (LockResource r = new LockResource(mReadLock)) { String path = uri.getPath(); LOG.debug("Resolving {}", path); // This will re-acquire the read lock, but that is allowed. String mountPoint = getMountPoint(uri); ...
[ "public", "Resolution", "resolve", "(", "AlluxioURI", "uri", ")", "throws", "InvalidPathException", "{", "try", "(", "LockResource", "r", "=", "new", "LockResource", "(", "mReadLock", ")", ")", "{", "String", "path", "=", "uri", ".", "getPath", "(", ")", "...
Resolves the given Alluxio path. If the given Alluxio path is nested under a mount point, the resolution maps the Alluxio path to the corresponding UFS path. Otherwise, the resolution is a no-op. @param uri an Alluxio path URI @return the {@link Resolution} representing the UFS path @throws InvalidPathException if an ...
[ "Resolves", "the", "given", "Alluxio", "path", ".", "If", "the", "given", "Alluxio", "path", "is", "nested", "under", "a", "mount", "point", "the", "resolution", "maps", "the", "Alluxio", "path", "to", "the", "corresponding", "UFS", "path", ".", "Otherwise",...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L314-L342
18,878
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java
MountTable.checkUnderWritableMountPoint
public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { // This will re-acquire the read lock, but that is allowed. String mountPoint = getMountPoint(alluxioUri); MountInfo moun...
java
public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { // This will re-acquire the read lock, but that is allowed. String mountPoint = getMountPoint(alluxioUri); MountInfo moun...
[ "public", "void", "checkUnderWritableMountPoint", "(", "AlluxioURI", "alluxioUri", ")", "throws", "InvalidPathException", ",", "AccessControlException", "{", "try", "(", "LockResource", "r", "=", "new", "LockResource", "(", "mReadLock", ")", ")", "{", "// This will re...
Checks to see if a write operation is allowed for the specified Alluxio path, by determining if it is under a readonly mount point. @param alluxioUri an Alluxio path URI @throws InvalidPathException if the Alluxio path is invalid @throws AccessControlException if the Alluxio path is under a readonly mount point
[ "Checks", "to", "see", "if", "a", "write", "operation", "is", "allowed", "for", "the", "specified", "Alluxio", "path", "by", "determining", "if", "it", "is", "under", "a", "readonly", "mount", "point", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L352-L362
18,879
Alluxio/alluxio
core/common/src/main/java/alluxio/heartbeat/ScheduledTimer.java
ScheduledTimer.schedule
protected void schedule() { try (LockResource r = new LockResource(mLock)) { Preconditions.checkState(!mScheduled, "Called schedule twice without waiting for any ticks"); mScheduled = true; mTickCondition.signal(); HeartbeatScheduler.removeTimer(this); } }
java
protected void schedule() { try (LockResource r = new LockResource(mLock)) { Preconditions.checkState(!mScheduled, "Called schedule twice without waiting for any ticks"); mScheduled = true; mTickCondition.signal(); HeartbeatScheduler.removeTimer(this); } }
[ "protected", "void", "schedule", "(", ")", "{", "try", "(", "LockResource", "r", "=", "new", "LockResource", "(", "mLock", ")", ")", "{", "Preconditions", ".", "checkState", "(", "!", "mScheduled", ",", "\"Called schedule twice without waiting for any ticks\"", ")...
Schedules execution of the heartbeat.
[ "Schedules", "execution", "of", "the", "heartbeat", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/heartbeat/ScheduledTimer.java#L71-L78
18,880
Alluxio/alluxio
core/common/src/main/java/alluxio/heartbeat/ScheduledTimer.java
ScheduledTimer.tick
public void tick() throws InterruptedException { try (LockResource r = new LockResource(mLock)) { HeartbeatScheduler.addTimer(this); // Wait in a loop to handle spurious wakeups while (!mScheduled) { mTickCondition.await(); } mScheduled = false; } }
java
public void tick() throws InterruptedException { try (LockResource r = new LockResource(mLock)) { HeartbeatScheduler.addTimer(this); // Wait in a loop to handle spurious wakeups while (!mScheduled) { mTickCondition.await(); } mScheduled = false; } }
[ "public", "void", "tick", "(", ")", "throws", "InterruptedException", "{", "try", "(", "LockResource", "r", "=", "new", "LockResource", "(", "mLock", ")", ")", "{", "HeartbeatScheduler", ".", "addTimer", "(", "this", ")", ";", "// Wait in a loop to handle spurio...
Waits until the heartbeat is scheduled for execution. @throws InterruptedException if the thread is interrupted while waiting
[ "Waits", "until", "the", "heartbeat", "is", "scheduled", "for", "execution", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/heartbeat/ScheduledTimer.java#L85-L95
18,881
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManagerView.java
BlockMetadataManagerView.isBlockMarked
public boolean isBlockMarked(long blockId) { for (StorageTierView tierView : mTierViews) { for (StorageDirView dirView : tierView.getDirViews()) { if (dirView.isMarkedToMoveOut(blockId)) { return true; } } } return false; }
java
public boolean isBlockMarked(long blockId) { for (StorageTierView tierView : mTierViews) { for (StorageDirView dirView : tierView.getDirViews()) { if (dirView.isMarkedToMoveOut(blockId)) { return true; } } } return false; }
[ "public", "boolean", "isBlockMarked", "(", "long", "blockId", ")", "{", "for", "(", "StorageTierView", "tierView", ":", "mTierViews", ")", "{", "for", "(", "StorageDirView", "dirView", ":", "tierView", ".", "getDirViews", "(", ")", ")", "{", "if", "(", "di...
Tests if the block is marked to move out of its current dir in this view. @param blockId the id of the block @return boolean, true if the block is marked to move out
[ "Tests", "if", "the", "block", "is", "marked", "to", "move", "out", "of", "its", "current", "dir", "in", "this", "view", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManagerView.java#L135-L144
18,882
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManagerView.java
BlockMetadataManagerView.getNextTier
@Nullable public StorageTierView getNextTier(StorageTierView tierView) { int nextOrdinal = tierView.getTierViewOrdinal() + 1; if (nextOrdinal < mTierViews.size()) { return mTierViews.get(nextOrdinal); } return null; }
java
@Nullable public StorageTierView getNextTier(StorageTierView tierView) { int nextOrdinal = tierView.getTierViewOrdinal() + 1; if (nextOrdinal < mTierViews.size()) { return mTierViews.get(nextOrdinal); } return null; }
[ "@", "Nullable", "public", "StorageTierView", "getNextTier", "(", "StorageTierView", "tierView", ")", "{", "int", "nextOrdinal", "=", "tierView", ".", "getTierViewOrdinal", "(", ")", "+", "1", ";", "if", "(", "nextOrdinal", "<", "mTierViews", ".", "size", "(",...
Gets the next storage tier view. @param tierView the storage tier view @return the next storage tier view, null if this is the last tier view
[ "Gets", "the", "next", "storage", "tier", "view", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManagerView.java#L190-L197
18,883
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/stream/GrpcDataWriter.java
GrpcDataWriter.writeFallbackInitRequest
public void writeFallbackInitRequest(long pos) throws IOException { Preconditions.checkState(mPartialRequest.getType() == RequestType.UFS_FALLBACK_BLOCK); Protocol.CreateUfsBlockOptions ufsBlockOptions = mPartialRequest.getCreateUfsBlockOptions() .toBuilder().setBytesInBlockStore(pos).build(); Write...
java
public void writeFallbackInitRequest(long pos) throws IOException { Preconditions.checkState(mPartialRequest.getType() == RequestType.UFS_FALLBACK_BLOCK); Protocol.CreateUfsBlockOptions ufsBlockOptions = mPartialRequest.getCreateUfsBlockOptions() .toBuilder().setBytesInBlockStore(pos).build(); Write...
[ "public", "void", "writeFallbackInitRequest", "(", "long", "pos", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mPartialRequest", ".", "getType", "(", ")", "==", "RequestType", ".", "UFS_FALLBACK_BLOCK", ")", ";", "Protocol", ".", ...
Notifies the server UFS fallback endpoint to start writing a new block by resuming the given number of bytes from block store. @param pos number of bytes already written to block store
[ "Notifies", "the", "server", "UFS", "fallback", "endpoint", "to", "start", "writing", "a", "new", "block", "by", "resuming", "the", "given", "number", "of", "bytes", "from", "block", "store", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/GrpcDataWriter.java#L208-L217
18,884
Alluxio/alluxio
core/common/src/main/java/alluxio/wire/WorkerWebUIBlockInfo.java
WorkerWebUIBlockInfo.setFileBlocksOnTier
public WorkerWebUIBlockInfo setFileBlocksOnTier( List<ImmutablePair<String, List<UIFileBlockInfo>>> FileBlocksOnTier) { mFileBlocksOnTier = FileBlocksOnTier; return this; }
java
public WorkerWebUIBlockInfo setFileBlocksOnTier( List<ImmutablePair<String, List<UIFileBlockInfo>>> FileBlocksOnTier) { mFileBlocksOnTier = FileBlocksOnTier; return this; }
[ "public", "WorkerWebUIBlockInfo", "setFileBlocksOnTier", "(", "List", "<", "ImmutablePair", "<", "String", ",", "List", "<", "UIFileBlockInfo", ">", ">", ">", "FileBlocksOnTier", ")", "{", "mFileBlocksOnTier", "=", "FileBlocksOnTier", ";", "return", "this", ";", "...
Sets file blocks on tier. @param FileBlocksOnTier the file blocks on tier @return the file blocks on tier
[ "Sets", "file", "blocks", "on", "tier", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/wire/WorkerWebUIBlockInfo.java#L147-L151
18,885
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.startSinksFromConfig
public static synchronized void startSinksFromConfig(MetricsConfig config) { if (sSinks != null) { LOG.info("Sinks have already been started."); return; } LOG.info("Starting sinks with config: {}.", config); sSinks = new ArrayList<>(); Map<String, Properties> sinkConfigs = Metric...
java
public static synchronized void startSinksFromConfig(MetricsConfig config) { if (sSinks != null) { LOG.info("Sinks have already been started."); return; } LOG.info("Starting sinks with config: {}.", config); sSinks = new ArrayList<>(); Map<String, Properties> sinkConfigs = Metric...
[ "public", "static", "synchronized", "void", "startSinksFromConfig", "(", "MetricsConfig", "config", ")", "{", "if", "(", "sSinks", "!=", "null", ")", "{", "LOG", ".", "info", "(", "\"Sinks have already been started.\"", ")", ";", "return", ";", "}", "LOG", "."...
Starts sinks from a given metrics configuration. This is made public for unit test. @param config the metrics config
[ "Starts", "sinks", "from", "a", "given", "metrics", "configuration", ".", "This", "is", "made", "public", "for", "unit", "test", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L150-L174
18,886
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.stopSinks
public static synchronized void stopSinks() { if (sSinks != null) { for (Sink sink : sSinks) { sink.stop(); } } sSinks = null; }
java
public static synchronized void stopSinks() { if (sSinks != null) { for (Sink sink : sSinks) { sink.stop(); } } sSinks = null; }
[ "public", "static", "synchronized", "void", "stopSinks", "(", ")", "{", "if", "(", "sSinks", "!=", "null", ")", "{", "for", "(", "Sink", "sink", ":", "sSinks", ")", "{", "sink", ".", "stop", "(", ")", ";", "}", "}", "sSinks", "=", "null", ";", "}...
Stops all the sinks.
[ "Stops", "all", "the", "sinks", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L179-L186
18,887
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.getMetricName
public static String getMetricName(String name) { switch (CommonUtils.PROCESS_TYPE.get()) { case CLIENT: return getClientMetricName(name); case MASTER: return getMasterMetricName(name); case PROXY: return getProxyMetricName(name); case WORKER: return getWorker...
java
public static String getMetricName(String name) { switch (CommonUtils.PROCESS_TYPE.get()) { case CLIENT: return getClientMetricName(name); case MASTER: return getMasterMetricName(name); case PROXY: return getProxyMetricName(name); case WORKER: return getWorker...
[ "public", "static", "String", "getMetricName", "(", "String", "name", ")", "{", "switch", "(", "CommonUtils", ".", "PROCESS_TYPE", ".", "get", "(", ")", ")", "{", "case", "CLIENT", ":", "return", "getClientMetricName", "(", "name", ")", ";", "case", "MASTE...
Converts a simple string to a qualified metric name based on the process type. @param name the name of the metric @return the metric with instance and id tags
[ "Converts", "a", "simple", "string", "to", "a", "qualified", "metric", "name", "based", "on", "the", "process", "type", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L205-L222
18,888
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.getMasterMetricName
private static String getMasterMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> InstanceType.MASTER.toString() + "." + name); }
java
private static String getMasterMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> InstanceType.MASTER.toString() + "." + name); }
[ "private", "static", "String", "getMasterMetricName", "(", "String", "name", ")", "{", "String", "result", "=", "CACHED_METRICS", ".", "get", "(", "name", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "return", "CAC...
Builds metric registry names for master instance. The pattern is instance.metricName. @param name the metric name @return the metric registry name
[ "Builds", "metric", "registry", "names", "for", "master", "instance", ".", "The", "pattern", "is", "instance", ".", "metricName", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L230-L236
18,889
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.getWorkerMetricName
private static String getWorkerMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.WORKER, name)); }
java
private static String getWorkerMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.WORKER, name)); }
[ "private", "static", "String", "getWorkerMetricName", "(", "String", "name", ")", "{", "String", "result", "=", "CACHED_METRICS", ".", "get", "(", "name", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "return", "CAC...
Builds metric registry name for worker instance. The pattern is instance.uniqueId.metricName. @param name the metric name @return the metric registry name
[ "Builds", "metric", "registry", "name", "for", "worker", "instance", ".", "The", "pattern", "is", "instance", ".", "uniqueId", ".", "metricName", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L244-L251
18,890
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.getClientMetricName
private static String getClientMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.CLIENT, name)); }
java
private static String getClientMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.CLIENT, name)); }
[ "private", "static", "String", "getClientMetricName", "(", "String", "name", ")", "{", "String", "result", "=", "CACHED_METRICS", ".", "get", "(", "name", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "return", "CAC...
Builds metric registry name for client instance. The pattern is instance.uniqueId.metricName. @param name the metric name @return the metric registry name
[ "Builds", "metric", "registry", "name", "for", "client", "instance", ".", "The", "pattern", "is", "instance", ".", "uniqueId", ".", "metricName", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L259-L266
18,891
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.getJobMasterMetricName
private static String getJobMasterMetricName(String name) { return Joiner.on(".").join(InstanceType.JOB_MASTER, name); }
java
private static String getJobMasterMetricName(String name) { return Joiner.on(".").join(InstanceType.JOB_MASTER, name); }
[ "private", "static", "String", "getJobMasterMetricName", "(", "String", "name", ")", "{", "return", "Joiner", ".", "on", "(", "\".\"", ")", ".", "join", "(", "InstanceType", ".", "JOB_MASTER", ",", "name", ")", ";", "}" ]
Builds metric registry names for the job master instance. The pattern is instance.metricName. @param name the metric name @return the metric registry name
[ "Builds", "metric", "registry", "names", "for", "the", "job", "master", "instance", ".", "The", "pattern", "is", "instance", ".", "metricName", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L294-L296
18,892
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.checkMinimalPollingPeriod
public static void checkMinimalPollingPeriod(TimeUnit pollUnit, int pollPeriod) throws IllegalArgumentException { int period = (int) MINIMAL_POLL_UNIT.convert(pollPeriod, pollUnit); Preconditions.checkArgument(period >= MINIMAL_POLL_PERIOD, "Polling period %d %d is below the minimal polling period...
java
public static void checkMinimalPollingPeriod(TimeUnit pollUnit, int pollPeriod) throws IllegalArgumentException { int period = (int) MINIMAL_POLL_UNIT.convert(pollPeriod, pollUnit); Preconditions.checkArgument(period >= MINIMAL_POLL_PERIOD, "Polling period %d %d is below the minimal polling period...
[ "public", "static", "void", "checkMinimalPollingPeriod", "(", "TimeUnit", "pollUnit", ",", "int", "pollPeriod", ")", "throws", "IllegalArgumentException", "{", "int", "period", "=", "(", "int", ")", "MINIMAL_POLL_UNIT", ".", "convert", "(", "pollPeriod", ",", "pol...
Checks if the poll period is smaller that the minimal poll period which is 1 second. @param pollUnit the polling unit @param pollPeriod the polling period @throws IllegalArgumentException if the polling period is invalid
[ "Checks", "if", "the", "poll", "period", "is", "smaller", "that", "the", "minimal", "poll", "period", "which", "is", "1", "second", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L331-L336
18,893
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.stripInstanceAndHost
public static String stripInstanceAndHost(String metricsName) { String[] pieces = metricsName.split("\\."); Preconditions.checkArgument(pieces.length > 1, "Incorrect metrics name: %s.", metricsName); // Master metrics doesn't have hostname included. if (!pieces[0].equals(MetricsSystem.InstanceType.MAST...
java
public static String stripInstanceAndHost(String metricsName) { String[] pieces = metricsName.split("\\."); Preconditions.checkArgument(pieces.length > 1, "Incorrect metrics name: %s.", metricsName); // Master metrics doesn't have hostname included. if (!pieces[0].equals(MetricsSystem.InstanceType.MAST...
[ "public", "static", "String", "stripInstanceAndHost", "(", "String", "metricsName", ")", "{", "String", "[", "]", "pieces", "=", "metricsName", ".", "split", "(", "\"\\\\.\"", ")", ";", "Preconditions", ".", "checkArgument", "(", "pieces", ".", "length", ">", ...
Removes the instance and host from the given metric name, returning the result. @param metricsName the long metrics name with instance and host name @return the metrics name without instance and host name
[ "Removes", "the", "instance", "and", "host", "from", "the", "given", "metric", "name", "returning", "the", "result", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L344-L354
18,894
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.registerGaugeIfAbsent
public static synchronized <T> void registerGaugeIfAbsent(String name, Gauge<T> metric) { if (!METRIC_REGISTRY.getGauges().containsKey(name)) { METRIC_REGISTRY.register(name, metric); } }
java
public static synchronized <T> void registerGaugeIfAbsent(String name, Gauge<T> metric) { if (!METRIC_REGISTRY.getGauges().containsKey(name)) { METRIC_REGISTRY.register(name, metric); } }
[ "public", "static", "synchronized", "<", "T", ">", "void", "registerGaugeIfAbsent", "(", "String", "name", ",", "Gauge", "<", "T", ">", "metric", ")", "{", "if", "(", "!", "METRIC_REGISTRY", ".", "getGauges", "(", ")", ".", "containsKey", "(", "name", ")...
Registers a gauge if it has not been registered. @param name the gauge name @param metric the gauge @param <T> the type
[ "Registers", "a", "gauge", "if", "it", "has", "not", "been", "registered", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L400-L404
18,895
Alluxio/alluxio
core/common/src/main/java/alluxio/metrics/MetricsSystem.java
MetricsSystem.resetAllCounters
public static void resetAllCounters() { for (Map.Entry<String, Counter> entry : METRIC_REGISTRY.getCounters().entrySet()) { entry.getValue().dec(entry.getValue().getCount()); } }
java
public static void resetAllCounters() { for (Map.Entry<String, Counter> entry : METRIC_REGISTRY.getCounters().entrySet()) { entry.getValue().dec(entry.getValue().getCount()); } }
[ "public", "static", "void", "resetAllCounters", "(", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Counter", ">", "entry", ":", "METRIC_REGISTRY", ".", "getCounters", "(", ")", ".", "entrySet", "(", ")", ")", "{", "entry", ".", "getVa...
Resets all the counters to 0 for testing.
[ "Resets", "all", "the", "counters", "to", "0", "for", "testing", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/metrics/MetricsSystem.java#L409-L413
18,896
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/DefaultAccessControlList.java
DefaultAccessControlList.generateChildFileACL
public AccessControlList generateChildFileACL(Short umask) { Mode defaultMode = new Mode(umask); AccessControlList acl = new AccessControlList(); acl.mOwningUser = mOwningUser; acl.mOwningGroup = mOwningGroup; acl.mMode = mMode; if (mExtendedEntries == null) { acl.mExtendedEntries = null; ...
java
public AccessControlList generateChildFileACL(Short umask) { Mode defaultMode = new Mode(umask); AccessControlList acl = new AccessControlList(); acl.mOwningUser = mOwningUser; acl.mOwningGroup = mOwningGroup; acl.mMode = mMode; if (mExtendedEntries == null) { acl.mExtendedEntries = null; ...
[ "public", "AccessControlList", "generateChildFileACL", "(", "Short", "umask", ")", "{", "Mode", "defaultMode", "=", "new", "Mode", "(", "umask", ")", ";", "AccessControlList", "acl", "=", "new", "AccessControlList", "(", ")", ";", "acl", ".", "mOwningUser", "=...
create a child file 's accessACL based on the default ACL. @param umask file's umask @return child file's access ACL
[ "create", "a", "child", "file", "s", "accessACL", "based", "on", "the", "default", "ACL", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/DefaultAccessControlList.java#L64-L92
18,897
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/DefaultAccessControlList.java
DefaultAccessControlList.generateChildDirACL
public Pair<AccessControlList, DefaultAccessControlList> generateChildDirACL(Short umask) { AccessControlList acl = generateChildFileACL(umask); DefaultAccessControlList dAcl = new DefaultAccessControlList(acl); dAcl.setEmpty(false); dAcl.mOwningUser = mOwningUser; dAcl.mOwningGroup = mOwningGroup; ...
java
public Pair<AccessControlList, DefaultAccessControlList> generateChildDirACL(Short umask) { AccessControlList acl = generateChildFileACL(umask); DefaultAccessControlList dAcl = new DefaultAccessControlList(acl); dAcl.setEmpty(false); dAcl.mOwningUser = mOwningUser; dAcl.mOwningGroup = mOwningGroup; ...
[ "public", "Pair", "<", "AccessControlList", ",", "DefaultAccessControlList", ">", "generateChildDirACL", "(", "Short", "umask", ")", "{", "AccessControlList", "acl", "=", "generateChildFileACL", "(", "umask", ")", ";", "DefaultAccessControlList", "dAcl", "=", "new", ...
Creates a child directory's access ACL and default ACL based on the default ACL. @param umask child's umask @return child directory's access ACL and default ACL
[ "Creates", "a", "child", "directory", "s", "access", "ACL", "and", "default", "ACL", "based", "on", "the", "default", "ACL", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/DefaultAccessControlList.java#L99-L112
18,898
Alluxio/alluxio
core/server/common/src/main/java/alluxio/ProcessUtils.java
ProcessUtils.stopProcessOnShutdown
public static void stopProcessOnShutdown(final Process process) { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { process.stop(); } catch (Throwable t) { LOG.error("Failed to stop process", t); } }, "alluxio-process-shutdown-hook")); }
java
public static void stopProcessOnShutdown(final Process process) { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { process.stop(); } catch (Throwable t) { LOG.error("Failed to stop process", t); } }, "alluxio-process-shutdown-hook")); }
[ "public", "static", "void", "stopProcessOnShutdown", "(", "final", "Process", "process", ")", "{", "Runtime", ".", "getRuntime", "(", ")", ".", "addShutdownHook", "(", "new", "Thread", "(", "(", ")", "->", "{", "try", "{", "process", ".", "stop", "(", ")...
Adds a shutdown hook that will be invoked when a signal is sent to this process. The process may be utilizing some resources, and this shutdown hook will be invoked by JVM when a SIGTERM is sent to the process by "kill" command. The shutdown hook calls {@link Process#stop()} method to cleanly release the resources and...
[ "Adds", "a", "shutdown", "hook", "that", "will", "be", "invoked", "when", "a", "signal", "is", "sent", "to", "this", "process", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/ProcessUtils.java#L90-L98
18,899
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksStore.java
RocksStore.writeToCheckpoint
public synchronized void writeToCheckpoint(OutputStream output) throws IOException, InterruptedException { LOG.info("Creating rocksdb checkpoint at {}", mDbCheckpointPath); long startNano = System.nanoTime(); CheckpointOutputStream out = new CheckpointOutputStream(output, CheckpointType.ROCKS); t...
java
public synchronized void writeToCheckpoint(OutputStream output) throws IOException, InterruptedException { LOG.info("Creating rocksdb checkpoint at {}", mDbCheckpointPath); long startNano = System.nanoTime(); CheckpointOutputStream out = new CheckpointOutputStream(output, CheckpointType.ROCKS); t...
[ "public", "synchronized", "void", "writeToCheckpoint", "(", "OutputStream", "output", ")", "throws", "IOException", ",", "InterruptedException", "{", "LOG", ".", "info", "(", "\"Creating rocksdb checkpoint at {}\"", ",", "mDbCheckpointPath", ")", ";", "long", "startNano...
Writes a checkpoint of the database's content to the given output stream. @param output the stream to write to
[ "Writes", "a", "checkpoint", "of", "the", "database", "s", "content", "to", "the", "given", "output", "stream", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksStore.java#L159-L177