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,600
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalConfiguration.java
RaftJournalConfiguration.validate
public void validate() { Preconditions.checkState(getMaxLogSize() <= Integer.MAX_VALUE, "{} has value {} but must not exceed {}", PropertyKey.MASTER_JOURNAL_LOG_SIZE_BYTES_MAX, getMaxLogSize(), Integer.MAX_VALUE); Preconditions.checkState(getHeartbeatIntervalMs() < getElectionTimeoutMs() / 2, ...
java
public void validate() { Preconditions.checkState(getMaxLogSize() <= Integer.MAX_VALUE, "{} has value {} but must not exceed {}", PropertyKey.MASTER_JOURNAL_LOG_SIZE_BYTES_MAX, getMaxLogSize(), Integer.MAX_VALUE); Preconditions.checkState(getHeartbeatIntervalMs() < getElectionTimeoutMs() / 2, ...
[ "public", "void", "validate", "(", ")", "{", "Preconditions", ".", "checkState", "(", "getMaxLogSize", "(", ")", "<=", "Integer", ".", "MAX_VALUE", ",", "\"{} has value {} but must not exceed {}\"", ",", "PropertyKey", ".", "MASTER_JOURNAL_LOG_SIZE_BYTES_MAX", ",", "g...
Validates the configuration.
[ "Validates", "the", "configuration", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalConfiguration.java#L70-L80
18,601
Alluxio/alluxio
core/common/src/main/java/alluxio/security/group/CachedGroupMapping.java
CachedGroupMapping.getGroups
public List<String> getGroups(String user) throws IOException { if (!mCacheEnabled) { return mService.getGroups(user); } try { return mCache.get(user); } catch (ExecutionException e) { throw new IOException(e); } }
java
public List<String> getGroups(String user) throws IOException { if (!mCacheEnabled) { return mService.getGroups(user); } try { return mCache.get(user); } catch (ExecutionException e) { throw new IOException(e); } }
[ "public", "List", "<", "String", ">", "getGroups", "(", "String", "user", ")", "throws", "IOException", "{", "if", "(", "!", "mCacheEnabled", ")", "{", "return", "mService", ".", "getGroups", "(", "user", ")", ";", "}", "try", "{", "return", "mCache", ...
Gets a list of groups for the given user. @param user user name @return the list of groups that the user belongs to
[ "Gets", "a", "list", "of", "groups", "for", "the", "given", "user", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/group/CachedGroupMapping.java#L105-L114
18,602
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java
ServerConfigurationStore.registerNewConf
public synchronized void registerNewConf(Address address, List<ConfigProperty> configList) { Preconditions.checkNotNull(address, "address should not be null"); Preconditions.checkNotNull(configList, "configuration list should not be null"); // Instead of recording property name, we record property key. ...
java
public synchronized void registerNewConf(Address address, List<ConfigProperty> configList) { Preconditions.checkNotNull(address, "address should not be null"); Preconditions.checkNotNull(configList, "configuration list should not be null"); // Instead of recording property name, we record property key. ...
[ "public", "synchronized", "void", "registerNewConf", "(", "Address", "address", ",", "List", "<", "ConfigProperty", ">", "configList", ")", "{", "Preconditions", ".", "checkNotNull", "(", "address", ",", "\"address should not be null\"", ")", ";", "Preconditions", "...
Registers new configuration information. @param address the node address @param configList the configuration of this node
[ "Registers", "new", "configuration", "information", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java#L64-L75
18,603
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java
ServerConfigurationStore.handleNodeLost
public synchronized void handleNodeLost(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.add(address); for (Runnable function : mChangeListeners) { function.run(); } }
java
public synchronized void handleNodeLost(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.add(address); for (Runnable function : mChangeListeners) { function.run(); } }
[ "public", "synchronized", "void", "handleNodeLost", "(", "Address", "address", ")", "{", "Preconditions", ".", "checkNotNull", "(", "address", ",", "\"address should not be null\"", ")", ";", "mLostNodes", ".", "add", "(", "address", ")", ";", "for", "(", "Runna...
Updates configuration when a live node becomes lost. @param address the node address
[ "Updates", "configuration", "when", "a", "live", "node", "becomes", "lost", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java#L92-L98
18,604
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java
ServerConfigurationStore.lostNodeFound
public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } }
java
public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } }
[ "public", "synchronized", "void", "lostNodeFound", "(", "Address", "address", ")", "{", "Preconditions", ".", "checkNotNull", "(", "address", ",", "\"address should not be null\"", ")", ";", "mLostNodes", ".", "remove", "(", "address", ")", ";", "for", "(", "Run...
Updates configuration when a lost node is found. @param address the node address
[ "Updates", "configuration", "when", "a", "lost", "node", "is", "found", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationStore.java#L105-L111
18,605
Alluxio/alluxio
job/common/src/main/java/alluxio/job/meta/JobInfo.java
JobInfo.addTask
public synchronized void addTask(int taskId) { Preconditions.checkArgument(!mTaskIdToInfo.containsKey(taskId), ""); mTaskIdToInfo.put(taskId, new TaskInfo().setJobId(mId).setTaskId(taskId) .setStatus(Status.CREATED).setErrorMessage("").setResult(null)); }
java
public synchronized void addTask(int taskId) { Preconditions.checkArgument(!mTaskIdToInfo.containsKey(taskId), ""); mTaskIdToInfo.put(taskId, new TaskInfo().setJobId(mId).setTaskId(taskId) .setStatus(Status.CREATED).setErrorMessage("").setResult(null)); }
[ "public", "synchronized", "void", "addTask", "(", "int", "taskId", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "mTaskIdToInfo", ".", "containsKey", "(", "taskId", ")", ",", "\"\"", ")", ";", "mTaskIdToInfo", ".", "put", "(", "taskId", ",", "...
Registers a task. @param taskId the task id
[ "Registers", "a", "task", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/meta/JobInfo.java#L75-L79
18,606
Alluxio/alluxio
job/server/src/main/java/alluxio/master/AlluxioJobMasterProcess.java
AlluxioJobMasterProcess.start
@Override public void start() throws Exception { mJournalSystem.start(); mJournalSystem.gainPrimacy(); startMaster(true); startServing(); }
java
@Override public void start() throws Exception { mJournalSystem.start(); mJournalSystem.gainPrimacy(); startMaster(true); startServing(); }
[ "@", "Override", "public", "void", "start", "(", ")", "throws", "Exception", "{", "mJournalSystem", ".", "start", "(", ")", ";", "mJournalSystem", ".", "gainPrimacy", "(", ")", ";", "startMaster", "(", "true", ")", ";", "startServing", "(", ")", ";", "}"...
Starts the Alluxio job master server. @throws Exception if starting the master fails
[ "Starts", "the", "Alluxio", "job", "master", "server", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/master/AlluxioJobMasterProcess.java#L129-L135
18,607
Alluxio/alluxio
core/base/src/main/java/alluxio/util/URIUtils.java
URIUtils.appendPath
public static URI appendPath(URI base, String path) throws URISyntaxException { return new URI(base.getScheme(), base.getAuthority(), PathUtils.concatPath(base.getPath(), path), base.getQuery(), base.getFragment()); }
java
public static URI appendPath(URI base, String path) throws URISyntaxException { return new URI(base.getScheme(), base.getAuthority(), PathUtils.concatPath(base.getPath(), path), base.getQuery(), base.getFragment()); }
[ "public", "static", "URI", "appendPath", "(", "URI", "base", ",", "String", "path", ")", "throws", "URISyntaxException", "{", "return", "new", "URI", "(", "base", ".", "getScheme", "(", ")", ",", "base", ".", "getAuthority", "(", ")", ",", "PathUtils", "...
Appends the given path to the given base URI. @param base the base URI @param path the path to append @return the URI resulting from appending the base and the path @throws URISyntaxException if URI syntax error is encountered
[ "Appends", "the", "given", "path", "to", "the", "given", "base", "URI", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L50-L53
18,608
Alluxio/alluxio
core/base/src/main/java/alluxio/util/URIUtils.java
URIUtils.parseQueryString
public static Map<String, String> parseQueryString(String query) { Map<String, String> queryMap = new HashMap<>(); if (query == null || query.isEmpty()) { return queryMap; } // The query string should escape '&'. String[] entries = query.split(String.valueOf(QUERY_SEPARATOR)); try { ...
java
public static Map<String, String> parseQueryString(String query) { Map<String, String> queryMap = new HashMap<>(); if (query == null || query.isEmpty()) { return queryMap; } // The query string should escape '&'. String[] entries = query.split(String.valueOf(QUERY_SEPARATOR)); try { ...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "parseQueryString", "(", "String", "query", ")", "{", "Map", "<", "String", ",", "String", ">", "queryMap", "=", "new", "HashMap", "<>", "(", ")", ";", "if", "(", "query", "==", "null", "|...
Parses the given query string, and returns a map of the query parameters. @param query the query string to parse @return the map of query keys and values
[ "Parses", "the", "given", "query", "string", "and", "returns", "a", "map", "of", "the", "query", "parameters", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L103-L133
18,609
Alluxio/alluxio
core/base/src/main/java/alluxio/util/URIUtils.java
URIUtils.hash
public static int hash(int hash, String s) { if (s == null) { return hash; } // similar to Arrays.hashCode return s.indexOf('%') < 0 ? 31 * hash + s.hashCode() : normalizedHash(hash, s); }
java
public static int hash(int hash, String s) { if (s == null) { return hash; } // similar to Arrays.hashCode return s.indexOf('%') < 0 ? 31 * hash + s.hashCode() : normalizedHash(hash, s); }
[ "public", "static", "int", "hash", "(", "int", "hash", ",", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "hash", ";", "}", "// similar to Arrays.hashCode", "return", "s", ".", "indexOf", "(", "'", "'", ")", "<", "0", "...
Hashes a string for a URI hash. Handles octets. @param hash the input hash @param s the string to hash and combine with the input hash @return the resulting hash
[ "Hashes", "a", "string", "for", "a", "URI", "hash", ".", "Handles", "octets", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L276-L282
18,610
Alluxio/alluxio
core/base/src/main/java/alluxio/util/URIUtils.java
URIUtils.hashIgnoreCase
public static int hashIgnoreCase(int hash, String s) { if (s == null) { return hash; } int length = s.length(); for (int i = 0; i < length; i++) { hash = 31 * hash + URIUtils.toLower(s.charAt(i)); } return hash; }
java
public static int hashIgnoreCase(int hash, String s) { if (s == null) { return hash; } int length = s.length(); for (int i = 0; i < length; i++) { hash = 31 * hash + URIUtils.toLower(s.charAt(i)); } return hash; }
[ "public", "static", "int", "hashIgnoreCase", "(", "int", "hash", ",", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "hash", ";", "}", "int", "length", "=", "s", ".", "length", "(", ")", ";", "for", "(", "int", "i", ...
Hashes a string for a URI hash, while ignoring the case. @param hash the input hash @param s the string to hash and combine with the input hash @return the resulting hash
[ "Hashes", "a", "string", "for", "a", "URI", "hash", "while", "ignoring", "the", "case", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L291-L300
18,611
Alluxio/alluxio
core/common/src/main/java/alluxio/util/SecurityUtils.java
SecurityUtils.isAuthenticationEnabled
public static boolean isAuthenticationEnabled(AlluxioConfiguration conf) { return !conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class) .equals(AuthType.NOSASL); }
java
public static boolean isAuthenticationEnabled(AlluxioConfiguration conf) { return !conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class) .equals(AuthType.NOSASL); }
[ "public", "static", "boolean", "isAuthenticationEnabled", "(", "AlluxioConfiguration", "conf", ")", "{", "return", "!", "conf", ".", "getEnum", "(", "PropertyKey", ".", "SECURITY_AUTHENTICATION_TYPE", ",", "AuthType", ".", "class", ")", ".", "equals", "(", "AuthTy...
Checks if authentication is enabled. @param conf Alluxio configuration @return true if authentication is enabled, false otherwise
[ "Checks", "if", "authentication", "is", "enabled", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/SecurityUtils.java#L49-L52
18,612
Alluxio/alluxio
shell/src/main/java/alluxio/worker/AlluxioWorkerMonitor.java
AlluxioWorkerMonitor.main
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioWorkerMonitor.class.getCanonicalName()); LOG.warn("ignoring arguments"); } AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults...
java
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioWorkerMonitor.class.getCanonicalName()); LOG.warn("ignoring arguments"); } AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "0", ")", "{", "LOG", ".", "info", "(", "\"java -cp {} {}\"", ",", "RuntimeConstants", ".", "ALLUXIO_JAR", ",", "AlluxioWorkerMonitor", ...
Starts the Alluxio worker monitor. @param args command line arguments, should be empty
[ "Starts", "the", "Alluxio", "worker", "monitor", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/worker/AlluxioWorkerMonitor.java#L42-L57
18,613
Alluxio/alluxio
job/server/src/main/java/alluxio/job/migrate/MigrateDefinition.java
MigrateDefinition.computeTargetPath
private static String computeTargetPath(String path, String source, String destination) throws Exception { String relativePath = PathUtils.subtractPaths(path, source); return PathUtils.concatPath(destination, relativePath); }
java
private static String computeTargetPath(String path, String source, String destination) throws Exception { String relativePath = PathUtils.subtractPaths(path, source); return PathUtils.concatPath(destination, relativePath); }
[ "private", "static", "String", "computeTargetPath", "(", "String", "path", ",", "String", "source", ",", "String", "destination", ")", "throws", "Exception", "{", "String", "relativePath", "=", "PathUtils", ".", "subtractPaths", "(", "path", ",", "source", ")", ...
Computes the path that the given path should end up at when source is migrated to destination. @param path a path to migrate which must be a descendent path of the source path, e.g. /src/file @param source the base source path being migrated, e.g. /src @param destination the path to migrate to, e.g. /dst/src @return t...
[ "Computes", "the", "path", "that", "the", "given", "path", "should", "end", "up", "at", "when", "source", "is", "migrated", "to", "destination", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/job/migrate/MigrateDefinition.java#L218-L222
18,614
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksUtils.java
RocksUtils.generateDbPath
public static String generateDbPath(String baseDir, String dbName) { return PathUtils.concatPath(baseDir, dbName); }
java
public static String generateDbPath(String baseDir, String dbName) { return PathUtils.concatPath(baseDir, dbName); }
[ "public", "static", "String", "generateDbPath", "(", "String", "baseDir", ",", "String", "dbName", ")", "{", "return", "PathUtils", ".", "concatPath", "(", "baseDir", ",", "dbName", ")", ";", "}" ]
Generates a path to use for a RocksDB database. @param baseDir the base directory path @param dbName a name for the database @return the generated database path
[ "Generates", "a", "path", "to", "use", "for", "a", "RocksDB", "database", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksUtils.java#L32-L34
18,615
Alluxio/alluxio
underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoUnderFileSystem.java
KodoUnderFileSystem.getObjectStatus
@Nullable @Override protected ObjectStatus getObjectStatus(String key) { try { FileInfo fileInfo = mKodoClinet.getFileInfo(key); if (fileInfo == null) { return null; } return new ObjectStatus(key, fileInfo.hash, fileInfo.fsize, fileInfo.putTime / 10000); } catch (QiniuExcepti...
java
@Nullable @Override protected ObjectStatus getObjectStatus(String key) { try { FileInfo fileInfo = mKodoClinet.getFileInfo(key); if (fileInfo == null) { return null; } return new ObjectStatus(key, fileInfo.hash, fileInfo.fsize, fileInfo.putTime / 10000); } catch (QiniuExcepti...
[ "@", "Nullable", "@", "Override", "protected", "ObjectStatus", "getObjectStatus", "(", "String", "key", ")", "{", "try", "{", "FileInfo", "fileInfo", "=", "mKodoClinet", ".", "getFileInfo", "(", "key", ")", ";", "if", "(", "fileInfo", "==", "null", ")", "{...
Gets metadata information about object. Implementations should process the key as is, which may be a file or a directory key. @param key ufs key to get metadata for @return {@link ObjectStatus} if key exists and successful, otherwise null
[ "Gets", "metadata", "information", "about", "object", ".", "Implementations", "should", "process", "the", "key", "as", "is", "which", "may", "be", "a", "file", "or", "a", "directory", "key", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoUnderFileSystem.java#L186-L199
18,616
Alluxio/alluxio
core/server/common/src/main/java/alluxio/StorageTierAssoc.java
StorageTierAssoc.interpretOrdinal
static int interpretOrdinal(int ordinal, int numTiers) { if (ordinal >= 0) { return Math.min(ordinal, numTiers - 1); } return Math.max(numTiers + ordinal, 0); }
java
static int interpretOrdinal(int ordinal, int numTiers) { if (ordinal >= 0) { return Math.min(ordinal, numTiers - 1); } return Math.max(numTiers + ordinal, 0); }
[ "static", "int", "interpretOrdinal", "(", "int", "ordinal", ",", "int", "numTiers", ")", "{", "if", "(", "ordinal", ">=", "0", ")", "{", "return", "Math", ".", "min", "(", "ordinal", ",", "numTiers", "-", "1", ")", ";", "}", "return", "Math", ".", ...
Interprets a tier ordinal given the number of tiers. Non-negative values identify tiers starting from top going down (0 identifies the first tier, 1 identifies the second tier, and so on). If the provided value is greater than the number of tiers, it identifies the last tier. Negative values identify tiers starting fr...
[ "Interprets", "a", "tier", "ordinal", "given", "the", "number", "of", "tiers", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/StorageTierAssoc.java#L50-L55
18,617
Alluxio/alluxio
core/common/src/main/java/alluxio/util/webui/UIFileInfo.java
UIFileInfo.addBlock
public void addBlock(String tierAlias, long blockId, long blockSize, long blockLastAccessTimeMs) { UIFileBlockInfo block = new UIFileBlockInfo(blockId, blockSize, blockLastAccessTimeMs, tierAlias, mAlluxioConfiguration); List<UIFileBlockInfo> blocksOnTier = mBlocksOnTier.get(tierAlias); ...
java
public void addBlock(String tierAlias, long blockId, long blockSize, long blockLastAccessTimeMs) { UIFileBlockInfo block = new UIFileBlockInfo(blockId, blockSize, blockLastAccessTimeMs, tierAlias, mAlluxioConfiguration); List<UIFileBlockInfo> blocksOnTier = mBlocksOnTier.get(tierAlias); ...
[ "public", "void", "addBlock", "(", "String", "tierAlias", ",", "long", "blockId", ",", "long", "blockSize", ",", "long", "blockLastAccessTimeMs", ")", "{", "UIFileBlockInfo", "block", "=", "new", "UIFileBlockInfo", "(", "blockId", ",", "blockSize", ",", "blockLa...
Adds a block to the file information. @param tierAlias the tier alias @param blockId the block id @param blockSize the block size @param blockLastAccessTimeMs the last access time (in milliseconds)
[ "Adds", "a", "block", "to", "the", "file", "information", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/webui/UIFileInfo.java#L189-L202
18,618
Alluxio/alluxio
core/common/src/main/java/alluxio/util/webui/UIFileInfo.java
UIFileInfo.getCreationTime
public String getCreationTime() { if (mCreationTimeMs == UIFileInfo.LocalFileInfo.EMPTY_CREATION_TIME) { return ""; } return CommonUtils.convertMsToDate(mCreationTimeMs, mAlluxioConfiguration.get(PropertyKey.USER_DATE_FORMAT_PATTERN)); }
java
public String getCreationTime() { if (mCreationTimeMs == UIFileInfo.LocalFileInfo.EMPTY_CREATION_TIME) { return ""; } return CommonUtils.convertMsToDate(mCreationTimeMs, mAlluxioConfiguration.get(PropertyKey.USER_DATE_FORMAT_PATTERN)); }
[ "public", "String", "getCreationTime", "(", ")", "{", "if", "(", "mCreationTimeMs", "==", "UIFileInfo", ".", "LocalFileInfo", ".", "EMPTY_CREATION_TIME", ")", "{", "return", "\"\"", ";", "}", "return", "CommonUtils", ".", "convertMsToDate", "(", "mCreationTimeMs",...
Gets creation time. @return the creation time (in milliseconds)
[ "Gets", "creation", "time", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/webui/UIFileInfo.java#L240-L246
18,619
Alluxio/alluxio
core/common/src/main/java/alluxio/util/webui/UIFileInfo.java
UIFileInfo.getOnTierPercentages
public Map<String, Integer> getOnTierPercentages() { return mOrderedTierAliases.stream().collect(Collectors.toMap(tier -> tier, tier -> { Long sizeOnTier = mSizeOnTier.getOrDefault(tier, 0L); return mSize > 0 ? (int) (100 * sizeOnTier / mSize) : 0; })); }
java
public Map<String, Integer> getOnTierPercentages() { return mOrderedTierAliases.stream().collect(Collectors.toMap(tier -> tier, tier -> { Long sizeOnTier = mSizeOnTier.getOrDefault(tier, 0L); return mSize > 0 ? (int) (100 * sizeOnTier / mSize) : 0; })); }
[ "public", "Map", "<", "String", ",", "Integer", ">", "getOnTierPercentages", "(", ")", "{", "return", "mOrderedTierAliases", ".", "stream", "(", ")", ".", "collect", "(", "Collectors", ".", "toMap", "(", "tier", "->", "tier", ",", "tier", "->", "{", "Lon...
Gets on-tier percentages. @return the on-tier percentages
[ "Gets", "on", "-", "tier", "percentages", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/webui/UIFileInfo.java#L326-L331
18,620
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fs/command/ChgrpCommand.java
ChgrpCommand.chgrp
private void chgrp(AlluxioURI path, String group, boolean recursive) throws AlluxioException, IOException { SetAttributePOptions options = SetAttributePOptions.newBuilder().setGroup(group).setRecursive(recursive).build(); mFileSystem.setAttribute(path, options); System.out.println("Changed gro...
java
private void chgrp(AlluxioURI path, String group, boolean recursive) throws AlluxioException, IOException { SetAttributePOptions options = SetAttributePOptions.newBuilder().setGroup(group).setRecursive(recursive).build(); mFileSystem.setAttribute(path, options); System.out.println("Changed gro...
[ "private", "void", "chgrp", "(", "AlluxioURI", "path", ",", "String", "group", ",", "boolean", "recursive", ")", "throws", "AlluxioException", ",", "IOException", "{", "SetAttributePOptions", "options", "=", "SetAttributePOptions", ".", "newBuilder", "(", ")", "."...
Changes the group for the directory or file with the path specified in args. @param path The {@link AlluxioURI} path as the input of the command @param group The group to be updated to the file or directory @param recursive Whether change the group recursively
[ "Changes", "the", "group", "for", "the", "directory", "or", "file", "with", "the", "path", "specified", "in", "args", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/ChgrpCommand.java#L74-L80
18,621
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
UnderFileSystemBlockReader.transferTo
@Override public int transferTo(ByteBuf buf) throws IOException { Preconditions.checkState(!mClosed); if (mUnderFileSystemInputStream == null) { return -1; } if (mBlockMeta.getBlockSize() <= mInStreamPos) { return -1; } // Make a copy of the state to keep track of what we have read ...
java
@Override public int transferTo(ByteBuf buf) throws IOException { Preconditions.checkState(!mClosed); if (mUnderFileSystemInputStream == null) { return -1; } if (mBlockMeta.getBlockSize() <= mInStreamPos) { return -1; } // Make a copy of the state to keep track of what we have read ...
[ "@", "Override", "public", "int", "transferTo", "(", "ByteBuf", "buf", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "!", "mClosed", ")", ";", "if", "(", "mUnderFileSystemInputStream", "==", "null", ")", "{", "return", "-", "1",...
This interface is supposed to be used for sequence block reads. @param buf the byte buffer @return the number of bytes read, -1 if it reaches EOF and none was read
[ "This", "interface", "is", "supposed", "to", "be", "used", "for", "sequence", "block", "reads", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java#L206-L245
18,622
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
UnderFileSystemBlockReader.close
@Override public void close() throws IOException { if (mClosed) { return; } try { // This aborts the block if the block is not fully read. updateBlockWriter(mBlockMeta.getBlockSize()); if (mUnderFileSystemInputStream != null) { mUfsInstreamManager.release(mUnderFileSystem...
java
@Override public void close() throws IOException { if (mClosed) { return; } try { // This aborts the block if the block is not fully read. updateBlockWriter(mBlockMeta.getBlockSize()); if (mUnderFileSystemInputStream != null) { mUfsInstreamManager.release(mUnderFileSystem...
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "IOException", "{", "if", "(", "mClosed", ")", "{", "return", ";", "}", "try", "{", "// This aborts the block if the block is not fully read.", "updateBlockWriter", "(", "mBlockMeta", ".", "getBlockSize...
Closes the block reader. After this, this block reader should not be used anymore. This is recommended to be called after the client finishes reading the block. It is usually triggered when the client unlocks the block.
[ "Closes", "the", "block", "reader", ".", "After", "this", "this", "block", "reader", "should", "not", "be", "used", "anymore", ".", "This", "is", "recommended", "to", "be", "called", "after", "the", "client", "finishes", "reading", "the", "block", ".", "It...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java#L252-L275
18,623
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
UnderFileSystemBlockReader.updateUnderFileSystemInputStream
private void updateUnderFileSystemInputStream(long offset) throws IOException { if ((mUnderFileSystemInputStream != null) && offset != mInStreamPos) { mUfsInstreamManager.release(mUnderFileSystemInputStream); mUnderFileSystemInputStream = null; mInStreamPos = -1; } if (mUnderFileSystemInp...
java
private void updateUnderFileSystemInputStream(long offset) throws IOException { if ((mUnderFileSystemInputStream != null) && offset != mInStreamPos) { mUfsInstreamManager.release(mUnderFileSystemInputStream); mUnderFileSystemInputStream = null; mInStreamPos = -1; } if (mUnderFileSystemInp...
[ "private", "void", "updateUnderFileSystemInputStream", "(", "long", "offset", ")", "throws", "IOException", "{", "if", "(", "(", "mUnderFileSystemInputStream", "!=", "null", ")", "&&", "offset", "!=", "mInStreamPos", ")", "{", "mUfsInstreamManager", ".", "release", ...
Updates the UFS input stream given an offset to read. @param offset the read offset within the block
[ "Updates", "the", "UFS", "input", "stream", "given", "an", "offset", "to", "read", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java#L294-L308
18,624
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
UnderFileSystemBlockReader.cancelBlockWriter
private void cancelBlockWriter() throws IOException { if (mBlockWriter == null) { return; } try { mBlockWriter.close(); mBlockWriter = null; mLocalBlockStore.abortBlock(mBlockMeta.getSessionId(), mBlockMeta.getBlockId()); } catch (BlockDoesNotExistException e) { // This can...
java
private void cancelBlockWriter() throws IOException { if (mBlockWriter == null) { return; } try { mBlockWriter.close(); mBlockWriter = null; mLocalBlockStore.abortBlock(mBlockMeta.getSessionId(), mBlockMeta.getBlockId()); } catch (BlockDoesNotExistException e) { // This can...
[ "private", "void", "cancelBlockWriter", "(", ")", "throws", "IOException", "{", "if", "(", "mBlockWriter", "==", "null", ")", "{", "return", ";", "}", "try", "{", "mBlockWriter", ".", "close", "(", ")", ";", "mBlockWriter", "=", "null", ";", "mLocalBlockSt...
Closes the current block writer, cleans up its temp block and sets it to null.
[ "Closes", "the", "current", "block", "writer", "cleans", "up", "its", "temp", "block", "and", "sets", "it", "to", "null", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java#L313-L330
18,625
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
UnderFileSystemBlockReader.updateBlockWriter
private void updateBlockWriter(long offset) throws IOException { if (mBlockWriter != null && offset > mBlockWriter.getPosition()) { cancelBlockWriter(); } try { if (mBlockWriter == null && offset == 0 && !mBlockMeta.isNoCache()) { BlockStoreLocation loc = BlockStoreLocation.anyDirInTier(...
java
private void updateBlockWriter(long offset) throws IOException { if (mBlockWriter != null && offset > mBlockWriter.getPosition()) { cancelBlockWriter(); } try { if (mBlockWriter == null && offset == 0 && !mBlockMeta.isNoCache()) { BlockStoreLocation loc = BlockStoreLocation.anyDirInTier(...
[ "private", "void", "updateBlockWriter", "(", "long", "offset", ")", "throws", "IOException", "{", "if", "(", "mBlockWriter", "!=", "null", "&&", "offset", ">", "mBlockWriter", ".", "getPosition", "(", ")", ")", "{", "cancelBlockWriter", "(", ")", ";", "}", ...
Updates the block writer given an offset to read. If the offset is beyond the current position of the block writer, the block writer will be aborted. @param offset the read offset
[ "Updates", "the", "block", "writer", "given", "an", "offset", "to", "read", ".", "If", "the", "offset", "is", "beyond", "the", "current", "position", "of", "the", "block", "writer", "the", "block", "writer", "will", "be", "aborted", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java#L338-L363
18,626
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fs/command/AbstractFileSystemCommand.java
AbstractFileSystemCommand.runWildCardCmd
protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException { List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath); if (paths.size() == 0) { // A unified sanity check on the paths throw new IOException(wildCardPath + " does not exist."); ...
java
protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException { List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath); if (paths.size() == 0) { // A unified sanity check on the paths throw new IOException(wildCardPath + " does not exist."); ...
[ "protected", "void", "runWildCardCmd", "(", "AlluxioURI", "wildCardPath", ",", "CommandLine", "cl", ")", "throws", "IOException", "{", "List", "<", "AlluxioURI", ">", "paths", "=", "FileSystemShellUtils", ".", "getAlluxioURIs", "(", "mFileSystem", ",", "wildCardPath...
Runs the command for a particular URI that may contain wildcard in its path. @param wildCardPath an AlluxioURI that may or may not contain a wildcard @param cl object containing the original commandLine
[ "Runs", "the", "command", "for", "a", "particular", "URI", "that", "may", "contain", "wildcard", "in", "its", "path", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/AbstractFileSystemCommand.java#L79-L101
18,627
Alluxio/alluxio
core/common/src/main/java/alluxio/grpc/GrpcServer.java
GrpcServer.start
public GrpcServer start() throws IOException { RetryUtils.retry("Starting gRPC server", () -> mServer.start(), new ExponentialBackoffRetry(100, 500, 5)); mStarted = true; return this; }
java
public GrpcServer start() throws IOException { RetryUtils.retry("Starting gRPC server", () -> mServer.start(), new ExponentialBackoffRetry(100, 500, 5)); mStarted = true; return this; }
[ "public", "GrpcServer", "start", "(", ")", "throws", "IOException", "{", "RetryUtils", ".", "retry", "(", "\"Starting gRPC server\"", ",", "(", ")", "->", "mServer", ".", "start", "(", ")", ",", "new", "ExponentialBackoffRetry", "(", "100", ",", "500", ",", ...
Start serving. @return this instance of {@link GrpcServer} @throws IOException when unable to start serving
[ "Start", "serving", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServer.java#L50-L55
18,628
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.registerWorkerInternal
@Nullable private MasterWorkerInfo registerWorkerInternal(long workerId) { for (IndexedSet<MasterWorkerInfo> workers: Arrays.asList(mTempWorkers, mLostWorkers)) { MasterWorkerInfo worker = workers.getFirstByField(ID_INDEX, workerId); if (worker == null) { continue; } synchronized ...
java
@Nullable private MasterWorkerInfo registerWorkerInternal(long workerId) { for (IndexedSet<MasterWorkerInfo> workers: Arrays.asList(mTempWorkers, mLostWorkers)) { MasterWorkerInfo worker = workers.getFirstByField(ID_INDEX, workerId); if (worker == null) { continue; } synchronized ...
[ "@", "Nullable", "private", "MasterWorkerInfo", "registerWorkerInternal", "(", "long", "workerId", ")", "{", "for", "(", "IndexedSet", "<", "MasterWorkerInfo", ">", "workers", ":", "Arrays", ".", "asList", "(", "mTempWorkers", ",", "mLostWorkers", ")", ")", "{",...
Re-register a lost worker or complete registration after getting a worker id. @param workerId the worker id to register
[ "Re", "-", "register", "a", "lost", "worker", "or", "complete", "registration", "after", "getting", "a", "worker", "id", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L754-L779
18,629
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.processWorkerRemovedBlocks
@GuardedBy("workerInfo") private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds) { for (long removedBlockId : removedBlockIds) { try (LockResource lr = lockBlock(removedBlockId)) { Optional<BlockMeta> block = mBlockStore.getBlock(removedBlockId); ...
java
@GuardedBy("workerInfo") private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds) { for (long removedBlockId : removedBlockIds) { try (LockResource lr = lockBlock(removedBlockId)) { Optional<BlockMeta> block = mBlockStore.getBlock(removedBlockId); ...
[ "@", "GuardedBy", "(", "\"workerInfo\"", ")", "private", "void", "processWorkerRemovedBlocks", "(", "MasterWorkerInfo", "workerInfo", ",", "Collection", "<", "Long", ">", "removedBlockIds", ")", "{", "for", "(", "long", "removedBlockId", ":", "removedBlockIds", ")",...
Updates the worker and block metadata for blocks removed from a worker. @param workerInfo The worker metadata object @param removedBlockIds A list of block ids removed from the worker
[ "Updates", "the", "worker", "and", "block", "metadata", "for", "blocks", "removed", "from", "a", "worker", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L901-L918
18,630
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.processWorkerAddedBlocks
@GuardedBy("workerInfo") private void processWorkerAddedBlocks(MasterWorkerInfo workerInfo, Map<String, List<Long>> addedBlockIds) { for (Map.Entry<String, List<Long>> entry : addedBlockIds.entrySet()) { for (long blockId : entry.getValue()) { try (LockResource lr = lockBlock(blockId)) { ...
java
@GuardedBy("workerInfo") private void processWorkerAddedBlocks(MasterWorkerInfo workerInfo, Map<String, List<Long>> addedBlockIds) { for (Map.Entry<String, List<Long>> entry : addedBlockIds.entrySet()) { for (long blockId : entry.getValue()) { try (LockResource lr = lockBlock(blockId)) { ...
[ "@", "GuardedBy", "(", "\"workerInfo\"", ")", "private", "void", "processWorkerAddedBlocks", "(", "MasterWorkerInfo", "workerInfo", ",", "Map", "<", "String", ",", "List", "<", "Long", ">", ">", "addedBlockIds", ")", "{", "for", "(", "Map", ".", "Entry", "<"...
Updates the worker and block metadata for blocks added to a worker. @param workerInfo The worker metadata object @param addedBlockIds A mapping from storage tier alias to a list of block ids added
[ "Updates", "the", "worker", "and", "block", "metadata", "for", "blocks", "added", "to", "a", "worker", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L926-L947
18,631
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.generateBlockInfo
@GuardedBy("masterBlockInfo") private Optional<BlockInfo> generateBlockInfo(long blockId) throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } BlockMeta block; List<BlockLocation> blockLocations;...
java
@GuardedBy("masterBlockInfo") private Optional<BlockInfo> generateBlockInfo(long blockId) throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } BlockMeta block; List<BlockLocation> blockLocations;...
[ "@", "GuardedBy", "(", "\"masterBlockInfo\"", ")", "private", "Optional", "<", "BlockInfo", ">", "generateBlockInfo", "(", "long", "blockId", ")", "throws", "UnavailableException", "{", "if", "(", "mSafeModeManager", ".", "isInSafeMode", "(", ")", ")", "{", "thr...
Generates block info, including worker locations, for a block id. @param blockId a block id @return optional block info, empty if the block does not exist
[ "Generates", "block", "info", "including", "worker", "locations", "for", "a", "block", "id", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L971-L1007
18,632
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.selectInfoByAddress
private Set<MasterWorkerInfo> selectInfoByAddress(Set<String> addresses, Set<MasterWorkerInfo> workerInfoSet, Set<String> workerNames) { return workerInfoSet.stream().filter(info -> { String host = info.getWorkerAddress().getHost(); workerNames.add(host); String ip = null; try { ...
java
private Set<MasterWorkerInfo> selectInfoByAddress(Set<String> addresses, Set<MasterWorkerInfo> workerInfoSet, Set<String> workerNames) { return workerInfoSet.stream().filter(info -> { String host = info.getWorkerAddress().getHost(); workerNames.add(host); String ip = null; try { ...
[ "private", "Set", "<", "MasterWorkerInfo", ">", "selectInfoByAddress", "(", "Set", "<", "String", ">", "addresses", ",", "Set", "<", "MasterWorkerInfo", ">", "workerInfoSet", ",", "Set", "<", "String", ">", "workerNames", ")", "{", "return", "workerInfoSet", "...
Selects the MasterWorkerInfo from workerInfoSet whose host or related IP address exists in addresses. @param addresses the address set that user passed in @param workerInfoSet the MasterWorkerInfo set to select info from @param workerNames the supported worker names
[ "Selects", "the", "MasterWorkerInfo", "from", "workerInfoSet", "whose", "host", "or", "related", "IP", "address", "exists", "in", "addresses", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L1068-L1095
18,633
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.write
public void write(WriteRequest writeRequest) { if (!tryAcquireSemaphore()) { return; } mSerializingExecutor.execute(() -> { try { if (mContext == null) { LOG.debug("Received write request {}.", writeRequest); mContext = createRequestContext(writeRequest); } el...
java
public void write(WriteRequest writeRequest) { if (!tryAcquireSemaphore()) { return; } mSerializingExecutor.execute(() -> { try { if (mContext == null) { LOG.debug("Received write request {}.", writeRequest); mContext = createRequestContext(writeRequest); } el...
[ "public", "void", "write", "(", "WriteRequest", "writeRequest", ")", "{", "if", "(", "!", "tryAcquireSemaphore", "(", ")", ")", "{", "return", ";", "}", "mSerializingExecutor", ".", "execute", "(", "(", ")", "->", "{", "try", "{", "if", "(", "mContext", ...
Handles write request. @param writeRequest the request from the client
[ "Handles", "write", "request", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L101-L141
18,634
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.writeDataMessage
public void writeDataMessage(WriteRequest request, DataBuffer buffer) { if (buffer == null) { write(request); return; } Preconditions.checkState(!request.hasCommand(), "write request command should not come with data buffer"); Preconditions.checkState(buffer.readableBytes() > 0, ...
java
public void writeDataMessage(WriteRequest request, DataBuffer buffer) { if (buffer == null) { write(request); return; } Preconditions.checkState(!request.hasCommand(), "write request command should not come with data buffer"); Preconditions.checkState(buffer.readableBytes() > 0, ...
[ "public", "void", "writeDataMessage", "(", "WriteRequest", "request", ",", "DataBuffer", "buffer", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "write", "(", "request", ")", ";", "return", ";", "}", "Preconditions", ".", "checkState", "(", "!", ...
Handles write request with data message. @param request the request from the client @param buffer the data associated with the request
[ "Handles", "write", "request", "with", "data", "message", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L149-L168
18,635
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.onCompleted
public void onCompleted() { mSerializingExecutor.execute(() -> { Preconditions.checkState(mContext != null); try { completeRequest(mContext); replySuccess(); } catch (Exception e) { LogUtils.warnWithException(LOG, "Exception occurred while completing write request {}.", ...
java
public void onCompleted() { mSerializingExecutor.execute(() -> { Preconditions.checkState(mContext != null); try { completeRequest(mContext); replySuccess(); } catch (Exception e) { LogUtils.warnWithException(LOG, "Exception occurred while completing write request {}.", ...
[ "public", "void", "onCompleted", "(", ")", "{", "mSerializingExecutor", ".", "execute", "(", "(", ")", "->", "{", "Preconditions", ".", "checkState", "(", "mContext", "!=", "null", ")", ";", "try", "{", "completeRequest", "(", "mContext", ")", ";", "replyS...
Handles request complete event.
[ "Handles", "request", "complete", "event", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L173-L186
18,636
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.onCancel
public void onCancel() { mSerializingExecutor.execute(() -> { try { cancelRequest(mContext); replyCancel(); } catch (Exception e) { LogUtils.warnWithException(LOG, "Exception occurred while cancelling write request {}.", mContext.getRequest(), e); Throwables.t...
java
public void onCancel() { mSerializingExecutor.execute(() -> { try { cancelRequest(mContext); replyCancel(); } catch (Exception e) { LogUtils.warnWithException(LOG, "Exception occurred while cancelling write request {}.", mContext.getRequest(), e); Throwables.t...
[ "public", "void", "onCancel", "(", ")", "{", "mSerializingExecutor", ".", "execute", "(", "(", ")", "->", "{", "try", "{", "cancelRequest", "(", "mContext", ")", ";", "replyCancel", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LogUtil...
Handles request cancellation event.
[ "Handles", "request", "cancellation", "event", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L191-L203
18,637
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.onError
public void onError(Throwable cause) { if (cause instanceof StatusRuntimeException && ((StatusRuntimeException) cause).getStatus().getCode() == Status.Code.CANCELLED) { // Cancellation is already handled. return; } mSerializingExecutor.execute(() -> { LogUtils.warnWithException(LOG...
java
public void onError(Throwable cause) { if (cause instanceof StatusRuntimeException && ((StatusRuntimeException) cause).getStatus().getCode() == Status.Code.CANCELLED) { // Cancellation is already handled. return; } mSerializingExecutor.execute(() -> { LogUtils.warnWithException(LOG...
[ "public", "void", "onError", "(", "Throwable", "cause", ")", "{", "if", "(", "cause", "instanceof", "StatusRuntimeException", "&&", "(", "(", "StatusRuntimeException", ")", "cause", ")", ".", "getStatus", "(", ")", ".", "getCode", "(", ")", "==", "Status", ...
Handles errors from the request. @param cause the exception
[ "Handles", "errors", "from", "the", "request", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L210-L221
18,638
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.validateWriteRequest
@GuardedBy("mLock") private void validateWriteRequest(alluxio.grpc.WriteRequest request) throws InvalidArgumentException { if (request.hasCommand() && request.getCommand().hasOffset() && request.getCommand().getOffset() != mContext.getPos()) { throw new InvalidArgumentException(String.format( ...
java
@GuardedBy("mLock") private void validateWriteRequest(alluxio.grpc.WriteRequest request) throws InvalidArgumentException { if (request.hasCommand() && request.getCommand().hasOffset() && request.getCommand().getOffset() != mContext.getPos()) { throw new InvalidArgumentException(String.format( ...
[ "@", "GuardedBy", "(", "\"mLock\"", ")", "private", "void", "validateWriteRequest", "(", "alluxio", ".", "grpc", ".", "WriteRequest", "request", ")", "throws", "InvalidArgumentException", "{", "if", "(", "request", ".", "hasCommand", "(", ")", "&&", "request", ...
Validates a block write request. @param request the block write request @throws InvalidArgumentException if the write request is invalid
[ "Validates", "a", "block", "write", "request", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L242-L251
18,639
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.abort
private void abort(Error error) { try { if (mContext == null || mContext.getError() != null || mContext.isDoneUnsafe()) { // Note, we may reach here via events due to network errors bubbling up before // mContext is initialized, or stream error after the request is finished. return; ...
java
private void abort(Error error) { try { if (mContext == null || mContext.getError() != null || mContext.isDoneUnsafe()) { // Note, we may reach here via events due to network errors bubbling up before // mContext is initialized, or stream error after the request is finished. return; ...
[ "private", "void", "abort", "(", "Error", "error", ")", "{", "try", "{", "if", "(", "mContext", "==", "null", "||", "mContext", ".", "getError", "(", ")", "!=", "null", "||", "mContext", ".", "isDoneUnsafe", "(", ")", ")", "{", "// Note, we may reach her...
Abort the write process due to error. @param error the error
[ "Abort", "the", "write", "process", "due", "to", "error", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L287-L300
18,640
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.replyError
private void replyError() { Error error = Preconditions.checkNotNull(mContext.getError()); if (error.isNotifyClient()) { mResponseObserver.onError(error.getCause().toGrpcStatusException()); } }
java
private void replyError() { Error error = Preconditions.checkNotNull(mContext.getError()); if (error.isNotifyClient()) { mResponseObserver.onError(error.getCause().toGrpcStatusException()); } }
[ "private", "void", "replyError", "(", ")", "{", "Error", "error", "=", "Preconditions", ".", "checkNotNull", "(", "mContext", ".", "getError", "(", ")", ")", ";", "if", "(", "error", ".", "isNotifyClient", "(", ")", ")", "{", "mResponseObserver", ".", "o...
Writes an error response.
[ "Writes", "an", "error", "response", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L375-L380
18,641
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java
GrpcBlockingStream.send
public void send(ReqT request, long timeoutMs) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { throw new CancelledException(formatErrorMessage( "Failed to send request %s: stream is already closed or canceled.", request)); } try (LockResource lr = new LockResource(mLock...
java
public void send(ReqT request, long timeoutMs) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { throw new CancelledException(formatErrorMessage( "Failed to send request %s: stream is already closed or canceled.", request)); } try (LockResource lr = new LockResource(mLock...
[ "public", "void", "send", "(", "ReqT", "request", ",", "long", "timeoutMs", ")", "throws", "IOException", "{", "if", "(", "mClosed", "||", "mCanceled", "||", "mClosedFromRemote", ")", "{", "throw", "new", "CancelledException", "(", "formatErrorMessage", "(", "...
Sends a request. Will wait until the stream is ready before sending or timeout if the given timeout is reached. @param request the request @param timeoutMs maximum wait time before throwing a {@link DeadlineExceededException} @throws IOException if any error occurs
[ "Sends", "a", "request", ".", "Will", "wait", "until", "the", "stream", "is", "ready", "before", "sending", "or", "timeout", "if", "the", "given", "timeout", "is", "reached", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java#L93-L117
18,642
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java
GrpcBlockingStream.send
public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { throw new CancelledException(formatErrorMessage( "Failed to send request %s: stream is already closed or canceled.", request)); } try (LockResource lr = new LockResource(mLock)) { check...
java
public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { throw new CancelledException(formatErrorMessage( "Failed to send request %s: stream is already closed or canceled.", request)); } try (LockResource lr = new LockResource(mLock)) { check...
[ "public", "void", "send", "(", "ReqT", "request", ")", "throws", "IOException", "{", "if", "(", "mClosed", "||", "mCanceled", "||", "mClosedFromRemote", ")", "{", "throw", "new", "CancelledException", "(", "formatErrorMessage", "(", "\"Failed to send request %s: str...
Sends a request. Will not wait for the stream to be ready. @param request the request @throws IOException if any error occurs
[ "Sends", "a", "request", ".", "Will", "not", "wait", "for", "the", "stream", "to", "be", "ready", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java#L125-L134
18,643
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java
GrpcBlockingStream.receive
public ResT receive(long timeoutMs) throws IOException { if (mCompleted) { return null; } if (mCanceled) { throw new CancelledException(formatErrorMessage("Stream is already canceled.")); } try { Object response = mResponses.poll(timeoutMs, TimeUnit.MILLISECONDS); if (respons...
java
public ResT receive(long timeoutMs) throws IOException { if (mCompleted) { return null; } if (mCanceled) { throw new CancelledException(formatErrorMessage("Stream is already canceled.")); } try { Object response = mResponses.poll(timeoutMs, TimeUnit.MILLISECONDS); if (respons...
[ "public", "ResT", "receive", "(", "long", "timeoutMs", ")", "throws", "IOException", "{", "if", "(", "mCompleted", ")", "{", "return", "null", ";", "}", "if", "(", "mCanceled", ")", "{", "throw", "new", "CancelledException", "(", "formatErrorMessage", "(", ...
Receives a response from the server. Will wait until a response is received, or throw an exception if times out. @param timeoutMs maximum time to wait before giving up and throwing a {@link DeadlineExceededException} @return the response message, or null if the inbound stream is completed @throws IOException if any er...
[ "Receives", "a", "response", "from", "the", "server", ".", "Will", "wait", "until", "a", "response", "is", "received", "or", "throw", "an", "exception", "if", "times", "out", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java#L145-L169
18,644
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java
GrpcBlockingStream.cancel
public void cancel() { if (isOpen()) { LOG.debug("Cancelling stream ({})", mDescription); mCanceled = true; mRequestObserver.cancel("Request is cancelled by user.", null); } }
java
public void cancel() { if (isOpen()) { LOG.debug("Cancelling stream ({})", mDescription); mCanceled = true; mRequestObserver.cancel("Request is cancelled by user.", null); } }
[ "public", "void", "cancel", "(", ")", "{", "if", "(", "isOpen", "(", ")", ")", "{", "LOG", ".", "debug", "(", "\"Cancelling stream ({})\"", ",", "mDescription", ")", ";", "mCanceled", "=", "true", ";", "mRequestObserver", ".", "cancel", "(", "\"Request is ...
Cancels the stream.
[ "Cancels", "the", "stream", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/stream/GrpcBlockingStream.java#L185-L191
18,645
Alluxio/alluxio
shell/src/main/java/alluxio/master/job/AlluxioJobMasterMonitor.java
AlluxioJobMasterMonitor.main
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioJobMasterMonitor.class.getCanonicalName()); LOG.warn("ignoring arguments"); } AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defau...
java
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioJobMasterMonitor.class.getCanonicalName()); LOG.warn("ignoring arguments"); } AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defau...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "0", ")", "{", "LOG", ".", "info", "(", "\"java -cp {} {}\"", ",", "RuntimeConstants", ".", "ALLUXIO_JAR", ",", "AlluxioJobMasterMonitor"...
Starts the Alluxio job_master monitor. @param args command line arguments, should be empty
[ "Starts", "the", "Alluxio", "job_master", "monitor", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/master/job/AlluxioJobMasterMonitor.java#L37-L61
18,646
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java
LoadCommand.load
private void load(AlluxioURI filePath, boolean local) throws AlluxioException, IOException { URIStatus status = mFileSystem.getStatus(filePath); if (status.isFolder()) { List<URIStatus> statuses = mFileSystem.listStatus(filePath); for (URIStatus uriStatus : statuses) { AlluxioURI newPath = n...
java
private void load(AlluxioURI filePath, boolean local) throws AlluxioException, IOException { URIStatus status = mFileSystem.getStatus(filePath); if (status.isFolder()) { List<URIStatus> statuses = mFileSystem.listStatus(filePath); for (URIStatus uriStatus : statuses) { AlluxioURI newPath = n...
[ "private", "void", "load", "(", "AlluxioURI", "filePath", ",", "boolean", "local", ")", "throws", "AlluxioException", ",", "IOException", "{", "URIStatus", "status", "=", "mFileSystem", ".", "getStatus", "(", "filePath", ")", ";", "if", "(", "status", ".", "...
Loads a file or directory in Alluxio space, makes it resident in Alluxio. @param filePath The {@link AlluxioURI} path to load into Alluxio @param local whether to load data to local worker even when the data is already loaded remotely
[ "Loads", "a", "file", "or", "directory", "in", "Alluxio", "space", "makes", "it", "resident", "in", "Alluxio", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java#L88-L123
18,647
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java
UnderFileSystemBlockStore.closeReaderOrWriter
public void closeReaderOrWriter(long sessionId, long blockId) throws IOException { BlockInfo blockInfo; try (LockResource lr = new LockResource(mLock)) { blockInfo = mBlocks.get(new Key(sessionId, blockId)); if (blockInfo == null) { LOG.warn("Key (block ID: {}, session ID {}) is not found wh...
java
public void closeReaderOrWriter(long sessionId, long blockId) throws IOException { BlockInfo blockInfo; try (LockResource lr = new LockResource(mLock)) { blockInfo = mBlocks.get(new Key(sessionId, blockId)); if (blockInfo == null) { LOG.warn("Key (block ID: {}, session ID {}) is not found wh...
[ "public", "void", "closeReaderOrWriter", "(", "long", "sessionId", ",", "long", "blockId", ")", "throws", "IOException", "{", "BlockInfo", "blockInfo", ";", "try", "(", "LockResource", "lr", "=", "new", "LockResource", "(", "mLock", ")", ")", "{", "blockInfo",...
Closes the block reader or writer and checks whether it is necessary to commit the block to Local block store. During UFS block read, this is triggered when the block is unlocked. During UFS block write, this is triggered when the UFS block is committed. @param sessionId the session ID @param blockId the block ID
[ "Closes", "the", "block", "reader", "or", "writer", "and", "checks", "whether", "it", "is", "necessary", "to", "commit", "the", "block", "to", "Local", "block", "store", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java#L145-L156
18,648
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java
UnderFileSystemBlockStore.getBlockReader
public BlockReader getBlockReader(final long sessionId, long blockId, long offset) throws BlockDoesNotExistException, IOException { final BlockInfo blockInfo; try (LockResource lr = new LockResource(mLock)) { blockInfo = getBlockInfo(sessionId, blockId); BlockReader blockReader = blockInfo.get...
java
public BlockReader getBlockReader(final long sessionId, long blockId, long offset) throws BlockDoesNotExistException, IOException { final BlockInfo blockInfo; try (LockResource lr = new LockResource(mLock)) { blockInfo = getBlockInfo(sessionId, blockId); BlockReader blockReader = blockInfo.get...
[ "public", "BlockReader", "getBlockReader", "(", "final", "long", "sessionId", ",", "long", "blockId", ",", "long", "offset", ")", "throws", "BlockDoesNotExistException", ",", "IOException", "{", "final", "BlockInfo", "blockInfo", ";", "try", "(", "LockResource", "...
Creates a block reader that reads from UFS and optionally caches the block to the Alluxio block store. @param sessionId the client session ID that requested this read @param blockId the ID of the block to read @param offset the read offset within the block (NOT the file) @return the block reader instance @throws Block...
[ "Creates", "a", "block", "reader", "that", "reads", "from", "UFS", "and", "optionally", "caches", "the", "block", "to", "the", "Alluxio", "block", "store", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java#L231-L246
18,649
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeDirectoryIdGenerator.java
InodeDirectoryIdGenerator.getNewDirectoryId
synchronized long getNewDirectoryId(JournalContext context) throws UnavailableException { initialize(context); long containerId = mNextDirectoryId.getContainerId(); long sequenceNumber = mNextDirectoryId.getSequenceNumber(); long directoryId = BlockId.createBlockId(containerId, sequenceNumber); if (...
java
synchronized long getNewDirectoryId(JournalContext context) throws UnavailableException { initialize(context); long containerId = mNextDirectoryId.getContainerId(); long sequenceNumber = mNextDirectoryId.getSequenceNumber(); long directoryId = BlockId.createBlockId(containerId, sequenceNumber); if (...
[ "synchronized", "long", "getNewDirectoryId", "(", "JournalContext", "context", ")", "throws", "UnavailableException", "{", "initialize", "(", "context", ")", ";", "long", "containerId", "=", "mNextDirectoryId", ".", "getContainerId", "(", ")", ";", "long", "sequence...
Returns the next directory id, and journals the state. @return the next directory id
[ "Returns", "the", "next", "directory", "id", "and", "journals", "the", "state", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeDirectoryIdGenerator.java#L57-L71
18,650
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.listToString
public static <T> String listToString(List<T> list) { StringBuilder sb = new StringBuilder(); for (T s : list) { if (sb.length() != 0) { sb.append(" "); } sb.append(s); } return sb.toString(); }
java
public static <T> String listToString(List<T> list) { StringBuilder sb = new StringBuilder(); for (T s : list) { if (sb.length() != 0) { sb.append(" "); } sb.append(s); } return sb.toString(); }
[ "public", "static", "<", "T", ">", "String", "listToString", "(", "List", "<", "T", ">", "list", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "T", "s", ":", "list", ")", "{", "if", "(", "sb", ".", "leng...
Converts a list of objects to a string. @param list list of objects @param <T> type of the objects @return space-separated concatenation of the string representation returned by Object#toString of the individual objects
[ "Converts", "a", "list", "of", "objects", "to", "a", "string", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L112-L121
18,651
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.argsToString
public static <T> String argsToString(String separator, T... args) { StringBuilder sb = new StringBuilder(); for (T s : args) { if (sb.length() != 0) { sb.append(separator); } sb.append(s); } return sb.toString(); }
java
public static <T> String argsToString(String separator, T... args) { StringBuilder sb = new StringBuilder(); for (T s : args) { if (sb.length() != 0) { sb.append(separator); } sb.append(s); } return sb.toString(); }
[ "public", "static", "<", "T", ">", "String", "argsToString", "(", "String", "separator", ",", "T", "...", "args", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "T", "s", ":", "args", ")", "{", "if", "(", "...
Converts varargs of objects to a string. @param separator separator string @param args variable arguments @param <T> type of the objects @return concatenation of the string representation returned by Object#toString of the individual objects
[ "Converts", "varargs", "of", "objects", "to", "a", "string", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L132-L141
18,652
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.randomAlphaNumString
public static String randomAlphaNumString(int length) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { sb.append(ALPHANUM.charAt(RANDOM.nextInt(ALPHANUM.length()))); } return sb.toString(); }
java
public static String randomAlphaNumString(int length) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { sb.append(ALPHANUM.charAt(RANDOM.nextInt(ALPHANUM.length()))); } return sb.toString(); }
[ "public", "static", "String", "randomAlphaNumString", "(", "int", "length", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "sb", ".", ...
Generates a random alphanumeric string of the given length. @param length the length @return a random string
[ "Generates", "a", "random", "alphanumeric", "string", "of", "the", "given", "length", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L160-L166
18,653
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.createNewClassInstance
public static <T> T createNewClassInstance(Class<T> cls, Class<?>[] ctorClassArgs, Object[] ctorArgs) { try { if (ctorClassArgs == null) { return cls.newInstance(); } Constructor<T> ctor = cls.getConstructor(ctorClassArgs); return ctor.newInstance(ctorArgs); } catch (Invoca...
java
public static <T> T createNewClassInstance(Class<T> cls, Class<?>[] ctorClassArgs, Object[] ctorArgs) { try { if (ctorClassArgs == null) { return cls.newInstance(); } Constructor<T> ctor = cls.getConstructor(ctorClassArgs); return ctor.newInstance(ctorArgs); } catch (Invoca...
[ "public", "static", "<", "T", ">", "T", "createNewClassInstance", "(", "Class", "<", "T", ">", "cls", ",", "Class", "<", "?", ">", "[", "]", "ctorClassArgs", ",", "Object", "[", "]", "ctorArgs", ")", "{", "try", "{", "if", "(", "ctorClassArgs", "==",...
Creates new instance of a class by calling a constructor that receives ctorClassArgs arguments. @param <T> type of the object @param cls the class to create @param ctorClassArgs parameters type list of the constructor to initiate, if null default constructor will be called @param ctorArgs the arguments to pass the con...
[ "Creates", "new", "instance", "of", "a", "class", "by", "calling", "a", "constructor", "that", "receives", "ctorClassArgs", "arguments", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L224-L237
18,654
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.getUnixGroups
public static List<String> getUnixGroups(String user) throws IOException { String result; List<String> groups = new ArrayList<>(); try { result = ShellUtils.execCommand(ShellUtils.getGroupsForUserCommand(user)); } catch (ExitCodeException e) { // if we didn't get the group - just return empt...
java
public static List<String> getUnixGroups(String user) throws IOException { String result; List<String> groups = new ArrayList<>(); try { result = ShellUtils.execCommand(ShellUtils.getGroupsForUserCommand(user)); } catch (ExitCodeException e) { // if we didn't get the group - just return empt...
[ "public", "static", "List", "<", "String", ">", "getUnixGroups", "(", "String", "user", ")", "throws", "IOException", "{", "String", "result", ";", "List", "<", "String", ">", "groups", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "result", ...
Gets the current user's group list from Unix by running the command 'groups' NOTE. For non-existing user it will return EMPTY list. This method may return duplicate groups. @param user user name @return the groups list that the {@code user} belongs to. The primary group is returned first
[ "Gets", "the", "current", "user", "s", "group", "list", "from", "Unix", "by", "running", "the", "command", "groups", "NOTE", ".", "For", "non", "-", "existing", "user", "it", "will", "return", "EMPTY", "list", ".", "This", "method", "may", "return", "dup...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L246-L262
18,655
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.waitForResult
public static <T> T waitForResult(String description, Supplier<T> operation, WaitForOptions options) throws InterruptedException, TimeoutException { T t; long start = System.currentTimeMillis(); int interval = options.getInterval(); int timeout = options.getTimeoutMs(); while ((t = operation.g...
java
public static <T> T waitForResult(String description, Supplier<T> operation, WaitForOptions options) throws InterruptedException, TimeoutException { T t; long start = System.currentTimeMillis(); int interval = options.getInterval(); int timeout = options.getTimeoutMs(); while ((t = operation.g...
[ "public", "static", "<", "T", ">", "T", "waitForResult", "(", "String", "description", ",", "Supplier", "<", "T", ">", "operation", ",", "WaitForOptions", "options", ")", "throws", "InterruptedException", ",", "TimeoutException", "{", "T", "t", ";", "long", ...
Waits for an operation to return a non-null value with a specified timeout. @param description the description of this operation @param operation the operation @param options the options to use @param <T> the type of the return value @throws TimeoutException if the function times out while waiting to get a non-null va...
[ "Waits", "for", "an", "operation", "to", "return", "a", "non", "-", "null", "value", "with", "a", "specified", "timeout", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L299-L312
18,656
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.getPrimaryGroupName
public static String getPrimaryGroupName(String userName, AlluxioConfiguration conf) throws IOException { List<String> groups = getGroups(userName, conf); return (groups != null && groups.size() > 0) ? groups.get(0) : ""; }
java
public static String getPrimaryGroupName(String userName, AlluxioConfiguration conf) throws IOException { List<String> groups = getGroups(userName, conf); return (groups != null && groups.size() > 0) ? groups.get(0) : ""; }
[ "public", "static", "String", "getPrimaryGroupName", "(", "String", "userName", ",", "AlluxioConfiguration", "conf", ")", "throws", "IOException", "{", "List", "<", "String", ">", "groups", "=", "getGroups", "(", "userName", ",", "conf", ")", ";", "return", "(...
Gets the primary group name of a user. @param userName Alluxio user name @param conf Alluxio configuration @return primary group name
[ "Gets", "the", "primary", "group", "name", "of", "a", "user", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L321-L325
18,657
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.stripSuffixIfPresent
public static String stripSuffixIfPresent(final String key, final String suffix) { if (key.endsWith(suffix)) { return key.substring(0, key.length() - suffix.length()); } return key; }
java
public static String stripSuffixIfPresent(final String key, final String suffix) { if (key.endsWith(suffix)) { return key.substring(0, key.length() - suffix.length()); } return key; }
[ "public", "static", "String", "stripSuffixIfPresent", "(", "final", "String", "key", ",", "final", "String", "suffix", ")", "{", "if", "(", "key", ".", "endsWith", "(", "suffix", ")", ")", "{", "return", "key", ".", "substring", "(", "0", ",", "key", "...
Strips the suffix if it exists. This method will leave keys without a suffix unaltered. @param key the key to strip the suffix from @param suffix suffix to remove @return the key with the suffix removed, or the key unaltered if the suffix is not present
[ "Strips", "the", "suffix", "if", "it", "exists", ".", "This", "method", "will", "leave", "keys", "without", "a", "suffix", "unaltered", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L347-L352
18,658
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.getRootCause
public static Throwable getRootCause(Throwable e) { while (e.getCause() != null && !(e.getCause() instanceof StatusRuntimeException)) { e = e.getCause(); } return e; }
java
public static Throwable getRootCause(Throwable e) { while (e.getCause() != null && !(e.getCause() instanceof StatusRuntimeException)) { e = e.getCause(); } return e; }
[ "public", "static", "Throwable", "getRootCause", "(", "Throwable", "e", ")", "{", "while", "(", "e", ".", "getCause", "(", ")", "!=", "null", "&&", "!", "(", "e", ".", "getCause", "(", ")", "instanceof", "StatusRuntimeException", ")", ")", "{", "e", "=...
Gets the root cause of an exception. It stops at encountering gRPC's StatusRuntimeException. @param e the exception @return the root cause
[ "Gets", "the", "root", "cause", "of", "an", "exception", ".", "It", "stops", "at", "encountering", "gRPC", "s", "StatusRuntimeException", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L411-L416
18,659
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.singleElementIterator
public static <T> Iterator<T> singleElementIterator(final T element) { return new Iterator<T>() { private boolean mHasNext = true; @Override public boolean hasNext() { return mHasNext; } @Override public T next() { if (!hasNext()) { throw new NoSuchEle...
java
public static <T> Iterator<T> singleElementIterator(final T element) { return new Iterator<T>() { private boolean mHasNext = true; @Override public boolean hasNext() { return mHasNext; } @Override public T next() { if (!hasNext()) { throw new NoSuchEle...
[ "public", "static", "<", "T", ">", "Iterator", "<", "T", ">", "singleElementIterator", "(", "final", "T", "element", ")", "{", "return", "new", "Iterator", "<", "T", ">", "(", ")", "{", "private", "boolean", "mHasNext", "=", "true", ";", "@", "Override...
Returns an iterator that iterates on a single element. @param element the element @param <T> the type of the element @return the iterator
[ "Returns", "an", "iterator", "that", "iterates", "on", "a", "single", "element", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L439-L462
18,660
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.closeAndRethrow
public static RuntimeException closeAndRethrow(Closer closer, Throwable t) throws IOException { try { throw closer.rethrow(t); } finally { closer.close(); } }
java
public static RuntimeException closeAndRethrow(Closer closer, Throwable t) throws IOException { try { throw closer.rethrow(t); } finally { closer.close(); } }
[ "public", "static", "RuntimeException", "closeAndRethrow", "(", "Closer", "closer", ",", "Throwable", "t", ")", "throws", "IOException", "{", "try", "{", "throw", "closer", ".", "rethrow", "(", "t", ")", ";", "}", "finally", "{", "closer", ".", "close", "(...
Closes the Closer and re-throws the Throwable. Any exceptions thrown while closing the Closer will be added as suppressed exceptions to the Throwable. This method always throws the given Throwable, wrapping it in a RuntimeException if it's a non-IOException checked exception. Note: This method will wrap non-IOExceptio...
[ "Closes", "the", "Closer", "and", "re", "-", "throws", "the", "Throwable", ".", "Any", "exceptions", "thrown", "while", "closing", "the", "Closer", "will", "be", "added", "as", "suppressed", "exceptions", "to", "the", "Throwable", ".", "This", "method", "alw...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L536-L542
18,661
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.convertMsToDate
public static String convertMsToDate(long millis, String dateFormatPattern) { DateFormat dateFormat = new SimpleDateFormat(dateFormatPattern); return dateFormat.format(new Date(millis)); }
java
public static String convertMsToDate(long millis, String dateFormatPattern) { DateFormat dateFormat = new SimpleDateFormat(dateFormatPattern); return dateFormat.format(new Date(millis)); }
[ "public", "static", "String", "convertMsToDate", "(", "long", "millis", ",", "String", "dateFormatPattern", ")", "{", "DateFormat", "dateFormat", "=", "new", "SimpleDateFormat", "(", "dateFormatPattern", ")", ";", "return", "dateFormat", ".", "format", "(", "new",...
Converts a millisecond number to a formatted date String. @param millis a long millisecond number @param dateFormatPattern the date format to follow when converting. i.e. mm-dd-yyyy @return formatted date String
[ "Converts", "a", "millisecond", "number", "to", "a", "formatted", "date", "String", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L606-L609
18,662
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.createTags
private static Map<Tag, String> createTags(String ufsName, UfsStatus status) { Map<Tag, String> tagMap = new HashMap<>(); tagMap.put(Tag.UFS, ufsName); tagMap.put(Tag.OWNER, status.getOwner()); tagMap.put(Tag.GROUP, status.getGroup()); tagMap.put(Tag.MODE, String.valueOf(status.getMode())); if (...
java
private static Map<Tag, String> createTags(String ufsName, UfsStatus status) { Map<Tag, String> tagMap = new HashMap<>(); tagMap.put(Tag.UFS, ufsName); tagMap.put(Tag.OWNER, status.getOwner()); tagMap.put(Tag.GROUP, status.getGroup()); tagMap.put(Tag.MODE, String.valueOf(status.getMode())); if (...
[ "private", "static", "Map", "<", "Tag", ",", "String", ">", "createTags", "(", "String", "ufsName", ",", "UfsStatus", "status", ")", "{", "Map", "<", "Tag", ",", "String", ">", "tagMap", "=", "new", "HashMap", "<>", "(", ")", ";", "tagMap", ".", "put...
Parses the input status and returns a tag map. @param ufsName the name of the ufs, should be {@link UnderFileSystem#getUnderFSType()} @param status the {@link UfsStatus} to create the tagmap from @return the tag map object
[ "Parses", "the", "input", "status", "and", "returns", "a", "tag", "map", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L113-L126
18,663
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.isValid
public boolean isValid() { if (mValues.isEmpty()) { return false; } // Check required tags for (Tag tag : REQUIRED_TAGS) { if (!mValues.containsKey(tag)) { return false; } } return true; }
java
public boolean isValid() { if (mValues.isEmpty()) { return false; } // Check required tags for (Tag tag : REQUIRED_TAGS) { if (!mValues.containsKey(tag)) { return false; } } return true; }
[ "public", "boolean", "isValid", "(", ")", "{", "if", "(", "mValues", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "// Check required tags", "for", "(", "Tag", "tag", ":", "REQUIRED_TAGS", ")", "{", "if", "(", "!", "mValues", ".", ...
Checks if the fingerprint object was generated from an INVALID_UFS_FINGERPRINT. @return returns true if the fingerprint is valid
[ "Checks", "if", "the", "fingerprint", "object", "was", "generated", "from", "an", "INVALID_UFS_FINGERPRINT", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L165-L178
18,664
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.matchMetadata
public boolean matchMetadata(Fingerprint fp) { for (Tag tag : METADATA_TAGS) { if (!getTag(tag).equals(fp.getTag(tag))) { return false; } } return true; }
java
public boolean matchMetadata(Fingerprint fp) { for (Tag tag : METADATA_TAGS) { if (!getTag(tag).equals(fp.getTag(tag))) { return false; } } return true; }
[ "public", "boolean", "matchMetadata", "(", "Fingerprint", "fp", ")", "{", "for", "(", "Tag", "tag", ":", "METADATA_TAGS", ")", "{", "if", "(", "!", "getTag", "(", "tag", ")", ".", "equals", "(", "fp", ".", "getTag", "(", "tag", ")", ")", ")", "{", ...
Returns true if the serialized fingerprint matches the fingerprint in metadata. @param fp a parsed fingerprint object @return true if the given fingerprint matches the current fingerprint in metadata
[ "Returns", "true", "if", "the", "serialized", "fingerprint", "matches", "the", "fingerprint", "in", "metadata", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L207-L214
18,665
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.matchContent
public boolean matchContent(Fingerprint fp) { for (Tag tag : CONTENT_TAGS) { if (!getTag(tag).equals(fp.getTag(tag))) { return false; } } return true; }
java
public boolean matchContent(Fingerprint fp) { for (Tag tag : CONTENT_TAGS) { if (!getTag(tag).equals(fp.getTag(tag))) { return false; } } return true; }
[ "public", "boolean", "matchContent", "(", "Fingerprint", "fp", ")", "{", "for", "(", "Tag", "tag", ":", "CONTENT_TAGS", ")", "{", "if", "(", "!", "getTag", "(", "tag", ")", ".", "equals", "(", "fp", ".", "getTag", "(", "tag", ")", ")", ")", "{", ...
Returns true if the serialized fingerprint matches the fingerprint in the content part. @param fp a parsed fingerprint object @return true if the given fingerprint matches the current fingerprint's content
[ "Returns", "true", "if", "the", "serialized", "fingerprint", "matches", "the", "fingerprint", "in", "the", "content", "part", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L222-L229
18,666
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/Fingerprint.java
Fingerprint.putTag
public void putTag(Tag tag, String value) { if (value != null) { mValues.put(tag, sanitizeString(value)); } }
java
public void putTag(Tag tag, String value) { if (value != null) { mValues.put(tag, sanitizeString(value)); } }
[ "public", "void", "putTag", "(", "Tag", "tag", ",", "String", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "mValues", ".", "put", "(", "tag", ",", "sanitizeString", "(", "value", ")", ")", ";", "}", "}" ]
Updates a specific tag in the fingerprint. If the new value is null, the fingerprint is kept unchanged. @param tag the tag to update @param value the new value of the tag
[ "Updates", "a", "specific", "tag", "in", "the", "fingerprint", ".", "If", "the", "new", "value", "is", "null", "the", "fingerprint", "is", "kept", "unchanged", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/Fingerprint.java#L238-L242
18,667
Alluxio/alluxio
underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AInputStream.java
S3AInputStream.openStream
private void openStream() throws IOException { if (mIn != null) { // stream is already open return; } GetObjectRequest getReq = new GetObjectRequest(mBucketName, mKey); // If the position is 0, setting range is redundant and causes an error if the file is 0 length if (mPos > 0) { getReq....
java
private void openStream() throws IOException { if (mIn != null) { // stream is already open return; } GetObjectRequest getReq = new GetObjectRequest(mBucketName, mKey); // If the position is 0, setting range is redundant and causes an error if the file is 0 length if (mPos > 0) { getReq....
[ "private", "void", "openStream", "(", ")", "throws", "IOException", "{", "if", "(", "mIn", "!=", "null", ")", "{", "// stream is already open", "return", ";", "}", "GetObjectRequest", "getReq", "=", "new", "GetObjectRequest", "(", "mBucketName", ",", "mKey", "...
Opens a new stream at mPos if the wrapped stream mIn is null.
[ "Opens", "a", "new", "stream", "at", "mPos", "if", "the", "wrapped", "stream", "mIn", "is", "null", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AInputStream.java#L136-L162
18,668
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/DirectedAcyclicGraphNode.java
DirectedAcyclicGraphNode.removeChild
public void removeChild(DirectedAcyclicGraphNode<T> child) { Preconditions.checkState(mChildren.contains(child)); mChildren.remove(child); }
java
public void removeChild(DirectedAcyclicGraphNode<T> child) { Preconditions.checkState(mChildren.contains(child)); mChildren.remove(child); }
[ "public", "void", "removeChild", "(", "DirectedAcyclicGraphNode", "<", "T", ">", "child", ")", "{", "Preconditions", ".", "checkState", "(", "mChildren", ".", "contains", "(", "child", ")", ")", ";", "mChildren", ".", "remove", "(", "child", ")", ";", "}" ...
Removes a child node from the node. @param child the child node to be removed
[ "Removes", "a", "child", "node", "from", "the", "node", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/DirectedAcyclicGraphNode.java#L106-L109
18,669
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/AccessControlList.java
AccessControlList.setEntry
public void setEntry(AclEntry entry) { switch (entry.getType()) { case NAMED_USER: // fall through case NAMED_GROUP: // fall through case MASK: if (mExtendedEntries == null) { mExtendedEntries = new ExtendedACLEntries(); } mExtendedEntries.setEntry(entry); ...
java
public void setEntry(AclEntry entry) { switch (entry.getType()) { case NAMED_USER: // fall through case NAMED_GROUP: // fall through case MASK: if (mExtendedEntries == null) { mExtendedEntries = new ExtendedACLEntries(); } mExtendedEntries.setEntry(entry); ...
[ "public", "void", "setEntry", "(", "AclEntry", "entry", ")", "{", "switch", "(", "entry", ".", "getType", "(", ")", ")", "{", "case", "NAMED_USER", ":", "// fall through", "case", "NAMED_GROUP", ":", "// fall through", "case", "MASK", ":", "if", "(", "mExt...
Sets an entry into the access control list. If an entry with the same type and subject already exists, overwrites the existing entry; Otherwise, adds this new entry. After we modify entries for NAMED_GROUP, OWNING_GROUP, NAMED_USER, we need to update the mask. @param entry the entry to be added or updated
[ "Sets", "an", "entry", "into", "the", "access", "control", "list", ".", "If", "an", "entry", "with", "the", "same", "type", "and", "subject", "already", "exists", "overwrites", "the", "existing", "entry", ";", "Otherwise", "adds", "this", "new", "entry", "...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AccessControlList.java#L260-L288
18,670
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/AccessControlList.java
AccessControlList.checkPermission
public boolean checkPermission(String user, List<String> groups, AclAction action) { return getPermission(user, groups).contains(action); }
java
public boolean checkPermission(String user, List<String> groups, AclAction action) { return getPermission(user, groups).contains(action); }
[ "public", "boolean", "checkPermission", "(", "String", "user", ",", "List", "<", "String", ">", "groups", ",", "AclAction", "action", ")", "{", "return", "getPermission", "(", "user", ",", "groups", ")", ".", "contains", "(", "action", ")", ";", "}" ]
Checks whether the user has the permission to perform the action. 1. If the user is the owner, then the owner entry determines the permission; 2. Else if the user matches the name of one of the named user entries, this entry determines the permission; 3. Else if one of the groups is the owning group and the owning gro...
[ "Checks", "whether", "the", "user", "has", "the", "permission", "to", "perform", "the", "action", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AccessControlList.java#L310-L312
18,671
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/AccessControlList.java
AccessControlList.getPermission
public AclActions getPermission(String user, List<String> groups) { if (user.equals(mOwningUser)) { return new AclActions(getOwningUserActions()); } if (hasExtended()) { AclActions actions = mExtendedEntries.getNamedUser(user); if (actions != null) { AclActions result = new AclActi...
java
public AclActions getPermission(String user, List<String> groups) { if (user.equals(mOwningUser)) { return new AclActions(getOwningUserActions()); } if (hasExtended()) { AclActions actions = mExtendedEntries.getNamedUser(user); if (actions != null) { AclActions result = new AclActi...
[ "public", "AclActions", "getPermission", "(", "String", "user", ",", "List", "<", "String", ">", "groups", ")", "{", "if", "(", "user", ".", "equals", "(", "mOwningUser", ")", ")", "{", "return", "new", "AclActions", "(", "getOwningUserActions", "(", ")", ...
Gets the permitted actions for a user. When AccessControlList is not modified after calling getPermission, for each action returned by this method, checkPermission(user, groups, action) is true, for other actions, checkPermission(user, groups, action) is false. 1. If the user is the owner, then return the permission ...
[ "Gets", "the", "permitted", "actions", "for", "a", "user", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AccessControlList.java#L333-L369
18,672
Alluxio/alluxio
core/base/src/main/java/alluxio/security/authorization/AccessControlList.java
AccessControlList.fromStringEntries
public static AccessControlList fromStringEntries(String owner, String owningGroup, List<String> stringEntries) { AccessControlList acl; if (stringEntries.size() > 0) { AclEntry aclEntry = AclEntry.fromCliString(stringEntries.get(0)); if (aclEntry.isDefault()) { acl = new DefaultAccess...
java
public static AccessControlList fromStringEntries(String owner, String owningGroup, List<String> stringEntries) { AccessControlList acl; if (stringEntries.size() > 0) { AclEntry aclEntry = AclEntry.fromCliString(stringEntries.get(0)); if (aclEntry.isDefault()) { acl = new DefaultAccess...
[ "public", "static", "AccessControlList", "fromStringEntries", "(", "String", "owner", ",", "String", "owningGroup", ",", "List", "<", "String", ">", "stringEntries", ")", "{", "AccessControlList", "acl", ";", "if", "(", "stringEntries", ".", "size", "(", ")", ...
Converts a list of string entries into an AccessControlList or a DefaultAccessControlList. It assumes the stringEntries contain all default entries or normal entries. @param owner the owner @param owningGroup the owning group @param stringEntries the list of string representations of the entries @return the {@link Acc...
[ "Converts", "a", "list", "of", "string", "entries", "into", "an", "AccessControlList", "or", "a", "DefaultAccessControlList", ".", "It", "assumes", "the", "stringEntries", "contain", "all", "default", "entries", "or", "normal", "entries", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AccessControlList.java#L412-L434
18,673
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.contains
public <V> boolean contains(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.containsField(value); ...
java
public <V> boolean contains(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.containsField(value); ...
[ "public", "<", "V", ">", "boolean", "contains", "(", "IndexDefinition", "<", "T", ",", "V", ">", "indexDefinition", ",", "V", "value", ")", "{", "FieldIndex", "<", "T", ",", "V", ">", "index", "=", "(", "FieldIndex", "<", "T", ",", "V", ">", ")", ...
Whether there is an object with the specified index field value in the set. @param indexDefinition the field index definition @param value the field value @param <V> the field type @return true if there is one such object, otherwise false
[ "Whether", "there", "is", "an", "object", "with", "the", "specified", "index", "field", "value", "in", "the", "set", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L247-L253
18,674
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.getByField
public <V> Set<T> getByField(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.getByField(value); }
java
public <V> Set<T> getByField(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.getByField(value); }
[ "public", "<", "V", ">", "Set", "<", "T", ">", "getByField", "(", "IndexDefinition", "<", "T", ",", "V", ">", "indexDefinition", ",", "V", "value", ")", "{", "FieldIndex", "<", "T", ",", "V", ">", "index", "=", "(", "FieldIndex", "<", "T", ",", "...
Gets a subset of objects with the specified field value. If there is no object with the specified field value, a newly created empty set is returned. @param indexDefinition the field index definition @param value the field value to be satisfied @param <V> the field type @return the set of objects or an empty set if no...
[ "Gets", "a", "subset", "of", "objects", "with", "the", "specified", "field", "value", ".", "If", "there", "is", "no", "object", "with", "the", "specified", "field", "value", "a", "newly", "created", "empty", "set", "is", "returned", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L264-L270
18,675
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.getFirstByField
public <V> T getFirstByField(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.getFirst(value); }
java
public <V> T getFirstByField(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.getFirst(value); }
[ "public", "<", "V", ">", "T", "getFirstByField", "(", "IndexDefinition", "<", "T", ",", "V", ">", "indexDefinition", ",", "V", "value", ")", "{", "FieldIndex", "<", "T", ",", "V", ">", "index", "=", "(", "FieldIndex", "<", "T", ",", "V", ">", ")", ...
Gets the object from the set of objects with the specified field value. @param indexDefinition the field index definition @param value the field value @param <V> the field type @return the object or null if there is no such object
[ "Gets", "the", "object", "from", "the", "set", "of", "objects", "with", "the", "specified", "field", "value", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L280-L286
18,676
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.remove
@Override public boolean remove(Object object) { if (object == null) { return false; } // Locking this object protects against removing the exact object that might be in the // process of being added, but does not protect against removing a distinct, but equivalent // object. synchronize...
java
@Override public boolean remove(Object object) { if (object == null) { return false; } // Locking this object protects against removing the exact object that might be in the // process of being added, but does not protect against removing a distinct, but equivalent // object. synchronize...
[ "@", "Override", "public", "boolean", "remove", "(", "Object", "object", ")", "{", "if", "(", "object", "==", "null", ")", "{", "return", "false", ";", "}", "// Locking this object protects against removing the exact object that might be in the", "// process of being adde...
Removes an object from the set. @param object the object to remove @return true if the object is in the set and removed successfully, otherwise false
[ "Removes", "an", "object", "from", "the", "set", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L294-L314
18,677
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.removeFromIndices
private void removeFromIndices(T object) { for (FieldIndex<T, ?> fieldValue : mIndices.values()) { fieldValue.remove(object); } }
java
private void removeFromIndices(T object) { for (FieldIndex<T, ?> fieldValue : mIndices.values()) { fieldValue.remove(object); } }
[ "private", "void", "removeFromIndices", "(", "T", "object", ")", "{", "for", "(", "FieldIndex", "<", "T", ",", "?", ">", "fieldValue", ":", "mIndices", ".", "values", "(", ")", ")", "{", "fieldValue", ".", "remove", "(", "object", ")", ";", "}", "}" ...
Helper method that removes an object from the indices. @param object the object to be removed
[ "Helper", "method", "that", "removes", "an", "object", "from", "the", "indices", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L321-L325
18,678
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.removeByField
public <V> int removeByField(IndexDefinition<T, V> indexDefinition, V value) { Set<T> toRemove = getByField(indexDefinition, value); int removed = 0; for (T o : toRemove) { if (remove(o)) { removed++; } } return removed; }
java
public <V> int removeByField(IndexDefinition<T, V> indexDefinition, V value) { Set<T> toRemove = getByField(indexDefinition, value); int removed = 0; for (T o : toRemove) { if (remove(o)) { removed++; } } return removed; }
[ "public", "<", "V", ">", "int", "removeByField", "(", "IndexDefinition", "<", "T", ",", "V", ">", "indexDefinition", ",", "V", "value", ")", "{", "Set", "<", "T", ">", "toRemove", "=", "getByField", "(", "indexDefinition", ",", "value", ")", ";", "int"...
Removes the subset of objects with the specified index field value. @param indexDefinition the field index @param value the field value @param <V> the field type @return the number of objects removed
[ "Removes", "the", "subset", "of", "objects", "with", "the", "specified", "index", "field", "value", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L335-L345
18,679
Alluxio/alluxio
core/common/src/main/java/alluxio/ClientContext.java
ClientContext.updateConfigurationDefaults
@VisibleForTesting public synchronized void updateConfigurationDefaults(InetSocketAddress address) throws AlluxioStatusException { Pair<AlluxioConfiguration, PathConfiguration> conf = ConfigurationUtils.loadClusterAndPathDefaults(address, mConf, mPathConf); mConf = conf.getFirst(); mPathConf...
java
@VisibleForTesting public synchronized void updateConfigurationDefaults(InetSocketAddress address) throws AlluxioStatusException { Pair<AlluxioConfiguration, PathConfiguration> conf = ConfigurationUtils.loadClusterAndPathDefaults(address, mConf, mPathConf); mConf = conf.getFirst(); mPathConf...
[ "@", "VisibleForTesting", "public", "synchronized", "void", "updateConfigurationDefaults", "(", "InetSocketAddress", "address", ")", "throws", "AlluxioStatusException", "{", "Pair", "<", "AlluxioConfiguration", ",", "PathConfiguration", ">", "conf", "=", "ConfigurationUtils...
This method will attempt to load the cluster and path level configuration defaults and update the configuration if necessary. This method should be synchronized so that concurrent calls to it don't continually overwrite the previous configuration. The cluster defaults should only ever need to be updated once per {@lin...
[ "This", "method", "will", "attempt", "to", "load", "the", "cluster", "and", "path", "level", "configuration", "defaults", "and", "update", "the", "configuration", "if", "necessary", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/ClientContext.java#L111-L118
18,680
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.waitForAndKillPrimaryMaster
public synchronized int waitForAndKillPrimaryMaster(int timeoutMs) throws TimeoutException, InterruptedException { int index = getPrimaryMasterIndex(timeoutMs); mMasters.get(index).close(); return index; }
java
public synchronized int waitForAndKillPrimaryMaster(int timeoutMs) throws TimeoutException, InterruptedException { int index = getPrimaryMasterIndex(timeoutMs); mMasters.get(index).close(); return index; }
[ "public", "synchronized", "int", "waitForAndKillPrimaryMaster", "(", "int", "timeoutMs", ")", "throws", "TimeoutException", ",", "InterruptedException", "{", "int", "index", "=", "getPrimaryMasterIndex", "(", "timeoutMs", ")", ";", "mMasters", ".", "get", "(", "inde...
Kills the primary master. If no master is currently primary, this method blocks until a primary has been elected, then kills it. @param timeoutMs maximum amount of time to wait, in milliseconds @return the ID of the killed master
[ "Kills", "the", "primary", "master", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L248-L253
18,681
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.getPrimaryMasterIndex
public synchronized int getPrimaryMasterIndex(int timeoutMs) throws TimeoutException, InterruptedException { final FileSystem fs = getFileSystemClient(); final MasterInquireClient inquireClient = getMasterInquireClient(); CommonUtils.waitFor("a primary master to be serving", () -> { try { ...
java
public synchronized int getPrimaryMasterIndex(int timeoutMs) throws TimeoutException, InterruptedException { final FileSystem fs = getFileSystemClient(); final MasterInquireClient inquireClient = getMasterInquireClient(); CommonUtils.waitFor("a primary master to be serving", () -> { try { ...
[ "public", "synchronized", "int", "getPrimaryMasterIndex", "(", "int", "timeoutMs", ")", "throws", "TimeoutException", ",", "InterruptedException", "{", "final", "FileSystem", "fs", "=", "getFileSystemClient", "(", ")", ";", "final", "MasterInquireClient", "inquireClient...
Gets the index of the primary master. @param timeoutMs maximum amount of time to wait, in milliseconds @return the index of the primary master
[ "Gets", "the", "index", "of", "the", "primary", "master", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L261-L291
18,682
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.waitForAllNodesRegistered
public synchronized void waitForAllNodesRegistered(int timeoutMs) throws TimeoutException, InterruptedException { MetaMasterClient metaMasterClient = getMetaMasterClient(); CommonUtils.waitFor("all nodes registered", () -> { try { MasterInfo masterInfo = metaMasterClient.getMasterInfo(Collec...
java
public synchronized void waitForAllNodesRegistered(int timeoutMs) throws TimeoutException, InterruptedException { MetaMasterClient metaMasterClient = getMetaMasterClient(); CommonUtils.waitFor("all nodes registered", () -> { try { MasterInfo masterInfo = metaMasterClient.getMasterInfo(Collec...
[ "public", "synchronized", "void", "waitForAllNodesRegistered", "(", "int", "timeoutMs", ")", "throws", "TimeoutException", ",", "InterruptedException", "{", "MetaMasterClient", "metaMasterClient", "=", "getMetaMasterClient", "(", ")", ";", "CommonUtils", ".", "waitFor", ...
Waits for all nodes to be registered. @param timeoutMs maximum amount of time to wait, in milliseconds
[ "Waits", "for", "all", "nodes", "to", "be", "registered", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L298-L319
18,683
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.saveWorkdir
public synchronized void saveWorkdir() throws IOException { Preconditions.checkState(mState == State.STARTED, "cluster must be started before you can save its work directory"); ARTIFACTS_DIR.mkdirs(); File tarball = new File(mWorkDir.getParentFile(), mWorkDir.getName() + ".tar.gz"); // Tar up t...
java
public synchronized void saveWorkdir() throws IOException { Preconditions.checkState(mState == State.STARTED, "cluster must be started before you can save its work directory"); ARTIFACTS_DIR.mkdirs(); File tarball = new File(mWorkDir.getParentFile(), mWorkDir.getName() + ".tar.gz"); // Tar up t...
[ "public", "synchronized", "void", "saveWorkdir", "(", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"cluster must be started before you can save its work directory\"", ")", ";", "ARTIFACTS_DIR",...
Copies the work directory to the artifacts folder.
[ "Copies", "the", "work", "directory", "to", "the", "artifacts", "folder", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L388-L411
18,684
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.destroy
public synchronized void destroy() throws IOException { if (mState == State.DESTROYED) { return; } if (!mSuccess) { saveWorkdir(); } mCloser.close(); LOG.info("Destroyed cluster {}", mClusterName); mState = State.DESTROYED; }
java
public synchronized void destroy() throws IOException { if (mState == State.DESTROYED) { return; } if (!mSuccess) { saveWorkdir(); } mCloser.close(); LOG.info("Destroyed cluster {}", mClusterName); mState = State.DESTROYED; }
[ "public", "synchronized", "void", "destroy", "(", ")", "throws", "IOException", "{", "if", "(", "mState", "==", "State", ".", "DESTROYED", ")", "{", "return", ";", "}", "if", "(", "!", "mSuccess", ")", "{", "saveWorkdir", "(", ")", ";", "}", "mCloser",...
Destroys the cluster. It may not be re-started after being destroyed.
[ "Destroys", "the", "cluster", ".", "It", "may", "not", "be", "re", "-", "started", "after", "being", "destroyed", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L416-L426
18,685
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.startMaster
public synchronized void startMaster(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to start masters"); mMasters.get(i).start(); }
java
public synchronized void startMaster(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to start masters"); mMasters.get(i).start(); }
[ "public", "synchronized", "void", "startMaster", "(", "int", "i", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"Must be in a started state to start masters\"", ")", ";", "mMasters", ".", ...
Starts the specified master. @param i the index of the master to start
[ "Starts", "the", "specified", "master", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L440-L444
18,686
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.startWorker
public synchronized void startWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to start workers"); mWorkers.get(i).start(); }
java
public synchronized void startWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to start workers"); mWorkers.get(i).start(); }
[ "public", "synchronized", "void", "startWorker", "(", "int", "i", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"Must be in a started state to start workers\"", ")", ";", "mWorkers", ".", ...
Starts the specified worker. @param i the index of the worker to start
[ "Starts", "the", "specified", "worker", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L451-L455
18,687
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.updateDeployMode
public synchronized void updateDeployMode(DeployMode mode) { mDeployMode = mode; if (mDeployMode == DeployMode.EMBEDDED) { // Ensure that the journal properties are set correctly. for (int i = 0; i < mMasters.size(); i++) { Master master = mMasters.get(i); MasterNetAddress address = ...
java
public synchronized void updateDeployMode(DeployMode mode) { mDeployMode = mode; if (mDeployMode == DeployMode.EMBEDDED) { // Ensure that the journal properties are set correctly. for (int i = 0; i < mMasters.size(); i++) { Master master = mMasters.get(i); MasterNetAddress address = ...
[ "public", "synchronized", "void", "updateDeployMode", "(", "DeployMode", "mode", ")", "{", "mDeployMode", "=", "mode", ";", "if", "(", "mDeployMode", "==", "DeployMode", ".", "EMBEDDED", ")", "{", "// Ensure that the journal properties are set correctly.", "for", "(",...
Updates the cluster's deploy mode. @param mode the mode to set
[ "Updates", "the", "cluster", "s", "deploy", "mode", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L487-L502
18,688
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.createMaster
private synchronized Master createMaster(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create masters"); MasterNetAddress address = mMasterAddresses.get(i); File confDir = new File(mWorkDir, "conf-master" + i); File metastoreDir = ne...
java
private synchronized Master createMaster(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create masters"); MasterNetAddress address = mMasterAddresses.get(i); File confDir = new File(mWorkDir, "conf-master" + i); File metastoreDir = ne...
[ "private", "synchronized", "Master", "createMaster", "(", "int", "i", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"Must be in a started state to create masters\"", ")", ";", "MasterNetAddr...
Creates the specified master without starting it. @param i the index of the master to create
[ "Creates", "the", "specified", "master", "without", "starting", "it", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L545-L571
18,689
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.createWorker
private synchronized Worker createWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create workers"); File confDir = new File(mWorkDir, "conf-worker" + i); File logsDir = new File(mWorkDir, "logs-worker" + i); File ramdisk = new F...
java
private synchronized Worker createWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create workers"); File confDir = new File(mWorkDir, "conf-worker" + i); File logsDir = new File(mWorkDir, "logs-worker" + i); File ramdisk = new F...
[ "private", "synchronized", "Worker", "createWorker", "(", "int", "i", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"Must be in a started state to create workers\"", ")", ";", "File", "con...
Creates the specified worker without starting it. @param i the index of the worker to create
[ "Creates", "the", "specified", "worker", "without", "starting", "it", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L578-L604
18,690
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.formatJournal
public synchronized void formatJournal() throws IOException { if (mDeployMode == DeployMode.EMBEDDED) { for (Master master : mMasters) { File journalDir = new File(master.getConf().get(PropertyKey.MASTER_JOURNAL_FOLDER)); FileUtils.deleteDirectory(journalDir); journalDir.mkdirs(); ...
java
public synchronized void formatJournal() throws IOException { if (mDeployMode == DeployMode.EMBEDDED) { for (Master master : mMasters) { File journalDir = new File(master.getConf().get(PropertyKey.MASTER_JOURNAL_FOLDER)); FileUtils.deleteDirectory(journalDir); journalDir.mkdirs(); ...
[ "public", "synchronized", "void", "formatJournal", "(", ")", "throws", "IOException", "{", "if", "(", "mDeployMode", "==", "DeployMode", ".", "EMBEDDED", ")", "{", "for", "(", "Master", "master", ":", "mMasters", ")", "{", "File", "journalDir", "=", "new", ...
Formats the cluster journal.
[ "Formats", "the", "cluster", "journal", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L609-L624
18,691
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.writeConf
private void writeConf() throws IOException { for (int i = 0; i < mNumMasters; i++) { File confDir = new File(mWorkDir, "conf-master" + i); writeConfToFile(confDir, mMasterProperties.getOrDefault(i, new HashMap<>())); } for (int i = 0; i < mNumWorkers; i++) { File confDir = new File(mWorkD...
java
private void writeConf() throws IOException { for (int i = 0; i < mNumMasters; i++) { File confDir = new File(mWorkDir, "conf-master" + i); writeConfToFile(confDir, mMasterProperties.getOrDefault(i, new HashMap<>())); } for (int i = 0; i < mNumWorkers; i++) { File confDir = new File(mWorkD...
[ "private", "void", "writeConf", "(", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mNumMasters", ";", "i", "++", ")", "{", "File", "confDir", "=", "new", "File", "(", "mWorkDir", ",", "\"conf-master\"", "+", "i"...
Writes the contents of properties to the configuration file.
[ "Writes", "the", "contents", "of", "properties", "to", "the", "configuration", "file", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L660-L669
18,692
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.writeConfToFile
private void writeConfToFile(File dir, Map<PropertyKey, String> properties) throws IOException { // Generates the full set of properties to write Map<PropertyKey, String> map = new HashMap<>(mProperties); for (Map.Entry<PropertyKey, String> entry : properties.entrySet()) { map.put(entry.getKey(), entr...
java
private void writeConfToFile(File dir, Map<PropertyKey, String> properties) throws IOException { // Generates the full set of properties to write Map<PropertyKey, String> map = new HashMap<>(mProperties); for (Map.Entry<PropertyKey, String> entry : properties.entrySet()) { map.put(entry.getKey(), entr...
[ "private", "void", "writeConfToFile", "(", "File", "dir", ",", "Map", "<", "PropertyKey", ",", "String", ">", "properties", ")", "throws", "IOException", "{", "// Generates the full set of properties to write", "Map", "<", "PropertyKey", ",", "String", ">", "map", ...
Creates the conf directory and file. Writes the properties to the generated file. @param dir the conf directory to create @param properties the specific properties of the current node
[ "Creates", "the", "conf", "directory", "and", "file", ".", "Writes", "the", "properties", "to", "the", "generated", "file", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L686-L703
18,693
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/contexts/CreateDirectoryContext.java
CreateDirectoryContext.setDefaultAcl
public CreateDirectoryContext setDefaultAcl(List<AclEntry> defaultAcl) { mDefaultAcl = ImmutableList.copyOf(defaultAcl); return getThis(); }
java
public CreateDirectoryContext setDefaultAcl(List<AclEntry> defaultAcl) { mDefaultAcl = ImmutableList.copyOf(defaultAcl); return getThis(); }
[ "public", "CreateDirectoryContext", "setDefaultAcl", "(", "List", "<", "AclEntry", ">", "defaultAcl", ")", "{", "mDefaultAcl", "=", "ImmutableList", ".", "copyOf", "(", "defaultAcl", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Sets the default ACL in the context. @param defaultAcl a list of default ACL Entries @return the updated context object
[ "Sets", "the", "default", "ACL", "in", "the", "context", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/contexts/CreateDirectoryContext.java#L103-L106
18,694
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/file/FileOutStream.java
FileOutStream.scheduleAsyncPersist
protected void scheduleAsyncPersist() throws IOException { try (CloseableResource<FileSystemMasterClient> masterClient = mContext .acquireMasterClientResource()) { ScheduleAsyncPersistencePOptions persistOptions = FileSystemOptions.scheduleAsyncPersistDefaults(mContext.getPathConf(mUri)).toB...
java
protected void scheduleAsyncPersist() throws IOException { try (CloseableResource<FileSystemMasterClient> masterClient = mContext .acquireMasterClientResource()) { ScheduleAsyncPersistencePOptions persistOptions = FileSystemOptions.scheduleAsyncPersistDefaults(mContext.getPathConf(mUri)).toB...
[ "protected", "void", "scheduleAsyncPersist", "(", ")", "throws", "IOException", "{", "try", "(", "CloseableResource", "<", "FileSystemMasterClient", ">", "masterClient", "=", "mContext", ".", "acquireMasterClientResource", "(", ")", ")", "{", "ScheduleAsyncPersistencePO...
Schedules the async persistence of the current file.
[ "Schedules", "the", "async", "persistence", "of", "the", "current", "file", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileOutStream.java#L307-L315
18,695
Alluxio/alluxio
examples/src/main/java/alluxio/cli/CliUtils.java
CliUtils.printPassInfo
public static void printPassInfo(boolean pass) { if (pass) { System.out.println(Constants.ANSI_GREEN + "Passed the test!" + Constants.ANSI_RESET); } else { System.out.println(Constants.ANSI_RED + "Failed the test!" + Constants.ANSI_RESET); } }
java
public static void printPassInfo(boolean pass) { if (pass) { System.out.println(Constants.ANSI_GREEN + "Passed the test!" + Constants.ANSI_RESET); } else { System.out.println(Constants.ANSI_RED + "Failed the test!" + Constants.ANSI_RESET); } }
[ "public", "static", "void", "printPassInfo", "(", "boolean", "pass", ")", "{", "if", "(", "pass", ")", "{", "System", ".", "out", ".", "println", "(", "Constants", ".", "ANSI_GREEN", "+", "\"Passed the test!\"", "+", "Constants", ".", "ANSI_RESET", ")", ";...
Prints information of the test result. @param pass the test result
[ "Prints", "information", "of", "the", "test", "result", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/cli/CliUtils.java#L34-L40
18,696
Alluxio/alluxio
examples/src/main/java/alluxio/cli/CliUtils.java
CliUtils.runExample
public static boolean runExample(final Callable<Boolean> example) { boolean result; try { result = example.call(); } catch (Exception e) { LOG.error("Exception running test: " + example, e); result = false; } CliUtils.printPassInfo(result); return result; }
java
public static boolean runExample(final Callable<Boolean> example) { boolean result; try { result = example.call(); } catch (Exception e) { LOG.error("Exception running test: " + example, e); result = false; } CliUtils.printPassInfo(result); return result; }
[ "public", "static", "boolean", "runExample", "(", "final", "Callable", "<", "Boolean", ">", "example", ")", "{", "boolean", "result", ";", "try", "{", "result", "=", "example", ".", "call", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", ...
Runs an example. @param example the example to run @return whether the example completes
[ "Runs", "an", "example", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/examples/src/main/java/alluxio/cli/CliUtils.java#L48-L58
18,697
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java
AlluxioBlockStore.create
public static AlluxioBlockStore create(FileSystemContext context) { return new AlluxioBlockStore(context, TieredIdentityFactory.localIdentity(context.getClusterConf())); }
java
public static AlluxioBlockStore create(FileSystemContext context) { return new AlluxioBlockStore(context, TieredIdentityFactory.localIdentity(context.getClusterConf())); }
[ "public", "static", "AlluxioBlockStore", "create", "(", "FileSystemContext", "context", ")", "{", "return", "new", "AlluxioBlockStore", "(", "context", ",", "TieredIdentityFactory", ".", "localIdentity", "(", "context", ".", "getClusterConf", "(", ")", ")", ")", "...
Creates an Alluxio block store with default local hostname. @param context the file system context @return the {@link AlluxioBlockStore} created
[ "Creates", "an", "Alluxio", "block", "store", "with", "default", "local", "hostname", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java#L84-L87
18,698
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java
AlluxioBlockStore.getInfo
public BlockInfo getInfo(long blockId) throws IOException { try (CloseableResource<BlockMasterClient> masterClientResource = mContext.acquireBlockMasterClientResource()) { return masterClientResource.get().getBlockInfo(blockId); } }
java
public BlockInfo getInfo(long blockId) throws IOException { try (CloseableResource<BlockMasterClient> masterClientResource = mContext.acquireBlockMasterClientResource()) { return masterClientResource.get().getBlockInfo(blockId); } }
[ "public", "BlockInfo", "getInfo", "(", "long", "blockId", ")", "throws", "IOException", "{", "try", "(", "CloseableResource", "<", "BlockMasterClient", ">", "masterClientResource", "=", "mContext", ".", "acquireBlockMasterClientResource", "(", ")", ")", "{", "return...
Gets the block info of a block, if it exists. @param blockId the blockId to obtain information about @return a {@link BlockInfo} containing the metadata of the block
[ "Gets", "the", "block", "info", "of", "a", "block", "if", "it", "exists", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java#L110-L115
18,699
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java
AlluxioBlockStore.getInStream
public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); }
java
public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); }
[ "public", "BlockInStream", "getInStream", "(", "long", "blockId", ",", "InStreamOptions", "options", ")", "throws", "IOException", "{", "return", "getInStream", "(", "blockId", ",", "options", ",", "ImmutableMap", ".", "of", "(", ")", ")", ";", "}" ]
Gets a stream to read the data of a block. This method is primarily responsible for determining the data source and type of data source. The latest BlockInfo will be fetched from the master to ensure the locations are up to date. @param blockId the id of the block to read @param options the options associated with the...
[ "Gets", "a", "stream", "to", "read", "the", "data", "of", "a", "block", ".", "This", "method", "is", "primarily", "responsible", "for", "determining", "the", "data", "source", "and", "type", "of", "data", "source", ".", "The", "latest", "BlockInfo", "will"...
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java#L148-L150