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
117,600
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/GenericWritable.java
GenericWritable.set
public void set(Writable obj) { instance = obj; Class<? extends Writable> instanceClazz = instance.getClass(); Class<? extends Writable>[] clazzes = getTypes(); for (int i = 0; i < clazzes.length; i++) { Class<? extends Writable> clazz = clazzes[i]; if (clazz.equals(instanceClazz)) { ...
java
public void set(Writable obj) { instance = obj; Class<? extends Writable> instanceClazz = instance.getClass(); Class<? extends Writable>[] clazzes = getTypes(); for (int i = 0; i < clazzes.length; i++) { Class<? extends Writable> clazz = clazzes[i]; if (clazz.equals(instanceClazz)) { ...
[ "public", "void", "set", "(", "Writable", "obj", ")", "{", "instance", "=", "obj", ";", "Class", "<", "?", "extends", "Writable", ">", "instanceClazz", "=", "instance", ".", "getClass", "(", ")", ";", "Class", "<", "?", "extends", "Writable", ">", "[",...
Set the instance that is wrapped. @param obj
[ "Set", "the", "instance", "that", "is", "wrapped", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/GenericWritable.java#L91-L104
117,601
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
FileJournalManager.getEditLogManifest
public RemoteEditLogManifest getEditLogManifest(long firstTxId) throws IOException { File currentDir = sd.getCurrentDir(); List<EditLogFile> allLogFiles = matchEditLogs( FileUtil.listFiles(currentDir)); if (LOG.isDebugEnabled()) { LOG.debug(allLogFiles); } List<RemoteEditLog> ret ...
java
public RemoteEditLogManifest getEditLogManifest(long firstTxId) throws IOException { File currentDir = sd.getCurrentDir(); List<EditLogFile> allLogFiles = matchEditLogs( FileUtil.listFiles(currentDir)); if (LOG.isDebugEnabled()) { LOG.debug(allLogFiles); } List<RemoteEditLog> ret ...
[ "public", "RemoteEditLogManifest", "getEditLogManifest", "(", "long", "firstTxId", ")", "throws", "IOException", "{", "File", "currentDir", "=", "sd", ".", "getCurrentDir", "(", ")", ";", "List", "<", "EditLogFile", ">", "allLogFiles", "=", "matchEditLogs", "(", ...
Find all editlog segments starting at or above the given txid. Include inprogress segments. Notice that the segments do not have to be contiguous. JournalSet handles the holes between segments. @param fromTxId the txnid which to start looking @return a list of remote edit logs @throws IOException if edit logs cannot b...
[ "Find", "all", "editlog", "segments", "starting", "at", "or", "above", "the", "given", "txid", ".", "Include", "inprogress", "segments", ".", "Notice", "that", "the", "segments", "do", "not", "have", "to", "be", "contiguous", ".", "JournalSet", "handles", "t...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java#L167-L192
117,602
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
FileJournalManager.getLogFiles
public List<EditLogFile> getLogFiles(long fromTxId, boolean enforceBoundary) throws IOException { File currentDir = sd.getCurrentDir(); List<EditLogFile> allLogFiles = matchEditLogs(currentDir.listFiles()); List<EditLogFile> logFiles = new ArrayList<EditLogFile>(); for (EditLogFile elf : allL...
java
public List<EditLogFile> getLogFiles(long fromTxId, boolean enforceBoundary) throws IOException { File currentDir = sd.getCurrentDir(); List<EditLogFile> allLogFiles = matchEditLogs(currentDir.listFiles()); List<EditLogFile> logFiles = new ArrayList<EditLogFile>(); for (EditLogFile elf : allL...
[ "public", "List", "<", "EditLogFile", ">", "getLogFiles", "(", "long", "fromTxId", ",", "boolean", "enforceBoundary", ")", "throws", "IOException", "{", "File", "currentDir", "=", "sd", ".", "getCurrentDir", "(", ")", ";", "List", "<", "EditLogFile", ">", "a...
Get all edit log segments @param fromTxId starting txid @param enforceBoundary should we throw an exception if the requested txid is not the starting id of a segment
[ "Get", "all", "edit", "log", "segments" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java#L327-L347
117,603
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
FileJournalManager.findMaxTransaction
private long findMaxTransaction() throws IOException { for (EditLogFile elf : getLogFiles(0)) { if (elf.isInProgress()) { maxSeenTransaction = Math.max(elf.getFirstTxId(), maxSeenTransaction); } maxSeenTransaction = Math.max(elf.getLastTxId(), maxSeenTransaction); } return ma...
java
private long findMaxTransaction() throws IOException { for (EditLogFile elf : getLogFiles(0)) { if (elf.isInProgress()) { maxSeenTransaction = Math.max(elf.getFirstTxId(), maxSeenTransaction); } maxSeenTransaction = Math.max(elf.getLastTxId(), maxSeenTransaction); } return ma...
[ "private", "long", "findMaxTransaction", "(", ")", "throws", "IOException", "{", "for", "(", "EditLogFile", "elf", ":", "getLogFiles", "(", "0", ")", ")", "{", "if", "(", "elf", ".", "isInProgress", "(", ")", ")", "{", "maxSeenTransaction", "=", "Math", ...
Find the maximum transaction in the journal. This gets stored in a member variable, as corrupt edit logs will be moved aside, but we still need to remember their first tranaction id in the case that it was the maximum transaction in the journal.
[ "Find", "the", "maximum", "transaction", "in", "the", "journal", ".", "This", "gets", "stored", "in", "a", "member", "variable", "as", "corrupt", "edit", "logs", "will", "be", "moved", "aside", "but", "we", "still", "need", "to", "remember", "their", "firs...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java#L356-L365
117,604
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.init
void init(JobID jobId) { this.startTime = JobTracker.getClock().getTime(); this.id = new TaskID(jobId, isMapTask(), partition); this.skipping = startSkipping(); long speculativeDuration; if (isMapTask()) { this.speculativeLag = conf.getMapSpeculativeLag(); speculativeDuration = conf.getM...
java
void init(JobID jobId) { this.startTime = JobTracker.getClock().getTime(); this.id = new TaskID(jobId, isMapTask(), partition); this.skipping = startSkipping(); long speculativeDuration; if (isMapTask()) { this.speculativeLag = conf.getMapSpeculativeLag(); speculativeDuration = conf.getM...
[ "void", "init", "(", "JobID", "jobId", ")", "{", "this", ".", "startTime", "=", "JobTracker", ".", "getClock", "(", ")", ".", "getTime", "(", ")", ";", "this", ".", "id", "=", "new", "TaskID", "(", "jobId", ",", "isMapTask", "(", ")", ",", "partiti...
Initialization common to Map and Reduce
[ "Initialization", "common", "to", "Map", "and", "Reduce" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L290-L317
117,605
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.getDispatchTime
public long getDispatchTime(TaskAttemptID taskid){ Long l = dispatchTimeMap.get(taskid); if (l != null) { return l.longValue(); } return 0; }
java
public long getDispatchTime(TaskAttemptID taskid){ Long l = dispatchTimeMap.get(taskid); if (l != null) { return l.longValue(); } return 0; }
[ "public", "long", "getDispatchTime", "(", "TaskAttemptID", "taskid", ")", "{", "Long", "l", "=", "dispatchTimeMap", ".", "get", "(", "taskid", ")", ";", "if", "(", "l", "!=", "null", ")", "{", "return", "l", ".", "longValue", "(", ")", ";", "}", "ret...
Return the dispatch time
[ "Return", "the", "dispatch", "time" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L327-L333
117,606
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.setDispatchTime
public void setDispatchTime(TaskAttemptID taskid, long disTime){ dispatchTimeMap.put(taskid, disTime); this.lastDispatchTime = disTime; }
java
public void setDispatchTime(TaskAttemptID taskid, long disTime){ dispatchTimeMap.put(taskid, disTime); this.lastDispatchTime = disTime; }
[ "public", "void", "setDispatchTime", "(", "TaskAttemptID", "taskid", ",", "long", "disTime", ")", "{", "dispatchTimeMap", ".", "put", "(", "taskid", ",", "disTime", ")", ";", "this", ".", "lastDispatchTime", "=", "disTime", ";", "}" ]
Set the dispatch time
[ "Set", "the", "dispatch", "time" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L342-L345
117,607
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.shouldClose
public boolean shouldClose(TaskAttemptID taskid) { /** * If the task hasn't been closed yet, and it belongs to a completed * TaskInProgress close it. * * However, for completed map tasks we do not close the task which * actually was the one responsible for _completing_ the TaskInProgress. ...
java
public boolean shouldClose(TaskAttemptID taskid) { /** * If the task hasn't been closed yet, and it belongs to a completed * TaskInProgress close it. * * However, for completed map tasks we do not close the task which * actually was the one responsible for _completing_ the TaskInProgress. ...
[ "public", "boolean", "shouldClose", "(", "TaskAttemptID", "taskid", ")", "{", "/**\n * If the task hasn't been closed yet, and it belongs to a completed\n * TaskInProgress close it.\n * \n * However, for completed map tasks we do not close the task which\n * actually was the one ...
Returns whether a component task-thread should be closed because the containing JobInProgress has completed or the task is killed by the user
[ "Returns", "whether", "a", "component", "task", "-", "thread", "should", "be", "closed", "because", "the", "containing", "JobInProgress", "has", "completed", "or", "the", "task", "is", "killed", "by", "the", "user" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L564-L601
117,608
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.generateSingleReport
synchronized TaskReport generateSingleReport() { ArrayList<String> diagnostics = new ArrayList<String>(); for (List<String> l : taskDiagnosticData.values()) { diagnostics.addAll(l); } TIPStatus currentStatus = null; if (isRunning() && !isComplete()) { currentStatus = TIPStatus.RUNNING; ...
java
synchronized TaskReport generateSingleReport() { ArrayList<String> diagnostics = new ArrayList<String>(); for (List<String> l : taskDiagnosticData.values()) { diagnostics.addAll(l); } TIPStatus currentStatus = null; if (isRunning() && !isComplete()) { currentStatus = TIPStatus.RUNNING; ...
[ "synchronized", "TaskReport", "generateSingleReport", "(", ")", "{", "ArrayList", "<", "String", ">", "diagnostics", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "List", "<", "String", ">", "l", ":", "taskDiagnosticData", ".", "v...
Creates a "status report" for this task. Includes the task ID and overall status, plus reports for all the component task-threads that have ever been started.
[ "Creates", "a", "status", "report", "for", "this", "task", ".", "Includes", "the", "task", "ID", "and", "overall", "status", "plus", "reports", "for", "all", "the", "component", "task", "-", "threads", "that", "have", "ever", "been", "started", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L624-L652
117,609
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.addDiagnosticInfo
public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) { List<String> diagHistory = taskDiagnosticData.get(taskId); if (diagHistory == null) { diagHistory = new ArrayList<String>(); taskDiagnosticData.put(taskId, diagHistory); } diagHistory.add(diagInfo); }
java
public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) { List<String> diagHistory = taskDiagnosticData.get(taskId); if (diagHistory == null) { diagHistory = new ArrayList<String>(); taskDiagnosticData.put(taskId, diagHistory); } diagHistory.add(diagInfo); }
[ "public", "void", "addDiagnosticInfo", "(", "TaskAttemptID", "taskId", ",", "String", "diagInfo", ")", "{", "List", "<", "String", ">", "diagHistory", "=", "taskDiagnosticData", ".", "get", "(", "taskId", ")", ";", "if", "(", "diagHistory", "==", "null", ")"...
Save diagnostic information for a given task. @param taskId id of the task @param diagInfo diagnostic information for the task
[ "Save", "diagnostic", "information", "for", "a", "given", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L675-L682
117,610
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.incompleteSubTask
public void incompleteSubTask(TaskAttemptID taskid, JobStatus jobStatus) { // // Note the failure and its location // TaskStatus status = taskStatuses.get(taskid); String trackerName; String trackerHostName = null; TaskStatus.State taskState = TaskStatus.Stat...
java
public void incompleteSubTask(TaskAttemptID taskid, JobStatus jobStatus) { // // Note the failure and its location // TaskStatus status = taskStatuses.get(taskid); String trackerName; String trackerHostName = null; TaskStatus.State taskState = TaskStatus.Stat...
[ "public", "void", "incompleteSubTask", "(", "TaskAttemptID", "taskid", ",", "JobStatus", "jobStatus", ")", "{", "//", "// Note the failure and its location", "//", "TaskStatus", "status", "=", "taskStatuses", ".", "get", "(", "taskid", ")", ";", "String", "trackerNa...
Indicate that one of the taskids in this TaskInProgress has failed.
[ "Indicate", "that", "one", "of", "the", "taskids", "in", "this", "TaskInProgress", "has", "failed", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L785-L868
117,611
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.completed
public void completed(TaskAttemptID taskid) { // // Record that this taskid is complete // completedTask(taskid, TaskStatus.State.SUCCEEDED); // Note the successful taskid setSuccessfulTaskid(taskid); // // Now that the TIP is complete, the other speculative // subtask...
java
public void completed(TaskAttemptID taskid) { // // Record that this taskid is complete // completedTask(taskid, TaskStatus.State.SUCCEEDED); // Note the successful taskid setSuccessfulTaskid(taskid); // // Now that the TIP is complete, the other speculative // subtask...
[ "public", "void", "completed", "(", "TaskAttemptID", "taskid", ")", "{", "//", "// Record that this taskid is complete", "//", "completedTask", "(", "taskid", ",", "TaskStatus", ".", "State", ".", "SUCCEEDED", ")", ";", "// Note the successful taskid", "setSuccessfulTas...
Indicate that one of the taskids in this TaskInProgress has successfully completed!
[ "Indicate", "that", "one", "of", "the", "taskids", "in", "this", "TaskInProgress", "has", "successfully", "completed!" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L915-L934
117,612
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.killTask
boolean killTask(TaskAttemptID taskId, boolean shouldFail, String diagnosticInfo) { TaskStatus st = taskStatuses.get(taskId); if(st != null && (st.getRunState() == TaskStatus.State.RUNNING || st.getRunState() == TaskStatus.State.COMMIT_PENDING || st.inTaskCleanupPhase() || st.getRunState...
java
boolean killTask(TaskAttemptID taskId, boolean shouldFail, String diagnosticInfo) { TaskStatus st = taskStatuses.get(taskId); if(st != null && (st.getRunState() == TaskStatus.State.RUNNING || st.getRunState() == TaskStatus.State.COMMIT_PENDING || st.inTaskCleanupPhase() || st.getRunState...
[ "boolean", "killTask", "(", "TaskAttemptID", "taskId", ",", "boolean", "shouldFail", ",", "String", "diagnosticInfo", ")", "{", "TaskStatus", "st", "=", "taskStatuses", ".", "get", "(", "taskId", ")", ";", "if", "(", "st", "!=", "null", "&&", "(", "st", ...
Kill the given task
[ "Kill", "the", "given", "task" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L992-L1004
117,613
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.canBeSpeculated
boolean canBeSpeculated(long currentTime) { if (skipping || !isRunnable() || !isRunning() || completes != 0 || isOnlyCommitPending() || activeTasks.size() > MAX_TASK_EXECS) { if (isMapTask() ? job.shouldLogCannotspeculativeMaps() : job.shouldLogCannotspeculativeReduces()) { ...
java
boolean canBeSpeculated(long currentTime) { if (skipping || !isRunnable() || !isRunning() || completes != 0 || isOnlyCommitPending() || activeTasks.size() > MAX_TASK_EXECS) { if (isMapTask() ? job.shouldLogCannotspeculativeMaps() : job.shouldLogCannotspeculativeReduces()) { ...
[ "boolean", "canBeSpeculated", "(", "long", "currentTime", ")", "{", "if", "(", "skipping", "||", "!", "isRunnable", "(", ")", "||", "!", "isRunning", "(", ")", "||", "completes", "!=", "0", "||", "isOnlyCommitPending", "(", ")", "||", "activeTasks", ".", ...
Can this task be speculated? This requires that it isn't done or almost done and that it isn't already being speculatively executed. Added for use by queue scheduling algorithms. @param currentTime
[ "Can", "this", "task", "be", "speculated?", "This", "requires", "that", "it", "isn", "t", "done", "or", "almost", "done", "and", "that", "it", "isn", "t", "already", "being", "speculatively", "executed", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1081-L1139
117,614
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.getTaskToRun
public Task getTaskToRun(String taskTracker) { // Create the 'taskid'; do not count the 'killed' tasks against the job! TaskAttemptID taskid = null; if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) { // Make sure that the attempts are unqiue across restarts int attemptId = ...
java
public Task getTaskToRun(String taskTracker) { // Create the 'taskid'; do not count the 'killed' tasks against the job! TaskAttemptID taskid = null; if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) { // Make sure that the attempts are unqiue across restarts int attemptId = ...
[ "public", "Task", "getTaskToRun", "(", "String", "taskTracker", ")", "{", "// Create the 'taskid'; do not count the 'killed' tasks against the job!", "TaskAttemptID", "taskid", "=", "null", ";", "if", "(", "nextTaskId", "<", "(", "MAX_TASK_EXECS", "+", "maxTaskAttempts", ...
Return a Task that can be sent to a TaskTracker for execution.
[ "Return", "a", "Task", "that", "can", "be", "sent", "to", "a", "TaskTracker", "for", "execution", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1223-L1246
117,615
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.addRunningTask
public Task addRunningTask(TaskAttemptID taskid, String taskTracker, boolean taskCleanup) { // 1 slot is enough for taskCleanup task int numSlotsNeeded = taskCleanup ? 1 : numSlotsRequired; // create the task Task t = null; if (isMapTask()) ...
java
public Task addRunningTask(TaskAttemptID taskid, String taskTracker, boolean taskCleanup) { // 1 slot is enough for taskCleanup task int numSlotsNeeded = taskCleanup ? 1 : numSlotsRequired; // create the task Task t = null; if (isMapTask()) ...
[ "public", "Task", "addRunningTask", "(", "TaskAttemptID", "taskid", ",", "String", "taskTracker", ",", "boolean", "taskCleanup", ")", "{", "// 1 slot is enough for taskCleanup task", "int", "numSlotsNeeded", "=", "taskCleanup", "?", "1", ":", "numSlotsRequired", ";", ...
Adds a previously running task to this tip. This is used in case of jobtracker restarts.
[ "Adds", "a", "previously", "running", "task", "to", "this", "tip", ".", "This", "is", "used", "in", "case", "of", "jobtracker", "restarts", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1256-L1336
117,616
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.hasRunOnMachine
public boolean hasRunOnMachine(String trackerHost, String trackerName) { return this.activeTasks.values().contains(trackerName) || hasFailedOnMachine(trackerHost); }
java
public boolean hasRunOnMachine(String trackerHost, String trackerName) { return this.activeTasks.values().contains(trackerName) || hasFailedOnMachine(trackerHost); }
[ "public", "boolean", "hasRunOnMachine", "(", "String", "trackerHost", ",", "String", "trackerName", ")", "{", "return", "this", ".", "activeTasks", ".", "values", "(", ")", ".", "contains", "(", "trackerName", ")", "||", "hasFailedOnMachine", "(", "trackerHost",...
Was this task ever scheduled to run on this machine? @param trackerHost The task tracker hostname @param trackerName The tracker name @return Was task scheduled on the tracker?
[ "Was", "this", "task", "ever", "scheduled", "to", "run", "on", "this", "machine?" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1374-L1377
117,617
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.getSplitNodes
public String getSplitNodes() { if (!isMapTask() || jobSetup || jobCleanup) { return ""; } String[] nodes = rawSplit.getLocations(); if (nodes == null || nodes.length == 0) { return ""; } StringBuffer ret = new StringBuffer(nodes[0]); for(int i = 1; i < nodes.length;i++) { ...
java
public String getSplitNodes() { if (!isMapTask() || jobSetup || jobCleanup) { return ""; } String[] nodes = rawSplit.getLocations(); if (nodes == null || nodes.length == 0) { return ""; } StringBuffer ret = new StringBuffer(nodes[0]); for(int i = 1; i < nodes.length;i++) { ...
[ "public", "String", "getSplitNodes", "(", ")", "{", "if", "(", "!", "isMapTask", "(", ")", "||", "jobSetup", "||", "jobCleanup", ")", "{", "return", "\"\"", ";", "}", "String", "[", "]", "nodes", "=", "rawSplit", ".", "getLocations", "(", ")", ";", "...
Gets the Node list of input split locations sorted in rack order.
[ "Gets", "the", "Node", "list", "of", "input", "split", "locations", "sorted", "in", "rack", "order", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1411-L1425
117,618
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.updateProgressRate
public void updateProgressRate(long currentTime) { double bestProgressRate = 0; for (TaskStatus ts : taskStatuses.values()){ if (ts.getRunState() == TaskStatus.State.RUNNING || ts.getRunState() == TaskStatus.State.SUCCEEDED || ts.getRunState() == TaskStatus.State.COMMIT_PENDING) { ...
java
public void updateProgressRate(long currentTime) { double bestProgressRate = 0; for (TaskStatus ts : taskStatuses.values()){ if (ts.getRunState() == TaskStatus.State.RUNNING || ts.getRunState() == TaskStatus.State.SUCCEEDED || ts.getRunState() == TaskStatus.State.COMMIT_PENDING) { ...
[ "public", "void", "updateProgressRate", "(", "long", "currentTime", ")", "{", "double", "bestProgressRate", "=", "0", ";", "for", "(", "TaskStatus", "ts", ":", "taskStatuses", ".", "values", "(", ")", ")", "{", "if", "(", "ts", ".", "getRunState", "(", "...
update progress rate for a task The assumption is that the JIP lock is held entering this routine. So it's left unsynchronized. Currently the only places it's called from are TIP.updateStatus and JIP.refreshCandidate*
[ "update", "progress", "rate", "for", "a", "task" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1447-L1468
117,619
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
TaskInProgress.updateJobStats
private void updateJobStats(Phase phase, ProcessingRates oldRates, ProcessingRates newRates) { DataStatistics stats = job.getRunningTaskStatistics(phase); stats.updateStatistics(oldRates.getRate(phase), newRates.getRate(phase)); }
java
private void updateJobStats(Phase phase, ProcessingRates oldRates, ProcessingRates newRates) { DataStatistics stats = job.getRunningTaskStatistics(phase); stats.updateStatistics(oldRates.getRate(phase), newRates.getRate(phase)); }
[ "private", "void", "updateJobStats", "(", "Phase", "phase", ",", "ProcessingRates", "oldRates", ",", "ProcessingRates", "newRates", ")", "{", "DataStatistics", "stats", "=", "job", ".", "getRunningTaskStatistics", "(", "phase", ")", ";", "stats", ".", "updateStati...
Helper function that updates the processing rates stats for this job. Only updates the rate in the corresponding phase. @param phase @param oldRates @param newRates
[ "Helper", "function", "that", "updates", "the", "processing", "rates", "stats", "for", "this", "job", ".", "Only", "updates", "the", "rate", "in", "the", "corresponding", "phase", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1534-L1538
117,620
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.getAvailableSlots
private int getAvailableSlots(TaskTrackerStatus tts, TaskType type) { return getMaxSlots(tts, type) - occupiedSlotsAfterHeartbeat(tts, type); }
java
private int getAvailableSlots(TaskTrackerStatus tts, TaskType type) { return getMaxSlots(tts, type) - occupiedSlotsAfterHeartbeat(tts, type); }
[ "private", "int", "getAvailableSlots", "(", "TaskTrackerStatus", "tts", ",", "TaskType", "type", ")", "{", "return", "getMaxSlots", "(", "tts", ",", "type", ")", "-", "occupiedSlotsAfterHeartbeat", "(", "tts", ",", "type", ")", ";", "}" ]
Obtain the how many more slots can be scheduled on this tasktracker @param tts The status of the tasktracker @param type The type of the task to be scheduled @return the number of tasks can be scheduled
[ "Obtain", "the", "how", "many", "more", "slots", "can", "be", "scheduled", "on", "this", "tasktracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L805-L807
117,621
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.occupiedSlotsAfterHeartbeat
private int occupiedSlotsAfterHeartbeat( TaskTrackerStatus tts, TaskType type) { int occupied = (type == TaskType.MAP) ? tts.countOccupiedMapSlots() - tts.getMapsReleased() : tts.countOccupiedReduceSlots() - tts.getReducesReleased(); return occupied; }
java
private int occupiedSlotsAfterHeartbeat( TaskTrackerStatus tts, TaskType type) { int occupied = (type == TaskType.MAP) ? tts.countOccupiedMapSlots() - tts.getMapsReleased() : tts.countOccupiedReduceSlots() - tts.getReducesReleased(); return occupied; }
[ "private", "int", "occupiedSlotsAfterHeartbeat", "(", "TaskTrackerStatus", "tts", ",", "TaskType", "type", ")", "{", "int", "occupied", "=", "(", "type", "==", "TaskType", ".", "MAP", ")", "?", "tts", ".", "countOccupiedMapSlots", "(", ")", "-", "tts", ".", ...
Obtain the number of occupied slots after the scheduled kills are done @param tts The status of the tasktracker @param type The type of the task @return the number of occupied slots after kill actions
[ "Obtain", "the", "number", "of", "occupied", "slots", "after", "the", "scheduled", "kills", "are", "done" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L815-L821
117,622
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.updateLocalityWaitTimes
private void updateLocalityWaitTimes(long currentTime) { long timeSinceLastHeartbeat = (lastHeartbeatTime == 0 ? 0 : currentTime - lastHeartbeatTime); lastHeartbeatTime = currentTime; for (JobInfo info: infos.values()) { if (info.skippedAtLastHeartbeat) { info.timeWaitedForLocalMap += ti...
java
private void updateLocalityWaitTimes(long currentTime) { long timeSinceLastHeartbeat = (lastHeartbeatTime == 0 ? 0 : currentTime - lastHeartbeatTime); lastHeartbeatTime = currentTime; for (JobInfo info: infos.values()) { if (info.skippedAtLastHeartbeat) { info.timeWaitedForLocalMap += ti...
[ "private", "void", "updateLocalityWaitTimes", "(", "long", "currentTime", ")", "{", "long", "timeSinceLastHeartbeat", "=", "(", "lastHeartbeatTime", "==", "0", "?", "0", ":", "currentTime", "-", "lastHeartbeatTime", ")", ";", "lastHeartbeatTime", "=", "currentTime",...
Update locality wait times for jobs that were skipped at last heartbeat.
[ "Update", "locality", "wait", "times", "for", "jobs", "that", "were", "skipped", "at", "last", "heartbeat", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1021-L1034
117,623
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.updateLastMapLocalityLevel
private void updateLastMapLocalityLevel(JobInProgress job, Task mapTaskLaunched, TaskTrackerStatus tracker) { JobInfo info = infos.get(job); LocalityLevel localityLevel = localManager.taskToLocalityLevel( job, mapTaskLaunched, tracker); info.lastMapLocalityLevel = localityLevel; info.timeW...
java
private void updateLastMapLocalityLevel(JobInProgress job, Task mapTaskLaunched, TaskTrackerStatus tracker) { JobInfo info = infos.get(job); LocalityLevel localityLevel = localManager.taskToLocalityLevel( job, mapTaskLaunched, tracker); info.lastMapLocalityLevel = localityLevel; info.timeW...
[ "private", "void", "updateLastMapLocalityLevel", "(", "JobInProgress", "job", ",", "Task", "mapTaskLaunched", ",", "TaskTrackerStatus", "tracker", ")", "{", "JobInfo", "info", "=", "infos", ".", "get", "(", "job", ")", ";", "LocalityLevel", "localityLevel", "=", ...
Update a job's locality level and locality wait variables given that that it has just launched a map task on a given task tracker.
[ "Update", "a", "job", "s", "locality", "level", "and", "locality", "wait", "variables", "given", "that", "that", "it", "has", "just", "launched", "a", "map", "task", "on", "a", "given", "task", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1040-L1047
117,624
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.update
protected void update() { //Making more granual locking so that clusterStatus can be fetched from Jobtracker. ClusterStatus clusterStatus = taskTrackerManager.getClusterStatus(); // Recompute locality delay from JobTracker heartbeat interval if enabled. // This will also lock the JT, so do it outside of...
java
protected void update() { //Making more granual locking so that clusterStatus can be fetched from Jobtracker. ClusterStatus clusterStatus = taskTrackerManager.getClusterStatus(); // Recompute locality delay from JobTracker heartbeat interval if enabled. // This will also lock the JT, so do it outside of...
[ "protected", "void", "update", "(", ")", "{", "//Making more granual locking so that clusterStatus can be fetched from Jobtracker.", "ClusterStatus", "clusterStatus", "=", "taskTrackerManager", ".", "getClusterStatus", "(", ")", ";", "// Recompute locality delay from JobTracker heart...
Recompute the internal variables used by the scheduler - per-job weights, fair shares, deficits, minimum slot allocations, and numbers of running and needed tasks of each type.
[ "Recompute", "the", "internal", "variables", "used", "by", "the", "scheduler", "-", "per", "-", "job", "weights", "fair", "shares", "deficits", "minimum", "slot", "allocations", "and", "numbers", "of", "running", "and", "needed", "tasks", "of", "each", "type",...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1098-L1150
117,625
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.adjustClusterwideReason
private BlockedAdmissionReason adjustClusterwideReason( AdmissionControlData admissionControlData, BlockedAdmissionReason originalReason, String poolName) { BlockedAdmissionReason clusterwideReason = (BlockedAdmissionReason.underClusterwideAdmissionControl( admissionControlData...
java
private BlockedAdmissionReason adjustClusterwideReason( AdmissionControlData admissionControlData, BlockedAdmissionReason originalReason, String poolName) { BlockedAdmissionReason clusterwideReason = (BlockedAdmissionReason.underClusterwideAdmissionControl( admissionControlData...
[ "private", "BlockedAdmissionReason", "adjustClusterwideReason", "(", "AdmissionControlData", "admissionControlData", ",", "BlockedAdmissionReason", "originalReason", ",", "String", "poolName", ")", "{", "BlockedAdmissionReason", "clusterwideReason", "=", "(", "BlockedAdmissionRea...
Based on the original reason and admission control data, adjust the reason this job is not admitted, if any. @param admissionControlData Admission control data from initializer @param originalReason Original reason of denial @param poolName Name of the pool @return Reason that includes a possibility of cluster wide bl...
[ "Based", "on", "the", "original", "reason", "and", "admission", "control", "data", "adjust", "the", "reason", "this", "job", "is", "not", "admitted", "if", "any", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1161-L1173
117,626
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.getNotAdmittedJobs
synchronized Collection<NotAdmittedJobInfo> getNotAdmittedJobs() { List<NotAdmittedJobInfo> jobInfoList = new ArrayList<NotAdmittedJobInfo>(infos.size()); AdmissionControlData admissionControlData = jobInitializer.getAdmissionControlData(); float averageWaitMsecsPerHardAdmissionJob = ...
java
synchronized Collection<NotAdmittedJobInfo> getNotAdmittedJobs() { List<NotAdmittedJobInfo> jobInfoList = new ArrayList<NotAdmittedJobInfo>(infos.size()); AdmissionControlData admissionControlData = jobInitializer.getAdmissionControlData(); float averageWaitMsecsPerHardAdmissionJob = ...
[ "synchronized", "Collection", "<", "NotAdmittedJobInfo", ">", "getNotAdmittedJobs", "(", ")", "{", "List", "<", "NotAdmittedJobInfo", ">", "jobInfoList", "=", "new", "ArrayList", "<", "NotAdmittedJobInfo", ">", "(", "infos", ".", "size", "(", ")", ")", ";", "A...
Get the jobs that were not admitted and all the info needed for display. The reasons of why the jobs were not admitted were set by the fair scheduler, but will be adjusted when this method is called based on the current job initializer admission control data. @return Collection of jobs that were not admitted and thei...
[ "Get", "the", "jobs", "that", "were", "not", "admitted", "and", "all", "the", "info", "needed", "for", "display", ".", "The", "reasons", "of", "why", "the", "jobs", "were", "not", "admitted", "were", "set", "by", "the", "fair", "scheduler", "but", "will"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1183-L1212
117,627
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.getJobNotAdmittedReason
private synchronized String getJobNotAdmittedReason(JobInProgress job, JobAdmissionWaitInfo waitInfo) { JobInfo jobInfo = infos.get(job); if (jobInfo == null) { return "Unknown, can't find job"; } AdmissionControlData admissionControlData = jobInitializer.getAdmissionControlData(); ...
java
private synchronized String getJobNotAdmittedReason(JobInProgress job, JobAdmissionWaitInfo waitInfo) { JobInfo jobInfo = infos.get(job); if (jobInfo == null) { return "Unknown, can't find job"; } AdmissionControlData admissionControlData = jobInitializer.getAdmissionControlData(); ...
[ "private", "synchronized", "String", "getJobNotAdmittedReason", "(", "JobInProgress", "job", ",", "JobAdmissionWaitInfo", "waitInfo", ")", "{", "JobInfo", "jobInfo", "=", "infos", ".", "get", "(", "job", ")", ";", "if", "(", "jobInfo", "==", "null", ")", "{", ...
Get a stringified reason for not admitting a job. @param job Job not admitted @param waitInfo Details about job that is not admitted @return Reason why not admitted as a string
[ "Get", "a", "stringified", "reason", "for", "not", "admitting", "a", "job", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1221-L1234
117,628
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.dumpStatus
private void dumpStatus(long now) { if (now - lastDumpStatusTime < dumpStatusPeriod) { return; } lastDumpStatusTime = now; logJobStats(infos.keySet(), TaskType.MAP); logJobStats(infos.keySet(), TaskType.REDUCE); dumpSpeculationStatus(now); }
java
private void dumpStatus(long now) { if (now - lastDumpStatusTime < dumpStatusPeriod) { return; } lastDumpStatusTime = now; logJobStats(infos.keySet(), TaskType.MAP); logJobStats(infos.keySet(), TaskType.REDUCE); dumpSpeculationStatus(now); }
[ "private", "void", "dumpStatus", "(", "long", "now", ")", "{", "if", "(", "now", "-", "lastDumpStatusTime", "<", "dumpStatusPeriod", ")", "{", "return", ";", "}", "lastDumpStatusTime", "=", "now", ";", "logJobStats", "(", "infos", ".", "keySet", "(", ")", ...
Output some scheduling information to LOG @param now current unix time
[ "Output", "some", "scheduling", "information", "to", "LOG" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1240-L1248
117,629
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.slowerButAccurateCountTasks
private void slowerButAccurateCountTasks(JobInfo info, JobInProgress job) { // Count maps int totalMaps = job.numMapTasks; int finishedMaps = 0; int runningMaps = 0; int runningMapTips = 0; for (TaskInProgress tip : job.getTasks(org.apache.hadoop.mapreduce.TaskType.MAP)) { if (tip.is...
java
private void slowerButAccurateCountTasks(JobInfo info, JobInProgress job) { // Count maps int totalMaps = job.numMapTasks; int finishedMaps = 0; int runningMaps = 0; int runningMapTips = 0; for (TaskInProgress tip : job.getTasks(org.apache.hadoop.mapreduce.TaskType.MAP)) { if (tip.is...
[ "private", "void", "slowerButAccurateCountTasks", "(", "JobInfo", "info", ",", "JobInProgress", "job", ")", "{", "// Count maps", "int", "totalMaps", "=", "job", ".", "numMapTasks", ";", "int", "finishedMaps", "=", "0", ";", "int", "runningMaps", "=", "0", ";"...
Obtain task counts for a job by scanning all the tasks of all running jobs.
[ "Obtain", "task", "counts", "for", "a", "job", "by", "scanning", "all", "the", "tasks", "of", "all", "running", "jobs", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1558-L1605
117,630
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.fifoWeightAdjust
private void fifoWeightAdjust(Pool pool) { List<JobInProgress> jobs = new ArrayList<JobInProgress>(); jobs.addAll(pool.getJobs()); Collections.sort(jobs, fifoComparator); double factor = 1.0; for (JobInProgress job : jobs) { JobInfo info = infos.get(job); if (info == null) { thro...
java
private void fifoWeightAdjust(Pool pool) { List<JobInProgress> jobs = new ArrayList<JobInProgress>(); jobs.addAll(pool.getJobs()); Collections.sort(jobs, fifoComparator); double factor = 1.0; for (JobInProgress job : jobs) { JobInfo info = infos.get(job); if (info == null) { thro...
[ "private", "void", "fifoWeightAdjust", "(", "Pool", "pool", ")", "{", "List", "<", "JobInProgress", ">", "jobs", "=", "new", "ArrayList", "<", "JobInProgress", ">", "(", ")", ";", "jobs", ".", "addAll", "(", "pool", ".", "getJobs", "(", ")", ")", ";", ...
Boost the weight for the older jobs.
[ "Boost", "the", "weight", "for", "the", "older", "jobs", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1666-L1681
117,631
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.incSlotLimit
private boolean incSlotLimit(JobInfo info, TaskType type, LimitType limit) { switch (limit) { case MIN: if (type == TaskType.MAP) { if (info.minMaps < runnableTasks(info, type)) { info.minMaps += 1; return true; } } else { if (info.minReduc...
java
private boolean incSlotLimit(JobInfo info, TaskType type, LimitType limit) { switch (limit) { case MIN: if (type == TaskType.MAP) { if (info.minMaps < runnableTasks(info, type)) { info.minMaps += 1; return true; } } else { if (info.minReduc...
[ "private", "boolean", "incSlotLimit", "(", "JobInfo", "info", ",", "TaskType", "type", ",", "LimitType", "limit", ")", "{", "switch", "(", "limit", ")", "{", "case", "MIN", ":", "if", "(", "type", "==", "TaskType", ".", "MAP", ")", "{", "if", "(", "i...
Increment the slot limit of a job @param info The JobInfo of the job @param type Map or Reduce @param limit Max or Min @return true if we can increment
[ "Increment", "the", "slot", "limit", "of", "a", "job" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1879-L1910
117,632
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.computeShare
private double computeShare(JobInfo info, double w2sRatio, TaskType type, boolean considerMinMax) { if (!isRunnable(info)) { return 0; } double share = type == TaskType.MAP ? info.mapWeight : info.reduceWeight; share *= w2sRatio; if (considerMinMax) { int minSlots = type == TaskTyp...
java
private double computeShare(JobInfo info, double w2sRatio, TaskType type, boolean considerMinMax) { if (!isRunnable(info)) { return 0; } double share = type == TaskType.MAP ? info.mapWeight : info.reduceWeight; share *= w2sRatio; if (considerMinMax) { int minSlots = type == TaskTyp...
[ "private", "double", "computeShare", "(", "JobInfo", "info", ",", "double", "w2sRatio", ",", "TaskType", "type", ",", "boolean", "considerMinMax", ")", "{", "if", "(", "!", "isRunnable", "(", "info", ")", ")", "{", "return", "0", ";", "}", "double", "sha...
Compute the number of slots assigned to a job given a particular weight-to-slot ratio w2sRatio.
[ "Compute", "the", "number", "of", "slots", "assigned", "to", "a", "job", "given", "a", "particular", "weight", "-", "to", "-", "slot", "ratio", "w2sRatio", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1981-L1996
117,633
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.neededTasks
protected int neededTasks(JobInfo info, TaskType taskType) { if (info == null) return 0; return taskType == TaskType.MAP ? info.neededMaps : info.neededReduces; }
java
protected int neededTasks(JobInfo info, TaskType taskType) { if (info == null) return 0; return taskType == TaskType.MAP ? info.neededMaps : info.neededReduces; }
[ "protected", "int", "neededTasks", "(", "JobInfo", "info", ",", "TaskType", "taskType", ")", "{", "if", "(", "info", "==", "null", ")", "return", "0", ";", "return", "taskType", "==", "TaskType", ".", "MAP", "?", "info", ".", "neededMaps", ":", "info", ...
returning 0's for jobs with no JobInfo present.
[ "returning", "0", "s", "for", "jobs", "with", "no", "JobInfo", "present", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L2094-L2097
117,634
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.isStarvedForMinShare
boolean isStarvedForMinShare(JobInfo info, TaskType taskType) { float starvingThreshold = (float) (minTasks(info, taskType) * 0.9); return runningTasks(info, taskType) < starvingThreshold; }
java
boolean isStarvedForMinShare(JobInfo info, TaskType taskType) { float starvingThreshold = (float) (minTasks(info, taskType) * 0.9); return runningTasks(info, taskType) < starvingThreshold; }
[ "boolean", "isStarvedForMinShare", "(", "JobInfo", "info", ",", "TaskType", "taskType", ")", "{", "float", "starvingThreshold", "=", "(", "float", ")", "(", "minTasks", "(", "info", ",", "taskType", ")", "*", "0.9", ")", ";", "return", "runningTasks", "(", ...
Is a job below 90% of its min share for the given task type?
[ "Is", "a", "job", "below", "90%", "of", "its", "min", "share", "for", "the", "given", "task", "type?" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L2242-L2245
117,635
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java
FairScheduler.preemptTasksIfNecessary
protected void preemptTasksIfNecessary() { if (!preemptionEnabled || jobComparator == JobComparator.FIFO) return; long curTime = clock.getTime(); if (curTime - lastPreemptCheckTime < preemptionInterval) return; lastPreemptCheckTime = curTime; int currentMaxPreemptibleTasks = maxPreempt...
java
protected void preemptTasksIfNecessary() { if (!preemptionEnabled || jobComparator == JobComparator.FIFO) return; long curTime = clock.getTime(); if (curTime - lastPreemptCheckTime < preemptionInterval) return; lastPreemptCheckTime = curTime; int currentMaxPreemptibleTasks = maxPreempt...
[ "protected", "void", "preemptTasksIfNecessary", "(", ")", "{", "if", "(", "!", "preemptionEnabled", "||", "jobComparator", "==", "JobComparator", ".", "FIFO", ")", "return", ";", "long", "curTime", "=", "clock", ".", "getTime", "(", ")", ";", "if", "(", "c...
Check for jobs that need tasks preempted, either because they have been below their guaranteed share for their pool's preemptionTimeout or they have been below half their fair share for the fairSharePreemptionTimeout. If such jobs exist, compute how many tasks of each type need to be preempted and then select the right...
[ "Check", "for", "jobs", "that", "need", "tasks", "preempted", "either", "because", "they", "have", "been", "below", "their", "guaranteed", "share", "for", "their", "pool", "s", "preemptionTimeout", "or", "they", "have", "been", "below", "half", "their", "fair"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L2268-L2322
117,636
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
DatanodeInfo.getDatanodeReport
public String getDatanodeReport() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); long nonDFSUsed = getNonDfsUsed(); float usedPercent = getDfsUsedPercent(); float remainingPercent = getRemainingPercent(); buffer.append...
java
public String getDatanodeReport() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); long nonDFSUsed = getNonDfsUsed(); float usedPercent = getDfsUsedPercent(); float remainingPercent = getRemainingPercent(); buffer.append...
[ "public", "String", "getDatanodeReport", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "long", "c", "=", "getCapacity", "(", ")", ";", "long", "r", "=", "getRemaining", "(", ")", ";", "long", "u", "=", "getDfsUsed", ...
A formatted string for reporting the status of the DataNode.
[ "A", "formatted", "string", "for", "reporting", "the", "status", "of", "the", "DataNode", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java#L283-L312
117,637
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
DatanodeInfo.dumpDatanode
public String dumpDatanode() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); buffer.append(name); if (!NetworkTopology.DEFAULT_RACK.equals(location)) { buffer.append(" "+location); } if (isDecommissioned()) { ...
java
public String dumpDatanode() { StringBuffer buffer = new StringBuffer(); long c = getCapacity(); long r = getRemaining(); long u = getDfsUsed(); buffer.append(name); if (!NetworkTopology.DEFAULT_RACK.equals(location)) { buffer.append(" "+location); } if (isDecommissioned()) { ...
[ "public", "String", "dumpDatanode", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "long", "c", "=", "getCapacity", "(", ")", ";", "long", "r", "=", "getRemaining", "(", ")", ";", "long", "u", "=", "getDfsUsed", "("...
A formatted string for printing the status of the DataNode.
[ "A", "formatted", "string", "for", "printing", "the", "status", "of", "the", "DataNode", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java#L315-L337
117,638
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
DatanodeInfo.setAdminState
protected void setAdminState(AdminStates newState) { if (newState == AdminStates.NORMAL) { adminState = null; } else { adminState = newState; } }
java
protected void setAdminState(AdminStates newState) { if (newState == AdminStates.NORMAL) { adminState = null; } else { adminState = newState; } }
[ "protected", "void", "setAdminState", "(", "AdminStates", "newState", ")", "{", "if", "(", "newState", "==", "AdminStates", ".", "NORMAL", ")", "{", "adminState", "=", "null", ";", "}", "else", "{", "adminState", "=", "newState", ";", "}", "}" ]
Sets the admin state of this node.
[ "Sets", "the", "admin", "state", "of", "this", "node", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java#L400-L407
117,639
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java
Balancer.parse
private void parse(String[] args) { Options cliOpts = setupOptions(); BasicParser parser = new BasicParser(); CommandLine cl = null; try { try { cl = parser.parse(cliOpts, args); } catch (ParseException ex) { throw new IllegalArgumentException("args = " + Arrays.toString(args)...
java
private void parse(String[] args) { Options cliOpts = setupOptions(); BasicParser parser = new BasicParser(); CommandLine cl = null; try { try { cl = parser.parse(cliOpts, args); } catch (ParseException ex) { throw new IllegalArgumentException("args = " + Arrays.toString(args)...
[ "private", "void", "parse", "(", "String", "[", "]", "args", ")", "{", "Options", "cliOpts", "=", "setupOptions", "(", ")", ";", "BasicParser", "parser", "=", "new", "BasicParser", "(", ")", ";", "CommandLine", "cl", "=", "null", ";", "try", "{", "try"...
parse command line arguments
[ "parse", "command", "line", "arguments" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java#L1230-L1257
117,640
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java
CoronaReleaseManager.getLastTimeStamp
private long getLastTimeStamp() { long result = -1; if (coronaReleaseFileCheck != null && !coronaReleaseFileCheck.isEmpty()) { result = getLastTimeStamp(new Path(releasePath, coronaReleaseFileCheck)); if (result > 0) { return result; } } return getLastTimeStamp(releasePath); ...
java
private long getLastTimeStamp() { long result = -1; if (coronaReleaseFileCheck != null && !coronaReleaseFileCheck.isEmpty()) { result = getLastTimeStamp(new Path(releasePath, coronaReleaseFileCheck)); if (result > 0) { return result; } } return getLastTimeStamp(releasePath); ...
[ "private", "long", "getLastTimeStamp", "(", ")", "{", "long", "result", "=", "-", "1", ";", "if", "(", "coronaReleaseFileCheck", "!=", "null", "&&", "!", "coronaReleaseFileCheck", ".", "isEmpty", "(", ")", ")", "{", "result", "=", "getLastTimeStamp", "(", ...
getLastStamp will go throught all the files and directories in the release directory, and find the largest timestamp. This is used to check if there is any new release. RELEASE_COPY_PATTERN and CORONA_RELEASE_FILE_CHECK can be used to limit the files checked
[ "getLastStamp", "will", "go", "throught", "all", "the", "files", "and", "directories", "in", "the", "release", "directory", "and", "find", "the", "largest", "timestamp", ".", "This", "is", "used", "to", "check", "if", "there", "is", "any", "new", "release", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java#L352-L361
117,641
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java
CoronaReleaseManager.getLastTimeStamp
private long getLastTimeStamp(Path pathToCheck) { long lastTimeStamp = -1; long tmpTimeStamp = -1; try { for (FileStatus fileStat: fs.listStatus(pathToCheck)) { Path srcPath = fileStat.getPath(); if (!fileStat.isDir()) { boolean checkFlag = true; if (release_pattern...
java
private long getLastTimeStamp(Path pathToCheck) { long lastTimeStamp = -1; long tmpTimeStamp = -1; try { for (FileStatus fileStat: fs.listStatus(pathToCheck)) { Path srcPath = fileStat.getPath(); if (!fileStat.isDir()) { boolean checkFlag = true; if (release_pattern...
[ "private", "long", "getLastTimeStamp", "(", "Path", "pathToCheck", ")", "{", "long", "lastTimeStamp", "=", "-", "1", ";", "long", "tmpTimeStamp", "=", "-", "1", ";", "try", "{", "for", "(", "FileStatus", "fileStat", ":", "fs", ".", "listStatus", "(", "pa...
Get the release directory's latest timestamp
[ "Get", "the", "release", "directory", "s", "latest", "timestamp" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java#L366-L397
117,642
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java
CoronaReleaseManager.copyRelease
private boolean copyRelease(Path src, Path dest, boolean isTop, boolean isForced) { try { if (!fs.exists(dest)) { if (!fs.mkdirs(dest)) { LOG.error("Unable to make dir " + dest.toString()); return false; } } else { if (isTop && !isForced) { Path don...
java
private boolean copyRelease(Path src, Path dest, boolean isTop, boolean isForced) { try { if (!fs.exists(dest)) { if (!fs.mkdirs(dest)) { LOG.error("Unable to make dir " + dest.toString()); return false; } } else { if (isTop && !isForced) { Path don...
[ "private", "boolean", "copyRelease", "(", "Path", "src", ",", "Path", "dest", ",", "boolean", "isTop", ",", "boolean", "isForced", ")", "{", "try", "{", "if", "(", "!", "fs", ".", "exists", "(", "dest", ")", ")", "{", "if", "(", "!", "fs", ".", "...
For every jar files from the source, create a link in the dest
[ "For", "every", "jar", "files", "from", "the", "source", "create", "a", "link", "in", "the", "dest" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaReleaseManager.java#L401-L452
117,643
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.sessionEnd
public void sessionEnd(SessionStatus finishState) { if (sessionStatusToMetrics.containsKey(finishState)) { sessionStatusToMetrics.get(finishState).inc(); } else { throw new IllegalArgumentException("Invalid end state " + finishState); } }
java
public void sessionEnd(SessionStatus finishState) { if (sessionStatusToMetrics.containsKey(finishState)) { sessionStatusToMetrics.get(finishState).inc(); } else { throw new IllegalArgumentException("Invalid end state " + finishState); } }
[ "public", "void", "sessionEnd", "(", "SessionStatus", "finishState", ")", "{", "if", "(", "sessionStatusToMetrics", ".", "containsKey", "(", "finishState", ")", ")", "{", "sessionStatusToMetrics", ".", "get", "(", "finishState", ")", ".", "inc", "(", ")", ";",...
Record the end of a session. @param finishState The state that the session finished in.
[ "Record", "the", "end", "of", "a", "session", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L272-L278
117,644
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.registerUpdater
public void registerUpdater(Scheduler scheduler, SessionNotifier sessionNotifier) { this.scheduler = scheduler; this.sessionNotifier = sessionNotifier; context.registerUpdater(this); }
java
public void registerUpdater(Scheduler scheduler, SessionNotifier sessionNotifier) { this.scheduler = scheduler; this.sessionNotifier = sessionNotifier; context.registerUpdater(this); }
[ "public", "void", "registerUpdater", "(", "Scheduler", "scheduler", ",", "SessionNotifier", "sessionNotifier", ")", "{", "this", ".", "scheduler", "=", "scheduler", ";", "this", ".", "sessionNotifier", "=", "sessionNotifier", ";", "context", ".", "registerUpdater", ...
Set the scheduler and start the updating. The metrics won't be reported until this is called. @param scheduler Scheduler for this cluster manager. @param sessionNotifier Session Notifier for this cluster manager.
[ "Set", "the", "scheduler", "and", "start", "the", "updating", ".", "The", "metrics", "won", "t", "be", "reported", "until", "this", "is", "called", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L303-L308
117,645
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.createSessionStatusToMetricsMap
private Map<SessionStatus, MetricsTimeVaryingInt> createSessionStatusToMetricsMap() { Map<SessionStatus, MetricsTimeVaryingInt> m = new HashMap<SessionStatus, MetricsTimeVaryingInt>(); for (SessionStatus endState : SESSION_END_STATES) { String name = endState.toString().toLowerCase() + "_sessions"...
java
private Map<SessionStatus, MetricsTimeVaryingInt> createSessionStatusToMetricsMap() { Map<SessionStatus, MetricsTimeVaryingInt> m = new HashMap<SessionStatus, MetricsTimeVaryingInt>(); for (SessionStatus endState : SESSION_END_STATES) { String name = endState.toString().toLowerCase() + "_sessions"...
[ "private", "Map", "<", "SessionStatus", ",", "MetricsTimeVaryingInt", ">", "createSessionStatusToMetricsMap", "(", ")", "{", "Map", "<", "SessionStatus", ",", "MetricsTimeVaryingInt", ">", "m", "=", "new", "HashMap", "<", "SessionStatus", ",", "MetricsTimeVaryingInt",...
Create a map of session status -> metrics. @return the map.
[ "Create", "a", "map", "of", "session", "status", "-", ">", "metrics", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L328-L337
117,646
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.createTypeToCountMap
private Map<ResourceType, MetricsIntValue> createTypeToCountMap( Collection<ResourceType> resourceTypes, String actionType) { Map<ResourceType, MetricsIntValue> m = new HashMap<ResourceType, MetricsIntValue>(); for (ResourceType t : resourceTypes) { String name = (actionType + "_" + t).toLow...
java
private Map<ResourceType, MetricsIntValue> createTypeToCountMap( Collection<ResourceType> resourceTypes, String actionType) { Map<ResourceType, MetricsIntValue> m = new HashMap<ResourceType, MetricsIntValue>(); for (ResourceType t : resourceTypes) { String name = (actionType + "_" + t).toLow...
[ "private", "Map", "<", "ResourceType", ",", "MetricsIntValue", ">", "createTypeToCountMap", "(", "Collection", "<", "ResourceType", ">", "resourceTypes", ",", "String", "actionType", ")", "{", "Map", "<", "ResourceType", ",", "MetricsIntValue", ">", "m", "=", "n...
Create a map of resource type -> current count. @param resourceTypes The resource types. @param actionType A string indicating pending, running etc. @return The map.
[ "Create", "a", "map", "of", "resource", "type", "-", ">", "current", "count", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L345-L355
117,647
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java
ClusterManagerMetrics.createTypeToResourceCountMap
private Map<ResourceType, MetricsTimeVaryingLong> createTypeToResourceCountMap( Collection<ResourceType> resourceTypes, String actionType) { Map<ResourceType, MetricsTimeVaryingLong> m = new HashMap<ResourceType, MetricsTimeVaryingLong>(); for (ResourceType t : resourceTypes) { String name...
java
private Map<ResourceType, MetricsTimeVaryingLong> createTypeToResourceCountMap( Collection<ResourceType> resourceTypes, String actionType) { Map<ResourceType, MetricsTimeVaryingLong> m = new HashMap<ResourceType, MetricsTimeVaryingLong>(); for (ResourceType t : resourceTypes) { String name...
[ "private", "Map", "<", "ResourceType", ",", "MetricsTimeVaryingLong", ">", "createTypeToResourceCountMap", "(", "Collection", "<", "ResourceType", ">", "resourceTypes", ",", "String", "actionType", ")", "{", "Map", "<", "ResourceType", ",", "MetricsTimeVaryingLong", "...
Create a map of resource type -> cumulative counts. @param resourceTypes The resource types. @param actionType A string indicating granted, revoked, etc. @return The map.
[ "Create", "a", "map", "of", "resource", "type", "-", ">", "cumulative", "counts", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerMetrics.java#L363-L374
117,648
facebookarchive/hadoop-20
src/tools/org/apache/hadoop/tools/rumen/ZombieJob.java
ZombieJob.makeUpRuntime
private long makeUpRuntime(List<LoggedDiscreteCDF> mapAttemptCDFs) { int total = 0; for (LoggedDiscreteCDF cdf : mapAttemptCDFs) { total += cdf.getNumberValues(); } if (total == 0) { return -1; } int index = random.nextInt(total); for (LoggedDiscreteCDF cdf : mapAttemptCDFs) { ...
java
private long makeUpRuntime(List<LoggedDiscreteCDF> mapAttemptCDFs) { int total = 0; for (LoggedDiscreteCDF cdf : mapAttemptCDFs) { total += cdf.getNumberValues(); } if (total == 0) { return -1; } int index = random.nextInt(total); for (LoggedDiscreteCDF cdf : mapAttemptCDFs) { ...
[ "private", "long", "makeUpRuntime", "(", "List", "<", "LoggedDiscreteCDF", ">", "mapAttemptCDFs", ")", "{", "int", "total", "=", "0", ";", "for", "(", "LoggedDiscreteCDF", "cdf", ":", "mapAttemptCDFs", ")", "{", "total", "+=", "cdf", ".", "getNumberValues", ...
Perform a weighted random selection on a list of CDFs, and produce a random variable using the selected CDF. @param mapAttemptCDFs A list of CDFs for the distribution of runtime for the 1st, 2nd, ... map attempts for the job.
[ "Perform", "a", "weighted", "random", "selection", "on", "a", "list", "of", "CDFs", "and", "produce", "a", "random", "variable", "using", "the", "selected", "CDF", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/rumen/ZombieJob.java#L757-L777
117,649
facebookarchive/hadoop-20
src/core/org/apache/hadoop/record/compiler/ant/RccTask.java
RccTask.execute
public void execute() throws BuildException { if (src == null && filesets.size()==0) { throw new BuildException("There must be a file attribute or a fileset child element"); } if (src != null) { doCompile(src); } Project myProject = getProject(); for (int i = 0; i < filesets.size(); ...
java
public void execute() throws BuildException { if (src == null && filesets.size()==0) { throw new BuildException("There must be a file attribute or a fileset child element"); } if (src != null) { doCompile(src); } Project myProject = getProject(); for (int i = 0; i < filesets.size(); ...
[ "public", "void", "execute", "(", ")", "throws", "BuildException", "{", "if", "(", "src", "==", "null", "&&", "filesets", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "BuildException", "(", "\"There must be a file attribute or a fileset child elem...
Invoke the Hadoop record compiler on each record definition file
[ "Invoke", "the", "Hadoop", "record", "compiler", "on", "each", "record", "definition", "file" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/compiler/ant/RccTask.java#L105-L122
117,650
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/VLongWritable.java
VLongWritable.compareTo
public int compareTo(Object o) { long thisValue = this.value; long thatValue = ((VLongWritable)o).value; return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1)); }
java
public int compareTo(Object o) { long thisValue = this.value; long thatValue = ((VLongWritable)o).value; return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1)); }
[ "public", "int", "compareTo", "(", "Object", "o", ")", "{", "long", "thisValue", "=", "this", ".", "value", ";", "long", "thatValue", "=", "(", "(", "VLongWritable", ")", "o", ")", ".", "value", ";", "return", "(", "thisValue", "<", "thatValue", "?", ...
Compares two VLongWritables.
[ "Compares", "two", "VLongWritables", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/VLongWritable.java#L62-L66
117,651
facebookarchive/hadoop-20
src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java
DistributedPentomino.createInputDirectory
private static void createInputDirectory(FileSystem fs, Path dir, Pentomino pent, int depth ) throws IOException { fs.mkdirs(dir); List<int...
java
private static void createInputDirectory(FileSystem fs, Path dir, Pentomino pent, int depth ) throws IOException { fs.mkdirs(dir); List<int...
[ "private", "static", "void", "createInputDirectory", "(", "FileSystem", "fs", ",", "Path", "dir", ",", "Pentomino", "pent", ",", "int", "depth", ")", "throws", "IOException", "{", "fs", ".", "mkdirs", "(", "dir", ")", ";", "List", "<", "int", "[", "]", ...
Create the input file with all of the possible combinations of the given depth. @param fs the filesystem to write into @param dir the directory to write the input file into @param pent the puzzle @param depth the depth to explore when generating prefixes
[ "Create", "the", "input", "file", "with", "all", "of", "the", "possible", "combinations", "of", "the", "given", "depth", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java#L126-L146
117,652
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaDirectTaskUmbilical.java
CoronaDirectTaskUmbilical.getAddress
public static InetSocketAddress getAddress(JobConf conf, String key) { String str = conf.get(key); if (str == null) return null; String hostPortPair[] = str.split(":"); if (hostPortPair.length != 2) return null; return new InetSocketAddress(hostPortPair[0], Integer.parseInt(hostP...
java
public static InetSocketAddress getAddress(JobConf conf, String key) { String str = conf.get(key); if (str == null) return null; String hostPortPair[] = str.split(":"); if (hostPortPair.length != 2) return null; return new InetSocketAddress(hostPortPair[0], Integer.parseInt(hostP...
[ "public", "static", "InetSocketAddress", "getAddress", "(", "JobConf", "conf", ",", "String", "key", ")", "{", "String", "str", "=", "conf", ".", "get", "(", "key", ")", ";", "if", "(", "str", "==", "null", ")", "return", "null", ";", "String", "hostPo...
Deserialize InetSocketAddress from String from given key in conf @param conf job conf @param key name of entry @return address
[ "Deserialize", "InetSocketAddress", "from", "String", "from", "given", "key", "in", "conf" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaDirectTaskUmbilical.java#L49-L58
117,653
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaDirectTaskUmbilical.java
CoronaDirectTaskUmbilical.setAddress
public static void setAddress(JobConf conf, String key, InetSocketAddress address) { if (address == null) { conf.unset(key); return; } String addrStr = address.getHostName() + ":" + address.getPort(); conf.set(key, addrStr); }
java
public static void setAddress(JobConf conf, String key, InetSocketAddress address) { if (address == null) { conf.unset(key); return; } String addrStr = address.getHostName() + ":" + address.getPort(); conf.set(key, addrStr); }
[ "public", "static", "void", "setAddress", "(", "JobConf", "conf", ",", "String", "key", ",", "InetSocketAddress", "address", ")", "{", "if", "(", "address", "==", "null", ")", "{", "conf", ".", "unset", "(", "key", ")", ";", "return", ";", "}", "String...
Serialize InetSocketAddress to String and saves in given conf @param conf job conf @param key name of entry @param address address to save
[ "Serialize", "InetSocketAddress", "to", "String", "and", "saves", "in", "given", "conf" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaDirectTaskUmbilical.java#L66-L74
117,654
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java
PoolGroupSchedulable.snapshotConfig
private void snapshotConfig() { maximum = configManager.getPoolGroupMaximum(getName(), getType()); minimum = configManager.getPoolGroupMinimum(getName(), getType()); }
java
private void snapshotConfig() { maximum = configManager.getPoolGroupMaximum(getName(), getType()); minimum = configManager.getPoolGroupMinimum(getName(), getType()); }
[ "private", "void", "snapshotConfig", "(", ")", "{", "maximum", "=", "configManager", ".", "getPoolGroupMaximum", "(", "getName", "(", ")", ",", "getType", "(", ")", ")", ";", "minimum", "=", "configManager", ".", "getPoolGroupMinimum", "(", "getName", "(", "...
Get the snapshot of the configuration from the configuration manager
[ "Get", "the", "snapshot", "of", "the", "configuration", "from", "the", "configuration", "manager" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java#L74-L77
117,655
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java
PoolGroupSchedulable.getScheduleQueue
public Queue<PoolSchedulable> getScheduleQueue() { if (scheduleQueue == null) { ScheduleComparator sc = configManager.getPoolGroupComparator(getName()); scheduleQueue = createPoolQueue(sc); } return scheduleQueue; }
java
public Queue<PoolSchedulable> getScheduleQueue() { if (scheduleQueue == null) { ScheduleComparator sc = configManager.getPoolGroupComparator(getName()); scheduleQueue = createPoolQueue(sc); } return scheduleQueue; }
[ "public", "Queue", "<", "PoolSchedulable", ">", "getScheduleQueue", "(", ")", "{", "if", "(", "scheduleQueue", "==", "null", ")", "{", "ScheduleComparator", "sc", "=", "configManager", ".", "getPoolGroupComparator", "(", "getName", "(", ")", ")", ";", "schedul...
Get the queue of pools sorted for scheduling @return the queue of pools sorted for scheduling
[ "Get", "the", "queue", "of", "pools", "sorted", "for", "scheduling" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java#L101-L107
117,656
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java
PoolGroupSchedulable.getPreemptQueue
public Queue<PoolSchedulable> getPreemptQueue() { // TODO: For now, we support only one kind of scheduling. // Also note that FAIR is PRIORITY with equal priorities (by default) ScheduleComparator sPreempt = null; if (preemptQueue == null) { ScheduleComparator sc = configManager.getPoolGroupCompar...
java
public Queue<PoolSchedulable> getPreemptQueue() { // TODO: For now, we support only one kind of scheduling. // Also note that FAIR is PRIORITY with equal priorities (by default) ScheduleComparator sPreempt = null; if (preemptQueue == null) { ScheduleComparator sc = configManager.getPoolGroupCompar...
[ "public", "Queue", "<", "PoolSchedulable", ">", "getPreemptQueue", "(", ")", "{", "// TODO: For now, we support only one kind of scheduling.", "// Also note that FAIR is PRIORITY with equal priorities (by default)", "ScheduleComparator", "sPreempt", "=", "null", ";", "if", "(", "...
Get the queue of the pool sorted for preemption @return the queue of pool sorted for preemption
[ "Get", "the", "queue", "of", "the", "pool", "sorted", "for", "preemption" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java#L113-L127
117,657
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java
PoolGroupSchedulable.createPoolQueue
private Queue<PoolSchedulable> createPoolQueue( ScheduleComparator comparator) { int initCapacity = snapshotPools.size() == 0 ? 1 : snapshotPools.size(); Queue<PoolSchedulable> poolQueue = new PriorityQueue<PoolSchedulable>(initCapacity, comparator); poolQueue.addAll(snapshotPools); ...
java
private Queue<PoolSchedulable> createPoolQueue( ScheduleComparator comparator) { int initCapacity = snapshotPools.size() == 0 ? 1 : snapshotPools.size(); Queue<PoolSchedulable> poolQueue = new PriorityQueue<PoolSchedulable>(initCapacity, comparator); poolQueue.addAll(snapshotPools); ...
[ "private", "Queue", "<", "PoolSchedulable", ">", "createPoolQueue", "(", "ScheduleComparator", "comparator", ")", "{", "int", "initCapacity", "=", "snapshotPools", ".", "size", "(", ")", "==", "0", "?", "1", ":", "snapshotPools", ".", "size", "(", ")", ";", ...
Put all the pools into the priority queue sorted by a comparator @param comparator the comparator to sort all the pools in the queue by @return the queue of the pools sorted by a comparator
[ "Put", "all", "the", "pools", "into", "the", "priority", "queue", "sorted", "by", "a", "comparator" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java#L134-L142
117,658
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java
PoolGroupSchedulable.getPool
public PoolSchedulable getPool(PoolInfo poolInfo) { PoolSchedulable pool = nameToMap.get(poolInfo); if (pool == null) { pool = new PoolSchedulable(poolInfo, getType(), configManager); PoolSchedulable prevPool = nameToMap.putIfAbsent(poolInfo, pool); if (prevPool != null) { pool = prevP...
java
public PoolSchedulable getPool(PoolInfo poolInfo) { PoolSchedulable pool = nameToMap.get(poolInfo); if (pool == null) { pool = new PoolSchedulable(poolInfo, getType(), configManager); PoolSchedulable prevPool = nameToMap.putIfAbsent(poolInfo, pool); if (prevPool != null) { pool = prevP...
[ "public", "PoolSchedulable", "getPool", "(", "PoolInfo", "poolInfo", ")", "{", "PoolSchedulable", "pool", "=", "nameToMap", ".", "get", "(", "poolInfo", ")", ";", "if", "(", "pool", "==", "null", ")", "{", "pool", "=", "new", "PoolSchedulable", "(", "poolI...
Get a pool, creating it if it does not exist. Note that these pools are never removed. @param poolInfo Pool info used @return Pool that existed or was created
[ "Get", "a", "pool", "creating", "it", "if", "it", "does", "not", "exist", ".", "Note", "that", "these", "pools", "are", "never", "removed", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupSchedulable.java#L193-L203
117,659
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapreduce/JobContext.java
JobContext.getCombinerClass
@SuppressWarnings("unchecked") public Class<? extends Reducer<?,?,?,?>> getCombinerClass() throws ClassNotFoundException { return (Class<? extends Reducer<?,?,?,?>>) conf.getClass(COMBINE_CLASS_ATTR, null); }
java
@SuppressWarnings("unchecked") public Class<? extends Reducer<?,?,?,?>> getCombinerClass() throws ClassNotFoundException { return (Class<? extends Reducer<?,?,?,?>>) conf.getClass(COMBINE_CLASS_ATTR, null); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Class", "<", "?", "extends", "Reducer", "<", "?", ",", "?", ",", "?", ",", "?", ">", ">", "getCombinerClass", "(", ")", "throws", "ClassNotFoundException", "{", "return", "(", "Class", "<", "...
Get the combiner class for the job. @return the combiner class for the job.
[ "Get", "the", "combiner", "class", "for", "the", "job", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/JobContext.java#L166-L171
117,660
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/LongWritable.java
LongWritable.compareTo
public int compareTo(Object o) { long thisValue = this.value; long thatValue = ((LongWritable)o).value; return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1)); }
java
public int compareTo(Object o) { long thisValue = this.value; long thatValue = ((LongWritable)o).value; return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1)); }
[ "public", "int", "compareTo", "(", "Object", "o", ")", "{", "long", "thisValue", "=", "this", ".", "value", ";", "long", "thatValue", "=", "(", "(", "LongWritable", ")", "o", ")", ".", "value", ";", "return", "(", "thisValue", "<", "thatValue", "?", ...
Compares two LongWritables.
[ "Compares", "two", "LongWritables", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/LongWritable.java#L58-L62
117,661
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JSPUtil.java
JSPUtil.processButtons
public static void processButtons(HttpServletRequest request, HttpServletResponse response, JobTracker tracker) throws IOException { if (conf.getBoolean(PRIVATE_ACTIONS_KEY, false) && request.getParameter("killJobs") != null) { String[] jobs = request.getParameterValues("jobCheckBox"); if...
java
public static void processButtons(HttpServletRequest request, HttpServletResponse response, JobTracker tracker) throws IOException { if (conf.getBoolean(PRIVATE_ACTIONS_KEY, false) && request.getParameter("killJobs") != null) { String[] jobs = request.getParameterValues("jobCheckBox"); if...
[ "public", "static", "void", "processButtons", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "JobTracker", "tracker", ")", "throws", "IOException", "{", "if", "(", "conf", ".", "getBoolean", "(", "PRIVATE_ACTIONS_KEY", ",", "false...
Method used to process the request from the job page based on the request which it has received. For example like changing priority. @param request HTTP request Object. @param response HTTP response object. @param tracker {@link JobTracker} instance @throws IOException
[ "Method", "used", "to", "process", "the", "request", "from", "the", "job", "page", "based", "on", "the", "request", "which", "it", "has", "received", ".", "For", "example", "like", "changing", "priority", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JSPUtil.java#L65-L91
117,662
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JSPUtil.java
JSPUtil.getJobDetailsHistoryLink
public static String getJobDetailsHistoryLink(JobTracker tracker, String jobId) { RetireJobInfo info = tracker.retireJobs.get(JobID.forName(jobId)); String historyFileUrl = getHistoryFileUrl(info); String result = (historyFileUrl == null ? "" : ...
java
public static String getJobDetailsHistoryLink(JobTracker tracker, String jobId) { RetireJobInfo info = tracker.retireJobs.get(JobID.forName(jobId)); String historyFileUrl = getHistoryFileUrl(info); String result = (historyFileUrl == null ? "" : ...
[ "public", "static", "String", "getJobDetailsHistoryLink", "(", "JobTracker", "tracker", ",", "String", "jobId", ")", "{", "RetireJobInfo", "info", "=", "tracker", ".", "retireJobs", ".", "get", "(", "JobID", ".", "forName", "(", "jobId", ")", ")", ";", "Stri...
Given jobId, resolve the link to jobdetailshistory.jsp @param tracker JobTracker @param jobId JobID @return the link to the page jobdetailshistory.jsp for the job
[ "Given", "jobId", "resolve", "the", "link", "to", "jobdetailshistory", ".", "jsp" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JSPUtil.java#L243-L251
117,663
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JSPUtil.java
JSPUtil.getHistoryFileUrl
private static String getHistoryFileUrl(RetireJobInfo info) { String historyFile = info.getHistoryFile(); String historyFileUrl = null; if (historyFile != null && !historyFile.equals("")) { try { historyFileUrl = URLEncoder.encode(info.getHistoryFile(), "UTF-8"); } catch (UnsupportedEnco...
java
private static String getHistoryFileUrl(RetireJobInfo info) { String historyFile = info.getHistoryFile(); String historyFileUrl = null; if (historyFile != null && !historyFile.equals("")) { try { historyFileUrl = URLEncoder.encode(info.getHistoryFile(), "UTF-8"); } catch (UnsupportedEnco...
[ "private", "static", "String", "getHistoryFileUrl", "(", "RetireJobInfo", "info", ")", "{", "String", "historyFile", "=", "info", ".", "getHistoryFile", "(", ")", ";", "String", "historyFileUrl", "=", "null", ";", "if", "(", "historyFile", "!=", "null", "&&", ...
Obtain history file URL from RetireJobInfo @param info RetireJobInfo @return corresponding history file url, null if cannot creat one
[ "Obtain", "history", "file", "URL", "from", "RetireJobInfo" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JSPUtil.java#L276-L287
117,664
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JSPUtil.java
JSPUtil.generateClusterResTable
public static String generateClusterResTable(JobTracker tracker) throws IOException { ResourceReporter reporter = tracker.getResourceReporter(); if (reporter == null) { return ""; } StringBuffer sb = new StringBuffer(); sb.append("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\n"...
java
public static String generateClusterResTable(JobTracker tracker) throws IOException { ResourceReporter reporter = tracker.getResourceReporter(); if (reporter == null) { return ""; } StringBuffer sb = new StringBuffer(); sb.append("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\n"...
[ "public", "static", "String", "generateClusterResTable", "(", "JobTracker", "tracker", ")", "throws", "IOException", "{", "ResourceReporter", "reporter", "=", "tracker", ".", "getResourceReporter", "(", ")", ";", "if", "(", "reporter", "==", "null", ")", "{", "r...
Method used to generate the cluster resource utilization table
[ "Method", "used", "to", "generate", "the", "cluster", "resource", "utilization", "table" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JSPUtil.java#L435-L469
117,665
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/qjournal/client/URLImageInputStream.java
URLImageInputStream.setupInputStream
private void setupInputStream() throws IOException { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // set timeout for connecting and reading connection.setConnectTimeout(httpTimeout); connection.setReadTimeout(httpTimeout); if (connection.getResponseCode() != HttpURLConn...
java
private void setupInputStream() throws IOException { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // set timeout for connecting and reading connection.setConnectTimeout(httpTimeout); connection.setReadTimeout(httpTimeout); if (connection.getResponseCode() != HttpURLConn...
[ "private", "void", "setupInputStream", "(", ")", "throws", "IOException", "{", "HttpURLConnection", "connection", "=", "(", "HttpURLConnection", ")", "url", ".", "openConnection", "(", ")", ";", "// set timeout for connecting and reading", "connection", ".", "setConnect...
Get input stream for the image through http connection.
[ "Get", "input", "stream", "for", "the", "image", "through", "http", "connection", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/URLImageInputStream.java#L56-L94
117,666
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java
CoronaConf.getCpuToResourcePartitioning
public Map<Integer, Map<ResourceType, Integer>> getCpuToResourcePartitioning() { if (cachedCpuToResourcePartitioning == null) { cachedCpuToResourcePartitioning = getUncachedCpuToResourcePartitioning(this); } return cachedCpuToResourcePartitioning; }
java
public Map<Integer, Map<ResourceType, Integer>> getCpuToResourcePartitioning() { if (cachedCpuToResourcePartitioning == null) { cachedCpuToResourcePartitioning = getUncachedCpuToResourcePartitioning(this); } return cachedCpuToResourcePartitioning; }
[ "public", "Map", "<", "Integer", ",", "Map", "<", "ResourceType", ",", "Integer", ">", ">", "getCpuToResourcePartitioning", "(", ")", "{", "if", "(", "cachedCpuToResourcePartitioning", "==", "null", ")", "{", "cachedCpuToResourcePartitioning", "=", "getUncachedCpuTo...
Get and cache the cpu to resource partitioning for this object. @return Mapping of cpu to resources (cached)
[ "Get", "and", "cache", "the", "cpu", "to", "resource", "partitioning", "for", "this", "object", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java#L277-L283
117,667
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java
CoronaConf.getPoolInfo
public PoolInfo getPoolInfo() { String poolNameProperty = get(IMPLICIT_POOL_PROPERTY, "user.name"); String explicitPool = get(EXPLICIT_POOL_PROPERTY, get(poolNameProperty, "")).trim(); String[] poolInfoSplitString = explicitPool.split("[.]"); if (poolInfoSplitString != null && poolInfoSplitStrin...
java
public PoolInfo getPoolInfo() { String poolNameProperty = get(IMPLICIT_POOL_PROPERTY, "user.name"); String explicitPool = get(EXPLICIT_POOL_PROPERTY, get(poolNameProperty, "")).trim(); String[] poolInfoSplitString = explicitPool.split("[.]"); if (poolInfoSplitString != null && poolInfoSplitStrin...
[ "public", "PoolInfo", "getPoolInfo", "(", ")", "{", "String", "poolNameProperty", "=", "get", "(", "IMPLICIT_POOL_PROPERTY", ",", "\"user.name\"", ")", ";", "String", "explicitPool", "=", "get", "(", "EXPLICIT_POOL_PROPERTY", ",", "get", "(", "poolNameProperty", "...
Get the pool info. In order to support previous behavior, a single pool name is accepted. @return Pool info, using a default pool group if the explicit pool can not be found
[ "Get", "the", "pool", "info", ".", "In", "order", "to", "support", "previous", "behavior", "a", "single", "pool", "name", "is", "accepted", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java#L376-L388
117,668
facebookarchive/hadoop-20
src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java
InterleavedInputStream.readMetaDataIfNeeded
public boolean readMetaDataIfNeeded() throws IOException { if (eofReached) { return false; } if (rawBlockOffset == 0) { try { metaDataConsumer.readMetaData(in, metaDataBlockSize); rawBlockOffset += metaDataBlockSize; } catch (EOFException e) { eofReached = true; ...
java
public boolean readMetaDataIfNeeded() throws IOException { if (eofReached) { return false; } if (rawBlockOffset == 0) { try { metaDataConsumer.readMetaData(in, metaDataBlockSize); rawBlockOffset += metaDataBlockSize; } catch (EOFException e) { eofReached = true; ...
[ "public", "boolean", "readMetaDataIfNeeded", "(", ")", "throws", "IOException", "{", "if", "(", "eofReached", ")", "{", "return", "false", ";", "}", "if", "(", "rawBlockOffset", "==", "0", ")", "{", "try", "{", "metaDataConsumer", ".", "readMetaData", "(", ...
Returns whether we've reached EOF.
[ "Returns", "whether", "we", "ve", "reached", "EOF", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java#L118-L132
117,669
facebookarchive/hadoop-20
src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java
InterleavedInputStream.seekOrSkip
private boolean seekOrSkip(long bytes, boolean toNewSource) throws IOException { if (seekableIn != null) { // Use Seekable interface to speed up skip. int available = in.available(); try { if (toNewSource) { return seekableIn.seekToNewSource(seekableIn.getPos() + bytes); ...
java
private boolean seekOrSkip(long bytes, boolean toNewSource) throws IOException { if (seekableIn != null) { // Use Seekable interface to speed up skip. int available = in.available(); try { if (toNewSource) { return seekableIn.seekToNewSource(seekableIn.getPos() + bytes); ...
[ "private", "boolean", "seekOrSkip", "(", "long", "bytes", ",", "boolean", "toNewSource", ")", "throws", "IOException", "{", "if", "(", "seekableIn", "!=", "null", ")", "{", "// Use Seekable interface to speed up skip.", "int", "available", "=", "in", ".", "availab...
This function depends on the underlying @param toNewSource only useful when seekableIn != null. @return when toNewSource is true, return whether we seeked to a new source. otherwise return true.
[ "This", "function", "depends", "on", "the", "underlying" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java#L244-L273
117,670
facebookarchive/hadoop-20
src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java
InterleavedInputStream.rawSkip
protected boolean rawSkip(long bytes, boolean toNewSource) throws IOException { boolean result = seekOrSkip(bytes, toNewSource); setRawOffset(getRawOffset() + bytes); // Check validity if (rawBlockOffset > 0 && rawBlockOffset < metaDataBlockSize) { throw new IOException("Cannot jump into the mid...
java
protected boolean rawSkip(long bytes, boolean toNewSource) throws IOException { boolean result = seekOrSkip(bytes, toNewSource); setRawOffset(getRawOffset() + bytes); // Check validity if (rawBlockOffset > 0 && rawBlockOffset < metaDataBlockSize) { throw new IOException("Cannot jump into the mid...
[ "protected", "boolean", "rawSkip", "(", "long", "bytes", ",", "boolean", "toNewSource", ")", "throws", "IOException", "{", "boolean", "result", "=", "seekOrSkip", "(", "bytes", ",", "toNewSource", ")", ";", "setRawOffset", "(", "getRawOffset", "(", ")", "+", ...
Skip some bytes from the raw InputStream. @param toNewSource - only useful when seekableIn is not null. @return when toNewSource is true, return whether we seeked to a new source. otherwise return true.
[ "Skip", "some", "bytes", "from", "the", "raw", "InputStream", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/InterleavedInputStream.java#L286-L297
117,671
facebookarchive/hadoop-20
src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java
Environment.prepare
public static void prepare(String fname) { if (!"Linux".equalsIgnoreCase(System.getProperty("os.name"))) { System.err.println("Linux system required for FailMon. Exiting..."); System.exit(0); } System.setProperty("log4j.configuration", "conf/log4j.properties"); PropertyConfigurator.configu...
java
public static void prepare(String fname) { if (!"Linux".equalsIgnoreCase(System.getProperty("os.name"))) { System.err.println("Linux system required for FailMon. Exiting..."); System.exit(0); } System.setProperty("log4j.configuration", "conf/log4j.properties"); PropertyConfigurator.configu...
[ "public", "static", "void", "prepare", "(", "String", "fname", ")", "{", "if", "(", "!", "\"Linux\"", ".", "equalsIgnoreCase", "(", "System", ".", "getProperty", "(", "\"os.name\"", ")", ")", ")", "{", "System", ".", "err", ".", "println", "(", "\"Linux ...
Initializes structures needed by other methods. Also determines whether the executing user has superuser privileges.
[ "Initializes", "structures", "needed", "by", "other", "methods", ".", "Also", "determines", "whether", "the", "executing", "user", "has", "superuser", "privileges", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java#L64-L122
117,672
facebookarchive/hadoop-20
src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java
Environment.getInterval
public static int getInterval(ArrayList<MonitorJob> monitors) { String tmp = getProperty("executor.interval.min"); if (tmp != null) MIN_INTERVAL = Integer.parseInt(tmp); int[] monIntervals = new int[monitors.size()]; for (int i = 0; i < monitors.size(); i++) monIntervals[i] = monitors.get(...
java
public static int getInterval(ArrayList<MonitorJob> monitors) { String tmp = getProperty("executor.interval.min"); if (tmp != null) MIN_INTERVAL = Integer.parseInt(tmp); int[] monIntervals = new int[monitors.size()]; for (int i = 0; i < monitors.size(); i++) monIntervals[i] = monitors.get(...
[ "public", "static", "int", "getInterval", "(", "ArrayList", "<", "MonitorJob", ">", "monitors", ")", "{", "String", "tmp", "=", "getProperty", "(", "\"executor.interval.min\"", ")", ";", "if", "(", "tmp", "!=", "null", ")", "MIN_INTERVAL", "=", "Integer", "....
Determines the minimum interval at which the executor thread needs to wake upto execute jobs. Essentially, this is interval equals the GCD of intervals of all scheduled jobs. @param monitors the list of scheduled jobs @return the minimum interval between two scheduled jobs
[ "Determines", "the", "minimum", "interval", "at", "which", "the", "executor", "thread", "needs", "to", "wake", "upto", "execute", "jobs", ".", "Essentially", "this", "is", "interval", "equals", "the", "GCD", "of", "intervals", "of", "all", "scheduled", "jobs",...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java#L304-L315
117,673
facebookarchive/hadoop-20
src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java
Environment.checkExistence
public static boolean checkExistence(String cmd) { StringBuffer sb = runCommand("which " + cmd); if (sb.length() > 1) return true; return false; }
java
public static boolean checkExistence(String cmd) { StringBuffer sb = runCommand("which " + cmd); if (sb.length() > 1) return true; return false; }
[ "public", "static", "boolean", "checkExistence", "(", "String", "cmd", ")", "{", "StringBuffer", "sb", "=", "runCommand", "(", "\"which \"", "+", "cmd", ")", ";", "if", "(", "sb", ".", "length", "(", ")", ">", "1", ")", "return", "true", ";", "return",...
Checks whether a specific shell command is available in the system. @param cmd the command to check against @return true, if the command is availble, false otherwise
[ "Checks", "whether", "a", "specific", "shell", "command", "is", "available", "in", "the", "system", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java#L325-L331
117,674
facebookarchive/hadoop-20
src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java
Environment.runCommand
public static StringBuffer runCommand(String[] cmd) { StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH); Process p; try { p = Runtime.getRuntime().exec(cmd); InputStream tmp = p.getInputStream(); p.waitFor(); int c; while ((c = tmp.read()) != -1) retval.append((...
java
public static StringBuffer runCommand(String[] cmd) { StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH); Process p; try { p = Runtime.getRuntime().exec(cmd); InputStream tmp = p.getInputStream(); p.waitFor(); int c; while ((c = tmp.read()) != -1) retval.append((...
[ "public", "static", "StringBuffer", "runCommand", "(", "String", "[", "]", "cmd", ")", "{", "StringBuffer", "retval", "=", "new", "StringBuffer", "(", "MAX_OUTPUT_LENGTH", ")", ";", "Process", "p", ";", "try", "{", "p", "=", "Runtime", ".", "getRuntime", "...
Runs a shell command in the system and provides a StringBuffer with the output of the command. @param cmd an array of string that form the command to run @return a StringBuffer that contains the output of the command
[ "Runs", "a", "shell", "command", "in", "the", "system", "and", "provides", "a", "StringBuffer", "with", "the", "output", "of", "the", "command", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Environment.java#L341-L358
117,675
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
FileDataServlet.createUri
protected URI createUri(FileStatus i, UnixUserGroupInformation ugi, ClientProtocol nnproxy, HttpServletRequest request) throws IOException, URISyntaxException { return createUri(i.getPath().toString(), pickSrcDatanode(i, nnproxy), ugi, request); }
java
protected URI createUri(FileStatus i, UnixUserGroupInformation ugi, ClientProtocol nnproxy, HttpServletRequest request) throws IOException, URISyntaxException { return createUri(i.getPath().toString(), pickSrcDatanode(i, nnproxy), ugi, request); }
[ "protected", "URI", "createUri", "(", "FileStatus", "i", ",", "UnixUserGroupInformation", "ugi", ",", "ClientProtocol", "nnproxy", ",", "HttpServletRequest", "request", ")", "throws", "IOException", ",", "URISyntaxException", "{", "return", "createUri", "(", "i", "....
Create a redirection URI
[ "Create", "a", "redirection", "URI" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java#L39-L44
117,676
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java
FileDataServlet.pickSrcDatanode
private static DatanodeInfo[] pickSrcDatanode(FileStatus i, ClientProtocol nnproxy) throws IOException { // a race condition can happen by initializing a static member this way. // A proper fix should make JspHelper a singleton. Since it doesn't affect // correctness, we leave it as is for now. i...
java
private static DatanodeInfo[] pickSrcDatanode(FileStatus i, ClientProtocol nnproxy) throws IOException { // a race condition can happen by initializing a static member this way. // A proper fix should make JspHelper a singleton. Since it doesn't affect // correctness, we leave it as is for now. i...
[ "private", "static", "DatanodeInfo", "[", "]", "pickSrcDatanode", "(", "FileStatus", "i", ",", "ClientProtocol", "nnproxy", ")", "throws", "IOException", "{", "// a race condition can happen by initializing a static member this way.", "// A proper fix should make JspHelper a single...
Select a datanode to service this request, which is the first one in the returned array. The rest of the elements in the datanode are possible candidates if the first one fails. Currently, this looks at no more than the first five blocks of a file, selecting a datanode randomly from the most represented.
[ "Select", "a", "datanode", "to", "service", "this", "request", "which", "is", "the", "first", "one", "in", "the", "returned", "array", ".", "The", "rest", "of", "the", "elements", "in", "the", "datanode", "are", "possible", "candidates", "if", "the", "firs...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java#L54-L68
117,677
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.skip
public static void skip(DataInput in) throws IOException { int length = in.readUnsignedShort(); WritableUtils.skipFully(in, length); }
java
public static void skip(DataInput in) throws IOException { int length = in.readUnsignedShort(); WritableUtils.skipFully(in, length); }
[ "public", "static", "void", "skip", "(", "DataInput", "in", ")", "throws", "IOException", "{", "int", "length", "=", "in", ".", "readUnsignedShort", "(", ")", ";", "WritableUtils", ".", "skipFully", "(", "in", ",", "length", ")", ";", "}" ]
Skips over one UTF8 in the input.
[ "Skips", "over", "one", "UTF8", "in", "the", "input", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L190-L193
117,678
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.compareTo
public int compareTo(Object o) { UTF8 that = (UTF8)o; return WritableComparator.compareBytes(bytes, 0, length, that.bytes, 0, that.length); }
java
public int compareTo(Object o) { UTF8 that = (UTF8)o; return WritableComparator.compareBytes(bytes, 0, length, that.bytes, 0, that.length); }
[ "public", "int", "compareTo", "(", "Object", "o", ")", "{", "UTF8", "that", "=", "(", "UTF8", ")", "o", ";", "return", "WritableComparator", ".", "compareBytes", "(", "bytes", ",", "0", ",", "length", ",", "that", ".", "bytes", ",", "0", ",", "that",...
Compare two UTF8s.
[ "Compare", "two", "UTF8s", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L201-L205
117,679
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.getBytes
public static byte[] getBytes(String string) { byte[] result = new byte[utf8Length(string)]; try { // avoid sync'd allocations writeChars(result, string, 0, string.length()); } catch (IOException e) { throw new RuntimeException(e); } return result;...
java
public static byte[] getBytes(String string) { byte[] result = new byte[utf8Length(string)]; try { // avoid sync'd allocations writeChars(result, string, 0, string.length()); } catch (IOException e) { throw new RuntimeException(e); } return result;...
[ "public", "static", "byte", "[", "]", "getBytes", "(", "String", "string", ")", "{", "byte", "[", "]", "result", "=", "new", "byte", "[", "utf8Length", "(", "string", ")", "]", ";", "try", "{", "// avoid sync'd allocations", "writeChars", "(", "result", ...
Convert a string to a UTF-8 encoded byte array. @see String#getBytes(String)
[ "Convert", "a", "string", "to", "a", "UTF", "-", "8", "encoded", "byte", "array", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L259-L267
117,680
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.readString
public static String readString(DataInput in) throws IOException { int bytes = in.readUnsignedShort(); return readChars(in, bytes); }
java
public static String readString(DataInput in) throws IOException { int bytes = in.readUnsignedShort(); return readChars(in, bytes); }
[ "public", "static", "String", "readString", "(", "DataInput", "in", ")", "throws", "IOException", "{", "int", "bytes", "=", "in", ".", "readUnsignedShort", "(", ")", ";", "return", "readChars", "(", "in", ",", "bytes", ")", ";", "}" ]
Read a UTF-8 encoded string. @see DataInput#readUTF()
[ "Read", "a", "UTF", "-", "8", "encoded", "string", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L273-L276
117,681
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.writeString
public static int writeString(DataOutput out, String s) throws IOException { if (s.length() > 0xffff/3) { // maybe too long LOG.warn("truncating long string: " + s.length() + " chars, starting with " + s.substring(0, 20)); s = s.substring(0, 0xffff/3); } int len = utf...
java
public static int writeString(DataOutput out, String s) throws IOException { if (s.length() > 0xffff/3) { // maybe too long LOG.warn("truncating long string: " + s.length() + " chars, starting with " + s.substring(0, 20)); s = s.substring(0, 0xffff/3); } int len = utf...
[ "public", "static", "int", "writeString", "(", "DataOutput", "out", ",", "String", "s", ")", "throws", "IOException", "{", "if", "(", "s", ".", "length", "(", ")", ">", "0xffff", "/", "3", ")", "{", "// maybe too long", "LOG", ".", "warn", "(", "\"trun...
Write a UTF-8 encoded string. @see DataOutput#writeUTF(String)
[ "Write", "a", "UTF", "-", "8", "encoded", "string", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L322-L336
117,682
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/UTF8.java
UTF8.utf8Length
private static int utf8Length(String string) { int stringLength = string.length(); int utf8Length = 0; for (int i = 0; i < stringLength; i++) { int c = string.charAt(i); if (c <= 0x007F) { utf8Length++; } else if (c > 0x07FF) { utf8Length += 3; } else { utf8Le...
java
private static int utf8Length(String string) { int stringLength = string.length(); int utf8Length = 0; for (int i = 0; i < stringLength; i++) { int c = string.charAt(i); if (c <= 0x007F) { utf8Length++; } else if (c > 0x07FF) { utf8Length += 3; } else { utf8Le...
[ "private", "static", "int", "utf8Length", "(", "String", "string", ")", "{", "int", "stringLength", "=", "string", ".", "length", "(", ")", ";", "int", "utf8Length", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "stringLength", ";",...
Returns the number of bytes required to write this.
[ "Returns", "the", "number", "of", "bytes", "required", "to", "write", "this", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/UTF8.java#L351-L365
117,683
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
EditLogFileOutputStream.create
@Override public void create() throws IOException { fc.truncate(0); fc.position(0); doubleBuf.getCurrentBuf().writeInt(FSConstants.LAYOUT_VERSION); setReadyToFlush(); flush(); }
java
@Override public void create() throws IOException { fc.truncate(0); fc.position(0); doubleBuf.getCurrentBuf().writeInt(FSConstants.LAYOUT_VERSION); setReadyToFlush(); flush(); }
[ "@", "Override", "public", "void", "create", "(", ")", "throws", "IOException", "{", "fc", ".", "truncate", "(", "0", ")", ";", "fc", ".", "position", "(", "0", ")", ";", "doubleBuf", ".", "getCurrentBuf", "(", ")", ".", "writeInt", "(", "FSConstants",...
Create empty edits logs file.
[ "Create", "empty", "edits", "logs", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java#L127-L134
117,684
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
EditLogFileOutputStream.setReadyToFlush
@Override public void setReadyToFlush() throws IOException { doubleBuf.getCurrentBuf().write(FSEditLogOpCodes.OP_INVALID.getOpCode()); // insert eof marker doubleBuf.setReadyToFlush(); }
java
@Override public void setReadyToFlush() throws IOException { doubleBuf.getCurrentBuf().write(FSEditLogOpCodes.OP_INVALID.getOpCode()); // insert eof marker doubleBuf.setReadyToFlush(); }
[ "@", "Override", "public", "void", "setReadyToFlush", "(", ")", "throws", "IOException", "{", "doubleBuf", ".", "getCurrentBuf", "(", ")", ".", "write", "(", "FSEditLogOpCodes", ".", "OP_INVALID", ".", "getOpCode", "(", ")", ")", ";", "// insert eof marker", "...
All data that has been written to the stream so far will be flushed. New data can be still written to the stream while flushing is performed.
[ "All", "data", "that", "has", "been", "written", "to", "the", "stream", "so", "far", "will", "be", "flushed", ".", "New", "data", "can", "be", "still", "written", "to", "the", "stream", "while", "flushing", "is", "performed", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java#L179-L183
117,685
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
EditLogFileOutputStream.flushAndSync
@Override protected void flushAndSync(boolean durable) throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } preallocate(); // preallocate file if necessary if (doubleBuf.isFlushed()) { return; } doubleBuf.flushTo(fp); if (durabl...
java
@Override protected void flushAndSync(boolean durable) throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } preallocate(); // preallocate file if necessary if (doubleBuf.isFlushed()) { return; } doubleBuf.flushTo(fp); if (durabl...
[ "@", "Override", "protected", "void", "flushAndSync", "(", "boolean", "durable", ")", "throws", "IOException", "{", "if", "(", "fp", "==", "null", ")", "{", "throw", "new", "IOException", "(", "\"Trying to use aborted output stream\"", ")", ";", "}", "preallocat...
Flush ready buffer to persistent store. currentBuffer is not flushed as it accumulates new log records while readyBuffer will be flushed and synced.
[ "Flush", "ready", "buffer", "to", "persistent", "store", ".", "currentBuffer", "is", "not", "flushed", "as", "it", "accumulates", "new", "log", "records", "while", "readyBuffer", "will", "be", "flushed", "and", "synced", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java#L189-L203
117,686
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
EditLogFileOutputStream.preallocate
private void preallocate() throws IOException { long position = fc.position(); long triggerSize = Math.max(FSEditLog.preallocateSize / 100, 4096); if (position + triggerSize >= fc.size()) { if(FSNamesystem.LOG.isDebugEnabled()) { FSNamesystem.LOG.debug("Preallocating Edit log, current size " ...
java
private void preallocate() throws IOException { long position = fc.position(); long triggerSize = Math.max(FSEditLog.preallocateSize / 100, 4096); if (position + triggerSize >= fc.size()) { if(FSNamesystem.LOG.isDebugEnabled()) { FSNamesystem.LOG.debug("Preallocating Edit log, current size " ...
[ "private", "void", "preallocate", "(", ")", "throws", "IOException", "{", "long", "position", "=", "fc", ".", "position", "(", ")", ";", "long", "triggerSize", "=", "Math", ".", "max", "(", "FSEditLog", ".", "preallocateSize", "/", "100", ",", "4096", ")...
allocate a big chunk of data
[ "allocate", "a", "big", "chunk", "of", "data" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java#L223-L238
117,687
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyHBase.java
BlockPlacementPolicyHBase.directoryDataNodeUsage
private HashMap<DatanodeDescriptor, Integer> directoryDataNodeUsage(INodeDirectory dir, int threshold) { HashMap<DatanodeDescriptor, Integer> dataNodeUsage = new HashMap<DatanodeDescriptor, Integer>(); List<INode> children; nameSystem.readLock(); try { if (dir.getChildrenRaw() == null) { ...
java
private HashMap<DatanodeDescriptor, Integer> directoryDataNodeUsage(INodeDirectory dir, int threshold) { HashMap<DatanodeDescriptor, Integer> dataNodeUsage = new HashMap<DatanodeDescriptor, Integer>(); List<INode> children; nameSystem.readLock(); try { if (dir.getChildrenRaw() == null) { ...
[ "private", "HashMap", "<", "DatanodeDescriptor", ",", "Integer", ">", "directoryDataNodeUsage", "(", "INodeDirectory", "dir", ",", "int", "threshold", ")", "{", "HashMap", "<", "DatanodeDescriptor", ",", "Integer", ">", "dataNodeUsage", "=", "new", "HashMap", "<",...
Iterates through files in the directory dir, and counts the number of usages of datanodes for the files in the directory dir. Just iterates through threshold number of blocks.
[ "Iterates", "through", "files", "in", "the", "directory", "dir", "and", "counts", "the", "number", "of", "usages", "of", "datanodes", "for", "the", "files", "in", "the", "directory", "dir", ".", "Just", "iterates", "through", "threshold", "number", "of", "bl...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyHBase.java#L160-L199
117,688
facebookarchive/hadoop-20
src/tools/org/apache/hadoop/tools/DistTool.java
DistTool.checkSource
protected static void checkSource(Configuration conf, List<Path> srcs ) throws InvalidInputException { List<IOException> ioes = new ArrayList<IOException>(); for(Path p : srcs) { try { if (!p.getFileSystem(conf).exists(p)) { ioes.add(new FileNotFoundException("Source "+p+" does not...
java
protected static void checkSource(Configuration conf, List<Path> srcs ) throws InvalidInputException { List<IOException> ioes = new ArrayList<IOException>(); for(Path p : srcs) { try { if (!p.getFileSystem(conf).exists(p)) { ioes.add(new FileNotFoundException("Source "+p+" does not...
[ "protected", "static", "void", "checkSource", "(", "Configuration", "conf", ",", "List", "<", "Path", ">", "srcs", ")", "throws", "InvalidInputException", "{", "List", "<", "IOException", ">", "ioes", "=", "new", "ArrayList", "<", "IOException", ">", "(", ")...
Sanity check for source
[ "Sanity", "check", "for", "source" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistTool.java#L65-L79
117,689
facebookarchive/hadoop-20
src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationCollectorCached.java
UtilizationCollectorCached.connect
protected void connect() { LOG.info("Connecting to collector..."); try { conf.setStrings(UnixUserGroupInformation.UGI_PROPERTY_NAME, new String[]{"hadoop", "hadoop"}); rpcCollector = (UtilizationCollectorProtocol) RPC.getProxy(UtilizationCollectorProtocol.class, ...
java
protected void connect() { LOG.info("Connecting to collector..."); try { conf.setStrings(UnixUserGroupInformation.UGI_PROPERTY_NAME, new String[]{"hadoop", "hadoop"}); rpcCollector = (UtilizationCollectorProtocol) RPC.getProxy(UtilizationCollectorProtocol.class, ...
[ "protected", "void", "connect", "(", ")", "{", "LOG", ".", "info", "(", "\"Connecting to collector...\"", ")", ";", "try", "{", "conf", ".", "setStrings", "(", "UnixUserGroupInformation", ".", "UGI_PROPERTY_NAME", ",", "new", "String", "[", "]", "{", "\"hadoop...
Make connection to the Collector
[ "Make", "connection", "to", "the", "Collector" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationCollectorCached.java#L95-L111
117,690
facebookarchive/hadoop-20
src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationCollectorCached.java
UtilizationCollectorCached.fetchData
protected void fetchData() throws IOException { // if not connected to the collector, wait for a while then try connecting if (rpcCollector == null) { try { Thread.sleep(RECONNECT_PERIOD); } catch (InterruptedException e) { // do nothing } connect(); } try { ...
java
protected void fetchData() throws IOException { // if not connected to the collector, wait for a while then try connecting if (rpcCollector == null) { try { Thread.sleep(RECONNECT_PERIOD); } catch (InterruptedException e) { // do nothing } connect(); } try { ...
[ "protected", "void", "fetchData", "(", ")", "throws", "IOException", "{", "// if not connected to the collector, wait for a while then try connecting", "if", "(", "rpcCollector", "==", "null", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "RECONNECT_PERIOD", ")", ...
Mirror data from the Collector
[ "Mirror", "data", "from", "the", "Collector" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationCollectorCached.java#L143-L170
117,691
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.getCapacity
public float getCapacity(String queue) { //Check done in order to return default capacity which can be negative //In case of both capacity and default capacity not configured. //Last check is if the configuration is specified and is marked as //negative we throw exception String raw = rmConf.getRaw(...
java
public float getCapacity(String queue) { //Check done in order to return default capacity which can be negative //In case of both capacity and default capacity not configured. //Last check is if the configuration is specified and is marked as //negative we throw exception String raw = rmConf.getRaw(...
[ "public", "float", "getCapacity", "(", "String", "queue", ")", "{", "//Check done in order to return default capacity which can be negative", "//In case of both capacity and default capacity not configured.", "//Last check is if the configuration is specified and is marked as", "//negative we ...
Get the percentage of the cluster for the specified queue. This method defaults to configured default Capacity if no value is specified in the configuration for this queue. If the configured capacity is negative value or greater than 100 an {@link IllegalArgumentException} is thrown. If default capacity is not config...
[ "Get", "the", "percentage", "of", "the", "cluster", "for", "the", "specified", "queue", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L158-L175
117,692
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.setCapacity
public void setCapacity(String queue,float capacity) { rmConf.setFloat(toFullPropertyName(queue, CAPACITY_PROPERTY),capacity); }
java
public void setCapacity(String queue,float capacity) { rmConf.setFloat(toFullPropertyName(queue, CAPACITY_PROPERTY),capacity); }
[ "public", "void", "setCapacity", "(", "String", "queue", ",", "float", "capacity", ")", "{", "rmConf", ".", "setFloat", "(", "toFullPropertyName", "(", "queue", ",", "CAPACITY_PROPERTY", ")", ",", "capacity", ")", ";", "}" ]
Sets the capacity of the given queue. @param queue name of the queue @param capacity percent of the cluster for the queue.
[ "Sets", "the", "capacity", "of", "the", "given", "queue", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L183-L185
117,693
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.getMaxCapacity
public float getMaxCapacity(String queue) { float result = rmConf.getFloat( toFullPropertyName(queue, MAX_CAPACITY_PROPERTY), -1); //if result is 0 or less than 0 set it to -1 result = (result <= 0) ? -1 : result; if (result > 100.0) { throw new IllegalArgumentException( "Illegal "...
java
public float getMaxCapacity(String queue) { float result = rmConf.getFloat( toFullPropertyName(queue, MAX_CAPACITY_PROPERTY), -1); //if result is 0 or less than 0 set it to -1 result = (result <= 0) ? -1 : result; if (result > 100.0) { throw new IllegalArgumentException( "Illegal "...
[ "public", "float", "getMaxCapacity", "(", "String", "queue", ")", "{", "float", "result", "=", "rmConf", ".", "getFloat", "(", "toFullPropertyName", "(", "queue", ",", "MAX_CAPACITY_PROPERTY", ")", ",", "-", "1", ")", ";", "//if result is 0 or less than 0 set it t...
Return the maximum percentage of the cluster capacity that can be used by the given queue. This percentage defines a limit beyond which a queue cannot use the capacity of cluster. This provides a means to limit how much excess capacity a queue can use. By default, there is no limit. The maximum-capacity of a queue can...
[ "Return", "the", "maximum", "percentage", "of", "the", "cluster", "capacity", "that", "can", "be", "used", "by", "the", "given", "queue", ".", "This", "percentage", "defines", "a", "limit", "beyond", "which", "a", "queue", "cannot", "use", "the", "capacity",...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L201-L220
117,694
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.setMaxCapacity
public void setMaxCapacity(String queue,float maxCapacity) { rmConf.setFloat( toFullPropertyName(queue, MAX_CAPACITY_PROPERTY), maxCapacity); }
java
public void setMaxCapacity(String queue,float maxCapacity) { rmConf.setFloat( toFullPropertyName(queue, MAX_CAPACITY_PROPERTY), maxCapacity); }
[ "public", "void", "setMaxCapacity", "(", "String", "queue", ",", "float", "maxCapacity", ")", "{", "rmConf", ".", "setFloat", "(", "toFullPropertyName", "(", "queue", ",", "MAX_CAPACITY_PROPERTY", ")", ",", "maxCapacity", ")", ";", "}" ]
Sets the maxCapacity of the given queue. @param queue name of the queue @param maxCapacity percent of the cluster for the queue.
[ "Sets", "the", "maxCapacity", "of", "the", "given", "queue", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L228-L231
117,695
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.getMinimumUserLimitPercent
public int getMinimumUserLimitPercent(String queue) { int userLimit = rmConf.getInt(toFullPropertyName(queue, "minimum-user-limit-percent"), defaultUlimitMinimum); if(userLimit <= 0 || userLimit > 100) { throw new IllegalArgumentException("Invalid user limit : " + userLimit + " for queue...
java
public int getMinimumUserLimitPercent(String queue) { int userLimit = rmConf.getInt(toFullPropertyName(queue, "minimum-user-limit-percent"), defaultUlimitMinimum); if(userLimit <= 0 || userLimit > 100) { throw new IllegalArgumentException("Invalid user limit : " + userLimit + " for queue...
[ "public", "int", "getMinimumUserLimitPercent", "(", "String", "queue", ")", "{", "int", "userLimit", "=", "rmConf", ".", "getInt", "(", "toFullPropertyName", "(", "queue", ",", "\"minimum-user-limit-percent\"", ")", ",", "defaultUlimitMinimum", ")", ";", "if", "("...
Get the minimum limit of resources for any user submitting jobs in this queue, in percentage. This method defaults to default user limit configured if no value is specified in the configuration for this queue. Throws an {@link IllegalArgumentException} when invalid value is configured. @param queue name of the queue...
[ "Get", "the", "minimum", "limit", "of", "resources", "for", "any", "user", "submitting", "jobs", "in", "this", "queue", "in", "percentage", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L273-L281
117,696
facebookarchive/hadoop-20
src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java
CapacitySchedulerConf.getMaxJobsPerUserToInitialize
public int getMaxJobsPerUserToInitialize(String queue) { int maxJobsPerUser = rmConf.getInt(toFullPropertyName(queue, "maximum-initialized-jobs-per-user"), defaultMaxJobsPerUsersToInitialize); if(maxJobsPerUser <= 0) { throw new IllegalArgumentException( "Invalid maximum jobs pe...
java
public int getMaxJobsPerUserToInitialize(String queue) { int maxJobsPerUser = rmConf.getInt(toFullPropertyName(queue, "maximum-initialized-jobs-per-user"), defaultMaxJobsPerUsersToInitialize); if(maxJobsPerUser <= 0) { throw new IllegalArgumentException( "Invalid maximum jobs pe...
[ "public", "int", "getMaxJobsPerUserToInitialize", "(", "String", "queue", ")", "{", "int", "maxJobsPerUser", "=", "rmConf", ".", "getInt", "(", "toFullPropertyName", "(", "queue", ",", "\"maximum-initialized-jobs-per-user\"", ")", ",", "defaultMaxJobsPerUsersToInitialize"...
Gets the maximum number of jobs which are allowed to initialize in the job queue. @param queue queue name. @return maximum number of jobs allowed to be initialized per user. @throws IllegalArgumentException if maximum number of users is negative or zero.
[ "Gets", "the", "maximum", "number", "of", "jobs", "which", "are", "allowed", "to", "initialize", "in", "the", "job", "queue", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerConf.java#L319-L328
117,697
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
DatanodeDescriptor.addBlock
boolean addBlock(BlockInfo b) { int dnIndex = b.addNode(this); if(dnIndex < 0) return false; // add to the head of the data-node list blockList = b.listInsert(blockList, this, dnIndex); numOfBlocks++; return true; }
java
boolean addBlock(BlockInfo b) { int dnIndex = b.addNode(this); if(dnIndex < 0) return false; // add to the head of the data-node list blockList = b.listInsert(blockList, this, dnIndex); numOfBlocks++; return true; }
[ "boolean", "addBlock", "(", "BlockInfo", "b", ")", "{", "int", "dnIndex", "=", "b", ".", "addNode", "(", "this", ")", ";", "if", "(", "dnIndex", "<", "0", ")", "return", "false", ";", "// add to the head of the data-node list", "blockList", "=", "b", ".", ...
Add data-node to the block. Add block to the head of the list of blocks belonging to the data-node.
[ "Add", "data", "-", "node", "to", "the", "block", ".", "Add", "block", "to", "the", "head", "of", "the", "list", "of", "blocks", "belonging", "to", "the", "data", "-", "node", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java#L255-L263
117,698
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
DatanodeDescriptor.insertIntoList
void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) { if (head == null) return; // connect tail to now-head tail.setNext(tailIndex, blockList); if (blockList != null) blockList.setPrevious(blockList.findDatanode(this), tail); // create n...
java
void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) { if (head == null) return; // connect tail to now-head tail.setNext(tailIndex, blockList); if (blockList != null) blockList.setPrevious(blockList.findDatanode(this), tail); // create n...
[ "void", "insertIntoList", "(", "BlockInfo", "head", ",", "int", "headIndex", ",", "BlockInfo", "tail", ",", "int", "tailIndex", ",", "int", "count", ")", "{", "if", "(", "head", "==", "null", ")", "return", ";", "// connect tail to now-head", "tail", ".", ...
Adds blocks already connected into list, to this descriptor's blocks. The blocks in the input list already have this descriptor inserted to them. Used for parallel initial block reports.
[ "Adds", "blocks", "already", "connected", "into", "list", "to", "this", "descriptor", "s", "blocks", ".", "The", "blocks", "in", "the", "input", "list", "already", "have", "this", "descriptor", "inserted", "to", "them", ".", "Used", "for", "parallel", "initi...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java#L270-L285
117,699
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
DatanodeDescriptor.removeBlock
boolean removeBlock(BlockInfo b) { blockList = b.listRemove(blockList, this); if ( b.removeNode(this) ) { numOfBlocks--; return true; } else { return false; } }
java
boolean removeBlock(BlockInfo b) { blockList = b.listRemove(blockList, this); if ( b.removeNode(this) ) { numOfBlocks--; return true; } else { return false; } }
[ "boolean", "removeBlock", "(", "BlockInfo", "b", ")", "{", "blockList", "=", "b", ".", "listRemove", "(", "blockList", ",", "this", ")", ";", "if", "(", "b", ".", "removeNode", "(", "this", ")", ")", "{", "numOfBlocks", "--", ";", "return", "true", "...
Remove block from the list of blocks belonging to the data-node. Remove data-node from the block.
[ "Remove", "block", "from", "the", "list", "of", "blocks", "belonging", "to", "the", "data", "-", "node", ".", "Remove", "data", "-", "node", "from", "the", "block", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java#L300-L308