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
119,700
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java
Host2NodesMap.contains
boolean contains(DatanodeDescriptor node) { if (node==null) { return false; } String host = node.getHost(); hostmapLock.readLock().lock(); try { DatanodeDescriptor[] nodes = map.get(host); if (nodes != null) { for(DatanodeDescriptor containedNode:nodes) { i...
java
boolean contains(DatanodeDescriptor node) { if (node==null) { return false; } String host = node.getHost(); hostmapLock.readLock().lock(); try { DatanodeDescriptor[] nodes = map.get(host); if (nodes != null) { for(DatanodeDescriptor containedNode:nodes) { i...
[ "boolean", "contains", "(", "DatanodeDescriptor", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "false", ";", "}", "String", "host", "=", "node", ".", "getHost", "(", ")", ";", "hostmapLock", ".", "readLock", "(", ")", ".", "...
Check if node is already in the map.
[ "Check", "if", "node", "is", "already", "in", "the", "map", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java#L34-L54
119,701
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java
Host2NodesMap.add
boolean add(DatanodeDescriptor node) { hostmapLock.writeLock().lock(); try { if (node==null || contains(node)) { return false; } String host = node.getHost(); DatanodeDescriptor[] nodes = map.get(host); DatanodeDescriptor[] newNodes; if (nodes==null) { ...
java
boolean add(DatanodeDescriptor node) { hostmapLock.writeLock().lock(); try { if (node==null || contains(node)) { return false; } String host = node.getHost(); DatanodeDescriptor[] nodes = map.get(host); DatanodeDescriptor[] newNodes; if (nodes==null) { ...
[ "boolean", "add", "(", "DatanodeDescriptor", "node", ")", "{", "hostmapLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "node", "==", "null", "||", "contains", "(", "node", ")", ")", "{", "return", "false", ";", ...
add node to the map return true if the node is added; false otherwise.
[ "add", "node", "to", "the", "map", "return", "true", "if", "the", "node", "is", "added", ";", "false", "otherwise", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java#L59-L82
119,702
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java
Host2NodesMap.remove
boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String host = node.getHost(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(host); if (nodes==null) { return false; } if (nodes.length==1) { ...
java
boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String host = node.getHost(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(host); if (nodes==null) { return false; } if (nodes.length==1) { ...
[ "boolean", "remove", "(", "DatanodeDescriptor", "node", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", "false", ";", "}", "String", "host", "=", "node", ".", "getHost", "(", ")", ";", "hostmapLock", ".", "writeLock", "(", ")", ".", "l...
remove node from the map return true if the node is removed; false otherwise.
[ "remove", "node", "from", "the", "map", "return", "true", "if", "the", "node", "is", "removed", ";", "false", "otherwise", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java#L87-L128
119,703
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java
Host2NodesMap.getDatanodeByName
@Deprecated public DatanodeDescriptor getDatanodeByName(String name) { if (name == null) { return null; } int colon = name.indexOf(":"); String host; if (colon < 0) { host = name; } else { host = name.substring(0, colon); } hostmapLock.readLock().lock(); try { ...
java
@Deprecated public DatanodeDescriptor getDatanodeByName(String name) { if (name == null) { return null; } int colon = name.indexOf(":"); String host; if (colon < 0) { host = name; } else { host = name.substring(0, colon); } hostmapLock.readLock().lock(); try { ...
[ "@", "Deprecated", "public", "DatanodeDescriptor", "getDatanodeByName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "null", ";", "}", "int", "colon", "=", "name", ".", "indexOf", "(", "\":\"", ")", ";", "String",...
Find data node by its name. @deprecated use {@link #getDataNodeByIpPort(String)} @return DatanodeDescriptor if found or null otherwise
[ "Find", "data", "node", "by", "its", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/Host2NodesMap.java#L185-L213
119,704
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorMapper.java
ValueAggregatorMapper.reduce
public void reduce(Text arg0, Iterator<Text> arg1, OutputCollector<Text, Text> arg2, Reporter arg3) throws IOException { throw new IOException("should not be called\n"); }
java
public void reduce(Text arg0, Iterator<Text> arg1, OutputCollector<Text, Text> arg2, Reporter arg3) throws IOException { throw new IOException("should not be called\n"); }
[ "public", "void", "reduce", "(", "Text", "arg0", ",", "Iterator", "<", "Text", ">", "arg1", ",", "OutputCollector", "<", "Text", ",", "Text", ">", "arg2", ",", "Reporter", "arg3", ")", "throws", "IOException", "{", "throw", "new", "IOException", "(", "\"...
Do nothing. Should not be called.
[ "Do", "nothing", ".", "Should", "not", "be", "called", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorMapper.java#L60-L64
119,705
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskErrorCollector.java
TaskErrorCollector.getRecentErrorCounts
public synchronized Map<TaskError, Integer> getRecentErrorCounts(long timeWindow) { long start = System.currentTimeMillis() - timeWindow; Map<TaskError, Integer> errorCounts = createErrorCountsMap(); Iterator<Map<TaskError, Integer>> errorCountsIter = errorCountsQueue.iterator(); Iterator<Long> startTim...
java
public synchronized Map<TaskError, Integer> getRecentErrorCounts(long timeWindow) { long start = System.currentTimeMillis() - timeWindow; Map<TaskError, Integer> errorCounts = createErrorCountsMap(); Iterator<Map<TaskError, Integer>> errorCountsIter = errorCountsQueue.iterator(); Iterator<Long> startTim...
[ "public", "synchronized", "Map", "<", "TaskError", ",", "Integer", ">", "getRecentErrorCounts", "(", "long", "timeWindow", ")", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "timeWindow", ";", "Map", "<", "TaskError", ",", "In...
Get recent TaskError counts within the given window @param timeWindow Window size in milliseconds. Ex: 24 * 60 * 60 * 1000 gives you last day error counts @return Counts for each TaskError
[ "Get", "recent", "TaskError", "counts", "within", "the", "given", "window" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskErrorCollector.java#L191-L204
119,706
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskErrorCollector.java
TaskErrorCollector.parseConfigFile
private Map<String, TaskError> parseConfigFile(URL configURL) { Map<String, TaskError> knownErrors = new LinkedHashMap<String, TaskError>(); try { Element root = getRootElement(configURL); NodeList elements = root.getChildNodes(); for (int i = 0; i < elements.getLength(); ++i) { Node n...
java
private Map<String, TaskError> parseConfigFile(URL configURL) { Map<String, TaskError> knownErrors = new LinkedHashMap<String, TaskError>(); try { Element root = getRootElement(configURL); NodeList elements = root.getChildNodes(); for (int i = 0; i < elements.getLength(); ++i) { Node n...
[ "private", "Map", "<", "String", ",", "TaskError", ">", "parseConfigFile", "(", "URL", "configURL", ")", "{", "Map", "<", "String", ",", "TaskError", ">", "knownErrors", "=", "new", "LinkedHashMap", "<", "String", ",", "TaskError", ">", "(", ")", ";", "t...
Parse the error.xml file which contains the error The following is an example of the error.xml <?xml version="1.0"?> <configuration> <error name="Map output lost"> <pattern>Map output lost</pattern> <description>TaskTracker cannot find requested map output</description> </error> <error name="Memory killing"> <pattern...
[ "Parse", "the", "error", ".", "xml", "file", "which", "contains", "the", "error" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskErrorCollector.java#L310-L347
119,707
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.processBadResource
public void processBadResource(int grant, boolean abandonHost) { synchronized (lockObject) { Set<String> excludedHosts = null; TaskInProgress tip = requestToTipMap.get(grant); if (!job.canLaunchJobCleanupTask() && (!tip.isRunnable() || (tip.isRunning() && !(specul...
java
public void processBadResource(int grant, boolean abandonHost) { synchronized (lockObject) { Set<String> excludedHosts = null; TaskInProgress tip = requestToTipMap.get(grant); if (!job.canLaunchJobCleanupTask() && (!tip.isRunnable() || (tip.isRunning() && !(specul...
[ "public", "void", "processBadResource", "(", "int", "grant", ",", "boolean", "abandonHost", ")", "{", "synchronized", "(", "lockObject", ")", "{", "Set", "<", "String", ">", "excludedHosts", "=", "null", ";", "TaskInProgress", "tip", "=", "requestToTipMap", "....
Return this grant and request a different one. This can happen because the task has failed, was killed or the job tracker decided that the resource is bad @param grant The grant identifier. @param abandonHost - if true then this host will be excluded from the list of possibilities for this request
[ "Return", "this", "grant", "and", "request", "a", "different", "one", ".", "This", "can", "happen", "because", "the", "task", "has", "failed", "was", "killed", "or", "the", "job", "tracker", "decided", "that", "the", "resource", "is", "bad" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L1599-L1632
119,708
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.updateTaskStatuses
private void updateTaskStatuses(TaskTrackerStatus status) { TaskTrackerInfo trackerInfo = TaskTrackerInfo.fromStatus(status); String trackerName = status.getTrackerName(); for (TaskStatus report : status.getTaskReports()) { // Ensure that every report has information about task tracker report.se...
java
private void updateTaskStatuses(TaskTrackerStatus status) { TaskTrackerInfo trackerInfo = TaskTrackerInfo.fromStatus(status); String trackerName = status.getTrackerName(); for (TaskStatus report : status.getTaskReports()) { // Ensure that every report has information about task tracker report.se...
[ "private", "void", "updateTaskStatuses", "(", "TaskTrackerStatus", "status", ")", "{", "TaskTrackerInfo", "trackerInfo", "=", "TaskTrackerInfo", ".", "fromStatus", "(", "status", ")", ";", "String", "trackerName", "=", "status", ".", "getTrackerName", "(", ")", ";...
Updates job and tasks state according to report from TaskTracker @param status TaskTrackerStatus
[ "Updates", "job", "and", "tasks", "state", "according", "to", "report", "from", "TaskTracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L1932-L1944
119,709
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.updateTaskStatus
private void updateTaskStatus(TaskTrackerInfo info, TaskStatus report) { TaskAttemptID taskId = report.getTaskID(); // Here we want strict job id comparison. if (!this.jobId.equals(taskId.getJobID())) { LOG.warn("Task " + taskId + " belongs to unknown job " + taskId.getJobID()); retur...
java
private void updateTaskStatus(TaskTrackerInfo info, TaskStatus report) { TaskAttemptID taskId = report.getTaskID(); // Here we want strict job id comparison. if (!this.jobId.equals(taskId.getJobID())) { LOG.warn("Task " + taskId + " belongs to unknown job " + taskId.getJobID()); retur...
[ "private", "void", "updateTaskStatus", "(", "TaskTrackerInfo", "info", ",", "TaskStatus", "report", ")", "{", "TaskAttemptID", "taskId", "=", "report", ".", "getTaskID", "(", ")", ";", "// Here we want strict job id comparison.", "if", "(", "!", "this", ".", "jobI...
Updates job and tasks state according to TaskStatus from given TaskTracker. This function only updates internal job state, it shall NOT issue any actions directly. @param info TaskTrackerInfo object @param report TaskStatus report
[ "Updates", "job", "and", "tasks", "state", "according", "to", "TaskStatus", "from", "given", "TaskTracker", ".", "This", "function", "only", "updates", "internal", "job", "state", "it", "shall", "NOT", "issue", "any", "actions", "directly", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L1953-L1987
119,710
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.saveNewRequestForTip
private void saveNewRequestForTip(TaskInProgress tip, ResourceRequest req) { requestToTipMap.put(req.getId(), tip); TaskContext context = taskToContextMap.get(tip); if (context == null) { context = new TaskContext(req); } else { context.resourceRequests.add(req); } taskToContextMap.p...
java
private void saveNewRequestForTip(TaskInProgress tip, ResourceRequest req) { requestToTipMap.put(req.getId(), tip); TaskContext context = taskToContextMap.get(tip); if (context == null) { context = new TaskContext(req); } else { context.resourceRequests.add(req); } taskToContextMap.p...
[ "private", "void", "saveNewRequestForTip", "(", "TaskInProgress", "tip", ",", "ResourceRequest", "req", ")", "{", "requestToTipMap", ".", "put", "(", "req", ".", "getId", "(", ")", ",", "tip", ")", ";", "TaskContext", "context", "=", "taskToContextMap", ".", ...
Saves new request for given tip, no recording in resource tracker happens @param tip task in progress @param req request
[ "Saves", "new", "request", "for", "given", "tip", "no", "recording", "in", "resource", "tracker", "happens" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L2141-L2150
119,711
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.getNewJobId
@Override public JobID getNewJobId() throws IOException { int value = jobCounter.incrementAndGet(); if (value > 1) { throw new RuntimeException( "CoronaJobTracker can only run one job! (value=" + value + ")"); } createSession(); // the jobtracker can run only a single job. it's jobid...
java
@Override public JobID getNewJobId() throws IOException { int value = jobCounter.incrementAndGet(); if (value > 1) { throw new RuntimeException( "CoronaJobTracker can only run one job! (value=" + value + ")"); } createSession(); // the jobtracker can run only a single job. it's jobid...
[ "@", "Override", "public", "JobID", "getNewJobId", "(", ")", "throws", "IOException", "{", "int", "value", "=", "jobCounter", ".", "incrementAndGet", "(", ")", ";", "if", "(", "value", ">", "1", ")", "{", "throw", "new", "RuntimeException", "(", "\"CoronaJ...
Returns a unique JobID for a new job. CoronaJobTracker can only run a single job and it's id is fixed a-priori @return the job ID.
[ "Returns", "a", "unique", "JobID", "for", "a", "new", "job", ".", "CoronaJobTracker", "can", "only", "run", "a", "single", "job", "and", "it", "s", "id", "is", "fixed", "a", "-", "priori" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L2425-L2437
119,712
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.dispatchCommitActions
private void dispatchCommitActions(List<CommitTaskAction> commitActions) throws IOException { if (!commitActions.isEmpty()) { TaskAttemptID[] wasCommitting; try { wasCommitting = commitPermissionClient .getAndSetCommitting(commitActions); } catch (IOException e) { ...
java
private void dispatchCommitActions(List<CommitTaskAction> commitActions) throws IOException { if (!commitActions.isEmpty()) { TaskAttemptID[] wasCommitting; try { wasCommitting = commitPermissionClient .getAndSetCommitting(commitActions); } catch (IOException e) { ...
[ "private", "void", "dispatchCommitActions", "(", "List", "<", "CommitTaskAction", ">", "commitActions", ")", "throws", "IOException", "{", "if", "(", "!", "commitActions", ".", "isEmpty", "(", ")", ")", "{", "TaskAttemptID", "[", "]", "wasCommitting", ";", "tr...
Executes actions that can be executed after asking commit permission authority @param actions list of actions to execute @throws IOException
[ "Executes", "actions", "that", "can", "be", "executed", "after", "asking", "commit", "permission", "authority" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L2897-L2933
119,713
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.isMatchingJobId
private boolean isMatchingJobId(JobID jobId) { if (isStandalone) { // Requests to remote JT must hold exact attempt id. return this.jobId.equals(jobId); } else { // Local JT serves as translator between job id and job attempt id. return this.jobId.equals(getMainJobID(jobId)); } }
java
private boolean isMatchingJobId(JobID jobId) { if (isStandalone) { // Requests to remote JT must hold exact attempt id. return this.jobId.equals(jobId); } else { // Local JT serves as translator between job id and job attempt id. return this.jobId.equals(getMainJobID(jobId)); } }
[ "private", "boolean", "isMatchingJobId", "(", "JobID", "jobId", ")", "{", "if", "(", "isStandalone", ")", "{", "// Requests to remote JT must hold exact attempt id.", "return", "this", ".", "jobId", ".", "equals", "(", "jobId", ")", ";", "}", "else", "{", "// Lo...
Check if given id matches job id of this JT. @param jobId id to check @return true iff match
[ "Check", "if", "given", "id", "matches", "job", "id", "of", "this", "JT", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L3067-L3075
119,714
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.expiredLaunchingTask
public void expiredLaunchingTask(TaskAttemptID taskId) { synchronized (lockObject) { String trackerName = taskLookupTable.getAssignedTracker(taskId); trackerStats.recordTimeout(trackerName); localJTSubmitter.submit(new TaskTimeout(trackerName)); failTask(taskId, "Error launching task", false...
java
public void expiredLaunchingTask(TaskAttemptID taskId) { synchronized (lockObject) { String trackerName = taskLookupTable.getAssignedTracker(taskId); trackerStats.recordTimeout(trackerName); localJTSubmitter.submit(new TaskTimeout(trackerName)); failTask(taskId, "Error launching task", false...
[ "public", "void", "expiredLaunchingTask", "(", "TaskAttemptID", "taskId", ")", "{", "synchronized", "(", "lockObject", ")", "{", "String", "trackerName", "=", "taskLookupTable", ".", "getAssignedTracker", "(", "taskId", ")", ";", "trackerStats", ".", "recordTimeout"...
Handle a task that could not be launched. @param taskId The task attempt ID.
[ "Handle", "a", "task", "that", "could", "not", "be", "launched", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L3285-L3292
119,715
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.prepareFailover
public void prepareFailover() { if (!RemoteJTProxy.isJTRestartingEnabled(conf)) { return; } LOG.info("prepareFailover done"); this.isPurgingJob = false; if (this.parentHeartbeat != null) { // Because our failover mechanism based on remotJTProxy can't // reach remote...
java
public void prepareFailover() { if (!RemoteJTProxy.isJTRestartingEnabled(conf)) { return; } LOG.info("prepareFailover done"); this.isPurgingJob = false; if (this.parentHeartbeat != null) { // Because our failover mechanism based on remotJTProxy can't // reach remote...
[ "public", "void", "prepareFailover", "(", ")", "{", "if", "(", "!", "RemoteJTProxy", ".", "isJTRestartingEnabled", "(", "conf", ")", ")", "{", "return", ";", "}", "LOG", ".", "info", "(", "\"prepareFailover done\"", ")", ";", "this", ".", "isPurgingJob", "...
Some perparation job needed by remote job tracker for failover
[ "Some", "perparation", "job", "needed", "by", "remote", "job", "tracker", "for", "failover" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L3431-L3446
119,716
facebookarchive/hadoop-20
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java
StreamJob.go
@Deprecated public int go() throws IOException { try { return run(argv_); } catch (Exception ex) { throw new IOException(ex.getMessage()); } }
java
@Deprecated public int go() throws IOException { try { return run(argv_); } catch (Exception ex) { throw new IOException(ex.getMessage()); } }
[ "@", "Deprecated", "public", "int", "go", "(", ")", "throws", "IOException", "{", "try", "{", "return", "run", "(", "argv_", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "throw", "new", "IOException", "(", "ex", ".", "getMessage", "(", "...
This is the method that actually initializes the job conf and submits the job to the jobtracker @throws IOException @deprecated use {@link #run(String[])} instead.
[ "This", "is", "the", "method", "that", "actually", "initializes", "the", "job", "conf", "and", "submits", "the", "job", "to", "the", "jobtracker" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java#L171-L179
119,717
facebookarchive/hadoop-20
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java
StreamJob.listJobConfProperties
protected void listJobConfProperties() { msg("==== JobConf properties:"); Iterator it = jobConf_.iterator(); TreeMap sorted = new TreeMap(); while(it.hasNext()) { Map.Entry en = (Map.Entry)it.next(); sorted.put(en.getKey(), en.getValue()); } it = sorted.entrySet().iterator(); w...
java
protected void listJobConfProperties() { msg("==== JobConf properties:"); Iterator it = jobConf_.iterator(); TreeMap sorted = new TreeMap(); while(it.hasNext()) { Map.Entry en = (Map.Entry)it.next(); sorted.put(en.getKey(), en.getValue()); } it = sorted.entrySet().iterator(); w...
[ "protected", "void", "listJobConfProperties", "(", ")", "{", "msg", "(", "\"==== JobConf properties:\"", ")", ";", "Iterator", "it", "=", "jobConf_", ".", "iterator", "(", ")", ";", "TreeMap", "sorted", "=", "new", "TreeMap", "(", ")", ";", "while", "(", "...
Prints out the jobconf properties on stdout when verbose is specified.
[ "Prints", "out", "the", "jobconf", "properties", "on", "stdout", "when", "verbose", "is", "specified", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java#L857-L872
119,718
facebookarchive/hadoop-20
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java
StreamJob.submitAndMonitorJob
public int submitAndMonitorJob() throws IOException { if (jar_ != null && isLocalHadoop()) { // getAbs became required when shell and subvm have different working dirs... File wd = new File(".").getAbsoluteFile(); StreamUtil.unJar(new File(jar_), wd); } // if jobConf_ changes must recrea...
java
public int submitAndMonitorJob() throws IOException { if (jar_ != null && isLocalHadoop()) { // getAbs became required when shell and subvm have different working dirs... File wd = new File(".").getAbsoluteFile(); StreamUtil.unJar(new File(jar_), wd); } // if jobConf_ changes must recrea...
[ "public", "int", "submitAndMonitorJob", "(", ")", "throws", "IOException", "{", "if", "(", "jar_", "!=", "null", "&&", "isLocalHadoop", "(", ")", ")", "{", "// getAbs became required when shell and subvm have different working dirs...", "File", "wd", "=", "new", "File...
Based on JobClient
[ "Based", "on", "JobClient" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamJob.java#L892-L957
119,719
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.checkIfLastPacketTimeout
private void checkIfLastPacketTimeout() { synchronized (ackQueue) { if( !ackQueue.isEmpty() && ( System.currentTimeMillis() - lastPacketSentTime > packetTimeout) ) { DFSClient.LOG.warn("Packet " + ackQueue.getLast().seqno + " of...
java
private void checkIfLastPacketTimeout() { synchronized (ackQueue) { if( !ackQueue.isEmpty() && ( System.currentTimeMillis() - lastPacketSentTime > packetTimeout) ) { DFSClient.LOG.warn("Packet " + ackQueue.getLast().seqno + " of...
[ "private", "void", "checkIfLastPacketTimeout", "(", ")", "{", "synchronized", "(", "ackQueue", ")", "{", "if", "(", "!", "ackQueue", ".", "isEmpty", "(", ")", "&&", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "lastPacketSentTime", ">", "packetTim...
Check if the last outstanding packet has not received an ack before it is timed out. If true, for now just log it. We will provide a decent solution to this later on.
[ "Check", "if", "the", "last", "outstanding", "packet", "has", "not", "received", "an", "ack", "before", "it", "is", "timed", "out", ".", "If", "true", "for", "now", "just", "log", "it", ".", "We", "will", "provide", "a", "decent", "solution", "to", "th...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L175-L183
119,720
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.setupPipelineForAppend
private boolean setupPipelineForAppend(LocatedBlock lastBlock) throws IOException { if (nodes == null || nodes.length == 0) { String msg = "Could not get block locations. " + "Source file \"" + src + "\" - Aborting..."; DFSClient.LOG.warn(msg); setLastException(new IOException(...
java
private boolean setupPipelineForAppend(LocatedBlock lastBlock) throws IOException { if (nodes == null || nodes.length == 0) { String msg = "Could not get block locations. " + "Source file \"" + src + "\" - Aborting..."; DFSClient.LOG.warn(msg); setLastException(new IOException(...
[ "private", "boolean", "setupPipelineForAppend", "(", "LocatedBlock", "lastBlock", ")", "throws", "IOException", "{", "if", "(", "nodes", "==", "null", "||", "nodes", ".", "length", "==", "0", ")", "{", "String", "msg", "=", "\"Could not get block locations. \"", ...
Setup the Append pipeline, the length of current pipeline will shrink if any datanodes are dead during the process.
[ "Setup", "the", "Append", "pipeline", "the", "length", "of", "current", "pipeline", "will", "shrink", "if", "any", "datanodes", "are", "dead", "during", "the", "process", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L1226-L1265
119,721
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.nextBlockOutputStream
private DatanodeInfo[] nextBlockOutputStream(String client) throws IOException { LocatedBlock lb = null; boolean retry = false; DatanodeInfo[] nodes; ArrayList<DatanodeInfo> excludedNodes = new ArrayList<DatanodeInfo>(); int count = dfsClient.conf.getInt("dfs.client.block.write.retries", 3); boo...
java
private DatanodeInfo[] nextBlockOutputStream(String client) throws IOException { LocatedBlock lb = null; boolean retry = false; DatanodeInfo[] nodes; ArrayList<DatanodeInfo> excludedNodes = new ArrayList<DatanodeInfo>(); int count = dfsClient.conf.getInt("dfs.client.block.write.retries", 3); boo...
[ "private", "DatanodeInfo", "[", "]", "nextBlockOutputStream", "(", "String", "client", ")", "throws", "IOException", "{", "LocatedBlock", "lb", "=", "null", ";", "boolean", "retry", "=", "false", ";", "DatanodeInfo", "[", "]", "nodes", ";", "ArrayList", "<", ...
Open a DataOutputStream to a DataNode so that it can be written to. This happens when a file is created and each time a new block is allocated. Must get block ID and the IDs of the destinations from the namenode. Returns the list of target datanodes.
[ "Open", "a", "DataOutputStream", "to", "a", "DataNode", "so", "that", "it", "can", "be", "written", "to", ".", "This", "happens", "when", "a", "file", "is", "created", "and", "each", "time", "a", "new", "block", "is", "allocated", ".", "Must", "get", "...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L1286-L1354
119,722
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.sync
public void sync() throws IOException { long start = System.currentTimeMillis(); try { long toWaitFor; synchronized (this) { eventStartSync(); /* Record current blockOffset. This might be changed inside * flushBuffer() where a partial checksum chunk might be flushed. ...
java
public void sync() throws IOException { long start = System.currentTimeMillis(); try { long toWaitFor; synchronized (this) { eventStartSync(); /* Record current blockOffset. This might be changed inside * flushBuffer() where a partial checksum chunk might be flushed. ...
[ "public", "void", "sync", "(", ")", "throws", "IOException", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "try", "{", "long", "toWaitFor", ";", "synchronized", "(", "this", ")", "{", "eventStartSync", "(", ")", ";", "/* R...
All data is written out to datanodes. It is not guaranteed that data has been flushed to persistent store on the datanode. Block allocations are persisted on namenode.
[ "All", "data", "is", "written", "out", "to", "datanodes", ".", "It", "is", "not", "guaranteed", "that", "data", "has", "been", "flushed", "to", "persistent", "store", "on", "the", "datanode", ".", "Block", "allocations", "are", "persisted", "on", "namenode",...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L1725-L1802
119,723
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.flushInternal
private void flushInternal() throws IOException { isClosed(); dfsClient.checkOpen(); long toWaitFor; synchronized (this) { enqueueCurrentPacket(); toWaitFor = lastQueuedSeqno; } waitForAckedSeqno(toWaitFor); }
java
private void flushInternal() throws IOException { isClosed(); dfsClient.checkOpen(); long toWaitFor; synchronized (this) { enqueueCurrentPacket(); toWaitFor = lastQueuedSeqno; } waitForAckedSeqno(toWaitFor); }
[ "private", "void", "flushInternal", "(", ")", "throws", "IOException", "{", "isClosed", "(", ")", ";", "dfsClient", ".", "checkOpen", "(", ")", ";", "long", "toWaitFor", ";", "synchronized", "(", "this", ")", "{", "enqueueCurrentPacket", "(", ")", ";", "to...
Waits till all existing data is flushed and confirmations received from datanodes.
[ "Waits", "till", "all", "existing", "data", "is", "flushed", "and", "confirmations", "received", "from", "datanodes", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L1834-L1845
119,724
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java
DFSOutputStream.closeThreads
private void closeThreads() throws IOException { try { if (streamer != null) { streamer.close(); streamer.join(); } // shutdown response after streamer has exited. if (response != null) { response.close(); response.join(); response = null; } ...
java
private void closeThreads() throws IOException { try { if (streamer != null) { streamer.close(); streamer.join(); } // shutdown response after streamer has exited. if (response != null) { response.close(); response.join(); response = null; } ...
[ "private", "void", "closeThreads", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "streamer", "!=", "null", ")", "{", "streamer", ".", "close", "(", ")", ";", "streamer", ".", "join", "(", ")", ";", "}", "// shutdown response after streamer...
shutdown datastreamer and responseprocessor threads.
[ "shutdown", "datastreamer", "and", "responseprocessor", "threads", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSOutputStream.java#L1942-L1958
119,725
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java
OutputHandler.output
public void output(K key, V value) throws IOException { collector.collect(key, value); }
java
public void output(K key, V value) throws IOException { collector.collect(key, value); }
[ "public", "void", "output", "(", "K", "key", ",", "V", "value", ")", "throws", "IOException", "{", "collector", ".", "collect", "(", "key", ",", "value", ")", ";", "}" ]
The task output a normal record.
[ "The", "task", "output", "a", "normal", "record", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java#L67-L69
119,726
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java
OutputHandler.partitionedOutput
public void partitionedOutput(int reduce, K key, V value) throws IOException { PipesPartitioner.setNextPartition(reduce); collector.collect(key, value); }
java
public void partitionedOutput(int reduce, K key, V value) throws IOException { PipesPartitioner.setNextPartition(reduce); collector.collect(key, value); }
[ "public", "void", "partitionedOutput", "(", "int", "reduce", ",", "K", "key", ",", "V", "value", ")", "throws", "IOException", "{", "PipesPartitioner", ".", "setNextPartition", "(", "reduce", ")", ";", "collector", ".", "collect", "(", "key", ",", "value", ...
The task output a record with a partition number attached.
[ "The", "task", "output", "a", "record", "with", "a", "partition", "number", "attached", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java#L74-L78
119,727
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java
OutputHandler.progress
public void progress(float progress) throws IOException { progressValue = progress; reporter.progress(); if (recordReader != null) { progressKey.set(progress); recordReader.next(progressKey, nullValue); } }
java
public void progress(float progress) throws IOException { progressValue = progress; reporter.progress(); if (recordReader != null) { progressKey.set(progress); recordReader.next(progressKey, nullValue); } }
[ "public", "void", "progress", "(", "float", "progress", ")", "throws", "IOException", "{", "progressValue", "=", "progress", ";", "reporter", ".", "progress", "(", ")", ";", "if", "(", "recordReader", "!=", "null", ")", "{", "progressKey", ".", "set", "(",...
Update the amount done and call progress on the reporter.
[ "Update", "the", "amount", "done", "and", "call", "progress", "on", "the", "reporter", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java#L92-L100
119,728
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java
OutputHandler.waitForFinish
public synchronized boolean waitForFinish() throws Throwable { while (!done && exception == null) { wait(); } if (exception != null) { throw exception; } return done; }
java
public synchronized boolean waitForFinish() throws Throwable { while (!done && exception == null) { wait(); } if (exception != null) { throw exception; } return done; }
[ "public", "synchronized", "boolean", "waitForFinish", "(", ")", "throws", "Throwable", "{", "while", "(", "!", "done", "&&", "exception", "==", "null", ")", "{", "wait", "(", ")", ";", "}", "if", "(", "exception", "!=", "null", ")", "{", "throw", "exce...
Wait for the task to finish or abort. @return did the task finish correctly? @throws Throwable
[ "Wait", "for", "the", "task", "to", "finish", "or", "abort", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/OutputHandler.java#L135-L143
119,729
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
DirectoryScanner.getDiskReportPerNamespace
private Map<Integer, DiskScanInfo[]> getDiskReportPerNamespace() { if (dataset.volumes == null) { LOG.warn("Dataset volumes are not initialized yet"); return new HashMap<Integer, DiskScanInfo[]>(); } // First get list of data directories FSVolume[] volumes = dataset.volumes.getVolumes(); ...
java
private Map<Integer, DiskScanInfo[]> getDiskReportPerNamespace() { if (dataset.volumes == null) { LOG.warn("Dataset volumes are not initialized yet"); return new HashMap<Integer, DiskScanInfo[]>(); } // First get list of data directories FSVolume[] volumes = dataset.volumes.getVolumes(); ...
[ "private", "Map", "<", "Integer", ",", "DiskScanInfo", "[", "]", ">", "getDiskReportPerNamespace", "(", ")", "{", "if", "(", "dataset", ".", "volumes", "==", "null", ")", "{", "LOG", ".", "warn", "(", "\"Dataset volumes are not initialized yet\"", ")", ";", ...
Get lists of blocks on the disk sorted by blockId, per namespace
[ "Get", "lists", "of", "blocks", "on", "the", "disk", "sorted", "by", "blockId", "per", "namespace" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java#L471-L515
119,730
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
DirectoryScanner.checkDifferenceAndReconcile
void checkDifferenceAndReconcile() { resetDiffsAndStats(); checkDifference(); // now reconcile the differences for (Entry<Integer, LinkedList<ScanDifference>> entry : diffsPerNamespace.entrySet()) { Integer namespaceId = entry.getKey(); LinkedList<ScanDifference> diff = entry.getValue()...
java
void checkDifferenceAndReconcile() { resetDiffsAndStats(); checkDifference(); // now reconcile the differences for (Entry<Integer, LinkedList<ScanDifference>> entry : diffsPerNamespace.entrySet()) { Integer namespaceId = entry.getKey(); LinkedList<ScanDifference> diff = entry.getValue()...
[ "void", "checkDifferenceAndReconcile", "(", ")", "{", "resetDiffsAndStats", "(", ")", ";", "checkDifference", "(", ")", ";", "// now reconcile the differences", "for", "(", "Entry", "<", "Integer", ",", "LinkedList", "<", "ScanDifference", ">", ">", "entry", ":", ...
Reconcile differences between disk and in-memory blocks
[ "Reconcile", "differences", "between", "disk", "and", "in", "-", "memory", "blocks" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java#L638-L654
119,731
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/JarModule.java
JarModule.createJarPackage
public static File createJarPackage(IResource resource) { JarModule jarModule = new JarModule(resource); try { PlatformUI.getWorkbench().getProgressService().run(false, true, jarModule); } catch (Exception e) { e.printStackTrace(); return null; } File jarFile = jarModu...
java
public static File createJarPackage(IResource resource) { JarModule jarModule = new JarModule(resource); try { PlatformUI.getWorkbench().getProgressService().run(false, true, jarModule); } catch (Exception e) { e.printStackTrace(); return null; } File jarFile = jarModu...
[ "public", "static", "File", "createJarPackage", "(", "IResource", "resource", ")", "{", "JarModule", "jarModule", "=", "new", "JarModule", "(", "resource", ")", ";", "try", "{", "PlatformUI", ".", "getWorkbench", "(", ")", ".", "getProgressService", "(", ")", ...
Static way to create a JAR package for the given resource and showing a progress bar @param resource @return
[ "Static", "way", "to", "create", "a", "JAR", "package", "for", "the", "given", "resource", "and", "showing", "a", "progress", "bar" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/JarModule.java#L124-L144
119,732
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.getValidTargets
DatanodeDescriptor[] getValidTargets() { if (targetGSs == null) { return null; } int count = 0; long lastBlockGS = this.getLastBlock().getGenerationStamp(); for (long targetGS : targetGSs) { if (lastBlockGS == targetGS) { count++; } } if (count == 0) { return ...
java
DatanodeDescriptor[] getValidTargets() { if (targetGSs == null) { return null; } int count = 0; long lastBlockGS = this.getLastBlock().getGenerationStamp(); for (long targetGS : targetGSs) { if (lastBlockGS == targetGS) { count++; } } if (count == 0) { return ...
[ "DatanodeDescriptor", "[", "]", "getValidTargets", "(", ")", "{", "if", "(", "targetGSs", "==", "null", ")", "{", "return", "null", ";", "}", "int", "count", "=", "0", ";", "long", "lastBlockGS", "=", "this", ".", "getLastBlock", "(", ")", ".", "getGen...
Return the targets with generation stamp matching that of the last block
[ "Return", "the", "targets", "with", "generation", "stamp", "matching", "that", "of", "the", "last", "block" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L133-L160
119,733
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.setTargets
void setTargets(DatanodeDescriptor[] locs, long generationStamp) { setTargets(locs); if (locs == null) { targetGSs = null; return; } long[] targetGSs = new long[locs.length]; for (int i=0; i<targetGSs.length; i++) { targetGSs[i] = generationStamp; } this.targetGSs = targetG...
java
void setTargets(DatanodeDescriptor[] locs, long generationStamp) { setTargets(locs); if (locs == null) { targetGSs = null; return; } long[] targetGSs = new long[locs.length]; for (int i=0; i<targetGSs.length; i++) { targetGSs[i] = generationStamp; } this.targetGSs = targetG...
[ "void", "setTargets", "(", "DatanodeDescriptor", "[", "]", "locs", ",", "long", "generationStamp", ")", "{", "setTargets", "(", "locs", ")", ";", "if", "(", "locs", "==", "null", ")", "{", "targetGSs", "=", "null", ";", "return", ";", "}", "long", "[",...
Set targets for list of replicas all sharing the same generationStamp @param locs location of replicas @param generationStamp shared generation stamp
[ "Set", "targets", "for", "list", "of", "replicas", "all", "sharing", "the", "same", "generationStamp" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L178-L189
119,734
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.addTarget
boolean addTarget(DatanodeDescriptor node, long generationStamp) { if (this.targets == null) { this.targets = new DatanodeDescriptor[0]; } for (int i=0; i<targets.length; i++) { if (targets[i].equals(node)) { if (generationStamp != targetGSs[i]) { targetGSs[i] = generatio...
java
boolean addTarget(DatanodeDescriptor node, long generationStamp) { if (this.targets == null) { this.targets = new DatanodeDescriptor[0]; } for (int i=0; i<targets.length; i++) { if (targets[i].equals(node)) { if (generationStamp != targetGSs[i]) { targetGSs[i] = generatio...
[ "boolean", "addTarget", "(", "DatanodeDescriptor", "node", ",", "long", "generationStamp", ")", "{", "if", "(", "this", ".", "targets", "==", "null", ")", "{", "this", ".", "targets", "=", "new", "DatanodeDescriptor", "[", "0", "]", ";", "}", "for", "(",...
add this target if it does not already exists. Returns true if the target was added. @param node data node having the block @param generationStamp the generation of the block on the data node @return true if the data node is added to the target list, or previous generation stamp for the datanode is updated. Otherwise,...
[ "add", "this", "target", "if", "it", "does", "not", "already", "exists", ".", "Returns", "true", "if", "the", "target", "was", "added", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L214-L248
119,735
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.assignPrimaryDatanode
void assignPrimaryDatanode() { //assign the first alive datanode as the primary datanode if (targets.length == 0) { NameNode.stateChangeLog.warn("BLOCK*" + " INodeFileUnderConstruction.initLeaseRecovery:" + " No blocks found, lease removed."); } int previous = primaryNodeIndex; ...
java
void assignPrimaryDatanode() { //assign the first alive datanode as the primary datanode if (targets.length == 0) { NameNode.stateChangeLog.warn("BLOCK*" + " INodeFileUnderConstruction.initLeaseRecovery:" + " No blocks found, lease removed."); } int previous = primaryNodeIndex; ...
[ "void", "assignPrimaryDatanode", "(", ")", "{", "//assign the first alive datanode as the primary datanode", "if", "(", "targets", ".", "length", "==", "0", ")", "{", "NameNode", ".", "stateChangeLog", ".", "warn", "(", "\"BLOCK*\"", "+", "\" INodeFileUnderConstruction....
Initialize lease recovery for this object
[ "Initialize", "lease", "recovery", "for", "this", "object" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L337-L360
119,736
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.setLastRecoveryTime
synchronized boolean setLastRecoveryTime(long now) { boolean expired = now - lastRecoveryTime > NameNode.LEASE_RECOVER_PERIOD; if (expired) { lastRecoveryTime = now; } return expired; }
java
synchronized boolean setLastRecoveryTime(long now) { boolean expired = now - lastRecoveryTime > NameNode.LEASE_RECOVER_PERIOD; if (expired) { lastRecoveryTime = now; } return expired; }
[ "synchronized", "boolean", "setLastRecoveryTime", "(", "long", "now", ")", "{", "boolean", "expired", "=", "now", "-", "lastRecoveryTime", ">", "NameNode", ".", "LEASE_RECOVER_PERIOD", ";", "if", "(", "expired", ")", "{", "lastRecoveryTime", "=", "now", ";", "...
Update lastRecoveryTime if expired. @return true if lastRecoveryTimeis updated.
[ "Update", "lastRecoveryTime", "if", "expired", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L366-L372
119,737
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.collectSubtreeBlocksAndClear
int collectSubtreeBlocksAndClear(List<BlockInfo> v, int blocksLimit, List<INode> removedINodes) { clearTargets(); return super.collectSubtreeBlocksAndClear(v, blocksLimit, removedINodes); }
java
int collectSubtreeBlocksAndClear(List<BlockInfo> v, int blocksLimit, List<INode> removedINodes) { clearTargets(); return super.collectSubtreeBlocksAndClear(v, blocksLimit, removedINodes); }
[ "int", "collectSubtreeBlocksAndClear", "(", "List", "<", "BlockInfo", ">", "v", ",", "int", "blocksLimit", ",", "List", "<", "INode", ">", "removedINodes", ")", "{", "clearTargets", "(", ")", ";", "return", "super", ".", "collectSubtreeBlocksAndClear", "(", "v...
When deleting an open file, we should remove it from the list of its targets.
[ "When", "deleting", "an", "open", "file", "we", "should", "remove", "it", "from", "the", "list", "of", "its", "targets", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L388-L393
119,738
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.removeINodeFromDatanodeDescriptors
private void removeINodeFromDatanodeDescriptors(DatanodeDescriptor[] targets) { if (targets != null) { for (DatanodeDescriptor node : targets) { node.removeINode(this); } } }
java
private void removeINodeFromDatanodeDescriptors(DatanodeDescriptor[] targets) { if (targets != null) { for (DatanodeDescriptor node : targets) { node.removeINode(this); } } }
[ "private", "void", "removeINodeFromDatanodeDescriptors", "(", "DatanodeDescriptor", "[", "]", "targets", ")", "{", "if", "(", "targets", "!=", "null", ")", "{", "for", "(", "DatanodeDescriptor", "node", ":", "targets", ")", "{", "node", ".", "removeINode", "("...
Remove this INodeFileUnderConstruction from the list of datanodes.
[ "Remove", "this", "INodeFileUnderConstruction", "from", "the", "list", "of", "datanodes", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L409-L415
119,739
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java
INodeFileUnderConstruction.addINodeToDatanodeDescriptors
private void addINodeToDatanodeDescriptors(DatanodeDescriptor[] targets) { if (targets != null) { for (DatanodeDescriptor node : targets) { node.addINode(this); } } }
java
private void addINodeToDatanodeDescriptors(DatanodeDescriptor[] targets) { if (targets != null) { for (DatanodeDescriptor node : targets) { node.addINode(this); } } }
[ "private", "void", "addINodeToDatanodeDescriptors", "(", "DatanodeDescriptor", "[", "]", "targets", ")", "{", "if", "(", "targets", "!=", "null", ")", "{", "for", "(", "DatanodeDescriptor", "node", ":", "targets", ")", "{", "node", ".", "addINode", "(", "thi...
Add this INodeFileUnderConstruction to the list of datanodes.
[ "Add", "this", "INodeFileUnderConstruction", "to", "the", "list", "of", "datanodes", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeFileUnderConstruction.java#L420-L426
119,740
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/join/OuterJoinRecordReader.java
OuterJoinRecordReader.combine
protected boolean combine(Object[] srcs, TupleWritable dst) { assert srcs.length == dst.size(); return true; }
java
protected boolean combine(Object[] srcs, TupleWritable dst) { assert srcs.length == dst.size(); return true; }
[ "protected", "boolean", "combine", "(", "Object", "[", "]", "srcs", ",", "TupleWritable", "dst", ")", "{", "assert", "srcs", ".", "length", "==", "dst", ".", "size", "(", ")", ";", "return", "true", ";", "}" ]
Emit everything from the collector.
[ "Emit", "everything", "from", "the", "collector", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/OuterJoinRecordReader.java#L41-L44
119,741
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java
TrackerClientCache.getClient
public CoronaTaskTrackerProtocol getClient( String host, int port) throws IOException { String key = makeKey(host, port); Node ttNode = topologyCache.getNode(host); CoronaTaskTrackerProtocol client = null; synchronized (ttNode) { client = trackerClients.get(key); if (client == null) { ...
java
public CoronaTaskTrackerProtocol getClient( String host, int port) throws IOException { String key = makeKey(host, port); Node ttNode = topologyCache.getNode(host); CoronaTaskTrackerProtocol client = null; synchronized (ttNode) { client = trackerClients.get(key); if (client == null) { ...
[ "public", "CoronaTaskTrackerProtocol", "getClient", "(", "String", "host", ",", "int", "port", ")", "throws", "IOException", "{", "String", "key", "=", "makeKey", "(", "host", ",", "port", ")", ";", "Node", "ttNode", "=", "topologyCache", ".", "getNode", "("...
API to get the RPC client. @param host The host @param port The port @return The RPC client @throws IOException
[ "API", "to", "get", "the", "RPC", "client", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java#L69-L82
119,742
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java
TrackerClientCache.createClient
private CoronaTaskTrackerProtocol createClient(String host, int port) throws IOException { String staticHost = NetUtils.getStaticResolution(host); InetSocketAddress s = null; InetAddress inetAddress = null; byte[] byteArr = null; if (staticHost != null) { inetAddress = InetAddress.getByNa...
java
private CoronaTaskTrackerProtocol createClient(String host, int port) throws IOException { String staticHost = NetUtils.getStaticResolution(host); InetSocketAddress s = null; InetAddress inetAddress = null; byte[] byteArr = null; if (staticHost != null) { inetAddress = InetAddress.getByNa...
[ "private", "CoronaTaskTrackerProtocol", "createClient", "(", "String", "host", ",", "int", "port", ")", "throws", "IOException", "{", "String", "staticHost", "=", "NetUtils", ".", "getStaticResolution", "(", "host", ")", ";", "InetSocketAddress", "s", "=", "null",...
Connect to the task tracker and get the RPC client. @param host The host. @param port the port. @return The RPC client. @throws IOException
[ "Connect", "to", "the", "task", "tracker", "and", "get", "the", "RPC", "client", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java#L100-L131
119,743
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java
ShardWriter.close
public void close() throws IOException { LOG.info("Closing the shard writer, processed " + numForms + " forms"); try { try { if (maxNumSegments > 0) { writer.optimize(maxNumSegments); LOG.info("Optimized the shard into at most " + maxNumSegments + " segment...
java
public void close() throws IOException { LOG.info("Closing the shard writer, processed " + numForms + " forms"); try { try { if (maxNumSegments > 0) { writer.optimize(maxNumSegments); LOG.info("Optimized the shard into at most " + maxNumSegments + " segment...
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"Closing the shard writer, processed \"", "+", "numForms", "+", "\" forms\"", ")", ";", "try", "{", "try", "{", "if", "(", "maxNumSegments", ">", "0", ")", "{", "...
Close the shard writer. Optimize the Lucene instance of the shard before closing if necessary, and copy the files created in the temp directory to the permanent directory after closing. @throws IOException
[ "Close", "the", "shard", "writer", ".", "Optimize", "the", "Lucene", "instance", "of", "the", "shard", "before", "closing", "if", "necessary", "and", "copy", "the", "files", "created", "in", "the", "temp", "directory", "to", "the", "permanent", "directory", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java#L115-L136
119,744
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java
ShardWriter.restoreGeneration
private void restoreGeneration(FileSystem fs, Path perm, long startGen) throws IOException { FileStatus[] fileStatus = fs.listStatus(perm, new PathFilter() { public boolean accept(Path path) { return LuceneUtil.isSegmentsFile(path.getName()); } }); // remove the segments...
java
private void restoreGeneration(FileSystem fs, Path perm, long startGen) throws IOException { FileStatus[] fileStatus = fs.listStatus(perm, new PathFilter() { public boolean accept(Path path) { return LuceneUtil.isSegmentsFile(path.getName()); } }); // remove the segments...
[ "private", "void", "restoreGeneration", "(", "FileSystem", "fs", ",", "Path", "perm", ",", "long", "startGen", ")", "throws", "IOException", "{", "FileStatus", "[", "]", "fileStatus", "=", "fs", ".", "listStatus", "(", "perm", ",", "new", "PathFilter", "(", ...
once the unwanted segments_N files are deleted
[ "once", "the", "unwanted", "segments_N", "files", "are", "deleted" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java#L165-L189
119,745
facebookarchive/hadoop-20
src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java
ShardWriter.moveFromTempToPerm
private void moveFromTempToPerm() throws IOException { try { FileStatus[] fileStatus = localFs.listStatus(temp, LuceneIndexFileNameFilter.getFilter()); Path segmentsPath = null; Path segmentsGenPath = null; // move the files created in temp dir except segments_N and segment...
java
private void moveFromTempToPerm() throws IOException { try { FileStatus[] fileStatus = localFs.listStatus(temp, LuceneIndexFileNameFilter.getFilter()); Path segmentsPath = null; Path segmentsGenPath = null; // move the files created in temp dir except segments_N and segment...
[ "private", "void", "moveFromTempToPerm", "(", ")", "throws", "IOException", "{", "try", "{", "FileStatus", "[", "]", "fileStatus", "=", "localFs", ".", "listStatus", "(", "temp", ",", "LuceneIndexFileNameFilter", ".", "getFilter", "(", ")", ")", ";", "Path", ...
and then delete the temp dir from the local FS
[ "and", "then", "delete", "the", "temp", "dir", "from", "the", "local", "FS" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/lucene/ShardWriter.java#L193-L231
119,746
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/permission/ChmodParser.java
ChmodParser.applyNewPermission
public short applyNewPermission(FileStatus file) { FsPermission perms = file.getPermission(); int existing = perms.toShort(); boolean exeOk = file.isDir() || (existing & 0111) != 0; return (short)combineModes(existing, exeOk); }
java
public short applyNewPermission(FileStatus file) { FsPermission perms = file.getPermission(); int existing = perms.toShort(); boolean exeOk = file.isDir() || (existing & 0111) != 0; return (short)combineModes(existing, exeOk); }
[ "public", "short", "applyNewPermission", "(", "FileStatus", "file", ")", "{", "FsPermission", "perms", "=", "file", ".", "getPermission", "(", ")", ";", "int", "existing", "=", "perms", ".", "toShort", "(", ")", ";", "boolean", "exeOk", "=", "file", ".", ...
Apply permission against specified file and determine what the new mode would be @param file File against which to apply mode @return File's new mode if applied.
[ "Apply", "permission", "against", "specified", "file", "and", "determine", "what", "the", "new", "mode", "would", "be" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/permission/ChmodParser.java#L44-L50
119,747
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/MaxTxId.java
MaxTxId.store
public synchronized void store(long maxTxId) throws IOException { long currentMaxTxId = get(); if (currentMaxTxId < maxTxId) { if (LOG.isDebugEnabled()) { LOG.debug("Resetting maxTxId to " + maxTxId); } set(maxTxId); } }
java
public synchronized void store(long maxTxId) throws IOException { long currentMaxTxId = get(); if (currentMaxTxId < maxTxId) { if (LOG.isDebugEnabled()) { LOG.debug("Resetting maxTxId to " + maxTxId); } set(maxTxId); } }
[ "public", "synchronized", "void", "store", "(", "long", "maxTxId", ")", "throws", "IOException", "{", "long", "currentMaxTxId", "=", "get", "(", ")", ";", "if", "(", "currentMaxTxId", "<", "maxTxId", ")", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ...
Store the specified transaction id in the maxTxId ZNode if the specified maxTxId is greater than the existing maxTxId. @param maxTxId Max transaction id to store @throws IOException If there is an unrecoverable error communicating with ZooKeeper
[ "Store", "the", "specified", "transaction", "id", "in", "the", "maxTxId", "ZNode", "if", "the", "specified", "maxTxId", "is", "greater", "than", "the", "existing", "maxTxId", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/MaxTxId.java#L78-L86
119,748
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/MaxTxId.java
MaxTxId.get
public synchronized long get() throws IOException { try { lastZNodeStat = zooKeeper.exists(fullyQualifiedZNode, false); if (lastZNodeStat == null) { return -1; } byte[] data = zooKeeper.getData(fullyQualifiedZNode, false, lastZNodeStat); WritableUtil.readWritableFromB...
java
public synchronized long get() throws IOException { try { lastZNodeStat = zooKeeper.exists(fullyQualifiedZNode, false); if (lastZNodeStat == null) { return -1; } byte[] data = zooKeeper.getData(fullyQualifiedZNode, false, lastZNodeStat); WritableUtil.readWritableFromB...
[ "public", "synchronized", "long", "get", "(", ")", "throws", "IOException", "{", "try", "{", "lastZNodeStat", "=", "zooKeeper", ".", "exists", "(", "fullyQualifiedZNode", ",", "false", ")", ";", "if", "(", "lastZNodeStat", "==", "null", ")", "{", "return", ...
Get the current max transaction id from ZooKeeper @return The current max transaction id @throws IOException If there is an error talking to ZooKeeper
[ "Get", "the", "current", "max", "transaction", "id", "from", "ZooKeeper" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/MaxTxId.java#L136-L155
119,749
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.checkAndSetServiceName
private void checkAndSetServiceName(Configuration conf, StartupInfo info) throws ConfigurationException { String fedrationMode = conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES); String serviceName = info.serviceName; if (fedrationMode != null && !fedrationMode.trim().isEmpty()) { ...
java
private void checkAndSetServiceName(Configuration conf, StartupInfo info) throws ConfigurationException { String fedrationMode = conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES); String serviceName = info.serviceName; if (fedrationMode != null && !fedrationMode.trim().isEmpty()) { ...
[ "private", "void", "checkAndSetServiceName", "(", "Configuration", "conf", ",", "StartupInfo", "info", ")", "throws", "ConfigurationException", "{", "String", "fedrationMode", "=", "conf", ".", "get", "(", "FSConstants", ".", "DFS_FEDERATION_NAMESERVICES", ")", ";", ...
Check if this is a fedrated cluster and set the service name. @throws ConfigurationException
[ "Check", "if", "this", "is", "a", "fedrated", "cluster", "and", "set", "the", "service", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L159-L170
119,750
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.shutdown
@Override public void shutdown() { LOG.info("Shutting down ..."); shouldShutdown = true; if (tserver != null) { tserver.stop(); } started = false; }
java
@Override public void shutdown() { LOG.info("Shutting down ..."); shouldShutdown = true; if (tserver != null) { tserver.stop(); } started = false; }
[ "@", "Override", "public", "void", "shutdown", "(", ")", "{", "LOG", ".", "info", "(", "\"Shutting down ...\"", ")", ";", "shouldShutdown", "=", "true", ";", "if", "(", "tserver", "!=", "null", ")", "{", "tserver", ".", "stop", "(", ")", ";", "}", "s...
Called when the Namespace Notifier server should shutdown.
[ "Called", "when", "the", "Namespace", "Notifier", "server", "should", "shutdown", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L262-L270
119,751
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.addClientAndConnect
@Override public long addClientAndConnect(String host, int port) throws TTransportException, IOException { long clientId = getNewClientId(); LOG.info("Adding client with id=" + clientId + " host=" + host + " port=" + port + " and connecting ..."); ClientHandler.Client clientHandler; ...
java
@Override public long addClientAndConnect(String host, int port) throws TTransportException, IOException { long clientId = getNewClientId(); LOG.info("Adding client with id=" + clientId + " host=" + host + " port=" + port + " and connecting ..."); ClientHandler.Client clientHandler; ...
[ "@", "Override", "public", "long", "addClientAndConnect", "(", "String", "host", ",", "int", "port", ")", "throws", "TTransportException", ",", "IOException", "{", "long", "clientId", "=", "getNewClientId", "(", ")", ";", "LOG", ".", "info", "(", "\"Adding cli...
Adds the client to the internal data structures and connects to it. If the method throws an exception, then it is guaranteed it will also be removed from the internal structures before throwing the exception. @param host the host on which the client is running @param port the port on which the client is running the Th...
[ "Adds", "the", "client", "to", "the", "internal", "data", "structures", "and", "connects", "to", "it", ".", "If", "the", "method", "throws", "an", "exception", "then", "it", "is", "guaranteed", "it", "will", "also", "be", "removed", "from", "the", "interna...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L355-L379
119,752
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.addClient
@Override public void addClient(ClientData clientData) { clientsData.put(clientData.id, clientData); dispatcher.assignClient(clientData.id); LOG.info("Succesfully added client " + clientData); metrics.numRegisteredClients.set(clientsData.size()); }
java
@Override public void addClient(ClientData clientData) { clientsData.put(clientData.id, clientData); dispatcher.assignClient(clientData.id); LOG.info("Succesfully added client " + clientData); metrics.numRegisteredClients.set(clientsData.size()); }
[ "@", "Override", "public", "void", "addClient", "(", "ClientData", "clientData", ")", "{", "clientsData", ".", "put", "(", "clientData", ".", "id", ",", "clientData", ")", ";", "dispatcher", ".", "assignClient", "(", "clientData", ".", "id", ")", ";", "LOG...
Adds the client to the internal structures @param clientData the initialized client data object for this client
[ "Adds", "the", "client", "to", "the", "internal", "structures" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L428-L434
119,753
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.removeClient
@Override public boolean removeClient(long clientId) { ClientData clientData = clientsData.get(clientId); if (clientData == null) { return false; } dispatcher.removeClient(clientId); // Iterate over all the sets in which this client figures as subscribed // and remove it synchro...
java
@Override public boolean removeClient(long clientId) { ClientData clientData = clientsData.get(clientId); if (clientData == null) { return false; } dispatcher.removeClient(clientId); // Iterate over all the sets in which this client figures as subscribed // and remove it synchro...
[ "@", "Override", "public", "boolean", "removeClient", "(", "long", "clientId", ")", "{", "ClientData", "clientData", "=", "clientsData", ".", "get", "(", "clientId", ")", ";", "if", "(", "clientData", "==", "null", ")", "{", "return", "false", ";", "}", ...
Removes a client from the internal data structures. This also removes the client from all the events to which he subscribed. @param clientId the client's id for the client we want to remove @return true if the client was present in the internal data structures, false otherwise.
[ "Removes", "a", "client", "from", "the", "internal", "data", "structures", ".", "This", "also", "removes", "the", "client", "from", "all", "the", "events", "to", "which", "he", "subscribed", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L445-L470
119,754
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.getClientNotificationQueue
@Override public Queue<NamespaceNotification> getClientNotificationQueue(long clientId) { ClientData clientData = clientsData.get(clientId); return (clientData == null) ? null : clientData.queue; }
java
@Override public Queue<NamespaceNotification> getClientNotificationQueue(long clientId) { ClientData clientData = clientsData.get(clientId); return (clientData == null) ? null : clientData.queue; }
[ "@", "Override", "public", "Queue", "<", "NamespaceNotification", ">", "getClientNotificationQueue", "(", "long", "clientId", ")", "{", "ClientData", "clientData", "=", "clientsData", ".", "get", "(", "clientId", ")", ";", "return", "(", "clientData", "==", "nul...
Gets the queue of notifications that should be sent to a client. It is important to send the notifications in this queue first before sending any other notification, or the order will be affected. @param clientId the id of the client for which we want to get the queued notifications. @return the queue with the notific...
[ "Gets", "the", "queue", "of", "notifications", "that", "should", "be", "sent", "to", "a", "client", ".", "It", "is", "important", "to", "send", "the", "notifications", "in", "this", "queue", "first", "before", "sending", "any", "other", "notification", "or",...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L637-L641
119,755
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.queueNotifications
private void queueNotifications(long clientId, NamespaceEvent event, long txId) throws TransactionIdTooOldException, InvalidClientIdException { if (txId == -1) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Queueing notifications for client " + clientId + " from txId " + ...
java
private void queueNotifications(long clientId, NamespaceEvent event, long txId) throws TransactionIdTooOldException, InvalidClientIdException { if (txId == -1) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Queueing notifications for client " + clientId + " from txId " + ...
[ "private", "void", "queueNotifications", "(", "long", "clientId", ",", "NamespaceEvent", "event", ",", "long", "txId", ")", "throws", "TransactionIdTooOldException", ",", "InvalidClientIdException", "{", "if", "(", "txId", "==", "-", "1", ")", "{", "return", ";"...
Queues the notification for a client. The queued notifications will be sent asynchronously after this method returns to the specified client. The queued notifications will be notifications for the given event and their associated transaction id is greater then the given transaction id (exclusive). @param clientId the...
[ "Queues", "the", "notification", "for", "a", "client", ".", "The", "queued", "notifications", "will", "be", "sent", "asynchronously", "after", "this", "method", "returns", "to", "the", "specified", "client", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L667-L687
119,756
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java
ServerCore.getNewClientId
private long getNewClientId() { while (true) { long clientId = Math.abs(clientIdsGenerator.nextLong()); if (!clientsData.containsKey(clientId)) { return clientId; } } }
java
private long getNewClientId() { while (true) { long clientId = Math.abs(clientIdsGenerator.nextLong()); if (!clientsData.containsKey(clientId)) { return clientId; } } }
[ "private", "long", "getNewClientId", "(", ")", "{", "while", "(", "true", ")", "{", "long", "clientId", "=", "Math", ".", "abs", "(", "clientIdsGenerator", ".", "nextLong", "(", ")", ")", ";", "if", "(", "!", "clientsData", ".", "containsKey", "(", "cl...
Generates a new client id which is not present in the current set of ids for the clients which are subscribed to this server. @return A newly generated client id
[ "Generates", "a", "new", "client", "id", "which", "is", "not", "present", "in", "the", "current", "set", "of", "ids", "for", "the", "clients", "which", "are", "subscribed", "to", "this", "server", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L696-L703
119,757
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java
ChecksumStore.putIfAbsentChecksum
public Long putIfAbsentChecksum(Block blk, Long newChecksum) throws IOException { Long oldChecksum = putIfAbsent(blk, newChecksum); if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) { throw new IOException("Block " + blk.toString() + " has different checksums " + oldChecksum + "(ol...
java
public Long putIfAbsentChecksum(Block blk, Long newChecksum) throws IOException { Long oldChecksum = putIfAbsent(blk, newChecksum); if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) { throw new IOException("Block " + blk.toString() + " has different checksums " + oldChecksum + "(ol...
[ "public", "Long", "putIfAbsentChecksum", "(", "Block", "blk", ",", "Long", "newChecksum", ")", "throws", "IOException", "{", "Long", "oldChecksum", "=", "putIfAbsent", "(", "blk", ",", "newChecksum", ")", ";", "if", "(", "oldChecksum", "!=", "null", "&&", "!...
Save the checksum for a raided block into store and compare the old value with new value, if different throw an exception @param blk @param newChecksum @param oldChecksum @throws IOException
[ "Save", "the", "checksum", "for", "a", "raided", "block", "into", "store", "and", "compare", "the", "old", "value", "with", "new", "value", "if", "different", "throw", "an", "exception" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java#L47-L56
119,758
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/join/OverrideRecordReader.java
OverrideRecordReader.fillJoinCollector
protected void fillJoinCollector(K iterkey) throws IOException { final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue(); if (!q.isEmpty()) { int highpos = -1; ArrayList<ComposableRecordReader<K,?>> list = new ArrayList<ComposableRecordReader<K,?>>(kids.length); q.p...
java
protected void fillJoinCollector(K iterkey) throws IOException { final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue(); if (!q.isEmpty()) { int highpos = -1; ArrayList<ComposableRecordReader<K,?>> list = new ArrayList<ComposableRecordReader<K,?>>(kids.length); q.p...
[ "protected", "void", "fillJoinCollector", "(", "K", "iterkey", ")", "throws", "IOException", "{", "final", "PriorityQueue", "<", "ComposableRecordReader", "<", "K", ",", "?", ">", ">", "q", "=", "getRecordReaderQueue", "(", ")", ";", "if", "(", "!", "q", "...
Instead of filling the JoinCollector with iterators from all data sources, fill only the rightmost for this key. This not only saves space by discarding the other sources, but it also emits the number of key-value pairs in the preferred RecordReader instead of repeating that stream n times, where n is the cardinality o...
[ "Instead", "of", "filling", "the", "JoinCollector", "with", "iterators", "from", "all", "data", "sources", "fill", "only", "the", "rightmost", "for", "this", "key", ".", "This", "not", "only", "saves", "space", "by", "discarding", "the", "other", "sources", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/OverrideRecordReader.java#L62-L91
119,759
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java
BlockWithChecksumFileReader.getGenerationStampFromSeperateChecksumFile
static long getGenerationStampFromSeperateChecksumFile(String[] listdir, String blockName) { for (int j = 0; j < listdir.length; j++) { String path = listdir[j]; if (!path.startsWith(blockName)) { continue; } String[] vals = StringUtils.split(path, '_'); if (vals.length != 3) {...
java
static long getGenerationStampFromSeperateChecksumFile(String[] listdir, String blockName) { for (int j = 0; j < listdir.length; j++) { String path = listdir[j]; if (!path.startsWith(blockName)) { continue; } String[] vals = StringUtils.split(path, '_'); if (vals.length != 3) {...
[ "static", "long", "getGenerationStampFromSeperateChecksumFile", "(", "String", "[", "]", "listdir", ",", "String", "blockName", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "listdir", ".", "length", ";", "j", "++", ")", "{", "String", "path...
Find the metadata file for the specified block file. Return the generation stamp from the name of the metafile.
[ "Find", "the", "metadata", "file", "for", "the", "specified", "block", "file", ".", "Return", "the", "generation", "stamp", "from", "the", "name", "of", "the", "metafile", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java#L397-L416
119,760
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java
BlockWithChecksumFileReader.parseGenerationStampInMetaFile
static long parseGenerationStampInMetaFile(File blockFile, File metaFile ) throws IOException { String metaname = metaFile.getName(); String gs = metaname.substring(blockFile.getName().length() + 1, metaname.length() - FSDataset.METADATA_EXTENSION.length()); try { return Long.parseLong(g...
java
static long parseGenerationStampInMetaFile(File blockFile, File metaFile ) throws IOException { String metaname = metaFile.getName(); String gs = metaname.substring(blockFile.getName().length() + 1, metaname.length() - FSDataset.METADATA_EXTENSION.length()); try { return Long.parseLong(g...
[ "static", "long", "parseGenerationStampInMetaFile", "(", "File", "blockFile", ",", "File", "metaFile", ")", "throws", "IOException", "{", "String", "metaname", "=", "metaFile", ".", "getName", "(", ")", ";", "String", "gs", "=", "metaname", ".", "substring", "...
Find generation stamp from block file and meta file. @param blockFile @param metaFile @return @throws IOException
[ "Find", "generation", "stamp", "from", "block", "file", "and", "meta", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java#L426-L437
119,761
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java
BlockWithChecksumFileReader.metaFileExists
static public boolean metaFileExists(FSDatasetInterface dataset, int namespaceId, Block b) throws IOException { return getMetaFile(dataset, namespaceId, b).exists(); }
java
static public boolean metaFileExists(FSDatasetInterface dataset, int namespaceId, Block b) throws IOException { return getMetaFile(dataset, namespaceId, b).exists(); }
[ "static", "public", "boolean", "metaFileExists", "(", "FSDatasetInterface", "dataset", ",", "int", "namespaceId", ",", "Block", "b", ")", "throws", "IOException", "{", "return", "getMetaFile", "(", "dataset", ",", "namespaceId", ",", "b", ")", ".", "exists", "...
Does the meta file exist for this block? @param namespaceId - parent namespace id @param b - the block @return true of the metafile for specified block exits @throws IOException
[ "Does", "the", "meta", "file", "exist", "for", "this", "block?" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockWithChecksumFileReader.java#L468-L470
119,762
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/BufferedByteInputStream.java
BufferedByteInputStream.wrapInputStream
public static DataInputStream wrapInputStream(InputStream is, int bufferSize, int readBufferSize) { // wrapping BufferedByteInputStream in BufferedInputStream decreases // pressure on BBIS internal locks, and we read from the BBIS in // bigger chunks return new DataInputStream(new BufferedInputStr...
java
public static DataInputStream wrapInputStream(InputStream is, int bufferSize, int readBufferSize) { // wrapping BufferedByteInputStream in BufferedInputStream decreases // pressure on BBIS internal locks, and we read from the BBIS in // bigger chunks return new DataInputStream(new BufferedInputStr...
[ "public", "static", "DataInputStream", "wrapInputStream", "(", "InputStream", "is", ",", "int", "bufferSize", ",", "int", "readBufferSize", ")", "{", "// wrapping BufferedByteInputStream in BufferedInputStream decreases", "// pressure on BBIS internal locks, and we read from the BBIS...
Wrap given input stream with BufferedByteInputOutput. This is the only way to instantiate the buffered input stream. @param is underlying input stream @param bufferSize size of the in memory buffer @param readBufferSize size of the buffer used for reading from is
[ "Wrap", "given", "input", "stream", "with", "BufferedByteInputOutput", ".", "This", "is", "the", "only", "way", "to", "instantiate", "the", "buffered", "input", "stream", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputStream.java#L57-L64
119,763
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/BufferedByteInputStream.java
BufferedByteInputStream.close
public void close() throws IOException { // multiple close should return with no errors // readThread will close underlying buffer readThread.close(); try { readThread.join(); } catch (InterruptedException e) { throw new IOException(e); } }
java
public void close() throws IOException { // multiple close should return with no errors // readThread will close underlying buffer readThread.close(); try { readThread.join(); } catch (InterruptedException e) { throw new IOException(e); } }
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "// multiple close should return with no errors", "// readThread will close underlying buffer", "readThread", ".", "close", "(", ")", ";", "try", "{", "readThread", ".", "join", "(", ")", ";", "}", "...
Close the input stream. Joins the thread and closes the underlying input stream. Can be called multiple times.
[ "Close", "the", "input", "stream", ".", "Joins", "the", "thread", "and", "closes", "the", "underlying", "input", "stream", ".", "Can", "be", "called", "multiple", "times", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputStream.java#L112-L121
119,764
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/BufferedByteInputStream.java
BufferedByteInputStream.checkOutput
private int checkOutput(int readBytes) throws IOException { if (readBytes > -1) { return readBytes; } if (closed) { throw new IOException("The stream has been closed"); } if (readThread.error != null) { throw new IOException(readThread.error.getMessage()); } return readByte...
java
private int checkOutput(int readBytes) throws IOException { if (readBytes > -1) { return readBytes; } if (closed) { throw new IOException("The stream has been closed"); } if (readThread.error != null) { throw new IOException(readThread.error.getMessage()); } return readByte...
[ "private", "int", "checkOutput", "(", "int", "readBytes", ")", "throws", "IOException", "{", "if", "(", "readBytes", ">", "-", "1", ")", "{", "return", "readBytes", ";", "}", "if", "(", "closed", ")", "{", "throw", "new", "IOException", "(", "\"The strea...
Check if the read thread died, if so, throw an exception.
[ "Check", "if", "the", "read", "thread", "died", "if", "so", "throw", "an", "exception", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputStream.java#L128-L139
119,765
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/ClusterStatus.java
ClusterStatus.initTrackersToTasksMap
private void initTrackersToTasksMap(Collection<JobInProgress> jobsInProgress) { for (TaskTrackerStatus tracker : taskTrackersDetails) { taskTrackerExtendedTasks.put(tracker.getTrackerName(), new ArrayList<TaskStatus>()); } for (JobInProgress job : jobsInProgress) { total_map_tasks ...
java
private void initTrackersToTasksMap(Collection<JobInProgress> jobsInProgress) { for (TaskTrackerStatus tracker : taskTrackersDetails) { taskTrackerExtendedTasks.put(tracker.getTrackerName(), new ArrayList<TaskStatus>()); } for (JobInProgress job : jobsInProgress) { total_map_tasks ...
[ "private", "void", "initTrackersToTasksMap", "(", "Collection", "<", "JobInProgress", ">", "jobsInProgress", ")", "{", "for", "(", "TaskTrackerStatus", "tracker", ":", "taskTrackersDetails", ")", "{", "taskTrackerExtendedTasks", ".", "put", "(", "tracker", ".", "get...
Goes through the list of TaskStatus objects for each of the running jobs on the cluster and associates them with the name of the task tracker they are or were running on.
[ "Goes", "through", "the", "list", "of", "TaskStatus", "objects", "for", "each", "of", "the", "running", "jobs", "on", "the", "cluster", "and", "associates", "them", "with", "the", "name", "of", "the", "task", "tracker", "they", "are", "or", "were", "runnin...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/ClusterStatus.java#L330-L366
119,766
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.getOutputFile
public Path getOutputFile(TaskAttemptID mapTaskId) throws IOException { return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/file.out", conf); }
java
public Path getOutputFile(TaskAttemptID mapTaskId) throws IOException { return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/file.out", conf); }
[ "public", "Path", "getOutputFile", "(", "TaskAttemptID", "mapTaskId", ")", "throws", "IOException", "{", "return", "lDirAlloc", ".", "getLocalPathToRead", "(", "TaskTracker", ".", "getIntermediateOutputDir", "(", "jobId", ".", "toString", "(", ")", ",", "mapTaskId",...
Return the path to local map output file created earlier @param mapTaskId a map task id
[ "Return", "the", "path", "to", "local", "map", "output", "file", "created", "earlier" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L60-L65
119,767
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.getSpillFileForWrite
public Path getSpillFileForWrite(TaskAttemptID mapTaskId, int spillNumber, long size) throws IOException { return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/spill" + ...
java
public Path getSpillFileForWrite(TaskAttemptID mapTaskId, int spillNumber, long size) throws IOException { return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/spill" + ...
[ "public", "Path", "getSpillFileForWrite", "(", "TaskAttemptID", "mapTaskId", ",", "int", "spillNumber", ",", "long", "size", ")", "throws", "IOException", "{", "return", "lDirAlloc", ".", "getLocalPathForWrite", "(", "TaskTracker", ".", "getIntermediateOutputDir", "("...
Create a local map spill file name. @param mapTaskId a map task id @param spillNumber the number @param size the size of the file
[ "Create", "a", "local", "map", "spill", "file", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L117-L123
119,768
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.getSpillIndexFile
public Path getSpillIndexFile(TaskAttemptID mapTaskId, int spillNumber) throws IOException { return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/spill" + spillNumber + ".out.in...
java
public Path getSpillIndexFile(TaskAttemptID mapTaskId, int spillNumber) throws IOException { return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), mapTaskId.toString()) + "/spill" + spillNumber + ".out.in...
[ "public", "Path", "getSpillIndexFile", "(", "TaskAttemptID", "mapTaskId", ",", "int", "spillNumber", ")", "throws", "IOException", "{", "return", "lDirAlloc", ".", "getLocalPathToRead", "(", "TaskTracker", ".", "getIntermediateOutputDir", "(", "jobId", ".", "toString"...
Return a local map spill index file created earlier @param mapTaskId a map task id @param spillNumber the number
[ "Return", "a", "local", "map", "spill", "index", "file", "created", "earlier" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L129-L135
119,769
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.getInputFile
public Path getInputFile(int mapId, TaskAttemptID reduceTaskId) throws IOException { // TODO *oom* should use a format here return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), reduceTaskId.toString()) + "/map_" + mapId + "...
java
public Path getInputFile(int mapId, TaskAttemptID reduceTaskId) throws IOException { // TODO *oom* should use a format here return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir( jobId.toString(), reduceTaskId.toString()) + "/map_" + mapId + "...
[ "public", "Path", "getInputFile", "(", "int", "mapId", ",", "TaskAttemptID", "reduceTaskId", ")", "throws", "IOException", "{", "// TODO *oom* should use a format here", "return", "lDirAlloc", ".", "getLocalPathToRead", "(", "TaskTracker", ".", "getIntermediateOutputDir", ...
Return a local reduce input file created earlier @param mapTaskId a map task id @param reduceTaskId a reduce task id
[ "Return", "a", "local", "reduce", "input", "file", "created", "earlier" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L154-L161
119,770
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.getInputFileForWrite
public Path getInputFileForWrite(TaskID mapId, TaskAttemptID reduceTaskId, long size) throws IOException { // TODO *oom* should use a format here return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir( jobId.toString(), reduceTas...
java
public Path getInputFileForWrite(TaskID mapId, TaskAttemptID reduceTaskId, long size) throws IOException { // TODO *oom* should use a format here return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir( jobId.toString(), reduceTas...
[ "public", "Path", "getInputFileForWrite", "(", "TaskID", "mapId", ",", "TaskAttemptID", "reduceTaskId", ",", "long", "size", ")", "throws", "IOException", "{", "// TODO *oom* should use a format here", "return", "lDirAlloc", ".", "getLocalPathForWrite", "(", "TaskTracker"...
Create a local reduce input file name. @param mapTaskId a map task id @param reduceTaskId a reduce task id @param size the size of the file
[ "Create", "a", "local", "reduce", "input", "file", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L168-L176
119,771
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapOutputFile.java
MapOutputFile.removeAll
public void removeAll(TaskAttemptID taskId) throws IOException { String toBeDeleted = TaskTracker.getIntermediateOutputDir(jobId.toString(), taskId.toString()); if (asyncDiskService != null) { asyncDiskService.moveAndDeleteFromEachVolume(toBeDeleted); LOG.info("Move and then delete map ouput "...
java
public void removeAll(TaskAttemptID taskId) throws IOException { String toBeDeleted = TaskTracker.getIntermediateOutputDir(jobId.toString(), taskId.toString()); if (asyncDiskService != null) { asyncDiskService.moveAndDeleteFromEachVolume(toBeDeleted); LOG.info("Move and then delete map ouput "...
[ "public", "void", "removeAll", "(", "TaskAttemptID", "taskId", ")", "throws", "IOException", "{", "String", "toBeDeleted", "=", "TaskTracker", ".", "getIntermediateOutputDir", "(", "jobId", ".", "toString", "(", ")", ",", "taskId", ".", "toString", "(", ")", "...
Removes all of the files related to a task.
[ "Removes", "all", "of", "the", "files", "related", "to", "a", "task", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapOutputFile.java#L179-L190
119,772
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java
LocatedBlocks.setLastBlockSize
public synchronized void setLastBlockSize(long blockId, long blockSize) { assert blocks.size() > 0; LocatedBlock last = blocks.get(blocks.size() - 1); if (underConstruction && blockSize > last.getBlockSize()) { assert blockId == last.getBlock().getBlockId(); this.setFileLength(this.getFileLengt...
java
public synchronized void setLastBlockSize(long blockId, long blockSize) { assert blocks.size() > 0; LocatedBlock last = blocks.get(blocks.size() - 1); if (underConstruction && blockSize > last.getBlockSize()) { assert blockId == last.getBlock().getBlockId(); this.setFileLength(this.getFileLengt...
[ "public", "synchronized", "void", "setLastBlockSize", "(", "long", "blockId", ",", "long", "blockSize", ")", "{", "assert", "blocks", ".", "size", "(", ")", ">", "0", ";", "LocatedBlock", "last", "=", "blocks", ".", "get", "(", "blocks", ".", "size", "("...
If file is under construction, set block size of the last block. It updates file length in the same time.
[ "If", "file", "is", "under", "construction", "set", "block", "size", "of", "the", "last", "block", ".", "It", "updates", "file", "length", "in", "the", "same", "time", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java#L132-L145
119,773
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/BlockReaderLocalWithChecksum.java
BlockReaderLocalWithChecksum.readAll
public ByteBuffer readAll() throws IOException { MappedByteBuffer bb = dataFileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, length); return bb; }
java
public ByteBuffer readAll() throws IOException { MappedByteBuffer bb = dataFileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, length); return bb; }
[ "public", "ByteBuffer", "readAll", "(", ")", "throws", "IOException", "{", "MappedByteBuffer", "bb", "=", "dataFileChannel", ".", "map", "(", "FileChannel", ".", "MapMode", ".", "READ_ONLY", ",", "startOffset", ",", "length", ")", ";", "return", "bb", ";", "...
Maps in the relevant portion of the file. This avoid copying the data from OS pages into this process's page. It will be automatically unmapped when the ByteBuffer that is returned here goes out of scope. This method is currently invoked only by the FSDataInputStream ScatterGather api.
[ "Maps", "in", "the", "relevant", "portion", "of", "the", "file", ".", "This", "avoid", "copying", "the", "data", "from", "OS", "pages", "into", "this", "process", "s", "page", ".", "It", "will", "be", "automatically", "unmapped", "when", "the", "ByteBuffer...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/BlockReaderLocalWithChecksum.java#L373-L377
119,774
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/TFactoryBasedThreadPoolServer.java
TFactoryBasedThreadPoolServer.createNewServer
public static TFactoryBasedThreadPoolServer createNewServer( TProcessor processor, ServerSocket serverSocket, int socketTimeOut) throws IOException { TServerSocket socket = new TServerSocket(serverSocket, socketTimeOut); TFactoryBasedThreadPoolServer.Args args = new TFactoryBasedThreadPoolServer.A...
java
public static TFactoryBasedThreadPoolServer createNewServer( TProcessor processor, ServerSocket serverSocket, int socketTimeOut) throws IOException { TServerSocket socket = new TServerSocket(serverSocket, socketTimeOut); TFactoryBasedThreadPoolServer.Args args = new TFactoryBasedThreadPoolServer.A...
[ "public", "static", "TFactoryBasedThreadPoolServer", "createNewServer", "(", "TProcessor", "processor", ",", "ServerSocket", "serverSocket", ",", "int", "socketTimeOut", ")", "throws", "IOException", "{", "TServerSocket", "socket", "=", "new", "TServerSocket", "(", "ser...
This is a helper method which creates a TFactoryBased..Server object using the processor, ServerSocket object and socket timeout limit. This is useful when we change the mechanism of server object creation. As a result, we don't have to change code in multiple places. @param processor @param serverSocket @param socketT...
[ "This", "is", "a", "helper", "method", "which", "creates", "a", "TFactoryBased", "..", "Server", "object", "using", "the", "processor", "ServerSocket", "object", "and", "socket", "timeout", "limit", ".", "This", "is", "useful", "when", "we", "change", "the", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/TFactoryBasedThreadPoolServer.java#L49-L62
119,775
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/IsolationRunner.java
IsolationRunner.fillInMissingMapOutputs
private static void fillInMissingMapOutputs(FileSystem fs, TaskAttemptID taskId, int numMaps, JobConf conf) throws IOException { Class<? extends WritableComparable> keyClass ...
java
private static void fillInMissingMapOutputs(FileSystem fs, TaskAttemptID taskId, int numMaps, JobConf conf) throws IOException { Class<? extends WritableComparable> keyClass ...
[ "private", "static", "void", "fillInMissingMapOutputs", "(", "FileSystem", "fs", ",", "TaskAttemptID", "taskId", ",", "int", "numMaps", ",", "JobConf", "conf", ")", "throws", "IOException", "{", "Class", "<", "?", "extends", "WritableComparable", ">", "keyClass", ...
Create empty sequence files for any of the map outputs that we don't have. @param fs the filesystem to create the files in @param dir the directory name to create the files in @param conf the jobconf @throws IOException if something goes wrong writing
[ "Create", "empty", "sequence", "files", "for", "any", "of", "the", "map", "outputs", "that", "we", "don", "t", "have", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/IsolationRunner.java#L148-L167
119,776
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/IsolationRunner.java
IsolationRunner.main
public static void main(String[] args ) throws ClassNotFoundException, IOException, InterruptedException { if (args.length != 1) { System.out.println("Usage: IsolationRunner <path>/job.xml"); System.exit(1); } File jobFilename = new F...
java
public static void main(String[] args ) throws ClassNotFoundException, IOException, InterruptedException { if (args.length != 1) { System.out.println("Usage: IsolationRunner <path>/job.xml"); System.exit(1); } File jobFilename = new F...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "ClassNotFoundException", ",", "IOException", ",", "InterruptedException", "{", "if", "(", "args", ".", "length", "!=", "1", ")", "{", "System", ".", "out", ".", "println",...
Run a single task @param args the first argument is the task directory
[ "Run", "a", "single", "task" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/IsolationRunner.java#L173-L226
119,777
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java
DFSFolder.upload
public void upload(IProgressMonitor monitor, final File file) throws IOException { if (file.isDirectory()) { Path filePath = new Path(this.path, file.getName()); getDFS().mkdirs(filePath); DFSFolder newFolder = new DFSFolder(this, filePath); monitor.worked(1); for (File child : ...
java
public void upload(IProgressMonitor monitor, final File file) throws IOException { if (file.isDirectory()) { Path filePath = new Path(this.path, file.getName()); getDFS().mkdirs(filePath); DFSFolder newFolder = new DFSFolder(this, filePath); monitor.worked(1); for (File child : ...
[ "public", "void", "upload", "(", "IProgressMonitor", "monitor", ",", "final", "File", "file", ")", "throws", "IOException", "{", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "Path", "filePath", "=", "new", "Path", "(", "this", ".", "path", ...
Upload the given file or directory into this DfsFolder @param file @throws IOException
[ "Upload", "the", "given", "file", "or", "directory", "into", "this", "DfsFolder" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java#L78-L99
119,778
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java
DFSFolder.mkdir
public void mkdir(String folderName) { try { getDFS().mkdirs(new Path(this.path, folderName)); } catch (IOException ioe) { ioe.printStackTrace(); } doRefresh(); }
java
public void mkdir(String folderName) { try { getDFS().mkdirs(new Path(this.path, folderName)); } catch (IOException ioe) { ioe.printStackTrace(); } doRefresh(); }
[ "public", "void", "mkdir", "(", "String", "folderName", ")", "{", "try", "{", "getDFS", "(", ")", ".", "mkdirs", "(", "new", "Path", "(", "this", ".", "path", ",", "folderName", ")", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "ioe...
Create a new sub directory into this directory @param folderName
[ "Create", "a", "new", "sub", "directory", "into", "this", "directory" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java#L150-L157
119,779
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/PendingReplication.java
PendingReplication.add
boolean add(Path filename) { synchronized (pendingReplications) { PendingInfo found = pendingReplications.get(filename); if (found == null) { pendingReplications.put(filename, new PendingInfo(filename)); return true; } return false; } }
java
boolean add(Path filename) { synchronized (pendingReplications) { PendingInfo found = pendingReplications.get(filename); if (found == null) { pendingReplications.put(filename, new PendingInfo(filename)); return true; } return false; } }
[ "boolean", "add", "(", "Path", "filename", ")", "{", "synchronized", "(", "pendingReplications", ")", "{", "PendingInfo", "found", "=", "pendingReplications", ".", "get", "(", "filename", ")", ";", "if", "(", "found", "==", "null", ")", "{", "pendingReplicat...
Add a block to the list of pending Replications. Returns true if the filename is added for the first time.
[ "Add", "a", "block", "to", "the", "list", "of", "pending", "Replications", ".", "Returns", "true", "if", "the", "filename", "is", "added", "for", "the", "first", "time", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/PendingReplication.java#L71-L80
119,780
facebookarchive/hadoop-20
src/core/org/apache/hadoop/net/TopologyCache.java
TopologyCache.getNode
public Node getNode(String name) { Node n = hostnameToNodeMap.get(name); // it's ok if multiple threads try to resolve the same host at the same time // the assumption is that resolve() will return a canonical node object and // the put operation is therefore idempotent if (n == null) { n = r...
java
public Node getNode(String name) { Node n = hostnameToNodeMap.get(name); // it's ok if multiple threads try to resolve the same host at the same time // the assumption is that resolve() will return a canonical node object and // the put operation is therefore idempotent if (n == null) { n = r...
[ "public", "Node", "getNode", "(", "String", "name", ")", "{", "Node", "n", "=", "hostnameToNodeMap", ".", "get", "(", "name", ")", ";", "// it's ok if multiple threads try to resolve the same host at the same time", "// the assumption is that resolve() will return a canonical n...
Return the Node in the network topology that corresponds to the hostname
[ "Return", "the", "Node", "in", "the", "network", "topology", "that", "corresponds", "to", "the", "hostname" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/TopologyCache.java#L44-L59
119,781
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/SequenceFileOutputFormat.java
SequenceFileOutputFormat.getReaders
public static SequenceFile.Reader[] getReaders(Configuration conf, Path dir) throws IOException { FileSystem fs = dir.getFileSystem(conf); Path[] names = FileUtil.stat2Paths(fs.listStatus(dir)); // sort names, so that hash partitioning works Arrays.sort(names); SequenceFile.Reader[] pa...
java
public static SequenceFile.Reader[] getReaders(Configuration conf, Path dir) throws IOException { FileSystem fs = dir.getFileSystem(conf); Path[] names = FileUtil.stat2Paths(fs.listStatus(dir)); // sort names, so that hash partitioning works Arrays.sort(names); SequenceFile.Reader[] pa...
[ "public", "static", "SequenceFile", ".", "Reader", "[", "]", "getReaders", "(", "Configuration", "conf", ",", "Path", "dir", ")", "throws", "IOException", "{", "FileSystem", "fs", "=", "dir", ".", "getFileSystem", "(", "conf", ")", ";", "Path", "[", "]", ...
Open the output generated by this format.
[ "Open", "the", "output", "generated", "by", "this", "format", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/SequenceFileOutputFormat.java#L83-L96
119,782
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.isFaulty
public boolean isFaulty(String trackerName) { synchronized (this) { NodeUsageReport usageReport = usageReports.get(trackerName); return isDeadTracker(trackerName) || (usageReport != null && (usageReport.getNumFailedConnections() > maxFailedConnections || usageReport.getNumFail...
java
public boolean isFaulty(String trackerName) { synchronized (this) { NodeUsageReport usageReport = usageReports.get(trackerName); return isDeadTracker(trackerName) || (usageReport != null && (usageReport.getNumFailedConnections() > maxFailedConnections || usageReport.getNumFail...
[ "public", "boolean", "isFaulty", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "usageReports", ".", "get", "(", "trackerName", ")", ";", "return", "isDeadTracker", "(", "trackerName", ")", ...
Check if a tracker is faulty. @param trackerName The name of the tracker. @return A boolean indicating if the tracker is faulty.
[ "Check", "if", "a", "tracker", "is", "faulty", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L65-L72
119,783
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.getNumFaultyTrackers
public int getNumFaultyTrackers() { int count = 0; synchronized (this) { for (String trackerName : usageReports.keySet()) { if (isFaulty(trackerName)) { count++; } } } return count; }
java
public int getNumFaultyTrackers() { int count = 0; synchronized (this) { for (String trackerName : usageReports.keySet()) { if (isFaulty(trackerName)) { count++; } } } return count; }
[ "public", "int", "getNumFaultyTrackers", "(", ")", "{", "int", "count", "=", "0", ";", "synchronized", "(", "this", ")", "{", "for", "(", "String", "trackerName", ":", "usageReports", ".", "keySet", "(", ")", ")", "{", "if", "(", "isFaulty", "(", "trac...
Get the number of faulty trackers. @return the number of faulty trackers.
[ "Get", "the", "number", "of", "faulty", "trackers", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L78-L88
119,784
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordTask
public void recordTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumTotalTasks(usageReport.getNumTotalTasks() + 1); } }
java
public void recordTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumTotalTasks(usageReport.getNumTotalTasks() + 1); } }
[ "public", "void", "recordTask", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumTotalTasks", "(", "usageReport", ...
Increment the number of tasks assigned to a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "tasks", "assigned", "to", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L117-L122
119,785
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordSucceededTask
public void recordSucceededTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumSucceeded(usageReport.getNumSucceeded() + 1); } }
java
public void recordSucceededTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumSucceeded(usageReport.getNumSucceeded() + 1); } }
[ "public", "void", "recordSucceededTask", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumSucceeded", "(", "usageRep...
Increment the number of succeeded tasks on a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "succeeded", "tasks", "on", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L128-L133
119,786
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordKilledTask
public void recordKilledTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumKilled(usageReport.getNumKilled() + 1); } }
java
public void recordKilledTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumKilled(usageReport.getNumKilled() + 1); } }
[ "public", "void", "recordKilledTask", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumKilled", "(", "usageReport", ...
Increment the number of killed tasks on a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "killed", "tasks", "on", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L139-L144
119,787
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordFailedTask
public void recordFailedTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumFailed(usageReport.getNumFailed() + 1); } }
java
public void recordFailedTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumFailed(usageReport.getNumFailed() + 1); } }
[ "public", "void", "recordFailedTask", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumFailed", "(", "usageReport", ...
Increment the number of failed tasks on a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "failed", "tasks", "on", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L150-L155
119,788
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordSlowTask
public void recordSlowTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumSlow(usageReport.getNumSlow() + 1); } }
java
public void recordSlowTask(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport.setNumSlow(usageReport.getNumSlow() + 1); } }
[ "public", "void", "recordSlowTask", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumSlow", "(", "usageReport", "....
Increment the number of tasks that ran slowly on a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "tasks", "that", "ran", "slowly", "on", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L183-L188
119,789
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.recordConnectionError
public void recordConnectionError(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport .setNumFailedConnections(usageReport.getNumFailedConnections() + 1); } }
java
public void recordConnectionError(String trackerName) { synchronized (this) { NodeUsageReport usageReport = getReportUnprotected(trackerName); usageReport .setNumFailedConnections(usageReport.getNumFailedConnections() + 1); } }
[ "public", "void", "recordConnectionError", "(", "String", "trackerName", ")", "{", "synchronized", "(", "this", ")", "{", "NodeUsageReport", "usageReport", "=", "getReportUnprotected", "(", "trackerName", ")", ";", "usageReport", ".", "setNumFailedConnections", "(", ...
Increment the number of connection errors encountered on a tracker. @param trackerName The name of the tracker.
[ "Increment", "the", "number", "of", "connection", "errors", "encountered", "on", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L194-L200
119,790
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java
TrackerStats.getReportUnprotected
private NodeUsageReport getReportUnprotected(String trackerName) { NodeUsageReport usageReport = usageReports.get(trackerName); if (usageReport == null) { usageReport = new NodeUsageReport(trackerName, 0, 0, 0, 0, 0, 0, 0); usageReports.put(trackerName, usageReport); } return usageReport; ...
java
private NodeUsageReport getReportUnprotected(String trackerName) { NodeUsageReport usageReport = usageReports.get(trackerName); if (usageReport == null) { usageReport = new NodeUsageReport(trackerName, 0, 0, 0, 0, 0, 0, 0); usageReports.put(trackerName, usageReport); } return usageReport; ...
[ "private", "NodeUsageReport", "getReportUnprotected", "(", "String", "trackerName", ")", "{", "NodeUsageReport", "usageReport", "=", "usageReports", ".", "get", "(", "trackerName", ")", ";", "if", "(", "usageReport", "==", "null", ")", "{", "usageReport", "=", "...
Get the usage report for a tracker. @param trackerName The name of the tracker. @return The {@link NodeUsageReport} for the tracker.
[ "Get", "the", "usage", "report", "for", "a", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerStats.java#L217-L224
119,791
facebookarchive/hadoop-20
src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
MetricsTimeVaryingRate.inc
public void inc(final int numOps, final long time) { lock.lock(); try { currentData.numOperations += numOps; currentData.time += time; long timePerOps = time/numOps; minMax.update(timePerOps); } finally { lock.unlock(); } }
java
public void inc(final int numOps, final long time) { lock.lock(); try { currentData.numOperations += numOps; currentData.time += time; long timePerOps = time/numOps; minMax.update(timePerOps); } finally { lock.unlock(); } }
[ "public", "void", "inc", "(", "final", "int", "numOps", ",", "final", "long", "time", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "currentData", ".", "numOperations", "+=", "numOps", ";", "currentData", ".", "time", "+=", "time", ";", "...
Increment the metrics for numOps operations @param numOps - number of operations @param time - time for numOps operations
[ "Increment", "the", "metrics", "for", "numOps", "operations" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java#L129-L139
119,792
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskAttemptID.java
TaskAttemptID.downgrade
public static TaskAttemptID downgrade(org.apache.hadoop.mapreduce.TaskAttemptID old) { if (old instanceof TaskAttemptID) { return (TaskAttemptID) old; } else { return new TaskAttemptID(TaskID.downgrade(old.getTaskID()), old.getId()); } }
java
public static TaskAttemptID downgrade(org.apache.hadoop.mapreduce.TaskAttemptID old) { if (old instanceof TaskAttemptID) { return (TaskAttemptID) old; } else { return new TaskAttemptID(TaskID.downgrade(old.getTaskID()), old.getId()); } }
[ "public", "static", "TaskAttemptID", "downgrade", "(", "org", ".", "apache", ".", "hadoop", ".", "mapreduce", ".", "TaskAttemptID", "old", ")", "{", "if", "(", "old", "instanceof", "TaskAttemptID", ")", "{", "return", "(", "TaskAttemptID", ")", "old", ";", ...
Downgrade a new TaskAttemptID to an old one @param old the new id @return either old or a new TaskAttemptID constructed to match old
[ "Downgrade", "a", "new", "TaskAttemptID", "to", "an", "old", "one" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskAttemptID.java#L78-L85
119,793
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockInlineChecksumReader.java
BlockInlineChecksumReader.getFileLengthFromBlockSize
public static long getFileLengthFromBlockSize(long blockSize, int bytesPerChecksum, int checksumSize) { long numChunks; if (blockSize % bytesPerChecksum == 0) { numChunks = blockSize / bytesPerChecksum; } else { numChunks = blockSize / bytesPerChecksum + 1; } return b...
java
public static long getFileLengthFromBlockSize(long blockSize, int bytesPerChecksum, int checksumSize) { long numChunks; if (blockSize % bytesPerChecksum == 0) { numChunks = blockSize / bytesPerChecksum; } else { numChunks = blockSize / bytesPerChecksum + 1; } return b...
[ "public", "static", "long", "getFileLengthFromBlockSize", "(", "long", "blockSize", ",", "int", "bytesPerChecksum", ",", "int", "checksumSize", ")", "{", "long", "numChunks", ";", "if", "(", "blockSize", "%", "bytesPerChecksum", "==", "0", ")", "{", "numChunks",...
get file length for the block size. @param blockSize @param bytesPerChecksum @param checksumSize @return
[ "get", "file", "length", "for", "the", "block", "size", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockInlineChecksumReader.java#L144-L154
119,794
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockInlineChecksumReader.java
BlockInlineChecksumReader.getPosFromBlockOffset
public static long getPosFromBlockOffset(long offsetInBlock, int bytesPerChecksum, int checksumSize) { // We only support to read full chunks, so offsetInBlock must be the boundary // of the chunks. assert offsetInBlock % bytesPerChecksum == 0; // The position in the file will be the same as the f...
java
public static long getPosFromBlockOffset(long offsetInBlock, int bytesPerChecksum, int checksumSize) { // We only support to read full chunks, so offsetInBlock must be the boundary // of the chunks. assert offsetInBlock % bytesPerChecksum == 0; // The position in the file will be the same as the f...
[ "public", "static", "long", "getPosFromBlockOffset", "(", "long", "offsetInBlock", ",", "int", "bytesPerChecksum", ",", "int", "checksumSize", ")", "{", "// We only support to read full chunks, so offsetInBlock must be the boundary", "// of the chunks.", "assert", "offsetInBlock"...
Translate from block offset to position in file. @param offsetInBlock @param bytesPerChecksum @param checksumSize @return
[ "Translate", "from", "block", "offset", "to", "position", "in", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockInlineChecksumReader.java#L164-L172
119,795
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java
FSDatasetAsyncDiskService.execute
synchronized void execute(File root, Runnable task) { if (executors == null) { throw new RuntimeException("AsyncDiskService is already shutdown"); } ThreadPoolExecutor executor = executors.get(root); if (executor == null) { throw new RuntimeException("Cannot find root " + root + " ...
java
synchronized void execute(File root, Runnable task) { if (executors == null) { throw new RuntimeException("AsyncDiskService is already shutdown"); } ThreadPoolExecutor executor = executors.get(root); if (executor == null) { throw new RuntimeException("Cannot find root " + root + " ...
[ "synchronized", "void", "execute", "(", "File", "root", ",", "Runnable", "task", ")", "{", "if", "(", "executors", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"AsyncDiskService is already shutdown\"", ")", ";", "}", "ThreadPoolExecutor", "...
Execute the task sometime in the future, using ThreadPools.
[ "Execute", "the", "task", "sometime", "in", "the", "future", "using", "ThreadPools", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java#L119-L130
119,796
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java
FSDatasetAsyncDiskService.shutdown
synchronized void shutdown() { if (executors == null) { LOG.warn("AsyncDiskService has already shut down."); } else { LOG.info("Shutting down all async disk service threads..."); for (Map.Entry<File, ThreadPoolExecutor> e : executors.entrySet()) { e....
java
synchronized void shutdown() { if (executors == null) { LOG.warn("AsyncDiskService has already shut down."); } else { LOG.info("Shutting down all async disk service threads..."); for (Map.Entry<File, ThreadPoolExecutor> e : executors.entrySet()) { e....
[ "synchronized", "void", "shutdown", "(", ")", "{", "if", "(", "executors", "==", "null", ")", "{", "LOG", ".", "warn", "(", "\"AsyncDiskService has already shut down.\"", ")", ";", "}", "else", "{", "LOG", ".", "info", "(", "\"Shutting down all async disk servic...
Gracefully shut down all ThreadPool. Will wait for all deletion tasks to finish.
[ "Gracefully", "shut", "down", "all", "ThreadPool", ".", "Will", "wait", "for", "all", "deletion", "tasks", "to", "finish", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java#L136-L154
119,797
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java
FSDatasetAsyncDiskService.deleteAsync
void deleteAsync(FSDataset.FSVolume volume, File blockFile, File metaFile, String blockName, int namespaceId) { DataNode.LOG.info("Scheduling block " + blockName + " file " + blockFile + " for deletion"); ReplicaFileDeleteTask deletionTask = new ReplicaFileDeleteTask(volume, blockFile, met...
java
void deleteAsync(FSDataset.FSVolume volume, File blockFile, File metaFile, String blockName, int namespaceId) { DataNode.LOG.info("Scheduling block " + blockName + " file " + blockFile + " for deletion"); ReplicaFileDeleteTask deletionTask = new ReplicaFileDeleteTask(volume, blockFile, met...
[ "void", "deleteAsync", "(", "FSDataset", ".", "FSVolume", "volume", ",", "File", "blockFile", ",", "File", "metaFile", ",", "String", "blockName", ",", "int", "namespaceId", ")", "{", "DataNode", ".", "LOG", ".", "info", "(", "\"Scheduling block \"", "+", "b...
Delete the block file and meta file from the disk asynchronously, adjust dfsUsed statistics accordingly.
[ "Delete", "the", "block", "file", "and", "meta", "file", "from", "the", "disk", "asynchronously", "adjust", "dfsUsed", "statistics", "accordingly", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java#L160-L167
119,798
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java
FSDatasetAsyncDiskService.deleteAsyncFile
void deleteAsyncFile(FSDataset.FSVolume volume, File file){ DataNode.LOG.info("Scheduling file " + file.toString() + " for deletion"); FileDeleteTask deletionTask = new FileDeleteTask(volume, file); execute(volume.getCurrentDir(), deletionTask); }
java
void deleteAsyncFile(FSDataset.FSVolume volume, File file){ DataNode.LOG.info("Scheduling file " + file.toString() + " for deletion"); FileDeleteTask deletionTask = new FileDeleteTask(volume, file); execute(volume.getCurrentDir(), deletionTask); }
[ "void", "deleteAsyncFile", "(", "FSDataset", ".", "FSVolume", "volume", ",", "File", "file", ")", "{", "DataNode", ".", "LOG", ".", "info", "(", "\"Scheduling file \"", "+", "file", ".", "toString", "(", ")", "+", "\" for deletion\"", ")", ";", "FileDeleteTa...
Delete a file or directory from the disk asynchronously. Used for deleting obsolete block files. Does not change dfs usage stats.
[ "Delete", "a", "file", "or", "directory", "from", "the", "disk", "asynchronously", ".", "Used", "for", "deleting", "obsolete", "block", "files", ".", "Does", "not", "change", "dfs", "usage", "stats", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetAsyncDiskService.java#L174-L179
119,799
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java
NativeS3FileSystem.createParent
private void createParent(Path path) throws IOException { Path parent = path.getParent(); if (parent != null) { String key = pathToKey(makeAbsolute(parent)); if (key.length() > 0) { store.storeEmptyFile(key + FOLDER_SUFFIX); } } }
java
private void createParent(Path path) throws IOException { Path parent = path.getParent(); if (parent != null) { String key = pathToKey(makeAbsolute(parent)); if (key.length() > 0) { store.storeEmptyFile(key + FOLDER_SUFFIX); } } }
[ "private", "void", "createParent", "(", "Path", "path", ")", "throws", "IOException", "{", "Path", "parent", "=", "path", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "null", ")", "{", "String", "key", "=", "pathToKey", "(", "makeAbsolute"...
of the source does not vanish.
[ "of", "the", "source", "does", "not", "vanish", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java#L458-L466