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,800
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getTask
public synchronized JvmTask getTask(JvmContext context) throws IOException { JVMId jvmId = context.jvmId; LOG.debug("JVM with ID : " + jvmId + " asked for a task"); // save pid of task JVM sent by child jvmManager.setPidToJvm(jvmId, context.pid); if (!jvmManager.isJvmKnown(jvmId)) { LOG.info...
java
public synchronized JvmTask getTask(JvmContext context) throws IOException { JVMId jvmId = context.jvmId; LOG.debug("JVM with ID : " + jvmId + " asked for a task"); // save pid of task JVM sent by child jvmManager.setPidToJvm(jvmId, context.pid); if (!jvmManager.isJvmKnown(jvmId)) { LOG.info...
[ "public", "synchronized", "JvmTask", "getTask", "(", "JvmContext", "context", ")", "throws", "IOException", "{", "JVMId", "jvmId", "=", "context", ".", "jvmId", ";", "LOG", ".", "debug", "(", "\"JVM with ID : \"", "+", "jvmId", "+", "\" asked for a task\"", ")",...
Called upon startup by the child process, to fetch Task data.
[ "Called", "upon", "startup", "by", "the", "child", "process", "to", "fetch", "Task", "data", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3571-L3610
118,801
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.statusUpdate
public synchronized boolean statusUpdate(TaskAttemptID taskid, TaskStatus taskStatus) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.reportProgress(taskStatus); myInstrumentation.statusUpdate(tip.getTask(), taskStat...
java
public synchronized boolean statusUpdate(TaskAttemptID taskid, TaskStatus taskStatus) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.reportProgress(taskStatus); myInstrumentation.statusUpdate(tip.getTask(), taskStat...
[ "public", "synchronized", "boolean", "statusUpdate", "(", "TaskAttemptID", "taskid", ",", "TaskStatus", "taskStatus", ")", "throws", "IOException", "{", "TaskInProgress", "tip", "=", "tasks", ".", "get", "(", "taskid", ")", ";", "if", "(", "tip", "!=", "null",...
Called periodically to report Task progress, from 0.0 to 1.0.
[ "Called", "periodically", "to", "report", "Task", "progress", "from", "0", ".", "0", "to", "1", ".", "0", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3615-L3629
118,802
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.reportDiagnosticInfo
public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, String info) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.reportDiagnosticInfo(info); } else { LOG.warn("Error from unknown child task: "+taskid+". Ignored."); } }
java
public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, String info) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.reportDiagnosticInfo(info); } else { LOG.warn("Error from unknown child task: "+taskid+". Ignored."); } }
[ "public", "synchronized", "void", "reportDiagnosticInfo", "(", "TaskAttemptID", "taskid", ",", "String", "info", ")", "throws", "IOException", "{", "TaskInProgress", "tip", "=", "tasks", ".", "get", "(", "taskid", ")", ";", "if", "(", "tip", "!=", "null", ")...
Called when the task dies before completion, and we want to report back diagnostic info
[ "Called", "when", "the", "task", "dies", "before", "completion", "and", "we", "want", "to", "report", "back", "diagnostic", "info" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3635-L3642
118,803
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.commitPending
public synchronized void commitPending(TaskAttemptID taskid, TaskStatus taskStatus) throws IOException { LOG.info("Task " + taskid + " is in commit-pending," +"" + " task state:" +taskStatus.getRunState()); statusUpdate(taskid, taskStatus); reportTaskF...
java
public synchronized void commitPending(TaskAttemptID taskid, TaskStatus taskStatus) throws IOException { LOG.info("Task " + taskid + " is in commit-pending," +"" + " task state:" +taskStatus.getRunState()); statusUpdate(taskid, taskStatus); reportTaskF...
[ "public", "synchronized", "void", "commitPending", "(", "TaskAttemptID", "taskid", ",", "TaskStatus", "taskStatus", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"Task \"", "+", "taskid", "+", "\" is in commit-pending,\"", "+", "\"\"", "+", "\" tas...
Task is reporting that it is in commit_pending and it is waiting for the commit Response
[ "Task", "is", "reporting", "that", "it", "is", "in", "commit_pending", "and", "it", "is", "waiting", "for", "the", "commit", "Response" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3664-L3671
118,804
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.done
public synchronized void done(TaskAttemptID taskid) throws IOException { TaskInProgress tip = tasks.get(taskid); commitResponses.remove(taskid); if (tip != null) { tip.reportDone(); } else { LOG.warn("Unknown child task done: "+taskid+". Ignored."); } }
java
public synchronized void done(TaskAttemptID taskid) throws IOException { TaskInProgress tip = tasks.get(taskid); commitResponses.remove(taskid); if (tip != null) { tip.reportDone(); } else { LOG.warn("Unknown child task done: "+taskid+". Ignored."); } }
[ "public", "synchronized", "void", "done", "(", "TaskAttemptID", "taskid", ")", "throws", "IOException", "{", "TaskInProgress", "tip", "=", "tasks", ".", "get", "(", "taskid", ")", ";", "commitResponses", ".", "remove", "(", "taskid", ")", ";", "if", "(", "...
The task is done.
[ "The", "task", "is", "done", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3683-L3692
118,805
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.shuffleError
public synchronized void shuffleError(TaskAttemptID taskId, String message) throws IOException { LOG.fatal("Task: " + taskId + " - Killed due to Shuffle Failure: " + message); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("Shuffle Error: " + message); ...
java
public synchronized void shuffleError(TaskAttemptID taskId, String message) throws IOException { LOG.fatal("Task: " + taskId + " - Killed due to Shuffle Failure: " + message); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("Shuffle Error: " + message); ...
[ "public", "synchronized", "void", "shuffleError", "(", "TaskAttemptID", "taskId", ",", "String", "message", ")", "throws", "IOException", "{", "LOG", ".", "fatal", "(", "\"Task: \"", "+", "taskId", "+", "\" - Killed due to Shuffle Failure: \"", "+", "message", ")", ...
A reduce-task failed to shuffle the map-outputs. Kill the task.
[ "A", "reduce", "-", "task", "failed", "to", "shuffle", "the", "map", "-", "outputs", ".", "Kill", "the", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3698-L3706
118,806
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.fsError
public synchronized void fsError(TaskAttemptID taskId, String message) throws IOException { LOG.fatal("Task: " + taskId + " - Killed due to FSError: " + message); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("FSError: " + message); purgeTask(tip, t...
java
public synchronized void fsError(TaskAttemptID taskId, String message) throws IOException { LOG.fatal("Task: " + taskId + " - Killed due to FSError: " + message); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("FSError: " + message); purgeTask(tip, t...
[ "public", "synchronized", "void", "fsError", "(", "TaskAttemptID", "taskId", ",", "String", "message", ")", "throws", "IOException", "{", "LOG", ".", "fatal", "(", "\"Task: \"", "+", "taskId", "+", "\" - Killed due to FSError: \"", "+", "message", ")", ";", "Tas...
A child task had a local filesystem error. Kill the task.
[ "A", "child", "task", "had", "a", "local", "filesystem", "error", ".", "Kill", "the", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3721-L3732
118,807
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.fatalError
public synchronized void fatalError(TaskAttemptID taskId, String msg) throws IOException { LOG.fatal("Task: " + taskId + " - Killed : " + msg); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("Error: " + msg); purgeTask(tip, true); } }
java
public synchronized void fatalError(TaskAttemptID taskId, String msg) throws IOException { LOG.fatal("Task: " + taskId + " - Killed : " + msg); TaskInProgress tip = runningTasks.get(taskId); if (tip != null) { tip.reportDiagnosticInfo("Error: " + msg); purgeTask(tip, true); } }
[ "public", "synchronized", "void", "fatalError", "(", "TaskAttemptID", "taskId", ",", "String", "msg", ")", "throws", "IOException", "{", "LOG", ".", "fatal", "(", "\"Task: \"", "+", "taskId", "+", "\" - Killed : \"", "+", "msg", ")", ";", "TaskInProgress", "ti...
A child task had a fatal error. Kill the task.
[ "A", "child", "task", "had", "a", "fatal", "error", ".", "Kill", "the", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3737-L3745
118,808
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.reportTaskFinished
void reportTaskFinished(TaskAttemptID taskid, boolean commitPending) { TaskInProgress tip; synchronized (this) { tip = tasks.get(taskid); } if (tip != null) { tip.reportTaskFinished(commitPending); } else { LOG.warn("Unknown child task finished: "+taskid+". Ignored."); } }
java
void reportTaskFinished(TaskAttemptID taskid, boolean commitPending) { TaskInProgress tip; synchronized (this) { tip = tasks.get(taskid); } if (tip != null) { tip.reportTaskFinished(commitPending); } else { LOG.warn("Unknown child task finished: "+taskid+". Ignored."); } }
[ "void", "reportTaskFinished", "(", "TaskAttemptID", "taskid", ",", "boolean", "commitPending", ")", "{", "TaskInProgress", "tip", ";", "synchronized", "(", "this", ")", "{", "tip", "=", "tasks", ".", "get", "(", "taskid", ")", ";", "}", "if", "(", "tip", ...
The task is no longer running. It may not have completed successfully
[ "The", "task", "is", "no", "longer", "running", ".", "It", "may", "not", "have", "completed", "successfully" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3772-L3782
118,809
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.mapOutputLost
public synchronized void mapOutputLost(TaskAttemptID taskid, String errorMsg) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.mapOutputLost(errorMsg); } else { LOG.warn("Unknown child with bad map output: "+taskid+". Ig...
java
public synchronized void mapOutputLost(TaskAttemptID taskid, String errorMsg) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.mapOutputLost(errorMsg); } else { LOG.warn("Unknown child with bad map output: "+taskid+". Ig...
[ "public", "synchronized", "void", "mapOutputLost", "(", "TaskAttemptID", "taskid", ",", "String", "errorMsg", ")", "throws", "IOException", "{", "TaskInProgress", "tip", "=", "tasks", ".", "get", "(", "taskid", ")", ";", "if", "(", "tip", "!=", "null", ")", ...
A completed map task's output has been lost.
[ "A", "completed", "map", "task", "s", "output", "has", "been", "lost", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3788-L3796
118,810
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getRunningTaskStatuses
synchronized List<TaskStatus> getRunningTaskStatuses() { List<TaskStatus> result = new ArrayList<TaskStatus>(runningTasks.size()); for(TaskInProgress tip: runningTasks.values()) { result.add(tip.getStatus()); } return result; }
java
synchronized List<TaskStatus> getRunningTaskStatuses() { List<TaskStatus> result = new ArrayList<TaskStatus>(runningTasks.size()); for(TaskInProgress tip: runningTasks.values()) { result.add(tip.getStatus()); } return result; }
[ "synchronized", "List", "<", "TaskStatus", ">", "getRunningTaskStatuses", "(", ")", "{", "List", "<", "TaskStatus", ">", "result", "=", "new", "ArrayList", "<", "TaskStatus", ">", "(", "runningTasks", ".", "size", "(", ")", ")", ";", "for", "(", "TaskInPro...
Get the list of tasks that will be reported back to the job tracker in the next heartbeat cycle. @return a copy of the list of TaskStatus objects
[ "Get", "the", "list", "of", "tasks", "that", "will", "be", "reported", "back", "to", "the", "job", "tracker", "in", "the", "next", "heartbeat", "cycle", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3891-L3897
118,811
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getNonRunningTasks
public synchronized List<TaskStatus> getNonRunningTasks() { List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size()); for(Map.Entry<TaskAttemptID, TaskInProgress> task: tasks.entrySet()) { if (!runningTasks.containsKey(task.getKey())) { result.add(task.getValue().getStatus()); } ...
java
public synchronized List<TaskStatus> getNonRunningTasks() { List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size()); for(Map.Entry<TaskAttemptID, TaskInProgress> task: tasks.entrySet()) { if (!runningTasks.containsKey(task.getKey())) { result.add(task.getValue().getStatus()); } ...
[ "public", "synchronized", "List", "<", "TaskStatus", ">", "getNonRunningTasks", "(", ")", "{", "List", "<", "TaskStatus", ">", "result", "=", "new", "ArrayList", "<", "TaskStatus", ">", "(", "tasks", ".", "size", "(", ")", ")", ";", "for", "(", "Map", ...
Get the list of stored tasks on this task tracker. @return
[ "Get", "the", "list", "of", "stored", "tasks", "on", "this", "task", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3903-L3911
118,812
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getTasksFromRunningJobs
synchronized List<TaskStatus> getTasksFromRunningJobs() { List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size()); for (Map.Entry <JobID, RunningJob> item : runningJobs.entrySet()) { RunningJob rjob = item.getValue(); synchronized (rjob) { for (TaskInProgress tip : rjob.tasks) { ...
java
synchronized List<TaskStatus> getTasksFromRunningJobs() { List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size()); for (Map.Entry <JobID, RunningJob> item : runningJobs.entrySet()) { RunningJob rjob = item.getValue(); synchronized (rjob) { for (TaskInProgress tip : rjob.tasks) { ...
[ "synchronized", "List", "<", "TaskStatus", ">", "getTasksFromRunningJobs", "(", ")", "{", "List", "<", "TaskStatus", ">", "result", "=", "new", "ArrayList", "<", "TaskStatus", ">", "(", "tasks", ".", "size", "(", ")", ")", ";", "for", "(", "Map", ".", ...
Get the list of tasks from running jobs on this task tracker. @return a copy of the list of TaskStatus objects
[ "Get", "the", "list", "of", "tasks", "from", "running", "jobs", "on", "this", "task", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3918-L3929
118,813
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getLocalFiles
Path[] getLocalFiles(JobConf conf, String subdir) throws IOException{ String[] localDirs = getLocalDirsFromConf(conf); Path[] paths = new Path[localDirs.length]; FileSystem localFs = FileSystem.getLocal(conf); for (int i = 0; i < localDirs.length; i++) { paths[i] = new Path(localDirs[i], subdir); ...
java
Path[] getLocalFiles(JobConf conf, String subdir) throws IOException{ String[] localDirs = getLocalDirsFromConf(conf); Path[] paths = new Path[localDirs.length]; FileSystem localFs = FileSystem.getLocal(conf); for (int i = 0; i < localDirs.length; i++) { paths[i] = new Path(localDirs[i], subdir); ...
[ "Path", "[", "]", "getLocalFiles", "(", "JobConf", "conf", ",", "String", "subdir", ")", "throws", "IOException", "{", "String", "[", "]", "localDirs", "=", "getLocalDirsFromConf", "(", "conf", ")", ";", "Path", "[", "]", "paths", "=", "new", "Path", "["...
get the full paths of the directory in all the local disks.
[ "get", "the", "full", "paths", "of", "the", "directory", "in", "all", "the", "local", "disks", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4200-L4209
118,814
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getLocalDirs
Path[] getLocalDirs() throws IOException{ String[] localDirs = getLocalDirsFromConf(fConf); Path[] paths = new Path[localDirs.length]; FileSystem localFs = FileSystem.getLocal(fConf); for (int i = 0; i < localDirs.length; i++) { paths[i] = new Path(localDirs[i]); paths[i] = paths[i].makeQual...
java
Path[] getLocalDirs() throws IOException{ String[] localDirs = getLocalDirsFromConf(fConf); Path[] paths = new Path[localDirs.length]; FileSystem localFs = FileSystem.getLocal(fConf); for (int i = 0; i < localDirs.length; i++) { paths[i] = new Path(localDirs[i]); paths[i] = paths[i].makeQual...
[ "Path", "[", "]", "getLocalDirs", "(", ")", "throws", "IOException", "{", "String", "[", "]", "localDirs", "=", "getLocalDirsFromConf", "(", "fConf", ")", ";", "Path", "[", "]", "paths", "=", "new", "Path", "[", "localDirs", ".", "length", "]", ";", "F...
get the paths in all the local disks.
[ "get", "the", "paths", "in", "all", "the", "local", "disks", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4212-L4221
118,815
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getAveMapSlotRefillMsecs
int getAveMapSlotRefillMsecs() { synchronized (mapSlotRefillMsecsQueue) { if (mapSlotRefillMsecsQueue.isEmpty()) { return -1; } int totalMapSlotRefillMsecs = 0; for (int refillMsecs : mapSlotRefillMsecsQueue) { totalMapSlotRefillMsecs += refillMsecs; } return tot...
java
int getAveMapSlotRefillMsecs() { synchronized (mapSlotRefillMsecsQueue) { if (mapSlotRefillMsecsQueue.isEmpty()) { return -1; } int totalMapSlotRefillMsecs = 0; for (int refillMsecs : mapSlotRefillMsecsQueue) { totalMapSlotRefillMsecs += refillMsecs; } return tot...
[ "int", "getAveMapSlotRefillMsecs", "(", ")", "{", "synchronized", "(", "mapSlotRefillMsecsQueue", ")", "{", "if", "(", "mapSlotRefillMsecsQueue", ".", "isEmpty", "(", ")", ")", "{", "return", "-", "1", ";", "}", "int", "totalMapSlotRefillMsecs", "=", "0", ";",...
Get the average time in milliseconds to refill a free map slot. This average is calculated on a rotating buffer. @return Average time in milliseconds to refill a free map slot. Return -1 if the value is not valid (hasn't actually refilled anything)
[ "Get", "the", "average", "time", "in", "milliseconds", "to", "refill", "a", "free", "map", "slot", ".", "This", "average", "is", "calculated", "on", "a", "rotating", "buffer", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4293-L4305
118,816
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.addAveMapSlotRefillMsecs
void addAveMapSlotRefillMsecs(int refillMsecs) { synchronized (mapSlotRefillMsecsQueue) { mapSlotRefillMsecsQueue.add(refillMsecs); if (mapSlotRefillMsecsQueue.size() >= maxRefillQueueSize) { mapSlotRefillMsecsQueue.remove(); } } }
java
void addAveMapSlotRefillMsecs(int refillMsecs) { synchronized (mapSlotRefillMsecsQueue) { mapSlotRefillMsecsQueue.add(refillMsecs); if (mapSlotRefillMsecsQueue.size() >= maxRefillQueueSize) { mapSlotRefillMsecsQueue.remove(); } } }
[ "void", "addAveMapSlotRefillMsecs", "(", "int", "refillMsecs", ")", "{", "synchronized", "(", "mapSlotRefillMsecsQueue", ")", "{", "mapSlotRefillMsecsQueue", ".", "add", "(", "refillMsecs", ")", ";", "if", "(", "mapSlotRefillMsecsQueue", ".", "size", "(", ")", ">=...
Add this new refill time for the map slot refill queue. Delete the oldest value if the maximum size has been met. @param refillMsecs Time to refill a map slot
[ "Add", "this", "new", "refill", "time", "for", "the", "map", "slot", "refill", "queue", ".", "Delete", "the", "oldest", "value", "if", "the", "maximum", "size", "has", "been", "met", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4313-L4320
118,817
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getAveReduceSlotRefillMsecs
int getAveReduceSlotRefillMsecs() { synchronized (reduceSlotRefillMsecsQueue) { if (reduceSlotRefillMsecsQueue.isEmpty()) { return -1; } int totalReduceSlotRefillMsecs = 0; for (int refillMsecs : reduceSlotRefillMsecsQueue) { totalReduceSlotRefillMsecs += refillMsecs; ...
java
int getAveReduceSlotRefillMsecs() { synchronized (reduceSlotRefillMsecsQueue) { if (reduceSlotRefillMsecsQueue.isEmpty()) { return -1; } int totalReduceSlotRefillMsecs = 0; for (int refillMsecs : reduceSlotRefillMsecsQueue) { totalReduceSlotRefillMsecs += refillMsecs; ...
[ "int", "getAveReduceSlotRefillMsecs", "(", ")", "{", "synchronized", "(", "reduceSlotRefillMsecsQueue", ")", "{", "if", "(", "reduceSlotRefillMsecsQueue", ".", "isEmpty", "(", ")", ")", "{", "return", "-", "1", ";", "}", "int", "totalReduceSlotRefillMsecs", "=", ...
Get the average time in milliseconds to refill a free reduce slot. This average is calculated on a rotating buffer. @return Average time in milliseconds to refill a free reduce slot. Return -1 if the value is not valid (hasn't actually refilled anything)
[ "Get", "the", "average", "time", "in", "milliseconds", "to", "refill", "a", "free", "reduce", "slot", ".", "This", "average", "is", "calculated", "on", "a", "rotating", "buffer", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4329-L4341
118,818
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.addAveReduceSlotRefillMsecs
void addAveReduceSlotRefillMsecs(int refillMsecs) { synchronized (reduceSlotRefillMsecsQueue) { reduceSlotRefillMsecsQueue.add(refillMsecs); if (reduceSlotRefillMsecsQueue.size() >= maxRefillQueueSize) { reduceSlotRefillMsecsQueue.remove(); } } }
java
void addAveReduceSlotRefillMsecs(int refillMsecs) { synchronized (reduceSlotRefillMsecsQueue) { reduceSlotRefillMsecsQueue.add(refillMsecs); if (reduceSlotRefillMsecsQueue.size() >= maxRefillQueueSize) { reduceSlotRefillMsecsQueue.remove(); } } }
[ "void", "addAveReduceSlotRefillMsecs", "(", "int", "refillMsecs", ")", "{", "synchronized", "(", "reduceSlotRefillMsecsQueue", ")", "{", "reduceSlotRefillMsecsQueue", ".", "add", "(", "refillMsecs", ")", ";", "if", "(", "reduceSlotRefillMsecsQueue", ".", "size", "(", ...
Add this new refill time for the reduce slot refill queue. Delete the oldest value if the maximum size has been met. @param refillMsecs Time to refill a reduce slot
[ "Add", "this", "new", "refill", "time", "for", "the", "reduce", "slot", "refill", "queue", ".", "Delete", "the", "oldest", "value", "if", "the", "maximum", "size", "has", "been", "met", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4349-L4356
118,819
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.initializeMemoryManagement
private void initializeMemoryManagement() { //handling @deprecated if (fConf.get(MAPRED_TASKTRACKER_VMEM_RESERVED_PROPERTY) != null) { LOG.warn( JobConf.deprecatedString( MAPRED_TASKTRACKER_VMEM_RESERVED_PROPERTY)); } //handling @deprecated if (fConf.get(MAPRED_TASKTRACKER_...
java
private void initializeMemoryManagement() { //handling @deprecated if (fConf.get(MAPRED_TASKTRACKER_VMEM_RESERVED_PROPERTY) != null) { LOG.warn( JobConf.deprecatedString( MAPRED_TASKTRACKER_VMEM_RESERVED_PROPERTY)); } //handling @deprecated if (fConf.get(MAPRED_TASKTRACKER_...
[ "private", "void", "initializeMemoryManagement", "(", ")", "{", "//handling @deprecated", "if", "(", "fConf", ".", "get", "(", "MAPRED_TASKTRACKER_VMEM_RESERVED_PROPERTY", ")", "!=", "null", ")", "{", "LOG", ".", "warn", "(", "JobConf", ".", "deprecatedString", "(...
Memory-related setup
[ "Memory", "-", "related", "setup" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4386-L4467
118,820
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.cleanUpOverMemoryTask
synchronized void cleanUpOverMemoryTask(TaskAttemptID tid, boolean wasFailure, String diagnosticMsg) { TaskInProgress tip = runningTasks.get(tid); if (tip != null) { tip.reportDiagnosticInfo(diagnosticMsg); try { purgeTask(tip, wasFailure); // Marking it as failed/killed. } catch...
java
synchronized void cleanUpOverMemoryTask(TaskAttemptID tid, boolean wasFailure, String diagnosticMsg) { TaskInProgress tip = runningTasks.get(tid); if (tip != null) { tip.reportDiagnosticInfo(diagnosticMsg); try { purgeTask(tip, wasFailure); // Marking it as failed/killed. } catch...
[ "synchronized", "void", "cleanUpOverMemoryTask", "(", "TaskAttemptID", "tid", ",", "boolean", "wasFailure", ",", "String", "diagnosticMsg", ")", "{", "TaskInProgress", "tip", "=", "runningTasks", ".", "get", "(", "tid", ")", ";", "if", "(", "tip", "!=", "null"...
Clean-up the task that TaskMemoryMangerThread requests to do so. @param tid @param wasFailure mark the task as failed or killed. 'failed' if true, 'killed' otherwise @param diagnosticMsg
[ "Clean", "-", "up", "the", "task", "that", "TaskMemoryMangerThread", "requests", "to", "do", "so", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4496-L4507
118,821
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getUserName
public String getUserName(TaskAttemptID taskId) { TaskInProgress tip = tasks.get(taskId); if (tip != null) { return tip.getJobConf().getUser(); } return null; }
java
public String getUserName(TaskAttemptID taskId) { TaskInProgress tip = tasks.get(taskId); if (tip != null) { return tip.getJobConf().getUser(); } return null; }
[ "public", "String", "getUserName", "(", "TaskAttemptID", "taskId", ")", "{", "TaskInProgress", "tip", "=", "tasks", ".", "get", "(", "taskId", ")", ";", "if", "(", "tip", "!=", "null", ")", "{", "return", "tip", ".", "getJobConf", "(", ")", ".", "getUs...
Obtain username from TaskId @param taskId @return username
[ "Obtain", "username", "from", "TaskId" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4543-L4549
118,822
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskTracker.java
TaskTracker.getMaxSlots
protected int getMaxSlots(JobConf conf, int numCpuOnTT, TaskType type) { int maxSlots; String cpuToSlots; if (type == TaskType.MAP) { maxSlots = conf.getInt("mapred.tasktracker.map.tasks.maximum", 2); cpuToSlots = conf.get("mapred.tasktracker.cpus.to.maptasks"); } else { maxSlots = con...
java
protected int getMaxSlots(JobConf conf, int numCpuOnTT, TaskType type) { int maxSlots; String cpuToSlots; if (type == TaskType.MAP) { maxSlots = conf.getInt("mapred.tasktracker.map.tasks.maximum", 2); cpuToSlots = conf.get("mapred.tasktracker.cpus.to.maptasks"); } else { maxSlots = con...
[ "protected", "int", "getMaxSlots", "(", "JobConf", "conf", ",", "int", "numCpuOnTT", ",", "TaskType", "type", ")", "{", "int", "maxSlots", ";", "String", "cpuToSlots", ";", "if", "(", "type", "==", "TaskType", ".", "MAP", ")", "{", "maxSlots", "=", "conf...
Obtain the max number of task slots based on the configuration and CPU
[ "Obtain", "the", "max", "number", "of", "task", "slots", "based", "on", "the", "configuration", "and", "CPU" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4554-L4582
118,823
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/BlockMover.java
BlockMover.chooseTargetNodes
public DatanodeInfo chooseTargetNodes(Set<DatanodeInfo> excludedNodes) throws IOException { DatanodeInfo target = cluster.getNodeOnDifferentRack(excludedNodes); if (target == null) { throw new IOException ("Error choose datanode"); } return target; }
java
public DatanodeInfo chooseTargetNodes(Set<DatanodeInfo> excludedNodes) throws IOException { DatanodeInfo target = cluster.getNodeOnDifferentRack(excludedNodes); if (target == null) { throw new IOException ("Error choose datanode"); } return target; }
[ "public", "DatanodeInfo", "chooseTargetNodes", "(", "Set", "<", "DatanodeInfo", ">", "excludedNodes", ")", "throws", "IOException", "{", "DatanodeInfo", "target", "=", "cluster", ".", "getNodeOnDifferentRack", "(", "excludedNodes", ")", ";", "if", "(", "target", "...
explicitly choose the target nodes. @throws IOException
[ "explicitly", "choose", "the", "target", "nodes", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockMover.java#L170-L177
118,824
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DatanodeBlockReader.java
DatanodeBlockReader.getChecksumInfo
protected void getChecksumInfo(long blockLength) { /* * If bytesPerChecksum is very large, then the metadata file is mostly * corrupted. For now just truncate bytesPerchecksum to blockLength. */ bytesPerChecksum = checksum.getBytesPerChecksum(); if (bytesPerChecksum > 10 * 1024 * 1024 && byte...
java
protected void getChecksumInfo(long blockLength) { /* * If bytesPerChecksum is very large, then the metadata file is mostly * corrupted. For now just truncate bytesPerchecksum to blockLength. */ bytesPerChecksum = checksum.getBytesPerChecksum(); if (bytesPerChecksum > 10 * 1024 * 1024 && byte...
[ "protected", "void", "getChecksumInfo", "(", "long", "blockLength", ")", "{", "/*\n * If bytesPerChecksum is very large, then the metadata file is mostly\n * corrupted. For now just truncate bytesPerchecksum to blockLength.\n */", "bytesPerChecksum", "=", "checksum", ".", "getB...
Populate bytes per checksum and checksum size information from local checksum object. @param blockLength
[ "Populate", "bytes", "per", "checksum", "and", "checksum", "size", "information", "from", "local", "checksum", "object", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DatanodeBlockReader.java#L163-L175
118,825
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.contains
@SuppressWarnings("unchecked") public boolean contains(final Object key) { // validate key if (key == null) { throw new IllegalArgumentException("Null element is not supported."); } // find element final int hashCode = ((T)key).hashCode(); final int index = getIndex(hashCode); return...
java
@SuppressWarnings("unchecked") public boolean contains(final Object key) { // validate key if (key == null) { throw new IllegalArgumentException("Null element is not supported."); } // find element final int hashCode = ((T)key).hashCode(); final int index = getIndex(hashCode); return...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "boolean", "contains", "(", "final", "Object", "key", ")", "{", "// validate key", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null element is not suppo...
Check if the set contains given element @return true if element present, false otherwise.
[ "Check", "if", "the", "set", "contains", "given", "element" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L176-L186
118,826
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.containsElem
protected boolean containsElem(int index, final T key, int hashCode) { for (LinkedElement<T> e = entries[index]; e != null; e = e.next) { // element found if (hashCode == e.hashCode && e.element.equals(key)) { return true; } } // element not found return false; }
java
protected boolean containsElem(int index, final T key, int hashCode) { for (LinkedElement<T> e = entries[index]; e != null; e = e.next) { // element found if (hashCode == e.hashCode && e.element.equals(key)) { return true; } } // element not found return false; }
[ "protected", "boolean", "containsElem", "(", "int", "index", ",", "final", "T", "key", ",", "int", "hashCode", ")", "{", "for", "(", "LinkedElement", "<", "T", ">", "e", "=", "entries", "[", "index", "]", ";", "e", "!=", "null", ";", "e", "=", "e",...
Check if the set contains given element at given index. @return true if element present, false otherwise.
[ "Check", "if", "the", "set", "contains", "given", "element", "at", "given", "index", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L193-L202
118,827
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.addAll
public boolean addAll(Collection<? extends T> toAdd) { boolean changed = false; for (T elem : toAdd) { changed |= addElem(elem); } expandIfNecessary(); return changed; }
java
public boolean addAll(Collection<? extends T> toAdd) { boolean changed = false; for (T elem : toAdd) { changed |= addElem(elem); } expandIfNecessary(); return changed; }
[ "public", "boolean", "addAll", "(", "Collection", "<", "?", "extends", "T", ">", "toAdd", ")", "{", "boolean", "changed", "=", "false", ";", "for", "(", "T", "elem", ":", "toAdd", ")", "{", "changed", "|=", "addElem", "(", "elem", ")", ";", "}", "e...
All all elements in the collection. Expand if necessary. @param toAdd - elements to add. @return
[ "All", "all", "elements", "in", "the", "collection", ".", "Expand", "if", "necessary", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L211-L218
118,828
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.remove
@SuppressWarnings("unchecked") public boolean remove(final Object key) { // validate key if (key == null) { throw new IllegalArgumentException("Null element is not supported."); } LinkedElement<T> removed = removeElem((T) key); shrinkIfNecessary(); return removed == null ? false : true; ...
java
@SuppressWarnings("unchecked") public boolean remove(final Object key) { // validate key if (key == null) { throw new IllegalArgumentException("Null element is not supported."); } LinkedElement<T> removed = removeElem((T) key); shrinkIfNecessary(); return removed == null ? false : true; ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "boolean", "remove", "(", "final", "Object", "key", ")", "{", "// validate key", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null element is not support...
Remove the element corresponding to the key. @return If such element exists, return true. Otherwise, return false.
[ "Remove", "the", "element", "corresponding", "to", "the", "key", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L264-L273
118,829
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.pollAll
public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); for (int i = 0; i < entries.length; i++) { LinkedElement<T> current = entries[i]; while (current != null) { retList.add(current.element); current = current.next; } } this.clear(); return retList; ...
java
public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); for (int i = 0; i < entries.length; i++) { LinkedElement<T> current = entries[i]; while (current != null) { retList.add(current.element); current = current.next; } } this.clear(); return retList; ...
[ "public", "List", "<", "T", ">", "pollAll", "(", ")", "{", "List", "<", "T", ">", "retList", "=", "new", "ArrayList", "<", "T", ">", "(", "size", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entries", ".", "length", ";", "i", ...
Remove all elements from the set and return them. Clear the entries.
[ "Remove", "all", "elements", "from", "the", "set", "and", "return", "them", ".", "Clear", "the", "entries", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L353-L364
118,830
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.pollToArray
@SuppressWarnings("unchecked") public T[] pollToArray(T[] array) { int currentIndex = 0; LinkedElement<T> current = null; if (array.length == 0) { return array; } if (array.length > size) { array = (T[]) java.lang.reflect.Array.newInstance(array.getClass() .getComponentType(...
java
@SuppressWarnings("unchecked") public T[] pollToArray(T[] array) { int currentIndex = 0; LinkedElement<T> current = null; if (array.length == 0) { return array; } if (array.length > size) { array = (T[]) java.lang.reflect.Array.newInstance(array.getClass() .getComponentType(...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "[", "]", "pollToArray", "(", "T", "[", "]", "array", ")", "{", "int", "currentIndex", "=", "0", ";", "LinkedElement", "<", "T", ">", "current", "=", "null", ";", "if", "(", "array", ...
Get array.length elements from the set, and put them into the array.
[ "Get", "array", ".", "length", "elements", "from", "the", "set", "and", "put", "them", "into", "the", "array", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L369-L414
118,831
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.computeCapacity
private int computeCapacity(int initial) { if (initial < MINIMUM_CAPACITY) { return MINIMUM_CAPACITY; } if (initial > MAXIMUM_CAPACITY) { return MAXIMUM_CAPACITY; } int capacity = 1; while (capacity < initial) { capacity <<= 1; } return capacity; }
java
private int computeCapacity(int initial) { if (initial < MINIMUM_CAPACITY) { return MINIMUM_CAPACITY; } if (initial > MAXIMUM_CAPACITY) { return MAXIMUM_CAPACITY; } int capacity = 1; while (capacity < initial) { capacity <<= 1; } return capacity; }
[ "private", "int", "computeCapacity", "(", "int", "initial", ")", "{", "if", "(", "initial", "<", "MINIMUM_CAPACITY", ")", "{", "return", "MINIMUM_CAPACITY", ";", "}", "if", "(", "initial", ">", "MAXIMUM_CAPACITY", ")", "{", "return", "MAXIMUM_CAPACITY", ";", ...
Compute capacity given initial capacity. @return final capacity, either MIN_CAPACITY, MAX_CAPACITY, or power of 2 closest to the requested capacity.
[ "Compute", "capacity", "given", "initial", "capacity", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L422-L434
118,832
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.resize
@SuppressWarnings("unchecked") private void resize(int cap) { int newCapacity = computeCapacity(cap); if (newCapacity == this.capacity) { return; } this.capacity = newCapacity; this.expandThreshold = (int) (capacity * maxLoadFactor); this.shrinkThreshold = (int) (capacity * minLoadFactor...
java
@SuppressWarnings("unchecked") private void resize(int cap) { int newCapacity = computeCapacity(cap); if (newCapacity == this.capacity) { return; } this.capacity = newCapacity; this.expandThreshold = (int) (capacity * maxLoadFactor); this.shrinkThreshold = (int) (capacity * minLoadFactor...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "resize", "(", "int", "cap", ")", "{", "int", "newCapacity", "=", "computeCapacity", "(", "cap", ")", ";", "if", "(", "newCapacity", "==", "this", ".", "capacity", ")", "{", "return", ...
Resize the internal table to given capacity.
[ "Resize", "the", "internal", "table", "to", "given", "capacity", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L439-L461
118,833
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java
LightWeightHashSet.clear
@SuppressWarnings("unchecked") public void clear() { this.capacity = this.initialCapacity; this.hash_mask = capacity - 1; this.expandThreshold = (int) (capacity * maxLoadFactor); this.shrinkThreshold = (int) (capacity * minLoadFactor); entries = new LinkedElement[capacity]; size = 0; mod...
java
@SuppressWarnings("unchecked") public void clear() { this.capacity = this.initialCapacity; this.hash_mask = capacity - 1; this.expandThreshold = (int) (capacity * maxLoadFactor); this.shrinkThreshold = (int) (capacity * minLoadFactor); entries = new LinkedElement[capacity]; size = 0; mod...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "clear", "(", ")", "{", "this", ".", "capacity", "=", "this", ".", "initialCapacity", ";", "this", ".", "hash_mask", "=", "capacity", "-", "1", ";", "this", ".", "expandThreshold", "=", ...
Clear the set. Resize it to the original capacity.
[ "Clear", "the", "set", ".", "Resize", "it", "to", "the", "original", "capacity", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightHashSet.java#L552-L563
118,834
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
EagerTaskInitializationListener.resortInitQueue
private synchronized void resortInitQueue() { Comparator<JobInProgress> comp = new Comparator<JobInProgress>() { public int compare(JobInProgress o1, JobInProgress o2) { int res = o1.getPriority().compareTo(o2.getPriority()); if(res == 0) { if(o1.getStartTime() < o2.getStartTime()) ...
java
private synchronized void resortInitQueue() { Comparator<JobInProgress> comp = new Comparator<JobInProgress>() { public int compare(JobInProgress o1, JobInProgress o2) { int res = o1.getPriority().compareTo(o2.getPriority()); if(res == 0) { if(o1.getStartTime() < o2.getStartTime()) ...
[ "private", "synchronized", "void", "resortInitQueue", "(", ")", "{", "Comparator", "<", "JobInProgress", ">", "comp", "=", "new", "Comparator", "<", "JobInProgress", ">", "(", ")", "{", "public", "int", "compare", "(", "JobInProgress", "o1", ",", "JobInProgres...
Sort jobs by priority and then by start time.
[ "Sort", "jobs", "by", "priority", "and", "then", "by", "start", "time", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java#L135-L153
118,835
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
EagerTaskInitializationListener.jobStateChanged
private void jobStateChanged(JobStatusChangeEvent event) { // Resort the job queue if the job-start-time or job-priority changes if (event.getEventType() == EventType.START_TIME_CHANGED || event.getEventType() == EventType.PRIORITY_CHANGED) { synchronized (jobInitQueue) { resortInitQueue()...
java
private void jobStateChanged(JobStatusChangeEvent event) { // Resort the job queue if the job-start-time or job-priority changes if (event.getEventType() == EventType.START_TIME_CHANGED || event.getEventType() == EventType.PRIORITY_CHANGED) { synchronized (jobInitQueue) { resortInitQueue()...
[ "private", "void", "jobStateChanged", "(", "JobStatusChangeEvent", "event", ")", "{", "// Resort the job queue if the job-start-time or job-priority changes", "if", "(", "event", ".", "getEventType", "(", ")", "==", "EventType", ".", "START_TIME_CHANGED", "||", "event", "...
called when the job's status is changed
[ "called", "when", "the", "job", "s", "status", "is", "changed" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java#L170-L178
118,836
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.readStartObjectToken
public static void readStartObjectToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.START_OBJECT); }
java
public static void readStartObjectToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.START_OBJECT); }
[ "public", "static", "void", "readStartObjectToken", "(", "JsonParser", "jsonParser", ",", "String", "parentFieldName", ")", "throws", "IOException", "{", "readToken", "(", "jsonParser", ",", "parentFieldName", ",", "JsonToken", ".", "START_OBJECT", ")", ";", "}" ]
This is a helper method that reads a JSON token using a JsonParser instance, and throws an exception if the next token is not START_OBJECT. @param jsonParser The JsonParser instance to be used @param parentFieldName The name of the field @throws IOException
[ "This", "is", "a", "helper", "method", "that", "reads", "a", "JSON", "token", "using", "a", "JsonParser", "instance", "and", "throws", "an", "exception", "if", "the", "next", "token", "is", "not", "START_OBJECT", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L48-L52
118,837
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.readStartArrayToken
public static void readStartArrayToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.START_ARRAY); }
java
public static void readStartArrayToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.START_ARRAY); }
[ "public", "static", "void", "readStartArrayToken", "(", "JsonParser", "jsonParser", ",", "String", "parentFieldName", ")", "throws", "IOException", "{", "readToken", "(", "jsonParser", ",", "parentFieldName", ",", "JsonToken", ".", "START_ARRAY", ")", ";", "}" ]
This is a helper method that reads a JSON token using a JsonParser instance, and throws an exception if the next token is not START_ARRAY. @param jsonParser The JsonParser instance to be used @param parentFieldName The name of the field @throws IOException
[ "This", "is", "a", "helper", "method", "that", "reads", "a", "JSON", "token", "using", "a", "JsonParser", "instance", "and", "throws", "an", "exception", "if", "the", "next", "token", "is", "not", "START_ARRAY", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L62-L66
118,838
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.readEndObjectToken
public static void readEndObjectToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.END_OBJECT); }
java
public static void readEndObjectToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.END_OBJECT); }
[ "public", "static", "void", "readEndObjectToken", "(", "JsonParser", "jsonParser", ",", "String", "parentFieldName", ")", "throws", "IOException", "{", "readToken", "(", "jsonParser", ",", "parentFieldName", ",", "JsonToken", ".", "END_OBJECT", ")", ";", "}" ]
This is a helper method that reads a JSON token using a JsonParser instance, and throws an exception if the next token is not END_OBJECT. @param jsonParser The JsonParser instance to be used @param parentFieldName The name of the field @throws IOException
[ "This", "is", "a", "helper", "method", "that", "reads", "a", "JSON", "token", "using", "a", "JsonParser", "instance", "and", "throws", "an", "exception", "if", "the", "next", "token", "is", "not", "END_OBJECT", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L76-L80
118,839
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.readEndArrayToken
public static void readEndArrayToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.END_ARRAY); }
java
public static void readEndArrayToken(JsonParser jsonParser, String parentFieldName) throws IOException { readToken(jsonParser, parentFieldName, JsonToken.END_ARRAY); }
[ "public", "static", "void", "readEndArrayToken", "(", "JsonParser", "jsonParser", ",", "String", "parentFieldName", ")", "throws", "IOException", "{", "readToken", "(", "jsonParser", ",", "parentFieldName", ",", "JsonToken", ".", "END_ARRAY", ")", ";", "}" ]
This is a helper method that reads a JSON token using a JsonParser instance, and throws an exception if the next token is not END_ARRAY. @param jsonParser The JsonParser instance to be used @param parentFieldName The name of the field @throws IOException
[ "This", "is", "a", "helper", "method", "that", "reads", "a", "JSON", "token", "using", "a", "JsonParser", "instance", "and", "throws", "an", "exception", "if", "the", "next", "token", "is", "not", "END_ARRAY", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L90-L94
118,840
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.createJsonGenerator
public static JsonGenerator createJsonGenerator(CoronaConf conf) throws IOException { OutputStream outputStream = new FileOutputStream(conf.getCMStateFile()); if (conf.getCMCompressStateFlag()) { outputStream = new GZIPOutputStream(outputStream); } ObjectMapper mapper = new ObjectMapper(); ...
java
public static JsonGenerator createJsonGenerator(CoronaConf conf) throws IOException { OutputStream outputStream = new FileOutputStream(conf.getCMStateFile()); if (conf.getCMCompressStateFlag()) { outputStream = new GZIPOutputStream(outputStream); } ObjectMapper mapper = new ObjectMapper(); ...
[ "public", "static", "JsonGenerator", "createJsonGenerator", "(", "CoronaConf", "conf", ")", "throws", "IOException", "{", "OutputStream", "outputStream", "=", "new", "FileOutputStream", "(", "conf", ".", "getCMStateFile", "(", ")", ")", ";", "if", "(", "conf", "...
This is a helper method which creates a JsonGenerator instance, for writing the state of the ClusterManager to the state file. The JsonGenerator instance writes to a compressed file if we have the compression flag turned on. @param conf The CoronaConf instance to be used @return The JsonGenerator instance to be used @...
[ "This", "is", "a", "helper", "method", "which", "creates", "a", "JsonGenerator", "instance", "for", "writing", "the", "state", "of", "the", "ClusterManager", "to", "the", "state", "file", ".", "The", "JsonGenerator", "instance", "writes", "to", "a", "compresse...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L130-L144
118,841
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.createJsonParser
public static JsonParser createJsonParser(CoronaConf conf) throws IOException { InputStream inputStream = new FileInputStream(conf.getCMStateFile()); if (conf.getCMCompressStateFlag()) { inputStream = new GZIPInputStream(inputStream); } ObjectMapper mapper = new ObjectMapper(); mapper.conf...
java
public static JsonParser createJsonParser(CoronaConf conf) throws IOException { InputStream inputStream = new FileInputStream(conf.getCMStateFile()); if (conf.getCMCompressStateFlag()) { inputStream = new GZIPInputStream(inputStream); } ObjectMapper mapper = new ObjectMapper(); mapper.conf...
[ "public", "static", "JsonParser", "createJsonParser", "(", "CoronaConf", "conf", ")", "throws", "IOException", "{", "InputStream", "inputStream", "=", "new", "FileInputStream", "(", "conf", ".", "getCMStateFile", "(", ")", ")", ";", "if", "(", "conf", ".", "ge...
This is a helper method which creates a JsonParser instance, for reading back the state of the ClusterManager from the state file. The JsonParser instance reads from a compressed file if we have the compression flag turned on. @param conf The CoronaConf instance to be used @return The JsonParser instance to be used @t...
[ "This", "is", "a", "helper", "method", "which", "creates", "a", "JsonParser", "instance", "for", "reading", "back", "the", "state", "of", "the", "ClusterManager", "from", "the", "state", "file", ".", "The", "JsonParser", "instance", "reads", "from", "a", "co...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L156-L168
118,842
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java
JsonUtils.readField
public static void readField(JsonParser jsonParser, String expectedFieldName) throws IOException { readToken(jsonParser, expectedFieldName, JsonToken.FIELD_NAME); String fieldName = jsonParser.getCurrentName(); if (!fieldName.equals(expectedFieldName)) { foundUnknownFiel...
java
public static void readField(JsonParser jsonParser, String expectedFieldName) throws IOException { readToken(jsonParser, expectedFieldName, JsonToken.FIELD_NAME); String fieldName = jsonParser.getCurrentName(); if (!fieldName.equals(expectedFieldName)) { foundUnknownFiel...
[ "public", "static", "void", "readField", "(", "JsonParser", "jsonParser", ",", "String", "expectedFieldName", ")", "throws", "IOException", "{", "readToken", "(", "jsonParser", ",", "expectedFieldName", ",", "JsonToken", ".", "FIELD_NAME", ")", ";", "String", "fie...
The method reads a field from the JSON stream, and checks if the field read is the same as the expect field. @param jsonParser The JsonParser instance to be used @param expectedFieldName The field name which is expected next @throws IOException
[ "The", "method", "reads", "a", "field", "from", "the", "JSON", "stream", "and", "checks", "if", "the", "field", "read", "is", "the", "same", "as", "the", "expect", "field", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/util/JsonUtils.java#L193-L200
118,843
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.replaceChild
void replaceChild(INode newChild) { if ( children == null ) { throw new IllegalArgumentException("The directory is empty"); } int low = Collections.binarySearch(children, newChild.name); if (low>=0) { // an old child exists so replace by the newChild INode oldChild = children.get(low); ...
java
void replaceChild(INode newChild) { if ( children == null ) { throw new IllegalArgumentException("The directory is empty"); } int low = Collections.binarySearch(children, newChild.name); if (low>=0) { // an old child exists so replace by the newChild INode oldChild = children.get(low); ...
[ "void", "replaceChild", "(", "INode", "newChild", ")", "{", "if", "(", "children", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The directory is empty\"", ")", ";", "}", "int", "low", "=", "Collections", ".", "binarySearch", "(",...
Replace a child that has the same name as newChild by newChild. This is only working on one child case @param newChild Child node to be added
[ "Replace", "a", "child", "that", "has", "the", "same", "name", "as", "newChild", "by", "newChild", ".", "This", "is", "only", "working", "on", "one", "child", "case" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L97-L125
118,844
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.getExistingPathINodes
public INode[] getExistingPathINodes(String path) { byte[][] components = getPathComponents(path); INode[] inodes = new INode[components.length]; this.getExistingPathINodes(components, inodes); return inodes; }
java
public INode[] getExistingPathINodes(String path) { byte[][] components = getPathComponents(path); INode[] inodes = new INode[components.length]; this.getExistingPathINodes(components, inodes); return inodes; }
[ "public", "INode", "[", "]", "getExistingPathINodes", "(", "String", "path", ")", "{", "byte", "[", "]", "[", "]", "components", "=", "getPathComponents", "(", "path", ")", ";", "INode", "[", "]", "inodes", "=", "new", "INode", "[", "components", ".", ...
Retrieve the existing INodes along the given path. The first INode always exist and is this INode. @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 expecte...
[ "Retrieve", "the", "existing", "INodes", "along", "the", "given", "path", ".", "The", "first", "INode", "always", "exist", "and", "is", "this", "INode", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L230-L237
118,845
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.nextChild
int nextChild(byte[] name) { if (name.length == 0) { // empty name return 0; } int nextPos = Collections.binarySearch(children, name) + 1; if (nextPos >= 0) { // the name is in the list of children return nextPos; } return -nextPos; // insert point }
java
int nextChild(byte[] name) { if (name.length == 0) { // empty name return 0; } int nextPos = Collections.binarySearch(children, name) + 1; if (nextPos >= 0) { // the name is in the list of children return nextPos; } return -nextPos; // insert point }
[ "int", "nextChild", "(", "byte", "[", "]", "name", ")", "{", "if", "(", "name", ".", "length", "==", "0", ")", "{", "// empty name", "return", "0", ";", "}", "int", "nextPos", "=", "Collections", ".", "binarySearch", "(", "children", ",", "name", ")"...
Search all children for the first child whose name is greater than the given name. If the given name is one of children's name, the next child's index is returned; Otherwise, return the insertion point: the index of the first child whose name's greater than the given name. @param name a name @return the index of the ...
[ "Search", "all", "children", "for", "the", "first", "child", "whose", "name", "is", "greater", "than", "the", "given", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L313-L322
118,846
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.addNode
<T extends INode> T addNode(String path, T newNode, boolean inheritPermission ) throws FileNotFoundException { byte[][] pathComponents = getPathComponents(path); if(addToParent(pathComponents, newNode, inheritPermission, true) == null) return null; return newNode; }
java
<T extends INode> T addNode(String path, T newNode, boolean inheritPermission ) throws FileNotFoundException { byte[][] pathComponents = getPathComponents(path); if(addToParent(pathComponents, newNode, inheritPermission, true) == null) return null; return newNode; }
[ "<", "T", "extends", "INode", ">", "T", "addNode", "(", "String", "path", ",", "T", "newNode", ",", "boolean", "inheritPermission", ")", "throws", "FileNotFoundException", "{", "byte", "[", "]", "[", "]", "pathComponents", "=", "getPathComponents", "(", "pat...
Add new INode to the file tree. Find the parent and insert @param path file path @param newNode INode to be added @param inheritPermission If true, copy the parent's permission to newNode. @return null if the node already exists; inserted INode, otherwise @throws FileNotFoundException if parent does not exist or is no...
[ "Add", "new", "INode", "to", "the", "file", "tree", ".", "Find", "the", "parent", "and", "insert" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L342-L348
118,847
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.computeContentSummary
private long[] computeContentSummary(long[] summary, Set<Long> visitedCtx) { if (children != null) { for (INode child : children) { if (child.isDirectory()) { // Process the directory with the visited hard link context ((INodeDirectory)child).computeContentSummary(summary, visi...
java
private long[] computeContentSummary(long[] summary, Set<Long> visitedCtx) { if (children != null) { for (INode child : children) { if (child.isDirectory()) { // Process the directory with the visited hard link context ((INodeDirectory)child).computeContentSummary(summary, visi...
[ "private", "long", "[", "]", "computeContentSummary", "(", "long", "[", "]", "summary", ",", "Set", "<", "Long", ">", "visitedCtx", ")", "{", "if", "(", "children", "!=", "null", ")", "{", "for", "(", "INode", "child", ":", "children", ")", "{", "if"...
Compute the content summary and skip calculating the visited hard link file.
[ "Compute", "the", "content", "summary", "and", "skip", "calculating", "the", "visited", "hard", "link", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L459-L490
118,848
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
INodeDirectory.countItems
public void countItems() { itemCounts = new ItemCounts(); itemCounts.startTime = System.currentTimeMillis(); itemCounts.numDirectories = 1; // count the current directory itemCounts.numFiles = 0; itemCounts.numBlocks = 0; if (children != null) { for (INode child : children) { count...
java
public void countItems() { itemCounts = new ItemCounts(); itemCounts.startTime = System.currentTimeMillis(); itemCounts.numDirectories = 1; // count the current directory itemCounts.numFiles = 0; itemCounts.numBlocks = 0; if (children != null) { for (INode child : children) { count...
[ "public", "void", "countItems", "(", ")", "{", "itemCounts", "=", "new", "ItemCounts", "(", ")", ";", "itemCounts", ".", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "itemCounts", ".", "numDirectories", "=", "1", ";", "// count the cu...
Count items under the current directory
[ "Count", "items", "under", "the", "current", "directory" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java#L572-L584
118,849
facebookarchive/hadoop-20
src/examples/org/apache/hadoop/examples/dancing/Sudoku.java
Sudoku.stringifySolution
static String stringifySolution(int size, List<List<ColumnName>> solution) { int[][] picture = new int[size][size]; StringBuffer result = new StringBuffer(); // go through the rows selected in the model and build a picture of the // solution. for(List<ColumnName> row: solution) { int x = -1; ...
java
static String stringifySolution(int size, List<List<ColumnName>> solution) { int[][] picture = new int[size][size]; StringBuffer result = new StringBuffer(); // go through the rows selected in the model and build a picture of the // solution. for(List<ColumnName> row: solution) { int x = -1; ...
[ "static", "String", "stringifySolution", "(", "int", "size", ",", "List", "<", "List", "<", "ColumnName", ">", ">", "solution", ")", "{", "int", "[", "]", "[", "]", "picture", "=", "new", "int", "[", "size", "]", "[", "size", "]", ";", "StringBuffer"...
A string containing a representation of the solution. @param size the size of the board @param solution a list of list of column names @return a string of the solution matrix
[ "A", "string", "containing", "a", "representation", "of", "the", "solution", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/examples/org/apache/hadoop/examples/dancing/Sudoku.java#L65-L93
118,850
facebookarchive/hadoop-20
src/examples/org/apache/hadoop/examples/dancing/Sudoku.java
Sudoku.generateRow
private boolean[] generateRow(boolean[] rowValues, int x, int y, int num) { // clear the scratch array for(int i=0; i < rowValues.length; ++i) { rowValues[i] = false; } // find the square coordinates int xBox = (int) x / squareXSize; int yBox = (int) y / squareYSize; // mark the column...
java
private boolean[] generateRow(boolean[] rowValues, int x, int y, int num) { // clear the scratch array for(int i=0; i < rowValues.length; ++i) { rowValues[i] = false; } // find the square coordinates int xBox = (int) x / squareXSize; int yBox = (int) y / squareYSize; // mark the column...
[ "private", "boolean", "[", "]", "generateRow", "(", "boolean", "[", "]", "rowValues", ",", "int", "x", ",", "int", "y", ",", "int", "num", ")", "{", "// clear the scratch array", "for", "(", "int", "i", "=", "0", ";", "i", "<", "rowValues", ".", "len...
Create a row that places num in cell x, y. @param rowValues a scratch pad to mark the bits needed @param x the horizontal offset of the cell @param y the vertical offset of the cell @param num the number to place @return a bitvector of the columns selected
[ "Create", "a", "row", "that", "places", "num", "in", "cell", "x", "y", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/examples/org/apache/hadoop/examples/dancing/Sudoku.java#L233-L250
118,851
facebookarchive/hadoop-20
src/examples/org/apache/hadoop/examples/dancing/Sudoku.java
Sudoku.main
public static void main(String[] args) throws IOException { if (args.length == 0) { System.out.println("Include a puzzle on the command line."); } for(int i=0; i < args.length; ++i) { Sudoku problem = new Sudoku(new FileInputStream(args[i])); System.out.println("Solving " + args[i]); ...
java
public static void main(String[] args) throws IOException { if (args.length == 0) { System.out.println("Include a puzzle on the command line."); } for(int i=0; i < args.length; ++i) { Sudoku problem = new Sudoku(new FileInputStream(args[i])); System.out.println("Solving " + args[i]); ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "IOException", "{", "if", "(", "args", ".", "length", "==", "0", ")", "{", "System", ".", "out", ".", "println", "(", "\"Include a puzzle on the command line.\"", ")", ";",...
Solves a set of sudoku puzzles. @param args a list of puzzle filenames to solve
[ "Solves", "a", "set", "of", "sudoku", "puzzles", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/examples/org/apache/hadoop/examples/dancing/Sudoku.java#L307-L316
118,852
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java
KosmosFileSystem.delete
public boolean delete(Path path, boolean recursive) throws IOException { Path absolute = makeAbsolute(path); String srep = absolute.toUri().getPath(); if (kfsImpl.isFile(srep)) return kfsImpl.remove(srep) == 0; FileStatus[] dirEntries = listStatus(absolute); if ((!recursive) && (d...
java
public boolean delete(Path path, boolean recursive) throws IOException { Path absolute = makeAbsolute(path); String srep = absolute.toUri().getPath(); if (kfsImpl.isFile(srep)) return kfsImpl.remove(srep) == 0; FileStatus[] dirEntries = listStatus(absolute); if ((!recursive) && (d...
[ "public", "boolean", "delete", "(", "Path", "path", ",", "boolean", "recursive", ")", "throws", "IOException", "{", "Path", "absolute", "=", "makeAbsolute", "(", "path", ")", ";", "String", "srep", "=", "absolute", ".", "toUri", "(", ")", ".", "getPath", ...
recursively delete the directory and its contents
[ "recursively", "delete", "the", "directory", "and", "its", "contents" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java#L220-L238
118,853
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java
KosmosFileSystem.getFileBlockLocations
@Override public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { if (file == null) { return null; } String srep = makeAbsolute(file.getPath()).toUri().getPath(); String[][] hints = kfsImpl.getDataLocation(srep, start, len); ...
java
@Override public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { if (file == null) { return null; } String srep = makeAbsolute(file.getPath()).toUri().getPath(); String[][] hints = kfsImpl.getDataLocation(srep, start, len); ...
[ "@", "Override", "public", "BlockLocation", "[", "]", "getFileBlockLocations", "(", "FileStatus", "file", ",", "long", "start", ",", "long", "len", ")", "throws", "IOException", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", ...
Return null if the file doesn't exist; otherwise, get the locations of the various chunks of the file file from KFS.
[ "Return", "null", "if", "the", "file", "doesn", "t", "exist", ";", "otherwise", "get", "the", "locations", "of", "the", "various", "chunks", "of", "the", "file", "file", "from", "KFS", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java#L293-L316
118,854
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
INodeDirectoryWithQuota.verifyQuota
void verifyQuota(long nsDelta, long dsDelta) throws QuotaExceededException { long newCount = nsCount + nsDelta; long newDiskspace = diskspace + dsDelta; if (nsDelta>0 || dsDelta>0) { if (nsQuota >= 0 && nsQuota < newCount) { throw new NSQuotaExceededException(nsQuota, newCount); } ...
java
void verifyQuota(long nsDelta, long dsDelta) throws QuotaExceededException { long newCount = nsCount + nsDelta; long newDiskspace = diskspace + dsDelta; if (nsDelta>0 || dsDelta>0) { if (nsQuota >= 0 && nsQuota < newCount) { throw new NSQuotaExceededException(nsQuota, newCount); } ...
[ "void", "verifyQuota", "(", "long", "nsDelta", ",", "long", "dsDelta", ")", "throws", "QuotaExceededException", "{", "long", "newCount", "=", "nsCount", "+", "nsDelta", ";", "long", "newDiskspace", "=", "diskspace", "+", "dsDelta", ";", "if", "(", "nsDelta", ...
Verify if the namespace count disk space satisfies the quota restriction @throws QuotaExceededException if the given quota is less than the count
[ "Verify", "if", "the", "namespace", "count", "disk", "space", "satisfies", "the", "quota", "restriction" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java#L141-L152
118,855
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java
Storage.checkVersionUpgradable
public static void checkVersionUpgradable(int oldVersion) throws IOException { if (oldVersion > LAST_UPGRADABLE_LAYOUT_VERSION) { String msg = "*********** Upgrade is not supported from this older" + " version of storage to the current version." + ...
java
public static void checkVersionUpgradable(int oldVersion) throws IOException { if (oldVersion > LAST_UPGRADABLE_LAYOUT_VERSION) { String msg = "*********** Upgrade is not supported from this older" + " version of storage to the current version." + ...
[ "public", "static", "void", "checkVersionUpgradable", "(", "int", "oldVersion", ")", "throws", "IOException", "{", "if", "(", "oldVersion", ">", "LAST_UPGRADABLE_LAYOUT_VERSION", ")", "{", "String", "msg", "=", "\"*********** Upgrade is not supported from this older\"", "...
Checks if the upgrade from the given old version is supported. If no upgrade is supported, it throws IncorrectVersionException. @param oldVersion
[ "Checks", "if", "the", "upgrade", "from", "the", "given", "old", "version", "is", "supported", ".", "If", "no", "upgrade", "is", "supported", "it", "throws", "IncorrectVersionException", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java#L723-L739
118,856
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java
Storage.getFields
protected void getFields(Properties props, StorageDirectory sd ) throws IOException { String sv, st, sid, sct; sv = props.getProperty(LAYOUT_VERSION); st = props.getProperty(STORAGE_TYPE); sid = props.getProperty(NAMESPACE_ID); sct = props.getP...
java
protected void getFields(Properties props, StorageDirectory sd ) throws IOException { String sv, st, sid, sct; sv = props.getProperty(LAYOUT_VERSION); st = props.getProperty(STORAGE_TYPE); sid = props.getProperty(NAMESPACE_ID); sct = props.getP...
[ "protected", "void", "getFields", "(", "Properties", "props", ",", "StorageDirectory", "sd", ")", "throws", "IOException", "{", "String", "sv", ",", "st", ",", "sid", ",", "sct", ";", "sv", "=", "props", ".", "getProperty", "(", "LAYOUT_VERSION", ")", ";",...
Get common storage fields. Should be overloaded if additional fields need to be get. @param props @throws IOException
[ "Get", "common", "storage", "fields", ".", "Should", "be", "overloaded", "if", "additional", "fields", "need", "to", "be", "get", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java#L748-L778
118,857
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java
Storage.writeAll
public void writeAll() throws IOException { this.layoutVersion = FSConstants.LAYOUT_VERSION; for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { it.next().write(); } }
java
public void writeAll() throws IOException { this.layoutVersion = FSConstants.LAYOUT_VERSION; for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { it.next().write(); } }
[ "public", "void", "writeAll", "(", ")", "throws", "IOException", "{", "this", ".", "layoutVersion", "=", "FSConstants", ".", "LAYOUT_VERSION", ";", "for", "(", "Iterator", "<", "StorageDirectory", ">", "it", "=", "storageDirs", ".", "iterator", "(", ")", ";"...
Write all data storage files. @throws IOException
[ "Write", "all", "data", "storage", "files", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java#L840-L845
118,858
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java
Storage.unlockAll
public void unlockAll() throws IOException { for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { it.next().unlock(); } }
java
public void unlockAll() throws IOException { for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { it.next().unlock(); } }
[ "public", "void", "unlockAll", "(", ")", "throws", "IOException", "{", "for", "(", "Iterator", "<", "StorageDirectory", ">", "it", "=", "storageDirs", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "it", ".", "next", "...
Unlock all storage directories. @throws IOException
[ "Unlock", "all", "storage", "directories", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java#L851-L855
118,859
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java
Storage.isLockSupported
public boolean isLockSupported(int idx) throws IOException { StorageDirectory sd = storageDirs.get(idx); FileLock firstLock = null; FileLock secondLock = null; try { firstLock = sd.lock; if(firstLock == null) { firstLock = sd.tryLock(); if(firstLock == null) return ...
java
public boolean isLockSupported(int idx) throws IOException { StorageDirectory sd = storageDirs.get(idx); FileLock firstLock = null; FileLock secondLock = null; try { firstLock = sd.lock; if(firstLock == null) { firstLock = sd.tryLock(); if(firstLock == null) return ...
[ "public", "boolean", "isLockSupported", "(", "int", "idx", ")", "throws", "IOException", "{", "StorageDirectory", "sd", "=", "storageDirs", ".", "get", "(", "idx", ")", ";", "FileLock", "firstLock", "=", "null", ";", "FileLock", "secondLock", "=", "null", ";...
Check whether underlying file system supports file locking. @return <code>true</code> if exclusive locks are supported or <code>false</code> otherwise. @throws IOException @see StorageDirectory#lock()
[ "Check", "whether", "underlying", "file", "system", "supports", "file", "locking", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java#L865-L890
118,860
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotifier.java
SessionNotifier.write
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); int totalSessionsToCtx = 0, totalDeletedSessions = 0; for (int i = 0; i < numNotifierThreads; i++) { totalSessionsToCtx += notifierThreads[i].sessionsToCtx.size(); totalDeletedSessions += notif...
java
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); int totalSessionsToCtx = 0, totalDeletedSessions = 0; for (int i = 0; i < numNotifierThreads; i++) { totalSessionsToCtx += notifierThreads[i].sessionsToCtx.size(); totalDeletedSessions += notif...
[ "public", "void", "write", "(", "JsonGenerator", "jsonGenerator", ")", "throws", "IOException", "{", "jsonGenerator", ".", "writeStartObject", "(", ")", ";", "int", "totalSessionsToCtx", "=", "0", ",", "totalDeletedSessions", "=", "0", ";", "for", "(", "int", ...
Used to write the state of the SessionNotifier instance to disk, when we are persisting the state of the ClusterManager @param jsonGenerator The JsonGenerator instance being used to write JSON to disk @throws IOException
[ "Used", "to", "write", "the", "state", "of", "the", "SessionNotifier", "instance", "to", "disk", "when", "we", "are", "persisting", "the", "state", "of", "the", "ClusterManager" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotifier.java#L160-L197
118,861
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotifier.java
SessionNotifier.restoreAfterSafeModeRestart
public void restoreAfterSafeModeRestart() { // Put the sessionsToCtxFromDisk entries into their respective // SessionNotifierThreads instances for (Map.Entry<String, SessionNotificationCtx> entry : sessionsToCtxFromDisk.entrySet()) { // The conf and the conf related properties are missing in...
java
public void restoreAfterSafeModeRestart() { // Put the sessionsToCtxFromDisk entries into their respective // SessionNotifierThreads instances for (Map.Entry<String, SessionNotificationCtx> entry : sessionsToCtxFromDisk.entrySet()) { // The conf and the conf related properties are missing in...
[ "public", "void", "restoreAfterSafeModeRestart", "(", ")", "{", "// Put the sessionsToCtxFromDisk entries into their respective", "// SessionNotifierThreads instances", "for", "(", "Map", ".", "Entry", "<", "String", ",", "SessionNotificationCtx", ">", "entry", ":", "sessions...
This method rebuilds members related to the SessionNotifier instance, which were not directly persisted themselves.
[ "This", "method", "rebuilds", "members", "related", "to", "the", "SessionNotifier", "instance", "which", "were", "not", "directly", "persisted", "themselves", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotifier.java#L380-L408
118,862
facebookarchive/hadoop-20
src/core/org/apache/hadoop/security/PermissionChecker.java
PermissionChecker.checkSuperuserPrivilege
public static void checkSuperuserPrivilege(UserGroupInformation owner, String supergroup) throws AccessControlException { PermissionChecker checker = new PermissionChecker(owner.getUserName(), supergroup); if (!checker.isSuper) { throw new AccessCont...
java
public static void checkSuperuserPrivilege(UserGroupInformation owner, String supergroup) throws AccessControlException { PermissionChecker checker = new PermissionChecker(owner.getUserName(), supergroup); if (!checker.isSuper) { throw new AccessCont...
[ "public", "static", "void", "checkSuperuserPrivilege", "(", "UserGroupInformation", "owner", ",", "String", "supergroup", ")", "throws", "AccessControlException", "{", "PermissionChecker", "checker", "=", "new", "PermissionChecker", "(", "owner", ".", "getUserName", "("...
Verify if the caller has the required permission. This will result into an exception if the caller is not allowed to access the resource. @param owner owner of the system @param supergroup supergroup of the system
[ "Verify", "if", "the", "caller", "has", "the", "required", "permission", ".", "This", "will", "result", "into", "an", "exception", "if", "the", "caller", "is", "not", "allowed", "to", "access", "the", "resource", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/PermissionChecker.java#L77-L86
118,863
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/LoadManager.java
LoadManager.getMaxSlots
public int getMaxSlots(TaskTrackerStatus status, TaskType type) { return (type == TaskType.MAP) ? status.getMaxMapSlots() : status.getMaxReduceSlots(); }
java
public int getMaxSlots(TaskTrackerStatus status, TaskType type) { return (type == TaskType.MAP) ? status.getMaxMapSlots() : status.getMaxReduceSlots(); }
[ "public", "int", "getMaxSlots", "(", "TaskTrackerStatus", "status", ",", "TaskType", "type", ")", "{", "return", "(", "type", "==", "TaskType", ".", "MAP", ")", "?", "status", ".", "getMaxMapSlots", "(", ")", ":", "status", ".", "getMaxReduceSlots", "(", "...
Obtain the overall number of the slots limit of a tasktracker @param status The status of the tasktracker @param type The type of the task @return The number of maximum slots
[ "Obtain", "the", "overall", "number", "of", "the", "slots", "limit", "of", "a", "tasktracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/LoadManager.java#L107-L110
118,864
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/MapFile.java
MapFile.rename
public static void rename(FileSystem fs, String oldName, String newName) throws IOException { Path oldDir = new Path(oldName); Path newDir = new Path(newName); if (!fs.rename(oldDir, newDir)) { throw new IOException("Could not rename " + oldDir + " to " + newDir); } }
java
public static void rename(FileSystem fs, String oldName, String newName) throws IOException { Path oldDir = new Path(oldName); Path newDir = new Path(newName); if (!fs.rename(oldDir, newDir)) { throw new IOException("Could not rename " + oldDir + " to " + newDir); } }
[ "public", "static", "void", "rename", "(", "FileSystem", "fs", ",", "String", "oldName", ",", "String", "newName", ")", "throws", "IOException", "{", "Path", "oldDir", "=", "new", "Path", "(", "oldName", ")", ";", "Path", "newDir", "=", "new", "Path", "(...
Renames an existing map directory.
[ "Renames", "an", "existing", "map", "directory", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/MapFile.java#L584-L591
118,865
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/MapFile.java
MapFile.delete
public static void delete(FileSystem fs, String name) throws IOException { Path dir = new Path(name); Path data = new Path(dir, DATA_FILE_NAME); Path index = new Path(dir, INDEX_FILE_NAME); fs.delete(data, true); fs.delete(index, true); fs.delete(dir, true); }
java
public static void delete(FileSystem fs, String name) throws IOException { Path dir = new Path(name); Path data = new Path(dir, DATA_FILE_NAME); Path index = new Path(dir, INDEX_FILE_NAME); fs.delete(data, true); fs.delete(index, true); fs.delete(dir, true); }
[ "public", "static", "void", "delete", "(", "FileSystem", "fs", ",", "String", "name", ")", "throws", "IOException", "{", "Path", "dir", "=", "new", "Path", "(", "name", ")", ";", "Path", "data", "=", "new", "Path", "(", "dir", ",", "DATA_FILE_NAME", ")...
Deletes the named map file.
[ "Deletes", "the", "named", "map", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/MapFile.java#L594-L602
118,866
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/MapFile.java
MapFile.fix
public static long fix(FileSystem fs, Path dir, Class<? extends Writable> keyClass, Class<? extends Writable> valueClass, boolean dryrun, Configuration conf) throws Exception { String dr = (dryrun ? "[DRY RUN ] " : ""); Path data = new P...
java
public static long fix(FileSystem fs, Path dir, Class<? extends Writable> keyClass, Class<? extends Writable> valueClass, boolean dryrun, Configuration conf) throws Exception { String dr = (dryrun ? "[DRY RUN ] " : ""); Path data = new P...
[ "public", "static", "long", "fix", "(", "FileSystem", "fs", ",", "Path", "dir", ",", "Class", "<", "?", "extends", "Writable", ">", "keyClass", ",", "Class", "<", "?", "extends", "Writable", ">", "valueClass", ",", "boolean", "dryrun", ",", "Configuration"...
This method attempts to fix a corrupt MapFile by re-creating its index. @param fs filesystem @param dir directory containing the MapFile data and index @param keyClass key class (has to be a subclass of Writable) @param valueClass value class (has to be a subclass of Writable) @param dryrun do not perform any changes, ...
[ "This", "method", "attempts", "to", "fix", "a", "corrupt", "MapFile", "by", "re", "-", "creating", "its", "index", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/MapFile.java#L614-L661
118,867
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.findConfigFiles
private void findConfigFiles() { // Find the materialized_JSON configuration file. if (configFileName == null) { String jsonConfigFileString = conf.getConfigFile().replace( CoronaConf.DEFAULT_CONFIG_FILE, Configuration.MATER...
java
private void findConfigFiles() { // Find the materialized_JSON configuration file. if (configFileName == null) { String jsonConfigFileString = conf.getConfigFile().replace( CoronaConf.DEFAULT_CONFIG_FILE, Configuration.MATER...
[ "private", "void", "findConfigFiles", "(", ")", "{", "// Find the materialized_JSON configuration file.", "if", "(", "configFileName", "==", "null", ")", "{", "String", "jsonConfigFileString", "=", "conf", ".", "getConfigFile", "(", ")", ".", "replace", "(", "Corona...
Find the configuration files as set file names or in the classpath.
[ "Find", "the", "configuration", "files", "as", "set", "file", "names", "or", "in", "the", "classpath", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L349-L409
118,868
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getWeight
public synchronized double getWeight(PoolInfo poolInfo) { Double weight = (poolInfoToWeight == null) ? null : poolInfoToWeight.get(poolInfo); return weight == null ? 1.0 : weight; }
java
public synchronized double getWeight(PoolInfo poolInfo) { Double weight = (poolInfoToWeight == null) ? null : poolInfoToWeight.get(poolInfo); return weight == null ? 1.0 : weight; }
[ "public", "synchronized", "double", "getWeight", "(", "PoolInfo", "poolInfo", ")", "{", "Double", "weight", "=", "(", "poolInfoToWeight", "==", "null", ")", "?", "null", ":", "poolInfoToWeight", ".", "get", "(", "poolInfo", ")", ";", "return", "weight", "=="...
Get the weight for the pool @param poolInfo Pool info to check @return the weight for the pool
[ "Get", "the", "weight", "for", "the", "pool" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L543-L547
118,869
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getPriority
public synchronized int getPriority(PoolInfo poolInfo) { Integer priority = (poolInfoToPriority == null) ? null : poolInfoToPriority.get(poolInfo); return priority == null ? 0 : priority; }
java
public synchronized int getPriority(PoolInfo poolInfo) { Integer priority = (poolInfoToPriority == null) ? null : poolInfoToPriority.get(poolInfo); return priority == null ? 0 : priority; }
[ "public", "synchronized", "int", "getPriority", "(", "PoolInfo", "poolInfo", ")", "{", "Integer", "priority", "=", "(", "poolInfoToPriority", "==", "null", ")", "?", "null", ":", "poolInfoToPriority", ".", "get", "(", "poolInfo", ")", ";", "return", "priority"...
Get the priority for the pool @param poolInfo Pool info to check @return the priority for the pool
[ "Get", "the", "priority", "for", "the", "pool" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L554-L558
118,870
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getPoolComparator
public synchronized ScheduleComparator getPoolComparator(PoolInfo poolInfo) { ScheduleComparator comparator = (poolInfoToComparator == null) ? null : poolInfoToComparator.get(poolInfo); return comparator == null ? defaultPoolComparator : comparator; }
java
public synchronized ScheduleComparator getPoolComparator(PoolInfo poolInfo) { ScheduleComparator comparator = (poolInfoToComparator == null) ? null : poolInfoToComparator.get(poolInfo); return comparator == null ? defaultPoolComparator : comparator; }
[ "public", "synchronized", "ScheduleComparator", "getPoolComparator", "(", "PoolInfo", "poolInfo", ")", "{", "ScheduleComparator", "comparator", "=", "(", "poolInfoToComparator", "==", "null", ")", "?", "null", ":", "poolInfoToComparator", ".", "get", "(", "poolInfo", ...
Get the comparator to use for scheduling sessions within a pool @param poolInfo Pool info to check @return the scheduling comparator to use for the pool
[ "Get", "the", "comparator", "to", "use", "for", "scheduling", "sessions", "within", "a", "pool" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L611-L616
118,871
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getLocalityWait
public synchronized long getLocalityWait(ResourceType type, LocalityLevel level) { if (level == LocalityLevel.ANY) { return 0L; } Long wait = level == LocalityLevel.NODE ? typeToNodeWait.get(type) : typeToRackWait.get(type); if (wait == null) { ...
java
public synchronized long getLocalityWait(ResourceType type, LocalityLevel level) { if (level == LocalityLevel.ANY) { return 0L; } Long wait = level == LocalityLevel.NODE ? typeToNodeWait.get(type) : typeToRackWait.get(type); if (wait == null) { ...
[ "public", "synchronized", "long", "getLocalityWait", "(", "ResourceType", "type", ",", "LocalityLevel", "level", ")", "{", "if", "(", "level", "==", "LocalityLevel", ".", "ANY", ")", "{", "return", "0L", ";", "}", "Long", "wait", "=", "level", "==", "Local...
Get the locality wait to be used by the scheduler for a given ResourceType on a given LocalityLevel @param type the type of the resource @param level the locality level @return the time in milliseconds to use as a locality wait for a resource of a given type on a given level
[ "Get", "the", "locality", "wait", "to", "be", "used", "by", "the", "scheduler", "for", "a", "given", "ResourceType", "on", "a", "given", "LocalityLevel" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L650-L661
118,872
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.generatePoolsConfigIfClassSet
public String generatePoolsConfigIfClassSet() { if (poolsConfigDocumentGenerator == null) { return null; } Document document = poolsConfigDocumentGenerator.generatePoolsDocument(); if (document == null) { LOG.warn("generatePoolsConfig: Did not generate a valid pools xml file"); return ...
java
public String generatePoolsConfigIfClassSet() { if (poolsConfigDocumentGenerator == null) { return null; } Document document = poolsConfigDocumentGenerator.generatePoolsDocument(); if (document == null) { LOG.warn("generatePoolsConfig: Did not generate a valid pools xml file"); return ...
[ "public", "String", "generatePoolsConfigIfClassSet", "(", ")", "{", "if", "(", "poolsConfigDocumentGenerator", "==", "null", ")", "{", "return", "null", ";", "}", "Document", "document", "=", "poolsConfigDocumentGenerator", ".", "generatePoolsDocument", "(", ")", ";...
Generate the new pools configuration using the configuration generator. The generated configuration is written to a temporary file and then atomically renamed to the specified destination file. This function may be called concurrently and it is safe to do so because of the atomic rename to the destination file. @retur...
[ "Generate", "the", "new", "pools", "configuration", "using", "the", "configuration", "generator", ".", "The", "generated", "configuration", "is", "written", "to", "a", "temporary", "file", "and", "then", "atomically", "renamed", "to", "the", "specified", "destinat...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L732-L781
118,873
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.reloadAllConfig
public synchronized boolean reloadAllConfig(boolean init) throws IOException, SAXException, ParserConfigurationException, JSONException { if (!isConfigChanged(init)) { return false; } reloadConfig(); reloadPoolsConfig(); this.lastSuccessfulReload = ClusterManager.clock.getTime(); ret...
java
public synchronized boolean reloadAllConfig(boolean init) throws IOException, SAXException, ParserConfigurationException, JSONException { if (!isConfigChanged(init)) { return false; } reloadConfig(); reloadPoolsConfig(); this.lastSuccessfulReload = ClusterManager.clock.getTime(); ret...
[ "public", "synchronized", "boolean", "reloadAllConfig", "(", "boolean", "init", ")", "throws", "IOException", ",", "SAXException", ",", "ParserConfigurationException", ",", "JSONException", "{", "if", "(", "!", "isConfigChanged", "(", "init", ")", ")", "{", "retur...
Reload all the configuration files if the config changed and set the last successful reload time. Synchronized due to potential conflict from a fetch pools config http request. @return true if the config was reloaded, false otherwise @throws IOException @throws SAXException @throws ParserConfigurationException @param...
[ "Reload", "all", "the", "configuration", "files", "if", "the", "config", "changed", "and", "set", "the", "last", "successful", "reload", "time", ".", "Synchronized", "due", "to", "potential", "conflict", "from", "a", "fetch", "pools", "config", "http", "reques...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L1284-L1293
118,874
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.isConfigChanged
private boolean isConfigChanged(boolean init) throws IOException { if (init && (configFileName == null || (poolsConfigFileName == null && conf.onlyAllowConfiguredPools()))) { throw new IOException("ClusterManager needs a config and a " + "pools file to start...
java
private boolean isConfigChanged(boolean init) throws IOException { if (init && (configFileName == null || (poolsConfigFileName == null && conf.onlyAllowConfiguredPools()))) { throw new IOException("ClusterManager needs a config and a " + "pools file to start...
[ "private", "boolean", "isConfigChanged", "(", "boolean", "init", ")", "throws", "IOException", "{", "if", "(", "init", "&&", "(", "configFileName", "==", "null", "||", "(", "poolsConfigFileName", "==", "null", "&&", "conf", ".", "onlyAllowConfiguredPools", "(", ...
Check if the config files have changed since they were last read @return true if the modification time of the file is greater than that of the last successful reload, false otherwise @param init true when the config manager is being initialized. false on reloads
[ "Check", "if", "the", "config", "files", "have", "changed", "since", "they", "were", "last", "read" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L1302-L1331
118,875
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getRootElement
private Element getRootElement(String fileName) throws IOException, SAXException, ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setIgnoringComments(true); DocumentBuilder builder = docBuilderFactory.newDocumentBu...
java
private Element getRootElement(String fileName) throws IOException, SAXException, ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setIgnoringComments(true); DocumentBuilder builder = docBuilderFactory.newDocumentBu...
[ "private", "Element", "getRootElement", "(", "String", "fileName", ")", "throws", "IOException", ",", "SAXException", ",", "ParserConfigurationException", "{", "DocumentBuilderFactory", "docBuilderFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";",...
Get the root element of the XML document @return the root element of the XML document @throws IOException @throws SAXException @throws ParserConfigurationException
[ "Get", "the", "root", "element", "of", "the", "XML", "document" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L1340-L1352
118,876
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java
ConfigManager.getText
private static String getText(Element element) { if (element.getFirstChild() == null) { return ""; } return ((Text) element.getFirstChild()).getData().trim(); }
java
private static String getText(Element element) { if (element.getFirstChild() == null) { return ""; } return ((Text) element.getFirstChild()).getData().trim(); }
[ "private", "static", "String", "getText", "(", "Element", "element", ")", "{", "if", "(", "element", ".", "getFirstChild", "(", ")", "==", "null", ")", "{", "return", "\"\"", ";", "}", "return", "(", "(", "Text", ")", "element", ".", "getFirstChild", "...
Get the text inside of the Xml element @param element xml element @return the text inside of the xml element
[ "Get", "the", "text", "inside", "of", "the", "Xml", "element" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ConfigManager.java#L1369-L1374
118,877
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/LoadManager.java
LoadManager.incrementLoad
public synchronized void incrementLoad(ResourceType type) { Integer load = typeToTotalLoad.get(type); assert(load != null); typeToTotalLoad.put(type, load + 1); }
java
public synchronized void incrementLoad(ResourceType type) { Integer load = typeToTotalLoad.get(type); assert(load != null); typeToTotalLoad.put(type, load + 1); }
[ "public", "synchronized", "void", "incrementLoad", "(", "ResourceType", "type", ")", "{", "Integer", "load", "=", "typeToTotalLoad", ".", "get", "(", "type", ")", ";", "assert", "(", "load", "!=", "null", ")", ";", "typeToTotalLoad", ".", "put", "(", "type...
Increment the number of running resources of a given type. @param type the resource type.
[ "Increment", "the", "number", "of", "running", "resources", "of", "a", "given", "type", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/LoadManager.java#L55-L59
118,878
facebookarchive/hadoop-20
src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
HadoopLogsAnalyzer.readBalancedLine
private Pair<String, String> readBalancedLine() throws IOException { String line = readCountedLine(); if (line == null) { return null; } while (line.indexOf('\f') > 0) { line = line.substring(line.indexOf('\f')); } if (line.length() != 0 && line.charAt(0) == '\f') { String s...
java
private Pair<String, String> readBalancedLine() throws IOException { String line = readCountedLine(); if (line == null) { return null; } while (line.indexOf('\f') > 0) { line = line.substring(line.indexOf('\f')); } if (line.length() != 0 && line.charAt(0) == '\f') { String s...
[ "private", "Pair", "<", "String", ",", "String", ">", "readBalancedLine", "(", ")", "throws", "IOException", "{", "String", "line", "=", "readCountedLine", "(", ")", ";", "if", "(", "line", "==", "null", ")", "{", "return", "null", ";", "}", "while", "...
no more input.
[ "no", "more", "input", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java#L647-L726
118,879
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/StripeStore.java
StripeStore.initializeConf
public Configuration initializeConf(String[] keys, Configuration conf, FileSystem fs) throws IOException { Configuration newConf = new Configuration(conf); if (fs == null) { fs = FileSystem.get(conf); } String suffix = fs.getUri().getAuthority(); for (String key: keys) { String val...
java
public Configuration initializeConf(String[] keys, Configuration conf, FileSystem fs) throws IOException { Configuration newConf = new Configuration(conf); if (fs == null) { fs = FileSystem.get(conf); } String suffix = fs.getUri().getAuthority(); for (String key: keys) { String val...
[ "public", "Configuration", "initializeConf", "(", "String", "[", "]", "keys", ",", "Configuration", "conf", ",", "FileSystem", "fs", ")", "throws", "IOException", "{", "Configuration", "newConf", "=", "new", "Configuration", "(", "conf", ")", ";", "if", "(", ...
Initialize the config based on the given Filesystem
[ "Initialize", "the", "config", "based", "on", "the", "given", "Filesystem" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/StripeStore.java#L94-L108
118,880
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
OfflineEditsViewer.go
public void go(EditsVisitor visitor) throws IOException { setEditsLoader(EditsLoader.LoaderFactory.getLoader(visitor)); editsLoader.loadEdits(); }
java
public void go(EditsVisitor visitor) throws IOException { setEditsLoader(EditsLoader.LoaderFactory.getLoader(visitor)); editsLoader.loadEdits(); }
[ "public", "void", "go", "(", "EditsVisitor", "visitor", ")", "throws", "IOException", "{", "setEditsLoader", "(", "EditsLoader", ".", "LoaderFactory", ".", "getLoader", "(", "visitor", ")", ")", ";", "editsLoader", ".", "loadEdits", "(", ")", ";", "}" ]
Process EditLog file. @param visitor use this visitor to process the file
[ "Process", "EditLog", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java#L63-L66
118,881
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
OfflineEditsViewer.printHelp
private void printHelp() { String summary = "Usage: bin/hdfs oev [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE\n" + "Offline edits viewer\n" + "Parse a Hadoop edits log file INPUT_FILE and save results\n" + "in OUTPUT_FILE.\n" + "Required command line arguments:\n" + "-i,--inputFile <ar...
java
private void printHelp() { String summary = "Usage: bin/hdfs oev [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE\n" + "Offline edits viewer\n" + "Parse a Hadoop edits log file INPUT_FILE and save results\n" + "in OUTPUT_FILE.\n" + "Required command line arguments:\n" + "-i,--inputFile <ar...
[ "private", "void", "printHelp", "(", ")", "{", "String", "summary", "=", "\"Usage: bin/hdfs oev [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE\\n\"", "+", "\"Offline edits viewer\\n\"", "+", "\"Parse a Hadoop edits log file INPUT_FILE and save results\\n\"", "+", "\"in OUTPUT_FILE.\\n\"", "+...
Print help.
[ "Print", "help", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java#L71-L104
118,882
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ServletUtil.java
ServletUtil.initHTML
public static PrintWriter initHTML(ServletResponse response, String title ) throws IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>\n" + "<link rel='stylesheet' type='text/css' href='/static/hadoop.css'>\n" + "<title>" + ti...
java
public static PrintWriter initHTML(ServletResponse response, String title ) throws IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>\n" + "<link rel='stylesheet' type='text/css' href='/static/hadoop.css'>\n" + "<title>" + ti...
[ "public", "static", "PrintWriter", "initHTML", "(", "ServletResponse", "response", ",", "String", "title", ")", "throws", "IOException", "{", "response", ".", "setContentType", "(", "\"text/html\"", ")", ";", "PrintWriter", "out", "=", "response", ".", "getWriter"...
Initial HTML header
[ "Initial", "HTML", "header" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ServletUtil.java#L29-L39
118,883
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ServletUtil.java
ServletUtil.getParameter
public static String getParameter(ServletRequest request, String name) { String s = request.getParameter(name); if (s == null) { return null; } s = s.trim(); return s.length() == 0? null: s; }
java
public static String getParameter(ServletRequest request, String name) { String s = request.getParameter(name); if (s == null) { return null; } s = s.trim(); return s.length() == 0? null: s; }
[ "public", "static", "String", "getParameter", "(", "ServletRequest", "request", ",", "String", "name", ")", "{", "String", "s", "=", "request", ".", "getParameter", "(", "name", ")", ";", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "...
Get a parameter from a ServletRequest. Return null if the parameter contains only white spaces.
[ "Get", "a", "parameter", "from", "a", "ServletRequest", ".", "Return", "null", "if", "the", "parameter", "contains", "only", "white", "spaces", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ServletUtil.java#L45-L52
118,884
facebookarchive/hadoop-20
src/core/org/apache/hadoop/util/ServletUtil.java
ServletUtil.percentageGraph
public static String percentageGraph(int perc, int width) throws IOException { assert perc >= 0; assert perc <= 100; StringBuilder builder = new StringBuilder(); builder.append("<table border=\"1px\" width=\""); builder.append(width); builder.append("px\"><tr>"); if(perc > 0) { builder.appen...
java
public static String percentageGraph(int perc, int width) throws IOException { assert perc >= 0; assert perc <= 100; StringBuilder builder = new StringBuilder(); builder.append("<table border=\"1px\" width=\""); builder.append(width); builder.append("px\"><tr>"); if(perc > 0) { builder.appen...
[ "public", "static", "String", "percentageGraph", "(", "int", "perc", ",", "int", "width", ")", "throws", "IOException", "{", "assert", "perc", ">=", "0", ";", "assert", "perc", "<=", "100", ";", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ...
Generate the percentage graph and returns HTML representation string of the same. @param perc The percentage value for which graph is to be generated @param width The width of the display table @return HTML String representation of the percentage graph @throws IOException
[ "Generate", "the", "percentage", "graph", "and", "returns", "HTML", "representation", "string", "of", "the", "same", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ServletUtil.java#L76-L92
118,885
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotificationCtx.java
SessionNotificationCtx.write
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("handle", handle); jsonGenerator.writeStringField("host", host); jsonGenerator.writeNumberField("port", port); jsonGenerator.writeNumberField("numPendingCalls", pe...
java
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("handle", handle); jsonGenerator.writeStringField("host", host); jsonGenerator.writeNumberField("port", port); jsonGenerator.writeNumberField("numPendingCalls", pe...
[ "public", "void", "write", "(", "JsonGenerator", "jsonGenerator", ")", "throws", "IOException", "{", "jsonGenerator", ".", "writeStartObject", "(", ")", ";", "jsonGenerator", ".", "writeStringField", "(", "\"handle\"", ",", "handle", ")", ";", "jsonGenerator", "."...
Used to write the state of the SessionNotificationCtx instance to disk, when we are persisting the state of the ClusterManager @param jsonGenerator The JsonGenerator instance being used to write JSON to disk @throws IOException
[ "Used", "to", "write", "the", "state", "of", "the", "SessionNotificationCtx", "instance", "to", "disk", "when", "we", "are", "persisting", "the", "state", "of", "the", "ClusterManager" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotificationCtx.java#L161-L193
118,886
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotificationCtx.java
SessionNotificationCtx.makeCalls
public boolean makeCalls(long now) { if (now < nextDispatchTime) return true; // we make calls in a loop until all pending calls are drained // if any call hits an error - we stop while (!pendingCalls.isEmpty()) { TBase call = pendingCalls.get(0); try { // initialize the clie...
java
public boolean makeCalls(long now) { if (now < nextDispatchTime) return true; // we make calls in a loop until all pending calls are drained // if any call hits an error - we stop while (!pendingCalls.isEmpty()) { TBase call = pendingCalls.get(0); try { // initialize the clie...
[ "public", "boolean", "makeCalls", "(", "long", "now", ")", "{", "if", "(", "now", "<", "nextDispatchTime", ")", "return", "true", ";", "// we make calls in a loop until all pending calls are drained", "// if any call hits an error - we stop", "while", "(", "!", "pendingCa...
make callbacks to the sessiondriver. if the function returns false, then the session should be discarded @return true on success. false if no calls can be made to session anymore
[ "make", "callbacks", "to", "the", "sessiondriver", ".", "if", "the", "function", "returns", "false", "then", "the", "session", "should", "be", "discarded" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionNotificationCtx.java#L246-L310
118,887
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.getCodecClasses
public static List<Class<? extends CompressionCodec>> getCodecClasses(Configuration conf) { String codecsString = conf.get("io.compression.codecs"); if (codecsString != null) { List<Class<? extends CompressionCodec>> result = new ArrayList<Class<? extends CompressionCodec>>(); StringTokenize...
java
public static List<Class<? extends CompressionCodec>> getCodecClasses(Configuration conf) { String codecsString = conf.get("io.compression.codecs"); if (codecsString != null) { List<Class<? extends CompressionCodec>> result = new ArrayList<Class<? extends CompressionCodec>>(); StringTokenize...
[ "public", "static", "List", "<", "Class", "<", "?", "extends", "CompressionCodec", ">", ">", "getCodecClasses", "(", "Configuration", "conf", ")", "{", "String", "codecsString", "=", "conf", ".", "get", "(", "\"io.compression.codecs\"", ")", ";", "if", "(", ...
Get the list of codecs listed in the configuration @param conf the configuration to look in @return a list of the Configuration classes or null if the attribute was not set
[ "Get", "the", "list", "of", "codecs", "listed", "in", "the", "configuration" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L85-L112
118,888
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.setCodecClasses
public static void setCodecClasses(Configuration conf, List<Class> classes) { StringBuffer buf = new StringBuffer(); Iterator<Class> itr = classes.iterator(); if (itr.hasNext()) { Class cls = itr.next(); buf.append(cls.getName()); while(itr.hasNext()) {...
java
public static void setCodecClasses(Configuration conf, List<Class> classes) { StringBuffer buf = new StringBuffer(); Iterator<Class> itr = classes.iterator(); if (itr.hasNext()) { Class cls = itr.next(); buf.append(cls.getName()); while(itr.hasNext()) {...
[ "public", "static", "void", "setCodecClasses", "(", "Configuration", "conf", ",", "List", "<", "Class", ">", "classes", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "Iterator", "<", "Class", ">", "itr", "=", "classes", ".", ...
Sets a list of codec classes in the configuration. @param conf the configuration to modify @param classes the list of classes to set
[ "Sets", "a", "list", "of", "codec", "classes", "in", "the", "configuration", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L119-L132
118,889
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.getCodec
public CompressionCodec getCodec(Path file) { CompressionCodec result = null; if (codecs != null) { String filename = file.getName(); String reversedFilename = new StringBuffer(filename).reverse().toString(); SortedMap<String, CompressionCodec> subMap = codecs.headMap(reversedFilename...
java
public CompressionCodec getCodec(Path file) { CompressionCodec result = null; if (codecs != null) { String filename = file.getName(); String reversedFilename = new StringBuffer(filename).reverse().toString(); SortedMap<String, CompressionCodec> subMap = codecs.headMap(reversedFilename...
[ "public", "CompressionCodec", "getCodec", "(", "Path", "file", ")", "{", "CompressionCodec", "result", "=", "null", ";", "if", "(", "codecs", "!=", "null", ")", "{", "String", "filename", "=", "file", ".", "getName", "(", ")", ";", "String", "reversedFilen...
Find the relevant compression codec for the given file based on its filename suffix. @param file the filename to check @return the codec object
[ "Find", "the", "relevant", "compression", "codec", "for", "the", "given", "file", "based", "on", "its", "filename", "suffix", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L160-L175
118,890
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.getCodecByClassName
public CompressionCodec getCodecByClassName(String classname) { if (codecsByClassName == null) { return null; } return codecsByClassName.get(classname); }
java
public CompressionCodec getCodecByClassName(String classname) { if (codecsByClassName == null) { return null; } return codecsByClassName.get(classname); }
[ "public", "CompressionCodec", "getCodecByClassName", "(", "String", "classname", ")", "{", "if", "(", "codecsByClassName", "==", "null", ")", "{", "return", "null", ";", "}", "return", "codecsByClassName", ".", "get", "(", "classname", ")", ";", "}" ]
Find the relevant compression codec for the codec's canonical class name. @param classname the canonical class name of the codec @return the codec object
[ "Find", "the", "relevant", "compression", "codec", "for", "the", "codec", "s", "canonical", "class", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L182-L187
118,891
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.removeSuffix
public static String removeSuffix(String filename, String suffix) { if (filename.endsWith(suffix)) { return filename.substring(0, filename.length() - suffix.length()); } return filename; }
java
public static String removeSuffix(String filename, String suffix) { if (filename.endsWith(suffix)) { return filename.substring(0, filename.length() - suffix.length()); } return filename; }
[ "public", "static", "String", "removeSuffix", "(", "String", "filename", ",", "String", "suffix", ")", "{", "if", "(", "filename", ".", "endsWith", "(", "suffix", ")", ")", "{", "return", "filename", ".", "substring", "(", "0", ",", "filename", ".", "len...
Removes a suffix from a filename, if it has it. @param filename the filename to strip @param suffix the suffix to remove @return the shortened filename
[ "Removes", "a", "suffix", "from", "a", "filename", "if", "it", "has", "it", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L195-L200
118,892
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java
CompressionCodecFactory.main
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); CompressionCodecFactory factory = new CompressionCodecFactory(conf); boolean encode = false; for(int i=0; i < args.length; ++i) { if ("-in".equals(args[i])) { encode = true; } else if ...
java
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); CompressionCodecFactory factory = new CompressionCodecFactory(conf); boolean encode = false; for(int i=0; i < args.length; ++i) { if ("-in".equals(args[i])) { encode = true; } else if ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "Configuration", "conf", "=", "new", "Configuration", "(", ")", ";", "CompressionCodecFactory", "factory", "=", "new", "CompressionCodecFactory", "(", "conf", ...
A little test program. @param args
[ "A", "little", "test", "program", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/CompressionCodecFactory.java#L206-L248
118,893
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java
DocumentAndOp.setInsert
public void setInsert(Document doc) { this.op = Op.INSERT; this.doc = doc; this.term = null; }
java
public void setInsert(Document doc) { this.op = Op.INSERT; this.doc = doc; this.term = null; }
[ "public", "void", "setInsert", "(", "Document", "doc", ")", "{", "this", ".", "op", "=", "Op", ".", "INSERT", ";", "this", ".", "doc", "=", "doc", ";", "this", ".", "term", "=", "null", ";", "}" ]
Set the instance to be an insert operation. @param doc
[ "Set", "the", "instance", "to", "be", "an", "insert", "operation", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java#L118-L122
118,894
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java
DocumentAndOp.setDelete
public void setDelete(Term term) { this.op = Op.DELETE; this.doc = null; this.term = term; }
java
public void setDelete(Term term) { this.op = Op.DELETE; this.doc = null; this.term = term; }
[ "public", "void", "setDelete", "(", "Term", "term", ")", "{", "this", ".", "op", "=", "Op", ".", "DELETE", ";", "this", ".", "doc", "=", "null", ";", "this", ".", "term", "=", "term", ";", "}" ]
Set the instance to be a delete operation. @param term
[ "Set", "the", "instance", "to", "be", "a", "delete", "operation", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java#L128-L132
118,895
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java
DocumentAndOp.setUpdate
public void setUpdate(Document doc, Term term) { this.op = Op.UPDATE; this.doc = doc; this.term = term; }
java
public void setUpdate(Document doc, Term term) { this.op = Op.UPDATE; this.doc = doc; this.term = term; }
[ "public", "void", "setUpdate", "(", "Document", "doc", ",", "Term", "term", ")", "{", "this", ".", "op", "=", "Op", ".", "UPDATE", ";", "this", ".", "doc", "=", "doc", ";", "this", ".", "term", "=", "term", ";", "}" ]
Set the instance to be an update operation. @param doc @param term
[ "Set", "the", "instance", "to", "be", "an", "update", "operation", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/DocumentAndOp.java#L139-L143
118,896
facebookarchive/hadoop-20
src/core/org/apache/hadoop/ipc/RPC.java
RPC.getProtocolProxy
public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy( Class<T> protocol, long clientVersion, InetSocketAddress addr, Configuration conf, SocketFactory factory) throws IOException { UserGroupInformation ugi = null; try { ugi = UserGroupInformation.login(conf); ...
java
public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy( Class<T> protocol, long clientVersion, InetSocketAddress addr, Configuration conf, SocketFactory factory) throws IOException { UserGroupInformation ugi = null; try { ugi = UserGroupInformation.login(conf); ...
[ "public", "static", "<", "T", "extends", "VersionedProtocol", ">", "ProtocolProxy", "<", "T", ">", "getProtocolProxy", "(", "Class", "<", "T", ">", "protocol", ",", "long", "clientVersion", ",", "InetSocketAddress", "addr", ",", "Configuration", "conf", ",", "...
Construct a client-side protocol proxy that contains a set of server methods and a proxy object implementing the named protocol, talking to a server at the named address.
[ "Construct", "a", "client", "-", "side", "protocol", "proxy", "that", "contains", "a", "set", "of", "server", "methods", "and", "a", "proxy", "object", "implementing", "the", "named", "protocol", "talking", "to", "a", "server", "at", "the", "named", "address...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/RPC.java#L514-L525
118,897
facebookarchive/hadoop-20
src/core/org/apache/hadoop/ipc/RPC.java
RPC.getProtocolProxy
@SuppressWarnings("unchecked") public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy( Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, ...
java
@SuppressWarnings("unchecked") public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy( Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "VersionedProtocol", ">", "ProtocolProxy", "<", "T", ">", "getProtocolProxy", "(", "Class", "<", "T", ">", "protocol", ",", "long", "clientVersion", ",", "InetSocketAddr...
Construct a client-side proxy that implements the named protocol, talking to a server at the named address. @param protocol protocol @param clientVersion client's version @param addr server address @param ticket security ticket @param conf configuration @param factory socket factory @param rpcTimeout max time for each...
[ "Construct", "a", "client", "-", "side", "proxy", "that", "implements", "the", "named", "protocol", "talking", "to", "a", "server", "at", "the", "named", "address", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/RPC.java#L587-L621
118,898
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/LocalFileSystem.java
LocalFileSystem.reportChecksumFailure
public boolean reportChecksumFailure(Path p, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos) { try { // canonicalize f File f = ((RawLocalFileSystem)fs).pathToFile(p).getCanonicalFile(); //...
java
public boolean reportChecksumFailure(Path p, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos) { try { // canonicalize f File f = ((RawLocalFileSystem)fs).pathToFile(p).getCanonicalFile(); //...
[ "public", "boolean", "reportChecksumFailure", "(", "Path", "p", ",", "FSDataInputStream", "in", ",", "long", "inPos", ",", "FSDataInputStream", "sums", ",", "long", "sumsPos", ")", "{", "try", "{", "// canonicalize f", "File", "f", "=", "(", "(", "RawLocalFile...
Moves files to a bad file directory on the same device, so that their storage will not be reused.
[ "Moves", "files", "to", "a", "bad", "file", "directory", "on", "the", "same", "device", "so", "that", "their", "storage", "will", "not", "be", "reused", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/LocalFileSystem.java#L68-L110
118,899
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/SpillRecord.java
SpillRecord.getIndex
public IndexRecord getIndex(int partition) { final int pos = partition * MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH / 8; return new IndexRecord(entries.get(pos), entries.get(pos + 1), entries.get(pos + 2)); }
java
public IndexRecord getIndex(int partition) { final int pos = partition * MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH / 8; return new IndexRecord(entries.get(pos), entries.get(pos + 1), entries.get(pos + 2)); }
[ "public", "IndexRecord", "getIndex", "(", "int", "partition", ")", "{", "final", "int", "pos", "=", "partition", "*", "MapTask", ".", "MAP_OUTPUT_INDEX_RECORD_LENGTH", "/", "8", ";", "return", "new", "IndexRecord", "(", "entries", ".", "get", "(", "pos", ")"...
Get spill offsets for given partition.
[ "Get", "spill", "offsets", "for", "given", "partition", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/SpillRecord.java#L93-L97