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
118,700
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.markCompleted
public void markCompleted() throws IOException { if (disableHistory) { return; } fileManager.moveToDone(jobId, true, CoronaJobTracker.getMainJobID(jobId)); }
java
public void markCompleted() throws IOException { if (disableHistory) { return; } fileManager.moveToDone(jobId, true, CoronaJobTracker.getMainJobID(jobId)); }
[ "public", "void", "markCompleted", "(", ")", "throws", "IOException", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "fileManager", ".", "moveToDone", "(", "jobId", ",", "true", ",", "CoronaJobTracker", ".", "getMainJobID", "(", "jobId", ")"...
Move the completed job into the completed folder.
[ "Move", "the", "completed", "job", "into", "the", "completed", "folder", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L465-L470
118,701
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logTaskFinished
public void logTaskFinished(TaskID taskId, String taskType, long finishTime, Counters counters) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeException("JobId from task: " + id + " does...
java
public void logTaskFinished(TaskID taskId, String taskType, long finishTime, Counters counters) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeException("JobId from task: " + id + " does...
[ "public", "void", "logTaskFinished", "(", "TaskID", "taskId", ",", "String", "taskType", ",", "long", "finishTime", ",", "Counters", "counters", ")", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "JobID", "id", "=", "taskId", ".", "getJob...
Log finish time of task. @param taskId task id @param taskType MAP or REDUCE @param finishTime finish timeof task in ms
[ "Log", "finish", "time", "of", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L506-L528
118,702
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logTaskUpdates
public void logTaskUpdates(TaskID taskId, long finishTime) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeException("JobId from task: " + id + " does not match expected: " + jobId); } i...
java
public void logTaskUpdates(TaskID taskId, long finishTime) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeException("JobId from task: " + id + " does not match expected: " + jobId); } i...
[ "public", "void", "logTaskUpdates", "(", "TaskID", "taskId", ",", "long", "finishTime", ")", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "JobID", "id", "=", "taskId", ".", "getJobID", "(", ")", ";", "if", "(", "!", "this", ".", "j...
Update the finish time of task. @param taskId task id @param finishTime finish time of task in ms
[ "Update", "the", "finish", "time", "of", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L536-L553
118,703
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logTaskFailed
public void logTaskFailed(TaskID taskId, String taskType, long time, String error) { logTaskFailed(taskId, taskType, time, error, null); }
java
public void logTaskFailed(TaskID taskId, String taskType, long time, String error) { logTaskFailed(taskId, taskType, time, error, null); }
[ "public", "void", "logTaskFailed", "(", "TaskID", "taskId", ",", "String", "taskType", ",", "long", "time", ",", "String", "error", ")", "{", "logTaskFailed", "(", "taskId", ",", "taskType", ",", "time", ",", "error", ",", "null", ")", ";", "}" ]
Log job failed event. @param taskId task id @param taskType MAP or REDUCE. @param time timestamp when job failed detected. @param error error message for failure.
[ "Log", "job", "failed", "event", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L562-L565
118,704
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logTaskFailed
public void logTaskFailed(TaskID taskId, String taskType, long time, String error, TaskAttemptID failedDueToAttempt) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeExcepti...
java
public void logTaskFailed(TaskID taskId, String taskType, long time, String error, TaskAttemptID failedDueToAttempt) { if (disableHistory) { return; } JobID id = taskId.getJobID(); if (!this.jobId.equals(id)) { throw new RuntimeExcepti...
[ "public", "void", "logTaskFailed", "(", "TaskID", "taskId", ",", "String", "taskType", ",", "long", "time", ",", "String", "error", ",", "TaskAttemptID", "failedDueToAttempt", ")", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "JobID", "id"...
Log the task failure @param taskId the task that failed @param taskType the type of the task @param time the time of the failure @param error the error the task failed with @param failedDueToAttempt The attempt that caused the failure, if any
[ "Log", "the", "task", "failure" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L576-L602
118,705
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logMapTaskStarted
public void logMapTaskStarted(TaskAttemptID taskAttemptId, long startTime, String trackerName, int httpPort, String taskType) { if (disableHistory) { return; } JobID id = taskAttemptId.getJobID(); if (!this.jobId.equals(id)) { ...
java
public void logMapTaskStarted(TaskAttemptID taskAttemptId, long startTime, String trackerName, int httpPort, String taskType) { if (disableHistory) { return; } JobID id = taskAttemptId.getJobID(); if (!this.jobId.equals(id)) { ...
[ "public", "void", "logMapTaskStarted", "(", "TaskAttemptID", "taskAttemptId", ",", "long", "startTime", ",", "String", "trackerName", ",", "int", "httpPort", ",", "String", "taskType", ")", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "JobID...
Log start time of this map task attempt. @param taskAttemptId task attempt id @param startTime start time of task attempt as reported by task tracker. @param trackerName name of the tracker executing the task attempt. @param httpPort http port of the task tracker executing the task attempt @param taskType Whether the ...
[ "Log", "start", "time", "of", "this", "map", "task", "attempt", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L613-L638
118,706
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logMapTaskFinished
public void logMapTaskFinished(TaskAttemptID taskAttemptId, long finishTime, String hostName, String taskType, String stateString, Counters counter) { ...
java
public void logMapTaskFinished(TaskAttemptID taskAttemptId, long finishTime, String hostName, String taskType, String stateString, Counters counter) { ...
[ "public", "void", "logMapTaskFinished", "(", "TaskAttemptID", "taskAttemptId", ",", "long", "finishTime", ",", "String", "hostName", ",", "String", "taskType", ",", "String", "stateString", ",", "Counters", "counter", ")", "{", "if", "(", "disableHistory", ")", ...
Log finish time of map task attempt. @param taskAttemptId task attempt id @param finishTime finish time @param hostName host name @param taskType Whether the attempt is cleanup or setup or map @param stateString state string of the task attempt @param counter counters of the task attempt
[ "Log", "finish", "time", "of", "map", "task", "attempt", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L650-L679
118,707
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java
CoronaJobHistory.logReduceTaskKilled
public void logReduceTaskKilled(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error, String taskType) { if (disableHistory) { return; } JobID id = taskAttemptId.getJobID(); if (!this.jobId.equals(id)) { ...
java
public void logReduceTaskKilled(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error, String taskType) { if (disableHistory) { return; } JobID id = taskAttemptId.getJobID(); if (!this.jobId.equals(id)) { ...
[ "public", "void", "logReduceTaskKilled", "(", "TaskAttemptID", "taskAttemptId", ",", "long", "timestamp", ",", "String", "hostName", ",", "String", "error", ",", "String", "taskType", ")", "{", "if", "(", "disableHistory", ")", "{", "return", ";", "}", "JobID"...
Log killed reduce task attempt. @param taskAttemptId task attempt id @param timestamp time stamp when task failed @param hostName host name of the task attempt. @param error error message of the task. @param taskType Whether the attempt is cleanup or setup or reduce
[ "Log", "killed", "reduce", "task", "attempt", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L884-L910
118,708
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.destroyProcess
protected static void destroyProcess(String pid, long sleeptimeBeforeSigkill, boolean inBackground) { terminateProcess(pid); sigKill(pid, false, sleeptimeBeforeSigkill, inBackground); }
java
protected static void destroyProcess(String pid, long sleeptimeBeforeSigkill, boolean inBackground) { terminateProcess(pid); sigKill(pid, false, sleeptimeBeforeSigkill, inBackground); }
[ "protected", "static", "void", "destroyProcess", "(", "String", "pid", ",", "long", "sleeptimeBeforeSigkill", ",", "boolean", "inBackground", ")", "{", "terminateProcess", "(", "pid", ")", ";", "sigKill", "(", "pid", ",", "false", ",", "sleeptimeBeforeSigkill", ...
Destroy the process. @param pid Process id of to-be-killed-process @param sleeptimeBeforeSigkill The time to wait before sending SIGKILL after sending SIGTERM @param inBackground Process is to be killed in the back ground with a separate thread
[ "Destroy", "the", "process", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L85-L89
118,709
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.destroyProcessGroup
protected static void destroyProcessGroup(String pgrpId, long sleeptimeBeforeSigkill, boolean inBackground) { terminateProcessGroup(pgrpId); sigKill(pgrpId, true, sleeptimeBeforeSigkill, inBackground); }
java
protected static void destroyProcessGroup(String pgrpId, long sleeptimeBeforeSigkill, boolean inBackground) { terminateProcessGroup(pgrpId); sigKill(pgrpId, true, sleeptimeBeforeSigkill, inBackground); }
[ "protected", "static", "void", "destroyProcessGroup", "(", "String", "pgrpId", ",", "long", "sleeptimeBeforeSigkill", ",", "boolean", "inBackground", ")", "{", "terminateProcessGroup", "(", "pgrpId", ")", ";", "sigKill", "(", "pgrpId", ",", "true", ",", "sleeptime...
Destroy the process group. @param pgrpId Process group id of to-be-killed-processes @param sleeptimeBeforeSigkill The time to wait before sending SIGKILL after sending SIGTERM @param inBackground Process group is to be killed in the back ground with a separate thread
[ "Destroy", "the", "process", "group", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L98-L102
118,710
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.terminateProcess
public static void terminateProcess(String pid) { ShellCommandExecutor shexec = null; String errMsg = null; try { String[] args = { "kill", pid }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (IOException ioe) { // Do nothing, we log the exit code in the fin...
java
public static void terminateProcess(String pid) { ShellCommandExecutor shexec = null; String errMsg = null; try { String[] args = { "kill", pid }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (IOException ioe) { // Do nothing, we log the exit code in the fin...
[ "public", "static", "void", "terminateProcess", "(", "String", "pid", ")", "{", "ShellCommandExecutor", "shexec", "=", "null", ";", "String", "errMsg", "=", "null", ";", "try", "{", "String", "[", "]", "args", "=", "{", "\"kill\"", ",", "pid", "}", ";", ...
Sends terminate signal to the process, allowing it to gracefully exit. @param pid pid of the process to be sent SIGTERM
[ "Sends", "terminate", "signal", "to", "the", "process", "allowing", "it", "to", "gracefully", "exit", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L109-L124
118,711
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.terminateProcessGroup
public static void terminateProcessGroup(String pgrpId) { ShellCommandExecutor shexec = null; try { String[] args = { "kill", "--", "-" + pgrpId }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (IOException ioe) { LOG.warn("Error executing shell command " + ioe);...
java
public static void terminateProcessGroup(String pgrpId) { ShellCommandExecutor shexec = null; try { String[] args = { "kill", "--", "-" + pgrpId }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (IOException ioe) { LOG.warn("Error executing shell command " + ioe);...
[ "public", "static", "void", "terminateProcessGroup", "(", "String", "pgrpId", ")", "{", "ShellCommandExecutor", "shexec", "=", "null", ";", "try", "{", "String", "[", "]", "args", "=", "{", "\"kill\"", ",", "\"--\"", ",", "\"-\"", "+", "pgrpId", "}", ";", ...
Sends terminate signal to all the process belonging to the passed process group, allowing the group to gracefully exit. @param pgrpId process group id
[ "Sends", "terminate", "signal", "to", "all", "the", "process", "belonging", "to", "the", "passed", "process", "group", "allowing", "the", "group", "to", "gracefully", "exit", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L132-L144
118,712
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.killProcess
public static void killProcess(String pid) { //If process tree is not alive then return immediately. if(!ProcessTree.isAlive(pid)) { return; } String[] args = { "kill", "-9", pid }; ShellCommandExecutor shexec = new ShellCommandExecutor(args); try { shexec.execute(); } catch (IO...
java
public static void killProcess(String pid) { //If process tree is not alive then return immediately. if(!ProcessTree.isAlive(pid)) { return; } String[] args = { "kill", "-9", pid }; ShellCommandExecutor shexec = new ShellCommandExecutor(args); try { shexec.execute(); } catch (IO...
[ "public", "static", "void", "killProcess", "(", "String", "pid", ")", "{", "//If process tree is not alive then return immediately.", "if", "(", "!", "ProcessTree", ".", "isAlive", "(", "pid", ")", ")", "{", "return", ";", "}", "String", "[", "]", "args", "=",...
Sends kill signal to process, forcefully terminating the process. @param pid process id
[ "Sends", "kill", "signal", "to", "process", "forcefully", "terminating", "the", "process", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L201-L218
118,713
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.killProcessGroup
public static void killProcessGroup(String pgrpId) { //If process tree is not alive then return immediately. if(!ProcessTree.isProcessGroupAlive(pgrpId)) { return; } String[] args = { "kill", "-9", "-"+pgrpId }; ShellCommandExecutor shexec = new ShellCommandExecutor(args); try { sh...
java
public static void killProcessGroup(String pgrpId) { //If process tree is not alive then return immediately. if(!ProcessTree.isProcessGroupAlive(pgrpId)) { return; } String[] args = { "kill", "-9", "-"+pgrpId }; ShellCommandExecutor shexec = new ShellCommandExecutor(args); try { sh...
[ "public", "static", "void", "killProcessGroup", "(", "String", "pgrpId", ")", "{", "//If process tree is not alive then return immediately.", "if", "(", "!", "ProcessTree", ".", "isProcessGroupAlive", "(", "pgrpId", ")", ")", "{", "return", ";", "}", "String", "[", ...
Sends kill signal to all process belonging to same process group, forcefully terminating the process group. @param pgrpId process group id
[ "Sends", "kill", "signal", "to", "all", "process", "belonging", "to", "same", "process", "group", "forcefully", "terminating", "the", "process", "group", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L226-L244
118,714
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ProcessTree.java
ProcessTree.isAlive
public static boolean isAlive(String pid) { ShellCommandExecutor shexec = null; try { String[] args = { "kill", "-0", pid }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (ExitCodeException ee) { return false; } catch (IOException ioe) { LOG.warn("Error...
java
public static boolean isAlive(String pid) { ShellCommandExecutor shexec = null; try { String[] args = { "kill", "-0", pid }; shexec = new ShellCommandExecutor(args); shexec.execute(); } catch (ExitCodeException ee) { return false; } catch (IOException ioe) { LOG.warn("Error...
[ "public", "static", "boolean", "isAlive", "(", "String", "pid", ")", "{", "ShellCommandExecutor", "shexec", "=", "null", ";", "try", "{", "String", "[", "]", "args", "=", "{", "\"kill\"", ",", "\"-0\"", ",", "pid", "}", ";", "shexec", "=", "new", "Shel...
Is the process with PID pid still alive? This method assumes that isAlive is called on a pid that was alive not too long ago, and hence assumes no chance of pid-wrapping-around. @param pid pid of the process to check. @return true if process is alive.
[ "Is", "the", "process", "with", "PID", "pid", "still", "alive?", "This", "method", "assumes", "that", "isAlive", "is", "called", "on", "a", "pid", "that", "was", "alive", "not", "too", "long", "ago", "and", "hence", "assumes", "no", "chance", "of", "pid"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ProcessTree.java#L254-L268
118,715
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.decodeHarURI
private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException { String tmpAuth = rawURI.getAuthority(); //we are using the default file //system in the config //so create a underlying uri and //return it if (tmpAuth == null) { //create a path return FileSystem.getDefaul...
java
private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException { String tmpAuth = rawURI.getAuthority(); //we are using the default file //system in the config //so create a underlying uri and //return it if (tmpAuth == null) { //create a path return FileSystem.getDefaul...
[ "private", "URI", "decodeHarURI", "(", "URI", "rawURI", ",", "Configuration", "conf", ")", "throws", "IOException", "{", "String", "tmpAuth", "=", "rawURI", ".", "getAuthority", "(", ")", ";", "//we are using the default file", "//system in the config", "//so create a...
decode the raw URI to get the underlying URI @param rawURI raw Har URI @return filtered URI of the underlying fileSystem
[ "decode", "the", "raw", "URI", "to", "get", "the", "underlying", "URI" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L237-L269
118,716
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.getPathInHar
public Path getPathInHar(Path path) { Path harPath = new Path(path.toUri().getPath()); if (archivePath.compareTo(harPath) == 0) return new Path(Path.SEPARATOR); Path tmp = new Path(harPath.getName()); Path parent = harPath.getParent(); while (!(parent.compareTo(archivePath) == 0)) { if (...
java
public Path getPathInHar(Path path) { Path harPath = new Path(path.toUri().getPath()); if (archivePath.compareTo(harPath) == 0) return new Path(Path.SEPARATOR); Path tmp = new Path(harPath.getName()); Path parent = harPath.getParent(); while (!(parent.compareTo(archivePath) == 0)) { if (...
[ "public", "Path", "getPathInHar", "(", "Path", "path", ")", "{", "Path", "harPath", "=", "new", "Path", "(", "path", ".", "toUri", "(", ")", ".", "getPath", "(", ")", ")", ";", "if", "(", "archivePath", ".", "compareTo", "(", "harPath", ")", "==", ...
this method returns the path inside the har filesystem. this is relative path inside the har filesystem. @param path the fully qualified path in the har filesystem. @return relative path in the filesystem.
[ "this", "method", "returns", "the", "path", "inside", "the", "har", "filesystem", ".", "this", "is", "relative", "path", "inside", "the", "har", "filesystem", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L330-L347
118,717
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.makeRelative
private Path makeRelative(String initial, Path p) { String scheme = this.uri.getScheme(); String authority = this.uri.getAuthority(); Path root = new Path(Path.SEPARATOR); if (root.compareTo(p) == 0) return new Path(scheme, authority, initial); Path retPath = new Path(p.getName()); Path pa...
java
private Path makeRelative(String initial, Path p) { String scheme = this.uri.getScheme(); String authority = this.uri.getAuthority(); Path root = new Path(Path.SEPARATOR); if (root.compareTo(p) == 0) return new Path(scheme, authority, initial); Path retPath = new Path(p.getName()); Path pa...
[ "private", "Path", "makeRelative", "(", "String", "initial", ",", "Path", "p", ")", "{", "String", "scheme", "=", "this", ".", "uri", ".", "getScheme", "(", ")", ";", "String", "authority", "=", "this", ".", "uri", ".", "getAuthority", "(", ")", ";", ...
just use the path api to do it.
[ "just", "use", "the", "path", "api", "to", "do", "it", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L353-L367
118,718
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.fixBlockLocations
static BlockLocation[] fixBlockLocations(BlockLocation[] locations, long start, long len, long fileOffsetInHar) { // offset 1 past last byte of desired range long end = start + len; ...
java
static BlockLocation[] fixBlockLocations(BlockLocation[] locations, long start, long len, long fileOffsetInHar) { // offset 1 past last byte of desired range long end = start + len; ...
[ "static", "BlockLocation", "[", "]", "fixBlockLocations", "(", "BlockLocation", "[", "]", "locations", ",", "long", "start", ",", "long", "len", ",", "long", "fileOffsetInHar", ")", "{", "// offset 1 past last byte of desired range", "long", "end", "=", "start", "...
Fix offset and length of block locations. Note that this method modifies the original array. @param locations block locations of har part file @param start the start of the desired range in the contained file @param len the length of the desired range @param fileOffsetInHar the offset of the desired file in the har par...
[ "Fix", "offset", "and", "length", "of", "block", "locations", ".", "Note", "that", "this", "method", "modifies", "the", "original", "array", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L419-L453
118,719
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.getFileBlockLocations
@Override public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { HarStatus hstatus = getFileHarStatus(file.getPath(), null); Path partPath = new Path(archivePath, hstatus.getPartName()); FileStatus partStatus ...
java
@Override public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { HarStatus hstatus = getFileHarStatus(file.getPath(), null); Path partPath = new Path(archivePath, hstatus.getPartName()); FileStatus partStatus ...
[ "@", "Override", "public", "BlockLocation", "[", "]", "getFileBlockLocations", "(", "FileStatus", "file", ",", "long", "start", ",", "long", "len", ")", "throws", "IOException", "{", "HarStatus", "hstatus", "=", "getFileHarStatus", "(", "file", ".", "getPath", ...
Get block locations from the underlying fs and fix their offsets and lengths. @param file the input filestatus to get block locations @param start the start of the desired range in the contained file @param len the length of the desired range @return block locations for this segment of file @throws IOException
[ "Get", "block", "locations", "from", "the", "underlying", "fs", "and", "fix", "their", "offsets", "and", "lengths", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L465-L478
118,720
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.fileStatusesInIndex
private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses, List<String> children, FileStatus archiveIndexStat) throws IOException { // read the index file FSDataInputStream aIn = null; try { aIn = fs.open(archiveIndex); LineReader aLin; long read = 0; aLin = ...
java
private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses, List<String> children, FileStatus archiveIndexStat) throws IOException { // read the index file FSDataInputStream aIn = null; try { aIn = fs.open(archiveIndex); LineReader aLin; long read = 0; aLin = ...
[ "private", "void", "fileStatusesInIndex", "(", "HarStatus", "parent", ",", "List", "<", "FileStatus", ">", "statuses", ",", "List", "<", "String", ">", "children", ",", "FileStatus", "archiveIndexStat", ")", "throws", "IOException", "{", "// read the index file", ...
Get filestatuses of all the children of a given directory. This just reads through index file and reads line by line to get all statuses for children of a directory. Its a brute force way of getting all such filestatuses @param parent the parent path directory @param statuses the list to add the children filestatuses ...
[ "Get", "filestatuses", "of", "all", "the", "children", "of", "a", "given", "directory", ".", "This", "just", "reads", "through", "index", "file", "and", "reads", "line", "by", "line", "to", "get", "all", "statuses", "for", "children", "of", "a", "directory...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L528-L572
118,721
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.fileStatusInIndex
private String fileStatusInIndex(Path harPath) throws IOException { // read the index file int hashCode = getHarHash(harPath.toString()); // get the master index to find the pos // in the index file FSDataInputStream in = fs.open(masterIndex); FileStatus masterStat = fs.getFileStatus(masterIndex...
java
private String fileStatusInIndex(Path harPath) throws IOException { // read the index file int hashCode = getHarHash(harPath.toString()); // get the master index to find the pos // in the index file FSDataInputStream in = fs.open(masterIndex); FileStatus masterStat = fs.getFileStatus(masterIndex...
[ "private", "String", "fileStatusInIndex", "(", "Path", "harPath", ")", "throws", "IOException", "{", "// read the index file", "int", "hashCode", "=", "getHarHash", "(", "harPath", ".", "toString", "(", ")", ")", ";", "// get the master index to find the pos", "// in ...
filename in the index file.
[ "filename", "in", "the", "index", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L578-L639
118,722
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.getFileStatus
@Override public FileStatus getFileStatus(Path f) throws IOException { FileStatus archiveStatus = fs.getFileStatus(archiveIndex); HarStatus hstatus = getFileHarStatus(f, archiveStatus); return new FileStatus(hstatus.isDir()?0:hstatus.getLength(), hstatus.isDir(), (int)archiveStatus.getReplication(...
java
@Override public FileStatus getFileStatus(Path f) throws IOException { FileStatus archiveStatus = fs.getFileStatus(archiveIndex); HarStatus hstatus = getFileHarStatus(f, archiveStatus); return new FileStatus(hstatus.isDir()?0:hstatus.getLength(), hstatus.isDir(), (int)archiveStatus.getReplication(...
[ "@", "Override", "public", "FileStatus", "getFileStatus", "(", "Path", "f", ")", "throws", "IOException", "{", "FileStatus", "archiveStatus", "=", "fs", ".", "getFileStatus", "(", "archiveIndex", ")", ";", "HarStatus", "hstatus", "=", "getFileHarStatus", "(", "f...
return the filestatus of files in har archive. The permission returned are that of the archive index files. The permissions are not persisted while creating a hadoop archive. @param f the path in har filesystem @return filestatus. @throws IOException
[ "return", "the", "filestatus", "of", "files", "in", "har", "archive", ".", "The", "permission", "returned", "are", "that", "of", "the", "archive", "index", "files", ".", "The", "permissions", "are", "not", "persisted", "while", "creating", "a", "hadoop", "ar...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L650-L661
118,723
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.open
@Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { HarStatus hstatus = getFileHarStatus(f, null); // we got it.. woo hooo!!! if (hstatus.isDir()) { throw new FileNotFoundException(f + " : not a file in " + archivePath); } return new HarFSData...
java
@Override public FSDataInputStream open(Path f, int bufferSize) throws IOException { HarStatus hstatus = getFileHarStatus(f, null); // we got it.. woo hooo!!! if (hstatus.isDir()) { throw new FileNotFoundException(f + " : not a file in " + archivePath); } return new HarFSData...
[ "@", "Override", "public", "FSDataInputStream", "open", "(", "Path", "f", ",", "int", "bufferSize", ")", "throws", "IOException", "{", "HarStatus", "hstatus", "=", "getFileHarStatus", "(", "f", ",", "null", ")", ";", "// we got it.. woo hooo!!!", "if", "(", "h...
Returns a har input stream which fakes end of file. It reads the index files to get the part file name and the size and start of the file.
[ "Returns", "a", "har", "input", "stream", "which", "fakes", "end", "of", "file", ".", "It", "reads", "the", "index", "files", "to", "get", "the", "part", "file", "name", "and", "the", "size", "and", "start", "of", "the", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L681-L692
118,724
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/HarFileSystem.java
HarFileSystem.listStatus
@Override public FileStatus[] listStatus(Path f) throws IOException { //need to see if the file is an index in file //get the filestatus of the archive directory // we will create fake filestatuses to return // to the client List<FileStatus> statuses = new ArrayList<FileStatus>(); FileStatus a...
java
@Override public FileStatus[] listStatus(Path f) throws IOException { //need to see if the file is an index in file //get the filestatus of the archive directory // we will create fake filestatuses to return // to the client List<FileStatus> statuses = new ArrayList<FileStatus>(); FileStatus a...
[ "@", "Override", "public", "FileStatus", "[", "]", "listStatus", "(", "Path", "f", ")", "throws", "IOException", "{", "//need to see if the file is an index in file", "//get the filestatus of the archive directory", "// we will create fake filestatuses to return", "// to the client...
liststatus returns the children of a directory after looking up the index files.
[ "liststatus", "returns", "the", "children", "of", "a", "directory", "after", "looking", "up", "the", "index", "files", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L745-L772
118,725
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java
BlockMetadataHeader.readHeader
public static BlockMetadataHeader readHeader(DataInputStream in, Checksum checksumImpl) throws IOException { return readHeader(in.readShort(), in, checksumImpl); }
java
public static BlockMetadataHeader readHeader(DataInputStream in, Checksum checksumImpl) throws IOException { return readHeader(in.readShort(), in, checksumImpl); }
[ "public", "static", "BlockMetadataHeader", "readHeader", "(", "DataInputStream", "in", ",", "Checksum", "checksumImpl", ")", "throws", "IOException", "{", "return", "readHeader", "(", "in", ".", "readShort", "(", ")", ",", "in", ",", "checksumImpl", ")", ";", ...
This reads all the fields till the beginning of checksum. @param in @param checksumImpl @return Metadata Header @throws IOException
[ "This", "reads", "all", "the", "fields", "till", "the", "beginning", "of", "checksum", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java#L84-L87
118,726
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java
BlockMetadataHeader.readHeader
static BlockMetadataHeader readHeader(File file) throws IOException { DataInputStream in = null; try { in = new DataInputStream(new BufferedInputStream( new FileInputStream(file))); return readHeader(in); } finally { IOUtils.closeStream(in); } }
java
static BlockMetadataHeader readHeader(File file) throws IOException { DataInputStream in = null; try { in = new DataInputStream(new BufferedInputStream( new FileInputStream(file))); return readHeader(in); } finally { IOUtils.closeStream(in); } }
[ "static", "BlockMetadataHeader", "readHeader", "(", "File", "file", ")", "throws", "IOException", "{", "DataInputStream", "in", "=", "null", ";", "try", "{", "in", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "...
Reads header at the top of metadata file and returns the header. @param dataset @param block @return @throws IOException
[ "Reads", "header", "at", "the", "top", "of", "metadata", "file", "and", "returns", "the", "header", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java#L97-L106
118,727
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java
BlockMetadataHeader.readHeader
private static BlockMetadataHeader readHeader(short version, DataInputStream in) throws IOException { DataChecksum checksum = DataChecksum.newDataChecksum(in); return new BlockMetadataHeader(version, checksum); }
java
private static BlockMetadataHeader readHeader(short version, DataInputStream in) throws IOException { DataChecksum checksum = DataChecksum.newDataChecksum(in); return new BlockMetadataHeader(version, checksum); }
[ "private", "static", "BlockMetadataHeader", "readHeader", "(", "short", "version", ",", "DataInputStream", "in", ")", "throws", "IOException", "{", "DataChecksum", "checksum", "=", "DataChecksum", ".", "newDataChecksum", "(", "in", ")", ";", "return", "new", "Bloc...
Version is already read.
[ "Version", "is", "already", "read", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java#L109-L113
118,728
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java
BlockMetadataHeader.writeHeader
private static void writeHeader(DataOutputStream out, BlockMetadataHeader header) throws IOException { out.writeShort(header.getVersion()); header.getChecksum().writeHeader(out); }
java
private static void writeHeader(DataOutputStream out, BlockMetadataHeader header) throws IOException { out.writeShort(header.getVersion()); header.getChecksum().writeHeader(out); }
[ "private", "static", "void", "writeHeader", "(", "DataOutputStream", "out", ",", "BlockMetadataHeader", "header", ")", "throws", "IOException", "{", "out", ".", "writeShort", "(", "header", ".", "getVersion", "(", ")", ")", ";", "header", ".", "getChecksum", "...
This writes all the fields till the beginning of checksum. @param out DataOutputStream @param header @return @throws IOException
[ "This", "writes", "all", "the", "fields", "till", "the", "beginning", "of", "checksum", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java#L130-L135
118,729
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java
BlockMetadataHeader.writeHeader
static void writeHeader(DataOutputStream out, DataChecksum checksum) throws IOException { writeHeader(out, new BlockMetadataHeader(METADATA_VERSION, checksum)); }
java
static void writeHeader(DataOutputStream out, DataChecksum checksum) throws IOException { writeHeader(out, new BlockMetadataHeader(METADATA_VERSION, checksum)); }
[ "static", "void", "writeHeader", "(", "DataOutputStream", "out", ",", "DataChecksum", "checksum", ")", "throws", "IOException", "{", "writeHeader", "(", "out", ",", "new", "BlockMetadataHeader", "(", "METADATA_VERSION", ",", "checksum", ")", ")", ";", "}" ]
Writes all the fields till the beginning of checksum. @param out @param checksum @throws IOException
[ "Writes", "all", "the", "fields", "till", "the", "beginning", "of", "checksum", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockMetadataHeader.java#L143-L146
118,730
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FSInputChecker.java
FSInputChecker.read
public synchronized int read(byte[] b, int off, int len) throws IOException { // parameter check if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException(); } int n = 0; for (;;) { int nread = read1(b, off + n, len - n); if (nread <= 0) ...
java
public synchronized int read(byte[] b, int off, int len) throws IOException { // parameter check if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException(); } int n = 0; for (;;) { int nread = read1(b, off + n, len - n); if (nread <= 0) ...
[ "public", "synchronized", "int", "read", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "// parameter check", "if", "(", "(", "off", "|", "len", "|", "(", "off", "+", "len", ")", "|", "(", "b", ...
Read checksum verified bytes from this byte-input stream into the specified byte array, starting at the given offset. <p> This method implements the general contract of the corresponding <code>{@link InputStream#read(byte[], int, int) read}</code> method of the <code>{@link InputStream}</code> class. As an additional...
[ "Read", "checksum", "verified", "bytes", "from", "this", "byte", "-", "input", "stream", "into", "the", "specified", "byte", "array", "starting", "at", "the", "given", "offset", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FSInputChecker.java#L150-L165
118,731
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FSInputChecker.java
FSInputChecker.checksum2long
static public long checksum2long(byte[] checksum, int offset, int length) { long crc = 0L; int iter = 0; for(int i=offset; i<offset+length; i++, iter++) { crc |= (0xffL&(long)checksum[i])<<((length-iter-1)*8); } return crc; }
java
static public long checksum2long(byte[] checksum, int offset, int length) { long crc = 0L; int iter = 0; for(int i=offset; i<offset+length; i++, iter++) { crc |= (0xffL&(long)checksum[i])<<((length-iter-1)*8); } return crc; }
[ "static", "public", "long", "checksum2long", "(", "byte", "[", "]", "checksum", ",", "int", "offset", ",", "int", "length", ")", "{", "long", "crc", "=", "0L", ";", "int", "iter", "=", "0", ";", "for", "(", "int", "i", "=", "offset", ";", "i", "<...
Convert a checksum byte array to a long
[ "Convert", "a", "checksum", "byte", "array", "to", "a", "long" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FSInputChecker.java#L297-L304
118,732
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FSInputChecker.java
FSInputChecker.set
final protected synchronized void set(boolean verifyChecksum, Checksum sum, int maxChunkSize, int checksumSize ) { this.verifyChecksum = verifyChecksum; this.sum = sum; this.buf = new byte[maxChunkSize]; this.checksum = new byte[checksumSize]; this.count = 0; this.pos = 0; }
java
final protected synchronized void set(boolean verifyChecksum, Checksum sum, int maxChunkSize, int checksumSize ) { this.verifyChecksum = verifyChecksum; this.sum = sum; this.buf = new byte[maxChunkSize]; this.checksum = new byte[checksumSize]; this.count = 0; this.pos = 0; }
[ "final", "protected", "synchronized", "void", "set", "(", "boolean", "verifyChecksum", ",", "Checksum", "sum", ",", "int", "maxChunkSize", ",", "int", "checksumSize", ")", "{", "this", ".", "verifyChecksum", "=", "verifyChecksum", ";", "this", ".", "sum", "=",...
Set the checksum related parameters @param verifyChecksum whether to verify checksum @param sum which type of checksum to use @param maxChunkSize maximun chunk size @param checksumSize checksum size
[ "Set", "the", "checksum", "related", "parameters" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FSInputChecker.java#L410-L418
118,733
facebookarchive/hadoop-20
src/core/org/apache/hadoop/metrics/MetricsServlet.java
MetricsServlet.printMap
void printMap(PrintWriter out, Map<String, Map<String, List<TagsMetricsPair>>> map) { for (Map.Entry<String, Map<String, List<TagsMetricsPair>>> context : map.entrySet()) { out.println(context.getKey()); for (Map.Entry<String, List<TagsMetricsPair>> record : context.getValue().entrySet()) { inde...
java
void printMap(PrintWriter out, Map<String, Map<String, List<TagsMetricsPair>>> map) { for (Map.Entry<String, Map<String, List<TagsMetricsPair>>> context : map.entrySet()) { out.println(context.getKey()); for (Map.Entry<String, List<TagsMetricsPair>> record : context.getValue().entrySet()) { inde...
[ "void", "printMap", "(", "PrintWriter", "out", ",", "Map", "<", "String", ",", "Map", "<", "String", ",", "List", "<", "TagsMetricsPair", ">", ">", ">", "map", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Map", "<", "String", ","...
Prints metrics data in a multi-line text form.
[ "Prints", "metrics", "data", "in", "a", "multi", "-", "line", "text", "form", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/MetricsServlet.java#L119-L153
118,734
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobStatus.java
JobStatus.getJobRunState
public static String getJobRunState(int state) { if (state < 1 || state >= runStates.length) { return UNKNOWN; } return runStates[state]; }
java
public static String getJobRunState(int state) { if (state < 1 || state >= runStates.length) { return UNKNOWN; } return runStates[state]; }
[ "public", "static", "String", "getJobRunState", "(", "int", "state", ")", "{", "if", "(", "state", "<", "1", "||", "state", ">=", "runStates", ".", "length", ")", "{", "return", "UNKNOWN", ";", "}", "return", "runStates", "[", "state", "]", ";", "}" ]
Helper method to get human-readable state of the job. @param state job state @return human-readable state of the job
[ "Helper", "method", "to", "get", "human", "-", "readable", "state", "of", "the", "job", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobStatus.java#L60-L65
118,735
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobStatus.java
JobStatus.isJobComplete
public synchronized boolean isJobComplete() { return (runState == JobStatus.SUCCEEDED || runState == JobStatus.FAILED || runState == JobStatus.KILLED); }
java
public synchronized boolean isJobComplete() { return (runState == JobStatus.SUCCEEDED || runState == JobStatus.FAILED || runState == JobStatus.KILLED); }
[ "public", "synchronized", "boolean", "isJobComplete", "(", ")", "{", "return", "(", "runState", "==", "JobStatus", ".", "SUCCEEDED", "||", "runState", "==", "JobStatus", ".", "FAILED", "||", "runState", "==", "JobStatus", ".", "KILLED", ")", ";", "}" ]
Returns true if the status is for a completed job.
[ "Returns", "true", "if", "the", "status", "is", "for", "a", "completed", "job", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobStatus.java#L319-L322
118,736
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobStatus.java
JobStatus.getOldNewJobRunState
static int getOldNewJobRunState( org.apache.hadoop.mapreduce.JobStatus.State state) { return state.getValue(); }
java
static int getOldNewJobRunState( org.apache.hadoop.mapreduce.JobStatus.State state) { return state.getValue(); }
[ "static", "int", "getOldNewJobRunState", "(", "org", ".", "apache", ".", "hadoop", ".", "mapreduce", ".", "JobStatus", ".", "State", "state", ")", "{", "return", "state", ".", "getValue", "(", ")", ";", "}" ]
A utility to convert new job runstates to the old ones.
[ "A", "utility", "to", "convert", "new", "job", "runstates", "to", "the", "old", "ones", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobStatus.java#L354-L357
118,737
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/BlockLocation.java
BlockLocation.setHosts
public void setHosts(String[] hosts) throws IOException { if (hosts == null) { this.hosts = new String[0]; } else { this.hosts = hosts; } }
java
public void setHosts(String[] hosts) throws IOException { if (hosts == null) { this.hosts = new String[0]; } else { this.hosts = hosts; } }
[ "public", "void", "setHosts", "(", "String", "[", "]", "hosts", ")", "throws", "IOException", "{", "if", "(", "hosts", "==", "null", ")", "{", "this", ".", "hosts", "=", "new", "String", "[", "0", "]", ";", "}", "else", "{", "this", ".", "hosts", ...
Set the hosts hosting this block
[ "Set", "the", "hosts", "hosting", "this", "block" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/BlockLocation.java#L196-L202
118,738
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/BlockLocation.java
BlockLocation.setTopologyPaths
public void setTopologyPaths(String[] topologyPaths) throws IOException { if (topologyPaths == null) { this.topologyPaths = new String[0]; } else { this.topologyPaths = topologyPaths; } }
java
public void setTopologyPaths(String[] topologyPaths) throws IOException { if (topologyPaths == null) { this.topologyPaths = new String[0]; } else { this.topologyPaths = topologyPaths; } }
[ "public", "void", "setTopologyPaths", "(", "String", "[", "]", "topologyPaths", ")", "throws", "IOException", "{", "if", "(", "topologyPaths", "==", "null", ")", "{", "this", ".", "topologyPaths", "=", "new", "String", "[", "0", "]", ";", "}", "else", "{...
Set the network topology paths of the hosts
[ "Set", "the", "network", "topology", "paths", "of", "the", "hosts" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/BlockLocation.java#L218-L224
118,739
facebookarchive/hadoop-20
src/core/org/apache/hadoop/ipc/RemoteException.java
RemoteException.unwrapRemoteException
public IOException unwrapRemoteException() { try { Class<?> realClass = Class.forName(getClassName()); return instantiateException(realClass.asSubclass(IOException.class)); } catch(Exception e) { // cannot instantiate the original exception, just return this } return this; }
java
public IOException unwrapRemoteException() { try { Class<?> realClass = Class.forName(getClassName()); return instantiateException(realClass.asSubclass(IOException.class)); } catch(Exception e) { // cannot instantiate the original exception, just return this } return this; }
[ "public", "IOException", "unwrapRemoteException", "(", ")", "{", "try", "{", "Class", "<", "?", ">", "realClass", "=", "Class", ".", "forName", "(", "getClassName", "(", ")", ")", ";", "return", "instantiateException", "(", "realClass", ".", "asSubclass", "(...
Instantiate and return the exception wrapped up by this remote exception. <p> This unwraps any <code>Throwable</code> that has a constructor taking a <code>String</code> as a parameter. Otherwise it returns this. @return <code>Throwable
[ "Instantiate", "and", "return", "the", "exception", "wrapped", "up", "by", "this", "remote", "exception", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/RemoteException.java#L92-L100
118,740
facebookarchive/hadoop-20
src/core/org/apache/hadoop/ipc/RemoteException.java
RemoteException.writeXml
public void writeXml(String path, XMLOutputter doc) throws IOException { doc.startTag(RemoteException.class.getSimpleName()); doc.attribute("path", path); doc.attribute("class", getClassName()); String msg = getLocalizedMessage(); int i = msg.indexOf("\n"); if (i >= 0) { msg = msg.substrin...
java
public void writeXml(String path, XMLOutputter doc) throws IOException { doc.startTag(RemoteException.class.getSimpleName()); doc.attribute("path", path); doc.attribute("class", getClassName()); String msg = getLocalizedMessage(); int i = msg.indexOf("\n"); if (i >= 0) { msg = msg.substrin...
[ "public", "void", "writeXml", "(", "String", "path", ",", "XMLOutputter", "doc", ")", "throws", "IOException", "{", "doc", ".", "startTag", "(", "RemoteException", ".", "class", ".", "getSimpleName", "(", ")", ")", ";", "doc", ".", "attribute", "(", "\"pat...
Write the object to XML format
[ "Write", "the", "object", "to", "XML", "format" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/RemoteException.java#L117-L128
118,741
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/PolicyInfo.java
PolicyInfo.addDestPath
public void addDestPath(String in, Properties repl) throws IOException { Path dPath = new Path(in); if (!dPath.isAbsolute() || !dPath.toUri().isAbsolute()) { throw new IOException("Path " + in + " is not absolute."); } PathInfo pinfo = new PathInfo(dPath, repl); if (this.destPath == null) { ...
java
public void addDestPath(String in, Properties repl) throws IOException { Path dPath = new Path(in); if (!dPath.isAbsolute() || !dPath.toUri().isAbsolute()) { throw new IOException("Path " + in + " is not absolute."); } PathInfo pinfo = new PathInfo(dPath, repl); if (this.destPath == null) { ...
[ "public", "void", "addDestPath", "(", "String", "in", ",", "Properties", "repl", ")", "throws", "IOException", "{", "Path", "dPath", "=", "new", "Path", "(", "in", ")", ";", "if", "(", "!", "dPath", ".", "isAbsolute", "(", ")", "||", "!", "dPath", "....
Sets the destination path on which this policy has to be applied
[ "Sets", "the", "destination", "path", "on", "which", "this", "policy", "has", "to", "be", "applied" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/PolicyInfo.java#L135-L145
118,742
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectoryNameCache.java
FSDirectoryNameCache.cacheNameInternal
private void cacheNameInternal(INode inode) { // Name is cached only for files if (inode.isDirectory()) { return; } ByteArray name = new ByteArray(inode.getLocalNameBytes()); name = nameCache.put(name); if (name != null) { inode.setLocalName(name.getBytes()); } }
java
private void cacheNameInternal(INode inode) { // Name is cached only for files if (inode.isDirectory()) { return; } ByteArray name = new ByteArray(inode.getLocalNameBytes()); name = nameCache.put(name); if (name != null) { inode.setLocalName(name.getBytes()); } }
[ "private", "void", "cacheNameInternal", "(", "INode", "inode", ")", "{", "// Name is cached only for files", "if", "(", "inode", ".", "isDirectory", "(", ")", ")", "{", "return", ";", "}", "ByteArray", "name", "=", "new", "ByteArray", "(", "inode", ".", "get...
Adds cached entry to the map and updates INode
[ "Adds", "cached", "entry", "to", "the", "map", "and", "updates", "INode" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectoryNameCache.java#L61-L71
118,743
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectoryNameCache.java
FSDirectoryNameCache.imageLoaded
void imageLoaded() throws IOException { for (Future<Void> task : cachingTasks) { try { task.get(); } catch (InterruptedException e) { throw new IOException("FSDirectory cache received interruption"); } catch (ExecutionException e) { throw new IOException(e); } } ...
java
void imageLoaded() throws IOException { for (Future<Void> task : cachingTasks) { try { task.get(); } catch (InterruptedException e) { throw new IOException("FSDirectory cache received interruption"); } catch (ExecutionException e) { throw new IOException(e); } } ...
[ "void", "imageLoaded", "(", ")", "throws", "IOException", "{", "for", "(", "Future", "<", "Void", ">", "task", ":", "cachingTasks", ")", "{", "try", "{", "task", ".", "get", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "th...
Inform that from now on all caching is done synchronously. Cache remaining inodes from the queue. @throws IOException
[ "Inform", "that", "from", "now", "on", "all", "caching", "is", "done", "synchronously", ".", "Cache", "remaining", "inodes", "from", "the", "queue", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectoryNameCache.java#L118-L141
118,744
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.resetLastInodeId
public void resetLastInodeId(long newValue) throws IOException { try { inodeId.skipTo(newValue); } catch(IllegalStateException ise) { throw new IOException(ise); } }
java
public void resetLastInodeId(long newValue) throws IOException { try { inodeId.skipTo(newValue); } catch(IllegalStateException ise) { throw new IOException(ise); } }
[ "public", "void", "resetLastInodeId", "(", "long", "newValue", ")", "throws", "IOException", "{", "try", "{", "inodeId", ".", "skipTo", "(", "newValue", ")", ";", "}", "catch", "(", "IllegalStateException", "ise", ")", "{", "throw", "new", "IOException", "("...
Set the last allocated inode id when fsimage or editlog is loaded.
[ "Set", "the", "last", "allocated", "inode", "id", "when", "fsimage", "or", "editlog", "is", "loaded", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L191-L197
118,745
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.waitForReady
void waitForReady() { if (!ready) { writeLock(); try { while (!ready) { try { cond.await(5000, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { } } } finally { writeUnlock(); } } }
java
void waitForReady() { if (!ready) { writeLock(); try { while (!ready) { try { cond.await(5000, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { } } } finally { writeUnlock(); } } }
[ "void", "waitForReady", "(", ")", "{", "if", "(", "!", "ready", ")", "{", "writeLock", "(", ")", ";", "try", "{", "while", "(", "!", "ready", ")", "{", "try", "{", "cond", ".", "await", "(", "5000", ",", "TimeUnit", ".", "MILLISECONDS", ")", ";",...
Block until the object is ready to be used.
[ "Block", "until", "the", "object", "is", "ready", "to", "be", "used", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L265-L279
118,746
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.addFile
INodeFileUnderConstruction addFile(String path, String[] names, byte[][] components, INode[] inodes, PermissionStatus permissions, short replication, long preferredBlockSize, String clientName, ...
java
INodeFileUnderConstruction addFile(String path, String[] names, byte[][] components, INode[] inodes, PermissionStatus permissions, short replication, long preferredBlockSize, String clientName, ...
[ "INodeFileUnderConstruction", "addFile", "(", "String", "path", ",", "String", "[", "]", "names", ",", "byte", "[", "]", "[", "]", "components", ",", "INode", "[", "]", "inodes", ",", "PermissionStatus", "permissions", ",", "short", "replication", ",", "long...
Add the given filename to the fs.
[ "Add", "the", "given", "filename", "to", "the", "fs", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L284-L343
118,747
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.addToParent
INodeDirectory addToParent( byte[] src, INodeDirectory parentINode, INode newNode, boolean propagateModTime, int childIndex) { // NOTE: This does not update space counts for parents // add new...
java
INodeDirectory addToParent( byte[] src, INodeDirectory parentINode, INode newNode, boolean propagateModTime, int childIndex) { // NOTE: This does not update space counts for parents // add new...
[ "INodeDirectory", "addToParent", "(", "byte", "[", "]", "src", ",", "INodeDirectory", "parentINode", ",", "INode", "newNode", ",", "boolean", "propagateModTime", ",", "int", "childIndex", ")", "{", "// NOTE: This does not update space counts for parents", "// add new node...
Add node to parent node when loading the image.
[ "Add", "node", "to", "parent", "node", "when", "loading", "the", "image", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L408-L439
118,748
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.addBlock
Block addBlock(String path, INode[] inodes, Block block) throws IOException { waitForReady(); writeLock(); try { INodeFile fileNode = (INodeFile) inodes[inodes.length-1]; INode.enforceRegularStorageINode(fileNode, "addBlock only works for regular file, not " + path); // ...
java
Block addBlock(String path, INode[] inodes, Block block) throws IOException { waitForReady(); writeLock(); try { INodeFile fileNode = (INodeFile) inodes[inodes.length-1]; INode.enforceRegularStorageINode(fileNode, "addBlock only works for regular file, not " + path); // ...
[ "Block", "addBlock", "(", "String", "path", ",", "INode", "[", "]", "inodes", ",", "Block", "block", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ";", "writeLock", "(", ")", ";", "try", "{", "INodeFile", "fileNode", "=", "(", "INodeFile",...
Add a block to the file. Returns a reference to the added block.
[ "Add", "a", "block", "to", "the", "file", ".", "Returns", "a", "reference", "to", "the", "added", "block", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L444-L473
118,749
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.persistBlocks
void persistBlocks(String path, INodeFileUnderConstruction file) throws IOException { waitForReady(); writeLock(); try { fsImage.getEditLog().logOpenFile(path, file); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.per...
java
void persistBlocks(String path, INodeFileUnderConstruction file) throws IOException { waitForReady(); writeLock(); try { fsImage.getEditLog().logOpenFile(path, file); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.per...
[ "void", "persistBlocks", "(", "String", "path", ",", "INodeFileUnderConstruction", "file", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ";", "writeLock", "(", ")", ";", "try", "{", "fsImage", ".", "getEditLog", "(", ")", ".", "logOpenFile", "...
Persist the block list for the inode.
[ "Persist", "the", "block", "list", "for", "the", "inode", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L478-L493
118,750
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.closeFile
void closeFile(String path, INodeFile file) throws IOException { waitForReady(); writeLock(); try { long now = FSNamesystem.now(); // file is closed file.setModificationTimeForce(now); fsImage.getEditLog().logCloseFile(path, file); if (NameNode.stateChangeLog.isDebugEnabled()) ...
java
void closeFile(String path, INodeFile file) throws IOException { waitForReady(); writeLock(); try { long now = FSNamesystem.now(); // file is closed file.setModificationTimeForce(now); fsImage.getEditLog().logCloseFile(path, file); if (NameNode.stateChangeLog.isDebugEnabled()) ...
[ "void", "closeFile", "(", "String", "path", ",", "INodeFile", "file", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ";", "writeLock", "(", ")", ";", "try", "{", "long", "now", "=", "FSNamesystem", ".", "now", "(", ")", ";", "// file is clo...
Close file.
[ "Close", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L498-L514
118,751
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.removeBlock
boolean removeBlock(String path, INodeFileUnderConstruction fileNode, Block block) throws IOException { waitForReady(); writeLock(); try { // modify file-> block and blocksMap fileNode.removeBlock(block); getFSNamesystem().blocksMap.removeBlock(block); // Remov...
java
boolean removeBlock(String path, INodeFileUnderConstruction fileNode, Block block) throws IOException { waitForReady(); writeLock(); try { // modify file-> block and blocksMap fileNode.removeBlock(block); getFSNamesystem().blocksMap.removeBlock(block); // Remov...
[ "boolean", "removeBlock", "(", "String", "path", ",", "INodeFileUnderConstruction", "fileNode", ",", "Block", "block", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ";", "writeLock", "(", ")", ";", "try", "{", "// modify file-> block and blocksMap", ...
Remove the block from a file.
[ "Remove", "the", "block", "from", "a", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L519-L542
118,752
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getHardLinkId
public long getHardLinkId(String src) throws IOException { byte[][] components = INode.getPathComponents(src); readLock(); try { INodeFile node = this.getFileINode(components); if ((!exists(node)) || (!(node instanceof INodeHardLinkFile))) { throw new IOException(src + " is not a valid h...
java
public long getHardLinkId(String src) throws IOException { byte[][] components = INode.getPathComponents(src); readLock(); try { INodeFile node = this.getFileINode(components); if ((!exists(node)) || (!(node instanceof INodeHardLinkFile))) { throw new IOException(src + " is not a valid h...
[ "public", "long", "getHardLinkId", "(", "String", "src", ")", "throws", "IOException", "{", "byte", "[", "]", "[", "]", "components", "=", "INode", ".", "getPathComponents", "(", "src", ")", ";", "readLock", "(", ")", ";", "try", "{", "INodeFile", "node"...
Retrieves a the hardlink id for a given file. @param src the file to lookup @return the hardlink id @throws IOException if the specified file is not a valid hardlink file
[ "Retrieves", "a", "the", "hardlink", "id", "for", "a", "given", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L553-L565
118,753
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedHardLinkTo
boolean unprotectedHardLinkTo(String src, String dst, long timestamp) throws QuotaExceededException, FileNotFoundException { return unprotectedHardLinkTo(src, null, null, null, dst, null, null, null, timestamp); }
java
boolean unprotectedHardLinkTo(String src, String dst, long timestamp) throws QuotaExceededException, FileNotFoundException { return unprotectedHardLinkTo(src, null, null, null, dst, null, null, null, timestamp); }
[ "boolean", "unprotectedHardLinkTo", "(", "String", "src", ",", "String", "dst", ",", "long", "timestamp", ")", "throws", "QuotaExceededException", ",", "FileNotFoundException", "{", "return", "unprotectedHardLinkTo", "(", "src", ",", "null", ",", "null", ",", "nul...
hard link the dst path to the src path @param src source path @param dst destination path @param timestamp The modification timestamp for the dst's parent directory @return true if the hardLink succeeds; false otherwise @throws QuotaExceededException if the operation violates any quota limit @throws FileNotFoundExcept...
[ "hard", "link", "the", "dst", "path", "to", "the", "src", "path" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L596-L599
118,754
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.raidFile
public void raidFile(INode sourceINodes[], String source, RaidCodec codec, short expectedSourceRepl, Block[] parityBlocks) throws IOException { waitForReady(); long now = FSNamesystem.now(); unprotectedRaidFile(sourceINodes, source, codec, expectedSourceRepl, parityBlocks, now); ...
java
public void raidFile(INode sourceINodes[], String source, RaidCodec codec, short expectedSourceRepl, Block[] parityBlocks) throws IOException { waitForReady(); long now = FSNamesystem.now(); unprotectedRaidFile(sourceINodes, source, codec, expectedSourceRepl, parityBlocks, now); ...
[ "public", "void", "raidFile", "(", "INode", "sourceINodes", "[", "]", ",", "String", "source", ",", "RaidCodec", "codec", ",", "short", "expectedSourceRepl", ",", "Block", "[", "]", "parityBlocks", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ...
Convert a file into a raid file format
[ "Convert", "a", "file", "into", "a", "raid", "file", "format" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L791-L801
118,755
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedRenameTo
boolean unprotectedRenameTo(String src, String dst, long timestamp) throws QuotaExceededException { return unprotectedRenameTo(src, null, null, null, dst, null, null, timestamp); }
java
boolean unprotectedRenameTo(String src, String dst, long timestamp) throws QuotaExceededException { return unprotectedRenameTo(src, null, null, null, dst, null, null, timestamp); }
[ "boolean", "unprotectedRenameTo", "(", "String", "src", ",", "String", "dst", ",", "long", "timestamp", ")", "throws", "QuotaExceededException", "{", "return", "unprotectedRenameTo", "(", "src", ",", "null", ",", "null", ",", "null", ",", "dst", ",", "null", ...
Change a path name @param src source path @param dst destination path @return true if rename succeeds; false otherwise @throws QuotaExceededException if the operation violates any quota limit
[ "Change", "a", "path", "name" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L849-L852
118,756
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.setReplication
BlockInfo[] setReplication(String src, short replication, int[] oldReplication ) throws IOException { waitForReady(); BlockInfo[] fileBlocks = unprotectedSetReplication(src, replication, oldReplication); if (fileBlocks != null) // l...
java
BlockInfo[] setReplication(String src, short replication, int[] oldReplication ) throws IOException { waitForReady(); BlockInfo[] fileBlocks = unprotectedSetReplication(src, replication, oldReplication); if (fileBlocks != null) // l...
[ "BlockInfo", "[", "]", "setReplication", "(", "String", "src", ",", "short", "replication", ",", "int", "[", "]", "oldReplication", ")", "throws", "IOException", "{", "waitForReady", "(", ")", ";", "BlockInfo", "[", "]", "fileBlocks", "=", "unprotectedSetRepli...
Set file replication @param src file name @param replication new replication @param oldReplication old replication - output parameter @return array of file blocks @throws IOException
[ "Set", "file", "replication" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L983-L992
118,757
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getPreferredBlockSize
long getPreferredBlockSize(String filename) throws IOException { byte[][] components = INodeDirectory.getPathComponents(filename); readLock(); try { INode fileNode = rootDir.getNode(components); if (fileNode == null) { throw new IOException("Unknown file: " + filename); } if ...
java
long getPreferredBlockSize(String filename) throws IOException { byte[][] components = INodeDirectory.getPathComponents(filename); readLock(); try { INode fileNode = rootDir.getNode(components); if (fileNode == null) { throw new IOException("Unknown file: " + filename); } if ...
[ "long", "getPreferredBlockSize", "(", "String", "filename", ")", "throws", "IOException", "{", "byte", "[", "]", "[", "]", "components", "=", "INodeDirectory", ".", "getPathComponents", "(", "filename", ")", ";", "readLock", "(", ")", ";", "try", "{", "INode...
Get the blocksize of a file @param filename the filename @return the number of bytes @throws IOException if it is a directory or does not exist.
[ "Get", "the", "blocksize", "of", "a", "file" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1052-L1068
118,758
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getINode
INode getINode(String src) { src = normalizePath(src); byte[][] components = INodeDirectory.getPathComponents(src); readLock(); try { INode inode = rootDir.getNode(components); return inode; } finally { readUnlock(); } }
java
INode getINode(String src) { src = normalizePath(src); byte[][] components = INodeDirectory.getPathComponents(src); readLock(); try { INode inode = rootDir.getNode(components); return inode; } finally { readUnlock(); } }
[ "INode", "getINode", "(", "String", "src", ")", "{", "src", "=", "normalizePath", "(", "src", ")", ";", "byte", "[", "]", "[", "]", "components", "=", "INodeDirectory", ".", "getPathComponents", "(", "src", ")", ";", "readLock", "(", ")", ";", "try", ...
This is a method required in addition to getFileInode It returns the INode regardless of its type getFileInode only returns the inode if it is of a file type
[ "This", "is", "a", "method", "required", "in", "addition", "to", "getFileInode", "It", "returns", "the", "INode", "regardless", "of", "its", "type", "getFileInode", "only", "returns", "the", "inode", "if", "it", "is", "of", "a", "file", "type" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1143-L1153
118,759
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getINode
INode getINode(long id) { readLock(); try { INode inode = inodeMap.get(id); return inode; } finally { readUnlock(); } }
java
INode getINode(long id) { readLock(); try { INode inode = inodeMap.get(id); return inode; } finally { readUnlock(); } }
[ "INode", "getINode", "(", "long", "id", ")", "{", "readLock", "(", ")", ";", "try", "{", "INode", "inode", "=", "inodeMap", ".", "get", "(", "id", ")", ";", "return", "inode", ";", "}", "finally", "{", "readUnlock", "(", ")", ";", "}", "}" ]
Get the inode from inodeMap based on its inode id. @param id The given id @return The inode associated with the given id
[ "Get", "the", "inode", "from", "inodeMap", "based", "on", "its", "inode", "id", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1160-L1168
118,760
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.mergeInternal
public void mergeInternal(INode parityINodes[], INode sourceINodes[], String parity, String source, RaidCodec codec, int[] checksums) throws IOException { waitForReady(); long now = FSNamesystem.now(); unprotectedMerge(parityINodes, sourceINodes, parity, source, codec, checksums, now...
java
public void mergeInternal(INode parityINodes[], INode sourceINodes[], String parity, String source, RaidCodec codec, int[] checksums) throws IOException { waitForReady(); long now = FSNamesystem.now(); unprotectedMerge(parityINodes, sourceINodes, parity, source, codec, checksums, now...
[ "public", "void", "mergeInternal", "(", "INode", "parityINodes", "[", "]", ",", "INode", "sourceINodes", "[", "]", ",", "String", "parity", ",", "String", "source", ",", "RaidCodec", "codec", ",", "int", "[", "]", "checksums", ")", "throws", "IOException", ...
Merge all the blocks in the parity file into source file. Source file will be converted into INodeRaidStorage format to include both parity blocks and source blocks
[ "Merge", "all", "the", "blocks", "in", "the", "parity", "file", "into", "source", "file", ".", "Source", "file", "will", "be", "converted", "into", "INodeRaidStorage", "format", "to", "include", "both", "parity", "blocks", "and", "source", "blocks" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1348-L1356
118,761
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.delete
INode delete(String src, INode[] inodes, List<BlockInfo> collectedBlocks, int blocksLimit) { if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.delete: "+src); } waitForReady(); long now = FSNamesystem.now(); INode deletedNode = unprotectedDel...
java
INode delete(String src, INode[] inodes, List<BlockInfo> collectedBlocks, int blocksLimit) { if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("DIR* FSDirectory.delete: "+src); } waitForReady(); long now = FSNamesystem.now(); INode deletedNode = unprotectedDel...
[ "INode", "delete", "(", "String", "src", ",", "INode", "[", "]", "inodes", ",", "List", "<", "BlockInfo", ">", "collectedBlocks", ",", "int", "blocksLimit", ")", "{", "if", "(", "NameNode", ".", "stateChangeLog", ".", "isDebugEnabled", "(", ")", ")", "{"...
Remove the file from management, return up to blocksLimit number of blocks
[ "Remove", "the", "file", "from", "management", "return", "up", "to", "blocksLimit", "number", "of", "blocks" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1403-L1416
118,762
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedDelete
INode unprotectedDelete(String src, long modificationTime) { return unprotectedDelete(src, this.getExistingPathINodes(src), null, BLOCK_DELETION_NO_LIMIT, modificationTime); }
java
INode unprotectedDelete(String src, long modificationTime) { return unprotectedDelete(src, this.getExistingPathINodes(src), null, BLOCK_DELETION_NO_LIMIT, modificationTime); }
[ "INode", "unprotectedDelete", "(", "String", "src", ",", "long", "modificationTime", ")", "{", "return", "unprotectedDelete", "(", "src", ",", "this", ".", "getExistingPathINodes", "(", "src", ")", ",", "null", ",", "BLOCK_DELETION_NO_LIMIT", ",", "modificationTim...
Delete a path from the name space Update the count at each ancestor directory with quota @param src a string representation of a path to an inode @param modificationTime the time the inode is removed @return the deleted target inode, null if deletion failed
[ "Delete", "a", "path", "from", "the", "name", "space", "Update", "the", "count", "at", "each", "ancestor", "directory", "with", "quota" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1443-L1446
118,763
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedDelete
INode unprotectedDelete(String src, INode inodes[], List<BlockInfo> toBeDeletedBlocks, int blocksLimit, long modificationTime) { src = normalizePath(src); writeLock(); try { INode targetNode = inodes[inodes.length-1]; if (targetNode == null) { // non-existent src ...
java
INode unprotectedDelete(String src, INode inodes[], List<BlockInfo> toBeDeletedBlocks, int blocksLimit, long modificationTime) { src = normalizePath(src); writeLock(); try { INode targetNode = inodes[inodes.length-1]; if (targetNode == null) { // non-existent src ...
[ "INode", "unprotectedDelete", "(", "String", "src", ",", "INode", "inodes", "[", "]", ",", "List", "<", "BlockInfo", ">", "toBeDeletedBlocks", ",", "int", "blocksLimit", ",", "long", "modificationTime", ")", "{", "src", "=", "normalizePath", "(", "src", ")",...
Delete a path from the name space Update the count at each ancestor directory with quota Up to blocksLimit blocks will be put in toBeDeletedBlocks to be removed later @param src a string representation of a path to an inode @param inodes all the inodes on the given path @param toBeDeletedBlocks the place holder for the...
[ "Delete", "a", "path", "from", "the", "name", "space", "Update", "the", "count", "at", "each", "ancestor", "directory", "with", "quota", "Up", "to", "blocksLimit", "blocks", "will", "be", "put", "in", "toBeDeletedBlocks", "to", "be", "removed", "later" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1465-L1518
118,764
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.removeFromInodeMap
void removeFromInodeMap(List<INode> inodes) { if (inodes != null) { for (INode inode : inodes) { if (inode != null) { inodeMap.remove(inode); } } } }
java
void removeFromInodeMap(List<INode> inodes) { if (inodes != null) { for (INode inode : inodes) { if (inode != null) { inodeMap.remove(inode); } } } }
[ "void", "removeFromInodeMap", "(", "List", "<", "INode", ">", "inodes", ")", "{", "if", "(", "inodes", "!=", "null", ")", "{", "for", "(", "INode", "inode", ":", "inodes", ")", "{", "if", "(", "inode", "!=", "null", ")", "{", "inodeMap", ".", "remo...
Remove inodes from inodeMap Not thread safe, needs lock on operations @param removedINodes inodes to be removed
[ "Remove", "inodes", "from", "inodeMap", "Not", "thread", "safe", "needs", "lock", "on", "operations" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1539-L1547
118,765
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.replaceNode
void replaceNode(String path, INodeFile oldnode, INodeFile newnode) throws IOException { replaceNode(path, null, oldnode, newnode, true); }
java
void replaceNode(String path, INodeFile oldnode, INodeFile newnode) throws IOException { replaceNode(path, null, oldnode, newnode, true); }
[ "void", "replaceNode", "(", "String", "path", ",", "INodeFile", "oldnode", ",", "INodeFile", "newnode", ")", "throws", "IOException", "{", "replaceNode", "(", "path", ",", "null", ",", "oldnode", ",", "newnode", ",", "true", ")", ";", "}" ]
Replaces the specified inode with the specified one.
[ "Replaces", "the", "specified", "inode", "with", "the", "specified", "one", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1552-L1555
118,766
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getRandomFileStats
public List<FileStatusExtended> getRandomFileStats(double percent) { readLock(); try { List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>(); for (INodeFile file : getRandomFiles(percent)) { try { String path = file.getFullPathName(); FileStatus stat = cre...
java
public List<FileStatusExtended> getRandomFileStats(double percent) { readLock(); try { List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>(); for (INodeFile file : getRandomFiles(percent)) { try { String path = file.getFullPathName(); FileStatus stat = cre...
[ "public", "List", "<", "FileStatusExtended", ">", "getRandomFileStats", "(", "double", "percent", ")", "{", "readLock", "(", ")", ";", "try", "{", "List", "<", "FileStatusExtended", ">", "stats", "=", "new", "LinkedList", "<", "FileStatusExtended", ">", "(", ...
Retrieves a list of random files with some information. @param percent the percent of files to return @return the list of files
[ "Retrieves", "a", "list", "of", "random", "files", "with", "some", "information", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1622-L1644
118,767
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getFileBlocks
Block[] getFileBlocks(String src) { waitForReady(); byte[][] components = INodeDirectory.getPathComponents(src); readLock(); try { INode targetNode = rootDir.getNode(components); if (targetNode == null) return null; if(targetNode.isDirectory()) return null; return...
java
Block[] getFileBlocks(String src) { waitForReady(); byte[][] components = INodeDirectory.getPathComponents(src); readLock(); try { INode targetNode = rootDir.getNode(components); if (targetNode == null) return null; if(targetNode.isDirectory()) return null; return...
[ "Block", "[", "]", "getFileBlocks", "(", "String", "src", ")", "{", "waitForReady", "(", ")", ";", "byte", "[", "]", "[", "]", "components", "=", "INodeDirectory", ".", "getPathComponents", "(", "src", ")", ";", "readLock", "(", ")", ";", "try", "{", ...
Get the blocks associated with the file.
[ "Get", "the", "blocks", "associated", "with", "the", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1876-L1890
118,768
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getExistingPathINodes
public INode[] getExistingPathINodes(String path) { byte[][] components = INode.getPathComponents(path); INode[] inodes = new INode[components.length]; readLock(); try { rootDir.getExistingPathINodes(components, inodes); return inodes; } finally { readUnlock(); } }
java
public INode[] getExistingPathINodes(String path) { byte[][] components = INode.getPathComponents(path); INode[] inodes = new INode[components.length]; readLock(); try { rootDir.getExistingPathINodes(components, inodes); return inodes; } finally { readUnlock(); } }
[ "public", "INode", "[", "]", "getExistingPathINodes", "(", "String", "path", ")", "{", "byte", "[", "]", "[", "]", "components", "=", "INode", ".", "getPathComponents", "(", "path", ")", ";", "INode", "[", "]", "inodes", "=", "new", "INode", "[", "comp...
Retrieve the existing INodes along the given path. @param path the path to explore @return INodes array containing the existing INodes in the order they appear when following the path from the root INode to the deepest INodes. The array size will be the number of expected components in the path, and non existing compo...
[ "Retrieve", "the", "existing", "INodes", "along", "the", "given", "path", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1979-L1990
118,769
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.isValidToCreate
boolean isValidToCreate(String src) { String srcs = normalizePath(src); byte[][] components = INodeDirectory.getPathComponents(srcs); readLock(); try { if (srcs.startsWith("/") && !srcs.endsWith("/") && rootDir.getNode(components) == null) { return true; } else { ...
java
boolean isValidToCreate(String src) { String srcs = normalizePath(src); byte[][] components = INodeDirectory.getPathComponents(srcs); readLock(); try { if (srcs.startsWith("/") && !srcs.endsWith("/") && rootDir.getNode(components) == null) { return true; } else { ...
[ "boolean", "isValidToCreate", "(", "String", "src", ")", "{", "String", "srcs", "=", "normalizePath", "(", "src", ")", ";", "byte", "[", "]", "[", "]", "components", "=", "INodeDirectory", ".", "getPathComponents", "(", "srcs", ")", ";", "readLock", "(", ...
Check whether the filepath could be created
[ "Check", "whether", "the", "filepath", "could", "be", "created" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2010-L2025
118,770
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.isDir
boolean isDir(String src) { byte[][] components = INodeDirectory.getPathComponents(normalizePath(src)); readLock(); try { INode node = rootDir.getNode(components); return isDir(node); } finally { readUnlock(); } }
java
boolean isDir(String src) { byte[][] components = INodeDirectory.getPathComponents(normalizePath(src)); readLock(); try { INode node = rootDir.getNode(components); return isDir(node); } finally { readUnlock(); } }
[ "boolean", "isDir", "(", "String", "src", ")", "{", "byte", "[", "]", "[", "]", "components", "=", "INodeDirectory", ".", "getPathComponents", "(", "normalizePath", "(", "src", ")", ")", ";", "readLock", "(", ")", ";", "try", "{", "INode", "node", "=",...
Check whether the path specifies a directory
[ "Check", "whether", "the", "path", "specifies", "a", "directory" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2030-L2039
118,771
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.updateCount
private void updateCount(INode[] inodes, int numOfINodes, long nsDelta, long dsDelta, boolean checkQuota) throws QuotaExceededException { this.updateCount(inodes, 0, numOfINodes, nsDelta, dsDelta, checkQuota); }
java
private void updateCount(INode[] inodes, int numOfINodes, long nsDelta, long dsDelta, boolean checkQuota) throws QuotaExceededException { this.updateCount(inodes, 0, numOfINodes, nsDelta, dsDelta, checkQuota); }
[ "private", "void", "updateCount", "(", "INode", "[", "]", "inodes", ",", "int", "numOfINodes", ",", "long", "nsDelta", ",", "long", "dsDelta", ",", "boolean", "checkQuota", ")", "throws", "QuotaExceededException", "{", "this", ".", "updateCount", "(", "inodes"...
Update count of each inode with quota in the inodes array from the position of 0 to the position of numOfINodes @param inodes an array of inodes on a path @param numOfINodes the number of inodes to update starting from index 0 @param nsDelta the delta change of namespace @param dsDelta the delta change of diskspace @p...
[ "Update", "count", "of", "each", "inode", "with", "quota", "in", "the", "inodes", "array", "from", "the", "position", "of", "0", "to", "the", "position", "of", "numOfINodes" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2100-L2104
118,772
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.updateCount
private void updateCount(INode[] inodes, int dsUpdateStartPos, int endPos, long nsDelta, long dsDelta, boolean checkQuota) throws QuotaExceededException { if (!ready) { // still intializing. do not check or update quotas. return; } if (endPos > inodes.length) { ...
java
private void updateCount(INode[] inodes, int dsUpdateStartPos, int endPos, long nsDelta, long dsDelta, boolean checkQuota) throws QuotaExceededException { if (!ready) { // still intializing. do not check or update quotas. return; } if (endPos > inodes.length) { ...
[ "private", "void", "updateCount", "(", "INode", "[", "]", "inodes", ",", "int", "dsUpdateStartPos", ",", "int", "endPos", ",", "long", "nsDelta", ",", "long", "dsDelta", ",", "boolean", "checkQuota", ")", "throws", "QuotaExceededException", "{", "if", "(", "...
Update NS quota of each inode with quota in the inodes array from the position 0 to the position of endPos. And update DS quota of each inode with quota in the inodes array from the position of dsUpdateStartPos to the position of endPos. Currently only HardLink operations use a dsUpdateStartPos that is non-zero and h...
[ "Update", "NS", "quota", "of", "each", "inode", "with", "quota", "in", "the", "inodes", "array", "from", "the", "position", "0", "to", "the", "position", "of", "endPos", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2125-L2149
118,773
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.updateCountNoQuotaCheck
private void updateCountNoQuotaCheck(INode[] inodes, int startPos, int endPos, long nsDelta, long dsDelta) { try { updateCount(inodes, startPos, endPos, nsDelta, dsDelta, false); } catch (QuotaExceededException e) { NameNode.LOG.warn("FSDirectory.updateCountNoQuotaCheck - ...
java
private void updateCountNoQuotaCheck(INode[] inodes, int startPos, int endPos, long nsDelta, long dsDelta) { try { updateCount(inodes, startPos, endPos, nsDelta, dsDelta, false); } catch (QuotaExceededException e) { NameNode.LOG.warn("FSDirectory.updateCountNoQuotaCheck - ...
[ "private", "void", "updateCountNoQuotaCheck", "(", "INode", "[", "]", "inodes", ",", "int", "startPos", ",", "int", "endPos", ",", "long", "nsDelta", ",", "long", "dsDelta", ")", "{", "try", "{", "updateCount", "(", "inodes", ",", "startPos", ",", "endPos"...
Update quota of each inode in the inodes array from the position of startPos to the position of endPos. But it won't throw out the QuotaExceededException.
[ "Update", "quota", "of", "each", "inode", "in", "the", "inodes", "array", "from", "the", "position", "of", "startPos", "to", "the", "position", "of", "endPos", ".", "But", "it", "won", "t", "throw", "out", "the", "QuotaExceededException", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2155-L2162
118,774
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedUpdateCount
private void unprotectedUpdateCount(INode[] inodes, int numOfINodes, long nsDelta, long dsDelta) { for(int i=0; i < numOfINodes; i++) { if (inodes[i].isQuotaSet()) { // a directory with quota INodeDirectoryWithQuota node =(INodeDirectoryWithQuota)inodes[i]; ...
java
private void unprotectedUpdateCount(INode[] inodes, int numOfINodes, long nsDelta, long dsDelta) { for(int i=0; i < numOfINodes; i++) { if (inodes[i].isQuotaSet()) { // a directory with quota INodeDirectoryWithQuota node =(INodeDirectoryWithQuota)inodes[i]; ...
[ "private", "void", "unprotectedUpdateCount", "(", "INode", "[", "]", "inodes", ",", "int", "numOfINodes", ",", "long", "nsDelta", ",", "long", "dsDelta", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numOfINodes", ";", "i", "++", ")", "...
updates quota without verification callers responsibility is to make sure quota is not exceeded @param inodes @param numOfINodes @param nsDelta @param dsDelta
[ "updates", "quota", "without", "verification", "callers", "responsibility", "is", "to", "make", "sure", "quota", "is", "not", "exceeded" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2172-L2180
118,775
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getFullPathName
static String getFullPathName(byte[][] names) { StringBuilder fullPathName = new StringBuilder(); for (int i = 1; i < names.length; i++) { byte[] name = names[i]; fullPathName.append(Path.SEPARATOR_CHAR) .append(DFSUtil.bytes2String(name)); } return fullPathName.toString(); }
java
static String getFullPathName(byte[][] names) { StringBuilder fullPathName = new StringBuilder(); for (int i = 1; i < names.length; i++) { byte[] name = names[i]; fullPathName.append(Path.SEPARATOR_CHAR) .append(DFSUtil.bytes2String(name)); } return fullPathName.toString(); }
[ "static", "String", "getFullPathName", "(", "byte", "[", "]", "[", "]", "names", ")", "{", "StringBuilder", "fullPathName", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "names", ".", "length", ";", "i",...
Return the name of the path represented by the byte array
[ "Return", "the", "name", "of", "the", "path", "represented", "by", "the", "byte", "array" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2193-L2201
118,776
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getINodeArray
static INode[] getINodeArray(INode inode) throws IOException { // calculate the depth of this inode from root int depth = getPathDepth(inode); INode[] inodes = new INode[depth]; // fill up the inodes in the path from this inode to root for (int i = 0; i < depth; i++) { inodes[depth-i-1] = ino...
java
static INode[] getINodeArray(INode inode) throws IOException { // calculate the depth of this inode from root int depth = getPathDepth(inode); INode[] inodes = new INode[depth]; // fill up the inodes in the path from this inode to root for (int i = 0; i < depth; i++) { inodes[depth-i-1] = ino...
[ "static", "INode", "[", "]", "getINodeArray", "(", "INode", "inode", ")", "throws", "IOException", "{", "// calculate the depth of this inode from root", "int", "depth", "=", "getPathDepth", "(", "inode", ")", ";", "INode", "[", "]", "inodes", "=", "new", "INode...
Return the inode array representing the given inode's full path name @param inode an inode @return the node array representation of the given inode's full path @throws IOException if the inode is invalid
[ "Return", "the", "inode", "array", "representing", "the", "given", "inode", "s", "full", "path", "name" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2209-L2220
118,777
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getPathDepth
static private int getPathDepth(INode inode) throws IOException { // calculate the depth of this inode from root int depth = 1; INode node; // node on the path to the root for (node = inode; node.parent != null; node = node.parent) { depth++; } // parent should be root if (node.isRoot...
java
static private int getPathDepth(INode inode) throws IOException { // calculate the depth of this inode from root int depth = 1; INode node; // node on the path to the root for (node = inode; node.parent != null; node = node.parent) { depth++; } // parent should be root if (node.isRoot...
[ "static", "private", "int", "getPathDepth", "(", "INode", "inode", ")", "throws", "IOException", "{", "// calculate the depth of this inode from root", "int", "depth", "=", "1", ";", "INode", "node", ";", "// node on the path to the root", "for", "(", "node", "=", "...
Get the depth of node inode from root @param inode an inode @return depth @throws IOException if the given inode is invalid
[ "Get", "the", "depth", "of", "node", "inode", "from", "root" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2228-L2243
118,778
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getINodeByteArray
static byte[][] getINodeByteArray(INode inode) throws IOException { // calculate the depth of this inode from root int depth = getPathDepth(inode); byte[][] names = new byte[depth][]; // fill up the inodes in the path from this inode to root for (int i = 0; i < depth; i++) { names[depth-...
java
static byte[][] getINodeByteArray(INode inode) throws IOException { // calculate the depth of this inode from root int depth = getPathDepth(inode); byte[][] names = new byte[depth][]; // fill up the inodes in the path from this inode to root for (int i = 0; i < depth; i++) { names[depth-...
[ "static", "byte", "[", "]", "[", "]", "getINodeByteArray", "(", "INode", "inode", ")", "throws", "IOException", "{", "// calculate the depth of this inode from root", "int", "depth", "=", "getPathDepth", "(", "inode", ")", ";", "byte", "[", "]", "[", "]", "nam...
Return the byte array representing the given inode's full path name @param inode an inode @return the byte array representation of the full path of the inode @throws IOException if the inode is invalid
[ "Return", "the", "byte", "array", "representing", "the", "given", "inode", "s", "full", "path", "name" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2251-L2263
118,779
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getFullPathName
static String getFullPathName(INode inode) throws IOException { INode[] inodes = getINodeArray(inode); return getFullPathName(inodes, inodes.length-1); }
java
static String getFullPathName(INode inode) throws IOException { INode[] inodes = getINodeArray(inode); return getFullPathName(inodes, inodes.length-1); }
[ "static", "String", "getFullPathName", "(", "INode", "inode", ")", "throws", "IOException", "{", "INode", "[", "]", "inodes", "=", "getINodeArray", "(", "inode", ")", ";", "return", "getFullPathName", "(", "inodes", ",", "inodes", ".", "length", "-", "1", ...
Return the full path name of the specified inode @param inode @return its full path name @throws IOException if the inode is invalid
[ "Return", "the", "full", "path", "name", "of", "the", "specified", "inode" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2271-L2274
118,780
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.addNode
private <T extends INode> T addNode(String src, T child, long childDiskspace, boolean inheritPermission) throws QuotaExceededException { byte[][] components = INode.getPathComponents(src); byte[] path = components[components.length - 1]; child.setLocalName(path); cacheName(child); INode[] ...
java
private <T extends INode> T addNode(String src, T child, long childDiskspace, boolean inheritPermission) throws QuotaExceededException { byte[][] components = INode.getPathComponents(src); byte[] path = components[components.length - 1]; child.setLocalName(path); cacheName(child); INode[] ...
[ "private", "<", "T", "extends", "INode", ">", "T", "addNode", "(", "String", "src", ",", "T", "child", ",", "long", "childDiskspace", ",", "boolean", "inheritPermission", ")", "throws", "QuotaExceededException", "{", "byte", "[", "]", "[", "]", "components",...
Add a node child to the namespace. The full path name of the node is src. childDiskspace should be -1, if unknown. QuotaExceededException is thrown if it violates quota limit
[ "Add", "a", "node", "child", "to", "the", "namespace", ".", "The", "full", "path", "name", "of", "the", "node", "is", "src", ".", "childDiskspace", "should", "be", "-", "1", "if", "unknown", ".", "QuotaExceededException", "is", "thrown", "if", "it", "vio...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2399-L2415
118,781
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.verifyQuota
private void verifyQuota(INode[] inodes, int nsQuotaStartPos, int dsQuotaStartPos, int endPos, long nsDelta, long dsDelta) throws QuotaExceededException { if (!ready) { // Do not check quota if edits log is still being processed return; } if (endPos >inodes.length) { endPos = inode...
java
private void verifyQuota(INode[] inodes, int nsQuotaStartPos, int dsQuotaStartPos, int endPos, long nsDelta, long dsDelta) throws QuotaExceededException { if (!ready) { // Do not check quota if edits log is still being processed return; } if (endPos >inodes.length) { endPos = inode...
[ "private", "void", "verifyQuota", "(", "INode", "[", "]", "inodes", ",", "int", "nsQuotaStartPos", ",", "int", "dsQuotaStartPos", ",", "int", "endPos", ",", "long", "nsDelta", ",", "long", "dsDelta", ")", "throws", "QuotaExceededException", "{", "if", "(", "...
Verify quota for adding or moving a new INode with required namespace and diskspace to a given position. This functiuon assumes that the nsQuotaStartPos is less or equal than the dsQuotaStartPos @param inodes INodes corresponding to a path @param dsQuotaStartPos the start position where the NS quota needs to be updat...
[ "Verify", "quota", "for", "adding", "or", "moving", "a", "new", "INode", "with", "required", "namespace", "and", "diskspace", "to", "a", "given", "position", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2431-L2462
118,782
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.updateCountForINodeWithQuota
private static void updateCountForINodeWithQuota(INodeDirectory dir, INode.DirCounts counts, ArrayList<INode> nodesInPath) { long parentNamespace = counts.nsCount; long parentDiskspace = counts.dsCount; counts.nsC...
java
private static void updateCountForINodeWithQuota(INodeDirectory dir, INode.DirCounts counts, ArrayList<INode> nodesInPath) { long parentNamespace = counts.nsCount; long parentDiskspace = counts.dsCount; counts.nsC...
[ "private", "static", "void", "updateCountForINodeWithQuota", "(", "INodeDirectory", "dir", ",", "INode", ".", "DirCounts", "counts", ",", "ArrayList", "<", "INode", ">", "nodesInPath", ")", "{", "long", "parentNamespace", "=", "counts", ".", "nsCount", ";", "lon...
Update the count of the directory if it has a quota and return the count This does not throw a QuotaExceededException. This is just an update of of existing state and throwing QuotaExceededException does not help with fixing the state, if there is a problem. @param dir the root of the tree that represents the directo...
[ "Update", "the", "count", "of", "the", "directory", "if", "it", "has", "a", "quota", "and", "return", "the", "count" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2657-L2708
118,783
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.createFileStatus
static FileStatus createFileStatus(String path, INode node) { // length is zero for directories return new FileStatus(node.isDirectory() ? 0 : node.computeContentSummary().getLength(), node.isDirectory(), node.isDirectory() ? 0 : ((INodeFile)node).getReplication(), node.isDirectory() ? 0...
java
static FileStatus createFileStatus(String path, INode node) { // length is zero for directories return new FileStatus(node.isDirectory() ? 0 : node.computeContentSummary().getLength(), node.isDirectory(), node.isDirectory() ? 0 : ((INodeFile)node).getReplication(), node.isDirectory() ? 0...
[ "static", "FileStatus", "createFileStatus", "(", "String", "path", ",", "INode", "node", ")", "{", "// length is zero for directories", "return", "new", "FileStatus", "(", "node", ".", "isDirectory", "(", ")", "?", "0", ":", "node", ".", "computeContentSummary", ...
Create FileStatus by file INode
[ "Create", "FileStatus", "by", "file", "INode" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2845-L2857
118,784
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.createHdfsFileStatus
private static HdfsFileStatus createHdfsFileStatus(byte[] path, INode node) { long size = 0; // length is zero for directories short replication = 0; long blocksize = 0; if (node instanceof INodeFile) { INodeFile fileNode = (INodeFile)node; size = fileNode.getFileSize(); rep...
java
private static HdfsFileStatus createHdfsFileStatus(byte[] path, INode node) { long size = 0; // length is zero for directories short replication = 0; long blocksize = 0; if (node instanceof INodeFile) { INodeFile fileNode = (INodeFile)node; size = fileNode.getFileSize(); rep...
[ "private", "static", "HdfsFileStatus", "createHdfsFileStatus", "(", "byte", "[", "]", "path", ",", "INode", "node", ")", "{", "long", "size", "=", "0", ";", "// length is zero for directories", "short", "replication", "=", "0", ";", "long", "blocksize", "=", "...
Create HdfsFileStatus by file INode
[ "Create", "HdfsFileStatus", "by", "file", "INode" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2862-L2889
118,785
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.createLocatedBlocks
private LocatedBlocks createLocatedBlocks(INode node) throws IOException { LocatedBlocks loc = null; if (node instanceof INodeFile) { loc = getFSNamesystem().getBlockLocationsInternal( (INodeFile)node, 0L, Long.MAX_VALUE, Integer.MAX_VALUE); } if (loc==null) { loc = EMPTY_BL...
java
private LocatedBlocks createLocatedBlocks(INode node) throws IOException { LocatedBlocks loc = null; if (node instanceof INodeFile) { loc = getFSNamesystem().getBlockLocationsInternal( (INodeFile)node, 0L, Long.MAX_VALUE, Integer.MAX_VALUE); } if (loc==null) { loc = EMPTY_BL...
[ "private", "LocatedBlocks", "createLocatedBlocks", "(", "INode", "node", ")", "throws", "IOException", "{", "LocatedBlocks", "loc", "=", "null", ";", "if", "(", "node", "instanceof", "INodeFile", ")", "{", "loc", "=", "getFSNamesystem", "(", ")", ".", "getBloc...
Create FileStatus with location info by file INode
[ "Create", "FileStatus", "with", "location", "info", "by", "file", "INode" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2896-L2906
118,786
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.close
public synchronized void close() throws IOException { // // Kill running tasks. Do this in a 2nd vector, called 'tasksToClose', // because calling jobHasFinished() may result in an edit to 'tasks'. // TreeMap<TaskAttemptID, TaskInProgress> tasksToClose = new TreeMap<TaskAttemptID, TaskInProgr...
java
public synchronized void close() throws IOException { // // Kill running tasks. Do this in a 2nd vector, called 'tasksToClose', // because calling jobHasFinished() may result in an edit to 'tasks'. // TreeMap<TaskAttemptID, TaskInProgress> tasksToClose = new TreeMap<TaskAttemptID, TaskInProgr...
[ "public", "synchronized", "void", "close", "(", ")", "throws", "IOException", "{", "//", "// Kill running tasks. Do this in a 2nd vector, called 'tasksToClose',", "// because calling jobHasFinished() may result in an edit to 'tasks'.", "//", "TreeMap", "<", "TaskAttemptID", ",", "...
Close down the TaskTracker and all its components. We must also shutdown any running tasks or threads, and cleanup disk space. A new TaskTracker within the same process space might be restarted, so everything must be clean.
[ "Close", "down", "the", "TaskTracker", "and", "all", "its", "components", ".", "We", "must", "also", "shutdown", "any", "running", "tasks", "or", "threads", "and", "cleanup", "disk", "space", ".", "A", "new", "TaskTracker", "within", "the", "same", "process"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L1333-L1435
118,787
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getTceFromStore
private static TaskCompletionEvent getTceFromStore(TaskCompletionEvent t) { // Use the store so that we can save memory in simulations where there // are multiple task trackers in memory synchronized(taskCompletionEventsStore) { WeakReference<TaskCompletionEvent> e = taskCompletionEventsStor...
java
private static TaskCompletionEvent getTceFromStore(TaskCompletionEvent t) { // Use the store so that we can save memory in simulations where there // are multiple task trackers in memory synchronized(taskCompletionEventsStore) { WeakReference<TaskCompletionEvent> e = taskCompletionEventsStor...
[ "private", "static", "TaskCompletionEvent", "getTceFromStore", "(", "TaskCompletionEvent", "t", ")", "{", "// Use the store so that we can save memory in simulations where there", "// are multiple task trackers in memory", "synchronized", "(", "taskCompletionEventsStore", ")", "{", "...
Given a TaskCompletionEvent, it checks the store and returns an equivalent copy that can be used instead. If not in the store, it adds it to the store and returns the same supplied TaskCompletionEvent. If the caller uses the stored copy, we have an opportunity to save memory. @param t the TaskCompletionEvent to check i...
[ "Given", "a", "TaskCompletionEvent", "it", "checks", "the", "store", "and", "returns", "an", "equivalent", "copy", "that", "can", "be", "used", "instead", ".", "If", "not", "in", "the", "store", "it", "adds", "it", "to", "the", "store", "and", "returns", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L1591-L1613
118,788
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.queryJobTracker
private List<TaskCompletionEvent> queryJobTracker(IntWritable fromEventId, JobID jobId, InterTrackerProtocol jobClient) throws IOException { if (jobClient == null) { List<TaskCompletionEvent> empty = Co...
java
private List<TaskCompletionEvent> queryJobTracker(IntWritable fromEventId, JobID jobId, InterTrackerProtocol jobClient) throws IOException { if (jobClient == null) { List<TaskCompletionEvent> empty = Co...
[ "private", "List", "<", "TaskCompletionEvent", ">", "queryJobTracker", "(", "IntWritable", "fromEventId", ",", "JobID", "jobId", ",", "InterTrackerProtocol", "jobClient", ")", "throws", "IOException", "{", "if", "(", "jobClient", "==", "null", ")", "{", "List", ...
Queries the job tracker for a set of outputs ready to be copied @param fromEventId the first event ID we want to start from, this is modified by the call to this method @param jobClient the job tracker @return a set of locations to copy outputs from @throws IOException
[ "Queries", "the", "job", "tracker", "for", "a", "set", "of", "outputs", "ready", "to", "be", "copied" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L1622-L1652
118,789
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.transmitHeartBeat
protected HeartbeatResponse transmitHeartBeat( InterTrackerProtocol jobClient, short heartbeatResponseId, TaskTrackerStatus status) throws IOException { // // Check if we should ask for a new Task // boolean askForNewTask; long localMinSpaceStart; synchronized (this) { askForNe...
java
protected HeartbeatResponse transmitHeartBeat( InterTrackerProtocol jobClient, short heartbeatResponseId, TaskTrackerStatus status) throws IOException { // // Check if we should ask for a new Task // boolean askForNewTask; long localMinSpaceStart; synchronized (this) { askForNe...
[ "protected", "HeartbeatResponse", "transmitHeartBeat", "(", "InterTrackerProtocol", "jobClient", ",", "short", "heartbeatResponseId", ",", "TaskTrackerStatus", "status", ")", "throws", "IOException", "{", "//", "// Check if we should ask for a new Task", "//", "boolean", "ask...
Build and transmit the heart beat to the JobTracker @param jobClient The jobTracker RPC handle @param heartbeatResponseId Last heartbeat response received @param status TaskTrackerStatus to transmit @return false if the tracker was unknown @throws IOException
[ "Build", "and", "transmit", "the", "heart", "beat", "to", "the", "JobTracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L1842-L1929
118,790
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.reinitTaskTracker
private boolean reinitTaskTracker(TaskTrackerAction[] actions) { if (actions != null) { for (TaskTrackerAction action : actions) { if (action.getActionId() == TaskTrackerAction.ActionType.REINIT_TRACKER) { LOG.info("Recieved RenitTrackerAction from JobTracker"); return ...
java
private boolean reinitTaskTracker(TaskTrackerAction[] actions) { if (actions != null) { for (TaskTrackerAction action : actions) { if (action.getActionId() == TaskTrackerAction.ActionType.REINIT_TRACKER) { LOG.info("Recieved RenitTrackerAction from JobTracker"); return ...
[ "private", "boolean", "reinitTaskTracker", "(", "TaskTrackerAction", "[", "]", "actions", ")", "{", "if", "(", "actions", "!=", "null", ")", "{", "for", "(", "TaskTrackerAction", "action", ":", "actions", ")", "{", "if", "(", "action", ".", "getActionId", ...
Check if the jobtracker directed a 'reset' of the tasktracker. @param actions the directives of the jobtracker for the tasktracker. @return <code>true</code> if tasktracker is to be reset, <code>false</code> otherwise.
[ "Check", "if", "the", "jobtracker", "directed", "a", "reset", "of", "the", "tasktracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2048-L2059
118,791
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.markUnresponsiveTasks
protected synchronized void markUnresponsiveTasks() throws IOException { long now = System.currentTimeMillis(); for (TaskInProgress tip: runningTasks.values()) { if (tip.getRunState() == TaskStatus.State.RUNNING || tip.getRunState() == TaskStatus.State.COMMIT_PENDING || tip.isCleaningu...
java
protected synchronized void markUnresponsiveTasks() throws IOException { long now = System.currentTimeMillis(); for (TaskInProgress tip: runningTasks.values()) { if (tip.getRunState() == TaskStatus.State.RUNNING || tip.getRunState() == TaskStatus.State.COMMIT_PENDING || tip.isCleaningu...
[ "protected", "synchronized", "void", "markUnresponsiveTasks", "(", ")", "throws", "IOException", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "for", "(", "TaskInProgress", "tip", ":", "runningTasks", ".", "values", "(", ")", ")",...
Kill any tasks that have not reported progress in the last X seconds.
[ "Kill", "any", "tasks", "that", "have", "not", "reported", "progress", "in", "the", "last", "X", "seconds", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2064-L2092
118,792
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.purgeJob
protected synchronized void purgeJob(KillJobAction action) throws IOException { JobID jobId = action.getJobID(); LOG.info("Received 'KillJobAction' for job: " + jobId); RunningJob rjob = null; synchronized (runningJobs) { rjob = runningJobs.get(jobId); } if (rjob == null) { if (LOG....
java
protected synchronized void purgeJob(KillJobAction action) throws IOException { JobID jobId = action.getJobID(); LOG.info("Received 'KillJobAction' for job: " + jobId); RunningJob rjob = null; synchronized (runningJobs) { rjob = runningJobs.get(jobId); } if (rjob == null) { if (LOG....
[ "protected", "synchronized", "void", "purgeJob", "(", "KillJobAction", "action", ")", "throws", "IOException", "{", "JobID", "jobId", "=", "action", ".", "getJobID", "(", ")", ";", "LOG", ".", "info", "(", "\"Received 'KillJobAction' for job: \"", "+", "jobId", ...
The task tracker is done with this job, so we need to clean up. @param action The action with the job @throws IOException
[ "The", "task", "tracker", "is", "done", "with", "this", "job", "so", "we", "need", "to", "clean", "up", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2125-L2171
118,793
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.purgeTask
private void purgeTask(TaskInProgress tip, boolean wasFailure) throws IOException { if (tip != null) { LOG.info("About to purge task: " + tip.getTask().getTaskID()); // Remove the task from running jobs, // removing the job if it's the last task removeTaskFromJob(tip.getTask().getJobID(),...
java
private void purgeTask(TaskInProgress tip, boolean wasFailure) throws IOException { if (tip != null) { LOG.info("About to purge task: " + tip.getTask().getTaskID()); // Remove the task from running jobs, // removing the job if it's the last task removeTaskFromJob(tip.getTask().getJobID(),...
[ "private", "void", "purgeTask", "(", "TaskInProgress", "tip", ",", "boolean", "wasFailure", ")", "throws", "IOException", "{", "if", "(", "tip", "!=", "null", ")", "{", "LOG", ".", "info", "(", "\"About to purge task: \"", "+", "tip", ".", "getTask", "(", ...
Remove the tip and update all relevant state. @param tip {@link TaskInProgress} to be removed. @param wasFailure did the task fail or was it killed?
[ "Remove", "the", "tip", "and", "update", "all", "relevant", "state", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2180-L2193
118,794
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.killOverflowingTasks
protected void killOverflowingTasks() throws IOException { long localMinSpaceKill; synchronized(this){ localMinSpaceKill = minSpaceKill; } if (!enoughFreeSpace(localMinSpaceKill)) { acceptNewTasks=false; //we give up! do not accept new tasks until //all the ones running have fini...
java
protected void killOverflowingTasks() throws IOException { long localMinSpaceKill; synchronized(this){ localMinSpaceKill = minSpaceKill; } if (!enoughFreeSpace(localMinSpaceKill)) { acceptNewTasks=false; //we give up! do not accept new tasks until //all the ones running have fini...
[ "protected", "void", "killOverflowingTasks", "(", ")", "throws", "IOException", "{", "long", "localMinSpaceKill", ";", "synchronized", "(", "this", ")", "{", "localMinSpaceKill", "=", "minSpaceKill", ";", "}", "if", "(", "!", "enoughFreeSpace", "(", "localMinSpace...
Check if we're dangerously low on disk space If so, kill jobs to free up space and make sure we don't accept any new tasks Try killing the reduce jobs first, since I believe they use up most space Then pick the one with least progress
[ "Check", "if", "we", "re", "dangerously", "low", "on", "disk", "space", "If", "so", "kill", "jobs", "to", "free", "up", "space", "and", "make", "sure", "we", "don", "t", "accept", "any", "new", "tasks", "Try", "killing", "the", "reduce", "jobs", "first...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2202-L2223
118,795
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getLogDiskFreeSpace
long getLogDiskFreeSpace() throws IOException { String logDir = fConf.getLogDir(); // If the log disk is not specified we assume it is usable. if (logDir == null) { return Long.MAX_VALUE; } DF df = localDirsDf.get(logDir); if (df == null) { df = new DF(new File(logDir), fConf); ...
java
long getLogDiskFreeSpace() throws IOException { String logDir = fConf.getLogDir(); // If the log disk is not specified we assume it is usable. if (logDir == null) { return Long.MAX_VALUE; } DF df = localDirsDf.get(logDir); if (df == null) { df = new DF(new File(logDir), fConf); ...
[ "long", "getLogDiskFreeSpace", "(", ")", "throws", "IOException", "{", "String", "logDir", "=", "fConf", ".", "getLogDir", "(", ")", ";", "// If the log disk is not specified we assume it is usable.", "if", "(", "logDir", "==", "null", ")", "{", "return", "Long", ...
Obtain the free space on the log disk. If the log disk is not configured, returns Long.MAX_VALUE @return The free space available. @throws IOException
[ "Obtain", "the", "free", "space", "on", "the", "log", "disk", ".", "If", "the", "log", "disk", "is", "not", "configured", "returns", "Long", ".", "MAX_VALUE" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2319-L2331
118,796
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.tryToGetOutputSize
long tryToGetOutputSize(TaskAttemptID taskId, JobConf conf) { try{ TaskInProgress tip; synchronized(this) { tip = tasks.get(taskId); } if(tip == null) return -1; if (!tip.getTask().isMapTask() || tip.getRunState() != TaskStatus.State.SUCCEEDED) { re...
java
long tryToGetOutputSize(TaskAttemptID taskId, JobConf conf) { try{ TaskInProgress tip; synchronized(this) { tip = tasks.get(taskId); } if(tip == null) return -1; if (!tip.getTask().isMapTask() || tip.getRunState() != TaskStatus.State.SUCCEEDED) { re...
[ "long", "tryToGetOutputSize", "(", "TaskAttemptID", "taskId", ",", "JobConf", "conf", ")", "{", "try", "{", "TaskInProgress", "tip", ";", "synchronized", "(", "this", ")", "{", "tip", "=", "tasks", ".", "get", "(", "taskId", ")", ";", "}", "if", "(", "...
Try to get the size of output for this task. Returns -1 if it can't be found. @return
[ "Try", "to", "get", "the", "size", "of", "output", "for", "this", "task", ".", "Returns", "-", "1", "if", "it", "can", "t", "be", "found", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2338-L2383
118,797
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.startNewTask
private void startNewTask(TaskInProgress tip) { try { boolean launched = localizeAndLaunchTask(tip); if (!launched) { // Free the slot. tip.kill(true); tip.cleanup(true); } } catch (Throwable e) { String msg = ("Error initializing " + tip.getTask().getTaskID() + ...
java
private void startNewTask(TaskInProgress tip) { try { boolean launched = localizeAndLaunchTask(tip); if (!launched) { // Free the slot. tip.kill(true); tip.cleanup(true); } } catch (Throwable e) { String msg = ("Error initializing " + tip.getTask().getTaskID() + ...
[ "private", "void", "startNewTask", "(", "TaskInProgress", "tip", ")", "{", "try", "{", "boolean", "launched", "=", "localizeAndLaunchTask", "(", "tip", ")", ";", "if", "(", "!", "launched", ")", "{", "// Free the slot.", "tip", ".", "kill", "(", "true", ")...
Start a new task. All exceptions are handled locally, so that we don't mess up the task tracker.
[ "Start", "a", "new", "task", ".", "All", "exceptions", "are", "handled", "locally", "so", "that", "we", "don", "t", "mess", "up", "the", "task", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2660-L2687
118,798
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.localizeAndLaunchTask
private boolean localizeAndLaunchTask(final TaskInProgress tip) throws IOException { FutureTask<Boolean> task = new FutureTask<Boolean>( new Callable<Boolean>() { public Boolean call() throws IOException { JobConf localConf = localizeJob(tip); boolean launched = false...
java
private boolean localizeAndLaunchTask(final TaskInProgress tip) throws IOException { FutureTask<Boolean> task = new FutureTask<Boolean>( new Callable<Boolean>() { public Boolean call() throws IOException { JobConf localConf = localizeJob(tip); boolean launched = false...
[ "private", "boolean", "localizeAndLaunchTask", "(", "final", "TaskInProgress", "tip", ")", "throws", "IOException", "{", "FutureTask", "<", "Boolean", ">", "task", "=", "new", "FutureTask", "<", "Boolean", ">", "(", "new", "Callable", "<", "Boolean", ">", "(",...
Localize and launch the task. If it takes too long, try cancel the thread that does localization. If the thread cannot be terminated, kill the JVM. The TaskTracker will die. We have seen localizeTask hangs TaskTracker. In this case we lose the node. This method will kill tasktracker and so it can be restarted later.
[ "Localize", "and", "launch", "the", "task", ".", "If", "it", "takes", "too", "long", "try", "cancel", "the", "thread", "that", "does", "localization", ".", "If", "the", "thread", "cannot", "be", "terminated", "kill", "the", "JVM", ".", "The", "TaskTracker"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2698-L2738
118,799
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.notifyTTAboutTaskCompletion
private void notifyTTAboutTaskCompletion() { if (oobHeartbeatOnTaskCompletion) { synchronized (finishedCount) { int value = finishedCount.get(); finishedCount.set(value+1); finishedCount.notifyAll(); } } }
java
private void notifyTTAboutTaskCompletion() { if (oobHeartbeatOnTaskCompletion) { synchronized (finishedCount) { int value = finishedCount.get(); finishedCount.set(value+1); finishedCount.notifyAll(); } } }
[ "private", "void", "notifyTTAboutTaskCompletion", "(", ")", "{", "if", "(", "oobHeartbeatOnTaskCompletion", ")", "{", "synchronized", "(", "finishedCount", ")", "{", "int", "value", "=", "finishedCount", ".", "get", "(", ")", ";", "finishedCount", ".", "set", ...
Notify the tasktracker to send an out-of-band heartbeat.
[ "Notify", "the", "tasktracker", "to", "send", "an", "out", "-", "of", "-", "band", "heartbeat", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L2762-L2770