id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
117,900 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.removeMatchingTipUnprotectedUnconditional | private TaskInProgress removeMatchingTipUnprotectedUnconditional(
List<TaskInProgress> taskList, TaskInProgress intendedTip) {
for (Iterator<TaskInProgress> iter = taskList.iterator(); iter.hasNext();) {
TaskInProgress t = iter.next();
if (t.getTIPId().equals(intendedTip.getTIPId())) {
ite... | java | private TaskInProgress removeMatchingTipUnprotectedUnconditional(
List<TaskInProgress> taskList, TaskInProgress intendedTip) {
for (Iterator<TaskInProgress> iter = taskList.iterator(); iter.hasNext();) {
TaskInProgress t = iter.next();
if (t.getTIPId().equals(intendedTip.getTIPId())) {
ite... | [
"private",
"TaskInProgress",
"removeMatchingTipUnprotectedUnconditional",
"(",
"List",
"<",
"TaskInProgress",
">",
"taskList",
",",
"TaskInProgress",
"intendedTip",
")",
"{",
"for",
"(",
"Iterator",
"<",
"TaskInProgress",
">",
"iter",
"=",
"taskList",
".",
"iterator",... | Removes matching TIP without checking any conditions
@param taskList list of tasks to remove from
@param intendedTip tip to remove
@return removed tip | [
"Removes",
"matching",
"TIP",
"without",
"checking",
"any",
"conditions"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L929-L939 |
117,901 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.forceNewReduceTaskForTip | public Task forceNewReduceTaskForTip(String taskTrackerName, String hostName,
TaskInProgress forcedTip) {
synchronized (lockObject) {
Task result = obtainTaskCleanupTask(taskTrackerName, forcedTip);
if (result != null) {
return result;
}
removeMatchingTipUnprotectedUncondition... | java | public Task forceNewReduceTaskForTip(String taskTrackerName, String hostName,
TaskInProgress forcedTip) {
synchronized (lockObject) {
Task result = obtainTaskCleanupTask(taskTrackerName, forcedTip);
if (result != null) {
return result;
}
removeMatchingTipUnprotectedUncondition... | [
"public",
"Task",
"forceNewReduceTaskForTip",
"(",
"String",
"taskTrackerName",
",",
"String",
"hostName",
",",
"TaskInProgress",
"forcedTip",
")",
"{",
"synchronized",
"(",
"lockObject",
")",
"{",
"Task",
"result",
"=",
"obtainTaskCleanupTask",
"(",
"taskTrackerName"... | Registers new task attempt for given task
@param taskTrackerName name of destination tracker
@param hostName hostname of tracker
@param forcedTip task in progress to run
@return task to run | [
"Registers",
"new",
"task",
"attempt",
"for",
"given",
"task"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L1035-L1056 |
117,902 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.canTrackerBeUsed | public boolean canTrackerBeUsed(
String taskTracker, String trackerHost, TaskInProgress tip) {
synchronized (lockObject) {
return !tip.hasFailedOnMachine(trackerHost);
}
} | java | public boolean canTrackerBeUsed(
String taskTracker, String trackerHost, TaskInProgress tip) {
synchronized (lockObject) {
return !tip.hasFailedOnMachine(trackerHost);
}
} | [
"public",
"boolean",
"canTrackerBeUsed",
"(",
"String",
"taskTracker",
",",
"String",
"trackerHost",
",",
"TaskInProgress",
"tip",
")",
"{",
"synchronized",
"(",
"lockObject",
")",
"{",
"return",
"!",
"tip",
".",
"hasFailedOnMachine",
"(",
"trackerHost",
")",
";... | Can a tracker be used for a TIP? | [
"Can",
"a",
"tracker",
"be",
"used",
"for",
"a",
"TIP?"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L1079-L1084 |
117,903 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.setJobCleanupTaskState | private void setJobCleanupTaskState(Task task) {
if (task.isJobCleanupTask()) {
if (jobFailed) {
task.setJobCleanupTaskState(
org.apache.hadoop.mapreduce.JobStatus.State.FAILED);
} else if (jobKilled) {
task.setJobCleanupTaskState(
org.apache.hadoop.mapreduce.JobS... | java | private void setJobCleanupTaskState(Task task) {
if (task.isJobCleanupTask()) {
if (jobFailed) {
task.setJobCleanupTaskState(
org.apache.hadoop.mapreduce.JobStatus.State.FAILED);
} else if (jobKilled) {
task.setJobCleanupTaskState(
org.apache.hadoop.mapreduce.JobS... | [
"private",
"void",
"setJobCleanupTaskState",
"(",
"Task",
"task",
")",
"{",
"if",
"(",
"task",
".",
"isJobCleanupTask",
"(",
")",
")",
"{",
"if",
"(",
"jobFailed",
")",
"{",
"task",
".",
"setJobCleanupTaskState",
"(",
"org",
".",
"apache",
".",
"hadoop",
... | Sets task state according to job state if given task is cleanup one
@param task task to handle | [
"Sets",
"task",
"state",
"according",
"to",
"job",
"state",
"if",
"given",
"task",
"is",
"cleanup",
"one"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L1129-L1142 |
117,904 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/protocol/JournalConfigHelper.java | JournalConfigHelper.getJournalHttpHosts | public static String[] getJournalHttpHosts(Configuration conf) {
Collection<String> hosts = conf.getStringCollection(JournalConfigKeys.DFS_JOURNALNODE_HOSTS);
int defaultHttpPort = JournalConfigKeys.DFS_JOURNALNODE_HTTP_PORT_DEFAULT;
String[] httpAddresses = new String[hosts.size()];
int i = 0;
... | java | public static String[] getJournalHttpHosts(Configuration conf) {
Collection<String> hosts = conf.getStringCollection(JournalConfigKeys.DFS_JOURNALNODE_HOSTS);
int defaultHttpPort = JournalConfigKeys.DFS_JOURNALNODE_HTTP_PORT_DEFAULT;
String[] httpAddresses = new String[hosts.size()];
int i = 0;
... | [
"public",
"static",
"String",
"[",
"]",
"getJournalHttpHosts",
"(",
"Configuration",
"conf",
")",
"{",
"Collection",
"<",
"String",
">",
"hosts",
"=",
"conf",
".",
"getStringCollection",
"(",
"JournalConfigKeys",
".",
"DFS_JOURNALNODE_HOSTS",
")",
";",
"int",
"d... | Parse the DFS_JOURNALNODE_HOSTS to get the list of Journal Node Hosts
This is used in JournalNode and QuorumJournalManager to talk to the
Http servers of other JournalNodes.
On the server side, the ports of the hosts are specified in the DFS_JOURNALNODE_HTTP_ADDRESS_KEY,
so the ports in DFS_JOURNALNODE_HOSTS should b... | [
"Parse",
"the",
"DFS_JOURNALNODE_HOSTS",
"to",
"get",
"the",
"list",
"of",
"Journal",
"Node",
"Hosts"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/protocol/JournalConfigHelper.java#L38-L53 |
117,905 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/protocol/JournalConfigHelper.java | JournalConfigHelper.getAddress | public static InetSocketAddress getAddress(Configuration conf) {
String addr = conf.get(JournalConfigKeys.DFS_JOURNALNODE_HTTP_ADDRESS_KEY,
JournalConfigKeys.DFS_JOURNALNODE_HTTP_ADDRESS_DEFAULT);
return NetUtils.createSocketAddr(addr,
JournalConfigKeys.DFS_JOURNALNODE_HTTP_PORT_DEFAULT);
} | java | public static InetSocketAddress getAddress(Configuration conf) {
String addr = conf.get(JournalConfigKeys.DFS_JOURNALNODE_HTTP_ADDRESS_KEY,
JournalConfigKeys.DFS_JOURNALNODE_HTTP_ADDRESS_DEFAULT);
return NetUtils.createSocketAddr(addr,
JournalConfigKeys.DFS_JOURNALNODE_HTTP_PORT_DEFAULT);
} | [
"public",
"static",
"InetSocketAddress",
"getAddress",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"addr",
"=",
"conf",
".",
"get",
"(",
"JournalConfigKeys",
".",
"DFS_JOURNALNODE_HTTP_ADDRESS_KEY",
",",
"JournalConfigKeys",
".",
"DFS_JOURNALNODE_HTTP_ADDRESS_DEFAUL... | Get the address bound by the JournalNode to start the web server.
This returns the server side address, should be consistent with the getJournalHttpHosts. | [
"Get",
"the",
"address",
"bound",
"by",
"the",
"JournalNode",
"to",
"start",
"the",
"web",
"server",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/protocol/JournalConfigHelper.java#L60-L65 |
117,906 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/rumen/Node.java | Node.addChild | public synchronized boolean addChild(Node child) {
if (child.parent != null) {
throw new IllegalArgumentException(
"The child is already under another node:" + child.parent);
}
checkChildren();
boolean retval = children.add(child);
if (retval) child.parent = this;
return retval;
... | java | public synchronized boolean addChild(Node child) {
if (child.parent != null) {
throw new IllegalArgumentException(
"The child is already under another node:" + child.parent);
}
checkChildren();
boolean retval = children.add(child);
if (retval) child.parent = this;
return retval;
... | [
"public",
"synchronized",
"boolean",
"addChild",
"(",
"Node",
"child",
")",
"{",
"if",
"(",
"child",
".",
"parent",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The child is already under another node:\"",
"+",
"child",
".",
"parent"... | Add a child node to this node.
@param child The child node to be added. The child node should currently not be belong to another cluster topology.
@return Boolean indicating whether the node is successfully added. | [
"Add",
"a",
"child",
"node",
"to",
"this",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/rumen/Node.java#L84-L93 |
117,907 | facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java | HourGlass.updateShares | static private void updateShares(Cluster clusters[]) {
assert(clusters.length == 2);
if (clusters[0].runnableMaps == 0 &&
clusters[0].runnableMaps == 0 &&
clusters[1].runnableReduces == 0 &&
clusters[1].runnableReduces == 0) {
// Do nothing if both clusters are empty
return;
... | java | static private void updateShares(Cluster clusters[]) {
assert(clusters.length == 2);
if (clusters[0].runnableMaps == 0 &&
clusters[0].runnableMaps == 0 &&
clusters[1].runnableReduces == 0 &&
clusters[1].runnableReduces == 0) {
// Do nothing if both clusters are empty
return;
... | [
"static",
"private",
"void",
"updateShares",
"(",
"Cluster",
"clusters",
"[",
"]",
")",
"{",
"assert",
"(",
"clusters",
".",
"length",
"==",
"2",
")",
";",
"if",
"(",
"clusters",
"[",
"0",
"]",
".",
"runnableMaps",
"==",
"0",
"&&",
"clusters",
"[",
"... | Update the task share of the clusters
@param clusters Two clusters with tasktrackers shares same nodes | [
"Update",
"the",
"task",
"share",
"of",
"the",
"clusters"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java#L195-L231 |
117,908 | facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java | HourGlass.run | @Override
public void run() {
long lastUpdate = -1L;
// Start balancing the clusters
while (running) {
try {
Thread.sleep(updateInterval / 10);
long now = JobTracker.getClock().getTime();
if (now - lastUpdate > updateInterval) {
lastUpdate = now;
doMoveSlo... | java | @Override
public void run() {
long lastUpdate = -1L;
// Start balancing the clusters
while (running) {
try {
Thread.sleep(updateInterval / 10);
long now = JobTracker.getClock().getTime();
if (now - lastUpdate > updateInterval) {
lastUpdate = now;
doMoveSlo... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"long",
"lastUpdate",
"=",
"-",
"1L",
";",
"// Start balancing the clusters",
"while",
"(",
"running",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"updateInterval",
"/",
"10",
")",
";",
"lon... | Keep moving slots between two clusters according to their runnable tasks.
These clusters are assumed to run tasktrackers on the same set of machines | [
"Keep",
"moving",
"slots",
"between",
"two",
"clusters",
"according",
"to",
"their",
"runnable",
"tasks",
".",
"These",
"clusters",
"are",
"assumed",
"to",
"run",
"tasktrackers",
"on",
"the",
"same",
"set",
"of",
"machines"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java#L237-L253 |
117,909 | facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java | HourGlass.getTotalSlots | private int getTotalSlots(
TaskTrackerStatus status, TaskType type) {
Map<Integer, Integer> defaultCpuToMaxSlots = (type == TaskType.MAP) ?
defaultCpuToMaxMapSlots : defaultCpuToMaxReduceSlots;
int cpus = status.getResourceStatus().getNumProcessors();
Integer slots = defaultCpuToMaxSlots.get(c... | java | private int getTotalSlots(
TaskTrackerStatus status, TaskType type) {
Map<Integer, Integer> defaultCpuToMaxSlots = (type == TaskType.MAP) ?
defaultCpuToMaxMapSlots : defaultCpuToMaxReduceSlots;
int cpus = status.getResourceStatus().getNumProcessors();
Integer slots = defaultCpuToMaxSlots.get(c... | [
"private",
"int",
"getTotalSlots",
"(",
"TaskTrackerStatus",
"status",
",",
"TaskType",
"type",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"defaultCpuToMaxSlots",
"=",
"(",
"type",
"==",
"TaskType",
".",
"MAP",
")",
"?",
"defaultCpuToMaxMapSlots",
"... | Obtain the two clusters combined total slots of a tasktracker | [
"Obtain",
"the",
"two",
"clusters",
"combined",
"total",
"slots",
"of",
"a",
"tasktracker"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java#L370-L383 |
117,910 | facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java | HourGlass.createClient | private static FairSchedulerProtocol createClient(
String target, Configuration conf) throws IOException {
InetSocketAddress addr = NetUtils.createSocketAddr(target);
UserGroupInformation ugi = UserGroupInformation.getCurrentUGI();
LOG.info("Connecting to " + addr);
return (FairSchedulerProtocol) ... | java | private static FairSchedulerProtocol createClient(
String target, Configuration conf) throws IOException {
InetSocketAddress addr = NetUtils.createSocketAddr(target);
UserGroupInformation ugi = UserGroupInformation.getCurrentUGI();
LOG.info("Connecting to " + addr);
return (FairSchedulerProtocol) ... | [
"private",
"static",
"FairSchedulerProtocol",
"createClient",
"(",
"String",
"target",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"InetSocketAddress",
"addr",
"=",
"NetUtils",
".",
"createSocketAddr",
"(",
"target",
")",
";",
"UserGroupInformatio... | Create a FariScheduler RPC client
@param target The host:port of the RPC server
@param conf The configuration
@return The FairScheduler client
@throws IOException | [
"Create",
"a",
"FariScheduler",
"RPC",
"client"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java#L392-L400 |
117,911 | facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java | HourGlass.main | public static void main(String argv[]) {
StringUtils.startupShutdownMessage(HourGlass.class, argv, LOG);
try {
HourGlass hourGlass = new HourGlass(new Configuration());
hourGlass.run();
} catch (Throwable e) {
LOG.fatal(StringUtils.stringifyException(e));
System.exit(-1);
}
} | java | public static void main(String argv[]) {
StringUtils.startupShutdownMessage(HourGlass.class, argv, LOG);
try {
HourGlass hourGlass = new HourGlass(new Configuration());
hourGlass.run();
} catch (Throwable e) {
LOG.fatal(StringUtils.stringifyException(e));
System.exit(-1);
}
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"argv",
"[",
"]",
")",
"{",
"StringUtils",
".",
"startupShutdownMessage",
"(",
"HourGlass",
".",
"class",
",",
"argv",
",",
"LOG",
")",
";",
"try",
"{",
"HourGlass",
"hourGlass",
"=",
"new",
"HourGlass",
... | Start the HourGlass process | [
"Start",
"the",
"HourGlass",
"process"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/HourGlass.java#L405-L414 |
117,912 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java | ConfigManager.reloadConfigsIfNecessary | public synchronized boolean reloadConfigsIfNecessary() {
long time = RaidNode.now();
if (time > lastReloadAttempt + reloadInterval) {
lastReloadAttempt = time;
try {
File file = new File(configFileName);
long lastModified = file.lastModified();
if (lastModified > lastSuccessf... | java | public synchronized boolean reloadConfigsIfNecessary() {
long time = RaidNode.now();
if (time > lastReloadAttempt + reloadInterval) {
lastReloadAttempt = time;
try {
File file = new File(configFileName);
long lastModified = file.lastModified();
if (lastModified > lastSuccessf... | [
"public",
"synchronized",
"boolean",
"reloadConfigsIfNecessary",
"(",
")",
"{",
"long",
"time",
"=",
"RaidNode",
".",
"now",
"(",
")",
";",
"if",
"(",
"time",
">",
"lastReloadAttempt",
"+",
"reloadInterval",
")",
"{",
"lastReloadAttempt",
"=",
"time",
";",
"... | Reload config file if it hasn't been loaded in a while
Returns true if the file was reloaded. | [
"Reload",
"config",
"file",
"if",
"it",
"hasn",
"t",
"been",
"loaded",
"in",
"a",
"while",
"Returns",
"true",
"if",
"the",
"file",
"was",
"reloaded",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java#L138-L161 |
117,913 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java | ConfigManager.stopReload | void stopReload() throws InterruptedException {
if (reloadThread != null) {
running = false;
reloadThread.interrupt();
reloadThread.join();
reloadThread = null;
}
} | java | void stopReload() throws InterruptedException {
if (reloadThread != null) {
running = false;
reloadThread.interrupt();
reloadThread.join();
reloadThread = null;
}
} | [
"void",
"stopReload",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"reloadThread",
"!=",
"null",
")",
"{",
"running",
"=",
"false",
";",
"reloadThread",
".",
"interrupt",
"(",
")",
";",
"reloadThread",
".",
"join",
"(",
")",
";",
"reloadThre... | Stop the background thread that reload the config file | [
"Stop",
"the",
"background",
"thread",
"that",
"reload",
"the",
"config",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java#L444-L451 |
117,914 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java | ConfigManager.getPolicy | PolicyInfo getPolicy(String policyName) {
for (PolicyInfo policy : allPolicies) {
if (policyName.equals(policy.getName())) {
return policy;
}
}
return null;
} | java | PolicyInfo getPolicy(String policyName) {
for (PolicyInfo policy : allPolicies) {
if (policyName.equals(policy.getName())) {
return policy;
}
}
return null;
} | [
"PolicyInfo",
"getPolicy",
"(",
"String",
"policyName",
")",
"{",
"for",
"(",
"PolicyInfo",
"policy",
":",
"allPolicies",
")",
"{",
"if",
"(",
"policyName",
".",
"equals",
"(",
"policy",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"policy",
";",
... | Find the PolicyInfo corresponding to a given policy name
@param policyName the name of a policy
@return PolicyInfo if there is a matched policy; null otherwise | [
"Find",
"the",
"PolicyInfo",
"corresponding",
"to",
"a",
"given",
"policy",
"name"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ConfigManager.java#L480-L487 |
117,915 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.stop | public void stop() {
if (stopRequested) {
return;
}
stopRequested = true;
running = false;
if (server != null) server.stop();
if (triggerThread != null) {
triggerThread.interrupt();
triggerMonitor = null;
}
if (urfThread != null) {
urfThread.interrupt();
urf... | java | public void stop() {
if (stopRequested) {
return;
}
stopRequested = true;
running = false;
if (server != null) server.stop();
if (triggerThread != null) {
triggerThread.interrupt();
triggerMonitor = null;
}
if (urfThread != null) {
urfThread.interrupt();
urf... | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"stopRequested",
")",
"{",
"return",
";",
"}",
"stopRequested",
"=",
"true",
";",
"running",
"=",
"false",
";",
"if",
"(",
"server",
"!=",
"null",
")",
"server",
".",
"stop",
"(",
")",
";",
"if",
... | Stop all RaidNode threads and wait for all to finish. | [
"Stop",
"all",
"RaidNode",
"threads",
"and",
"wait",
"for",
"all",
"to",
"finish",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L349-L381 |
117,916 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.getCorruptFilesCounterMap | public Map<String, Map<CorruptFileStatus, Long>> getCorruptFilesCounterMap() {
return ((CorruptionWorker)blockIntegrityMonitor.getCorruptionMonitor()).
getCorruptFilesCounterMap();
} | java | public Map<String, Map<CorruptFileStatus, Long>> getCorruptFilesCounterMap() {
return ((CorruptionWorker)blockIntegrityMonitor.getCorruptionMonitor()).
getCorruptFilesCounterMap();
} | [
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"CorruptFileStatus",
",",
"Long",
">",
">",
"getCorruptFilesCounterMap",
"(",
")",
"{",
"return",
"(",
"(",
"CorruptionWorker",
")",
"blockIntegrityMonitor",
".",
"getCorruptionMonitor",
"(",
")",
")",
".",
"get... | the value is counters of different types of corrupt files | [
"the",
"value",
"is",
"counters",
"of",
"different",
"types",
"of",
"corrupt",
"files"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L644-L647 |
117,917 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.determinePolicy | public PolicyInfo determinePolicy(Codec codec) {
for (PolicyInfo info : configMgr.getAllPolicies()) {
if (!info.getShouldRaid()) {
continue;
}
if (info.getCodecId().equals(codec.id)) {
return info;
}
}
return null;
} | java | public PolicyInfo determinePolicy(Codec codec) {
for (PolicyInfo info : configMgr.getAllPolicies()) {
if (!info.getShouldRaid()) {
continue;
}
if (info.getCodecId().equals(codec.id)) {
return info;
}
}
return null;
} | [
"public",
"PolicyInfo",
"determinePolicy",
"(",
"Codec",
"codec",
")",
"{",
"for",
"(",
"PolicyInfo",
"info",
":",
"configMgr",
".",
"getAllPolicies",
"(",
")",
")",
"{",
"if",
"(",
"!",
"info",
".",
"getShouldRaid",
"(",
")",
")",
"{",
"continue",
";",
... | Determine a PolicyInfo from the codec, to re-generate the parity files
of modified source files.
@param codec
@return | [
"Determine",
"a",
"PolicyInfo",
"from",
"the",
"codec",
"to",
"re",
"-",
"generate",
"the",
"parity",
"files",
"of",
"modified",
"source",
"files",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L686-L698 |
117,918 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.doRaid | public static boolean doRaid(Configuration conf, FileStatus stat,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException {
boolean succeed = false;
for (EncodingCandidate ec : RaidNode.splitPaths(conf, ... | java | public static boolean doRaid(Configuration conf, FileStatus stat,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException {
boolean succeed = false;
for (EncodingCandidate ec : RaidNode.splitPaths(conf, ... | [
"public",
"static",
"boolean",
"doRaid",
"(",
"Configuration",
"conf",
",",
"FileStatus",
"stat",
",",
"Path",
"destPath",
",",
"Codec",
"codec",
",",
"Statistics",
"statistics",
",",
"Progressable",
"reporter",
",",
"boolean",
"doSimulate",
",",
"int",
"targetR... | only used by test | [
"only",
"used",
"by",
"test"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L1455-L1465 |
117,919 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.raidedByOtherHighPriCodec | public static boolean raidedByOtherHighPriCodec(Configuration conf,
FileStatus stat, Codec codec) throws IOException {
for (Codec tcodec : Codec.getCodecs()) {
if (tcodec.priority > codec.priority) {
if (stat.isDir() && !tcodec.isDirRaid) {
// A directory could not be raided by ... | java | public static boolean raidedByOtherHighPriCodec(Configuration conf,
FileStatus stat, Codec codec) throws IOException {
for (Codec tcodec : Codec.getCodecs()) {
if (tcodec.priority > codec.priority) {
if (stat.isDir() && !tcodec.isDirRaid) {
// A directory could not be raided by ... | [
"public",
"static",
"boolean",
"raidedByOtherHighPriCodec",
"(",
"Configuration",
"conf",
",",
"FileStatus",
"stat",
",",
"Codec",
"codec",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Codec",
"tcodec",
":",
"Codec",
".",
"getCodecs",
"(",
")",
")",
"{",
... | check if the file is already raided by high priority codec | [
"check",
"if",
"the",
"file",
"is",
"already",
"raided",
"by",
"high",
"priority",
"codec"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L1508-L1527 |
117,920 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.doDirRaid | private static LOGRESULTS doDirRaid(Configuration conf, EncodingCandidate ec,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException {
FileStatus stat = ec.srcStat;
Path p = stat.getPath();
FileSystem... | java | private static LOGRESULTS doDirRaid(Configuration conf, EncodingCandidate ec,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException {
FileStatus stat = ec.srcStat;
Path p = stat.getPath();
FileSystem... | [
"private",
"static",
"LOGRESULTS",
"doDirRaid",
"(",
"Configuration",
"conf",
",",
"EncodingCandidate",
"ec",
",",
"Path",
"destPath",
",",
"Codec",
"codec",
",",
"Statistics",
"statistics",
",",
"Progressable",
"reporter",
",",
"boolean",
"doSimulate",
",",
"int"... | RAID an individual directory
@throws InterruptedException | [
"RAID",
"an",
"individual",
"directory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L1604-L1678 |
117,921 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.doFileRaid | private static LOGRESULTS doFileRaid(Configuration conf, EncodingCandidate ec,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException, InterruptedException {
FileStatus stat = ec.srcStat;
Path p = stat.ge... | java | private static LOGRESULTS doFileRaid(Configuration conf, EncodingCandidate ec,
Path destPath, Codec codec, Statistics statistics,
Progressable reporter, boolean doSimulate, int targetRepl, int metaRepl)
throws IOException, InterruptedException {
FileStatus stat = ec.srcStat;
Path p = stat.ge... | [
"private",
"static",
"LOGRESULTS",
"doFileRaid",
"(",
"Configuration",
"conf",
",",
"EncodingCandidate",
"ec",
",",
"Path",
"destPath",
",",
"Codec",
"codec",
",",
"Statistics",
"statistics",
",",
"Progressable",
"reporter",
",",
"boolean",
"doSimulate",
",",
"int... | RAID an individual file
@throws InterruptedException | [
"RAID",
"an",
"individual",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L1684-L1740 |
117,922 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.createRaidNode | public static RaidNode createRaidNode(Configuration conf)
throws ClassNotFoundException {
try {
// default to distributed raid node
Class<?> raidNodeClass =
conf.getClass(RAIDNODE_CLASSNAME_KEY, DistRaidNode.class);
if (!RaidNode.class.isAssignableFrom(raidNodeClass)) {
thr... | java | public static RaidNode createRaidNode(Configuration conf)
throws ClassNotFoundException {
try {
// default to distributed raid node
Class<?> raidNodeClass =
conf.getClass(RAIDNODE_CLASSNAME_KEY, DistRaidNode.class);
if (!RaidNode.class.isAssignableFrom(raidNodeClass)) {
thr... | [
"public",
"static",
"RaidNode",
"createRaidNode",
"(",
"Configuration",
"conf",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"// default to distributed raid node",
"Class",
"<",
"?",
">",
"raidNodeClass",
"=",
"conf",
".",
"getClass",
"(",
"RAIDNODE_CLASS... | Create an instance of the appropriate subclass of RaidNode | [
"Create",
"an",
"instance",
"of",
"the",
"appropriate",
"subclass",
"of",
"RaidNode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L2108-L2129 |
117,923 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.createRaidNode | public static RaidNode createRaidNode(String argv[], Configuration conf)
throws IOException, ClassNotFoundException {
if (conf == null) {
conf = new Configuration();
}
StartupOption startOpt = parseArguments(argv);
if (startOpt == null) {
printUsage();
return null;
}
setS... | java | public static RaidNode createRaidNode(String argv[], Configuration conf)
throws IOException, ClassNotFoundException {
if (conf == null) {
conf = new Configuration();
}
StartupOption startOpt = parseArguments(argv);
if (startOpt == null) {
printUsage();
return null;
}
setS... | [
"public",
"static",
"RaidNode",
"createRaidNode",
"(",
"String",
"argv",
"[",
"]",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"conf",
"==",
"null",
")",
"{",
"conf",
"=",
"new",
"Configuration",
... | Create an instance of the RaidNode | [
"Create",
"an",
"instance",
"of",
"the",
"RaidNode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L2170-L2183 |
117,924 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java | RaidNode.getJobID | public static String getJobID(Configuration conf) {
String jobId = conf.get("mapred.job.id", null);
if (jobId == null) {
jobId = "localRaid" + df.format(new Date());
conf.set("mapred.job.id", jobId);
}
return jobId;
} | java | public static String getJobID(Configuration conf) {
String jobId = conf.get("mapred.job.id", null);
if (jobId == null) {
jobId = "localRaid" + df.format(new Date());
conf.set("mapred.job.id", jobId);
}
return jobId;
} | [
"public",
"static",
"String",
"getJobID",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"jobId",
"=",
"conf",
".",
"get",
"(",
"\"mapred.job.id\"",
",",
"null",
")",
";",
"if",
"(",
"jobId",
"==",
"null",
")",
"{",
"jobId",
"=",
"\"localRaid\"",
"+",... | Get the job id from the configuration | [
"Get",
"the",
"job",
"id",
"from",
"the",
"configuration"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidNode.java#L2188-L2195 |
117,925 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/tools/AvatarDFSck.java | AvatarDFSck.adjustConf | public static String[] adjustConf(String[] argv, Configuration conf) {
String[] serviceId = new String[] { "" };
String[] filteredArgv = DFSUtil.getServiceName(argv, serviceId);
if (!serviceId[0].equals("")) {
NameNode.checkServiceName(conf, serviceId[0]);
DFSUtil.setGenericConf(conf, serviceId[... | java | public static String[] adjustConf(String[] argv, Configuration conf) {
String[] serviceId = new String[] { "" };
String[] filteredArgv = DFSUtil.getServiceName(argv, serviceId);
if (!serviceId[0].equals("")) {
NameNode.checkServiceName(conf, serviceId[0]);
DFSUtil.setGenericConf(conf, serviceId[... | [
"public",
"static",
"String",
"[",
"]",
"adjustConf",
"(",
"String",
"[",
"]",
"argv",
",",
"Configuration",
"conf",
")",
"{",
"String",
"[",
"]",
"serviceId",
"=",
"new",
"String",
"[",
"]",
"{",
"\"\"",
"}",
";",
"String",
"[",
"]",
"filteredArgv",
... | Adjust configuration for nameservice keys. | [
"Adjust",
"configuration",
"for",
"nameservice",
"keys",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/tools/AvatarDFSck.java#L52-L62 |
117,926 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java | BlockPlacementPolicyRaid.countCompanionBlocks | @SuppressWarnings("unchecked")
static Map<String, Integer>[] countCompanionBlocks(
Collection<LocatedBlock> companionBlocks) {
Map<String, Integer>[] result = new HashMap[2];
result[0] = new HashMap<String, Integer>();
result[1] = new HashMap<String, Integer>();
for (LocatedBlock block : co... | java | @SuppressWarnings("unchecked")
static Map<String, Integer>[] countCompanionBlocks(
Collection<LocatedBlock> companionBlocks) {
Map<String, Integer>[] result = new HashMap[2];
result[0] = new HashMap<String, Integer>();
result[1] = new HashMap<String, Integer>();
for (LocatedBlock block : co... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"Map",
"<",
"String",
",",
"Integer",
">",
"[",
"]",
"countCompanionBlocks",
"(",
"Collection",
"<",
"LocatedBlock",
">",
"companionBlocks",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"[... | Count how many companion blocks are on each datanode or the each rack
@param companionBlocks a collection of all the companion blocks
@param result the map from node name to the number of companion blocks
[0] for datanodes [1] for racks | [
"Count",
"how",
"many",
"companion",
"blocks",
"are",
"on",
"each",
"datanode",
"or",
"the",
"each",
"rack"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L236-L257 |
117,927 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java | BlockPlacementPolicyRaid.getCompanionBlocks | List<LocatedBlock> getCompanionBlocks(String path, FileInfo info, Block block, FSInodeInfo inode)
throws IOException {
Codec codec = info.codec;
switch (info.type) {
case NOT_RAID:
return Collections.emptyList();
case HAR_TEMP_PARITY:
return getCompanionBlocksForHarParityBlock(... | java | List<LocatedBlock> getCompanionBlocks(String path, FileInfo info, Block block, FSInodeInfo inode)
throws IOException {
Codec codec = info.codec;
switch (info.type) {
case NOT_RAID:
return Collections.emptyList();
case HAR_TEMP_PARITY:
return getCompanionBlocksForHarParityBlock(... | [
"List",
"<",
"LocatedBlock",
">",
"getCompanionBlocks",
"(",
"String",
"path",
",",
"FileInfo",
"info",
",",
"Block",
"block",
",",
"FSInodeInfo",
"inode",
")",
"throws",
"IOException",
"{",
"Codec",
"codec",
"=",
"info",
".",
"codec",
";",
"switch",
"(",
... | Obtain the companion blocks of the give block
Companion blocks are defined as the blocks that can help recover each
others by using raid decoder.
@param path The path of the file contains the block
@param info The info of this file
@param block The given block
null if it is the block which is currently being written to... | [
"Obtain",
"the",
"companion",
"blocks",
"of",
"the",
"give",
"block",
"Companion",
"blocks",
"are",
"defined",
"as",
"the",
"blocks",
"that",
"can",
"help",
"recover",
"each",
"others",
"by",
"using",
"raid",
"decoder",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L316-L345 |
117,928 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java | BlockPlacementPolicyRaid.getSourceFile | NameWithINode getSourceFile(String parity, String prefix) throws IOException {
if (isHarFile(parity)) {
return null;
}
// remove the prefix
String src = parity.substring(prefix.length());
byte[][] components = INodeDirectory.getPathComponents(src);
INode inode = namesystem.dir.getINode(com... | java | NameWithINode getSourceFile(String parity, String prefix) throws IOException {
if (isHarFile(parity)) {
return null;
}
// remove the prefix
String src = parity.substring(prefix.length());
byte[][] components = INodeDirectory.getPathComponents(src);
INode inode = namesystem.dir.getINode(com... | [
"NameWithINode",
"getSourceFile",
"(",
"String",
"parity",
",",
"String",
"prefix",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isHarFile",
"(",
"parity",
")",
")",
"{",
"return",
"null",
";",
"}",
"// remove the prefix",
"String",
"src",
"=",
"parity",
"... | Get path for the corresponding source file for a valid parity
file. Returns null if it does not exists
@param parity the toUri path of the parity file
@return the toUri path of the source file | [
"Get",
"path",
"for",
"the",
"corresponding",
"source",
"file",
"for",
"a",
"valid",
"parity",
"file",
".",
"Returns",
"null",
"if",
"it",
"does",
"not",
"exists"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L774-L783 |
117,929 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java | BlockPlacementPolicyRaid.getParityFile | private NameWithINode getParityFile(Codec codec, String src)
throws IOException {
String parity;
if (codec.isDirRaid) {
String parent = getParentPath(src);
parity = codec.parityDirectory + parent;
} else {
parity = codec.parityDirectory + src;
}
byte[][] components = IN... | java | private NameWithINode getParityFile(Codec codec, String src)
throws IOException {
String parity;
if (codec.isDirRaid) {
String parent = getParentPath(src);
parity = codec.parityDirectory + parent;
} else {
parity = codec.parityDirectory + src;
}
byte[][] components = IN... | [
"private",
"NameWithINode",
"getParityFile",
"(",
"Codec",
"codec",
",",
"String",
"src",
")",
"throws",
"IOException",
"{",
"String",
"parity",
";",
"if",
"(",
"codec",
".",
"isDirRaid",
")",
"{",
"String",
"parent",
"=",
"getParentPath",
"(",
"src",
")",
... | Get path for the parity file. Returns null if it does not exists
@param codec the codec of the parity file.
@return the toUri path of the parity file | [
"Get",
"path",
"for",
"the",
"parity",
"file",
".",
"Returns",
"null",
"if",
"it",
"does",
"not",
"exists"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L800-L814 |
117,930 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java | BlockPlacementPolicyRaid.getFileInfo | protected FileInfo getFileInfo(FSInodeInfo srcINode, String path) throws IOException {
for (Codec c : Codec.getCodecs()) {
if (path.startsWith(c.tmpHarDirectoryPS)) {
return new FileInfo(FileType.HAR_TEMP_PARITY, c);
}
if (path.startsWith(c.tmpParityDirectoryPS)) {
return new FileI... | java | protected FileInfo getFileInfo(FSInodeInfo srcINode, String path) throws IOException {
for (Codec c : Codec.getCodecs()) {
if (path.startsWith(c.tmpHarDirectoryPS)) {
return new FileInfo(FileType.HAR_TEMP_PARITY, c);
}
if (path.startsWith(c.tmpParityDirectoryPS)) {
return new FileI... | [
"protected",
"FileInfo",
"getFileInfo",
"(",
"FSInodeInfo",
"srcINode",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Codec",
"c",
":",
"Codec",
".",
"getCodecs",
"(",
")",
")",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"c"... | Return raid information about a file, for example
if this file is the source file, parity file, or not raid
@param path file name
@return raid information
@throws IOException | [
"Return",
"raid",
"information",
"about",
"a",
"file",
"for",
"example",
"if",
"this",
"file",
"is",
"the",
"source",
"file",
"parity",
"file",
"or",
"not",
"raid"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L870-L894 |
117,931 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/spi/CompositeContext.java | CompositeContext.isMonitoring | @Override
public boolean isMonitoring() {
boolean ret = true;
for (MetricsContext ctxt : subctxt) {
ret &= ctxt.isMonitoring();
}
return ret;
} | java | @Override
public boolean isMonitoring() {
boolean ret = true;
for (MetricsContext ctxt : subctxt) {
ret &= ctxt.isMonitoring();
}
return ret;
} | [
"@",
"Override",
"public",
"boolean",
"isMonitoring",
"(",
")",
"{",
"boolean",
"ret",
"=",
"true",
";",
"for",
"(",
"MetricsContext",
"ctxt",
":",
"subctxt",
")",
"{",
"ret",
"&=",
"ctxt",
".",
"isMonitoring",
"(",
")",
";",
"}",
"return",
"ret",
";",... | Return true if all subcontexts are monitoring. | [
"Return",
"true",
"if",
"all",
"subcontexts",
"are",
"monitoring",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/spi/CompositeContext.java#L123-L130 |
117,932 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BufferedByteInputOutput.java | BufferedByteInputOutput.read | public int read() throws IOException {
while (true) {
lockR.lock();
try {
if (availableCount.get() > 0) {
// as long as there is available data
// serve it even if closed
int b = bytes[readCursor] & 0xFF;
incReadCursor(1);
availableCount.decremen... | java | public int read() throws IOException {
while (true) {
lockR.lock();
try {
if (availableCount.get() > 0) {
// as long as there is available data
// serve it even if closed
int b = bytes[readCursor] & 0xFF;
incReadCursor(1);
availableCount.decremen... | [
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"lockR",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"availableCount",
".",
"get",
"(",
")",
">",
"0",
")",
"{",
"// as long as there is available d... | Read a single byte.
Blocks until data is available, or fail if buffer is closed. | [
"Read",
"a",
"single",
"byte",
".",
"Blocks",
"until",
"data",
"is",
"available",
"or",
"fail",
"if",
"buffer",
"is",
"closed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputOutput.java#L100-L122 |
117,933 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BufferedByteInputOutput.java | BufferedByteInputOutput.read | public int read(byte[] buf, int off, int len) throws IOException {
while (true) {
lockR.lock();
try {
int available = availableCount.get();
if (available > 0) {
// as long as there is available data
// serve it even if closed
final int lenToRead = Math.min(a... | java | public int read(byte[] buf, int off, int len) throws IOException {
while (true) {
lockR.lock();
try {
int available = availableCount.get();
if (available > 0) {
// as long as there is available data
// serve it even if closed
final int lenToRead = Math.min(a... | [
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"lockR",
".",
"lock",
"(",
")",
";",
"try",
"{",
"int",
"available",
"=",
"availableCoun... | Read data to the buffer, starting at offset off.
Will block until data available, or the input has been closed. | [
"Read",
"data",
"to",
"the",
"buffer",
"starting",
"at",
"offset",
"off",
".",
"Will",
"block",
"until",
"data",
"available",
"or",
"the",
"input",
"has",
"been",
"closed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputOutput.java#L128-L167 |
117,934 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BufferedByteInputOutput.java | BufferedByteInputOutput.write | public void write(byte[] buf, int off, int len) throws IOException {
while (true) {
lockW.lock();
try {
// fail if closed
checkClosed();
final int lenToWrite = Math.min(len, length - availableCount.get());
final int lenForward = Math.min(lenToWrite, length - writ... | java | public void write(byte[] buf, int off, int len) throws IOException {
while (true) {
lockW.lock();
try {
// fail if closed
checkClosed();
final int lenToWrite = Math.min(len, length - availableCount.get());
final int lenForward = Math.min(lenToWrite, length - writ... | [
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"lockW",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// fail if closed",
"checkClosed",
"("... | Write buf to the buffer, will block until it can write len bytes.
Will fail if buffer is closed. | [
"Write",
"buf",
"to",
"the",
"buffer",
"will",
"block",
"until",
"it",
"can",
"write",
"len",
"bytes",
".",
"Will",
"fail",
"if",
"buffer",
"is",
"closed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputOutput.java#L173-L210 |
117,935 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BufferedByteInputOutput.java | BufferedByteInputOutput.write | public void write(int b) throws IOException {
while (true) {
lockW.lock();
try {
// fail if closed
checkClosed();
if (length - availableCount.get() > 0) {
bytes[writeCursor] = (byte) b;
incWriteCursor(1);
availableCount.incrementAndGet();
... | java | public void write(int b) throws IOException {
while (true) {
lockW.lock();
try {
// fail if closed
checkClosed();
if (length - availableCount.get() > 0) {
bytes[writeCursor] = (byte) b;
incWriteCursor(1);
availableCount.incrementAndGet();
... | [
"public",
"void",
"write",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"lockW",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// fail if closed",
"checkClosed",
"(",
")",
";",
"if",
"(",
"length",
"-",
"availableCount... | Write a single byte to the buffer.
Will block until the byte can be written or fail when buffer is closed. | [
"Write",
"a",
"single",
"byte",
"to",
"the",
"buffer",
".",
"Will",
"block",
"until",
"the",
"byte",
"can",
"be",
"written",
"or",
"fail",
"when",
"buffer",
"is",
"closed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteInputOutput.java#L216-L235 |
117,936 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java | DistRaid.createJobConf | private static JobConf createJobConf(Configuration conf) {
JobConf jobconf = new JobConf(conf, DistRaid.class);
jobName = NAME + " " + dateForm.format(new Date(RaidNode.now()));
jobconf.setUser(RaidNode.JOBUSER);
jobconf.setJobName(jobName);
jobconf.setMapSpeculativeExecution(false);
RaidUtils.p... | java | private static JobConf createJobConf(Configuration conf) {
JobConf jobconf = new JobConf(conf, DistRaid.class);
jobName = NAME + " " + dateForm.format(new Date(RaidNode.now()));
jobconf.setUser(RaidNode.JOBUSER);
jobconf.setJobName(jobName);
jobconf.setMapSpeculativeExecution(false);
RaidUtils.p... | [
"private",
"static",
"JobConf",
"createJobConf",
"(",
"Configuration",
"conf",
")",
"{",
"JobConf",
"jobconf",
"=",
"new",
"JobConf",
"(",
"conf",
",",
"DistRaid",
".",
"class",
")",
";",
"jobName",
"=",
"NAME",
"+",
"\" \"",
"+",
"dateForm",
".",
"format"... | create new job conf based on configuration passed.
@param conf
@return | [
"create",
"new",
"job",
"conf",
"based",
"on",
"configuration",
"passed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L376-L392 |
117,937 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java | DistRaid.addRaidPaths | public void addRaidPaths(PolicyInfo info, List<EncodingCandidate> paths) {
raidPolicyPathPairList.add(new RaidPolicyPathPair(info, paths));
} | java | public void addRaidPaths(PolicyInfo info, List<EncodingCandidate> paths) {
raidPolicyPathPairList.add(new RaidPolicyPathPair(info, paths));
} | [
"public",
"void",
"addRaidPaths",
"(",
"PolicyInfo",
"info",
",",
"List",
"<",
"EncodingCandidate",
">",
"paths",
")",
"{",
"raidPolicyPathPairList",
".",
"add",
"(",
"new",
"RaidPolicyPathPair",
"(",
"info",
",",
"paths",
")",
")",
";",
"}"
] | Add paths to be raided | [
"Add",
"paths",
"to",
"be",
"raided"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L395-L397 |
117,938 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java | DistRaid.startDistRaid | public boolean startDistRaid() throws IOException {
assert(raidPolicyPathPairList.size() > 0);
if (setup()) {
this.jobClient = new JobClient(jobconf);
this.runningJob = this.jobClient.submitJob(jobconf);
LOG.info("Job Started: " + runningJob.getID());
this.startTime = System.currentTimeM... | java | public boolean startDistRaid() throws IOException {
assert(raidPolicyPathPairList.size() > 0);
if (setup()) {
this.jobClient = new JobClient(jobconf);
this.runningJob = this.jobClient.submitJob(jobconf);
LOG.info("Job Started: " + runningJob.getID());
this.startTime = System.currentTimeM... | [
"public",
"boolean",
"startDistRaid",
"(",
")",
"throws",
"IOException",
"{",
"assert",
"(",
"raidPolicyPathPairList",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"if",
"(",
"setup",
"(",
")",
")",
"{",
"this",
".",
"jobClient",
"=",
"new",
"JobClient",
... | Invokes a map-reduce job do parallel raiding.
@return true if the job was started, false otherwise | [
"Invokes",
"a",
"map",
"-",
"reduce",
"job",
"do",
"parallel",
"raiding",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L408-L418 |
117,939 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java | DistRaid.checkComplete | public boolean checkComplete() throws IOException {
JobID jobID = runningJob.getID();
if (runningJob.isComplete()) {
// delete job directory
final String jobdir = jobconf.get(JOB_DIR_LABEL);
if (jobdir != null) {
final Path jobpath = new Path(jobdir);
jobpath.getFileSyst... | java | public boolean checkComplete() throws IOException {
JobID jobID = runningJob.getID();
if (runningJob.isComplete()) {
// delete job directory
final String jobdir = jobconf.get(JOB_DIR_LABEL);
if (jobdir != null) {
final Path jobpath = new Path(jobdir);
jobpath.getFileSyst... | [
"public",
"boolean",
"checkComplete",
"(",
")",
"throws",
"IOException",
"{",
"JobID",
"jobID",
"=",
"runningJob",
".",
"getID",
"(",
")",
";",
"if",
"(",
"runningJob",
".",
"isComplete",
"(",
")",
")",
"{",
"// delete job directory",
"final",
"String",
"job... | Checks if the map-reduce job has completed.
@return true if the job completed, false otherwise.
@throws IOException | [
"Checks",
"if",
"the",
"map",
"-",
"reduce",
"job",
"has",
"completed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L435-L480 |
117,940 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java | DistRaid.setup | private boolean setup() throws IOException {
estimateSavings();
final String randomId = getRandomId();
JobClient jClient = new JobClient(jobconf);
Path jobdir = new Path(jClient.getSystemDir(), NAME + "_" + randomId);
LOG.info(JOB_DIR_LABEL + "=" + jobdir);
jobconf.set(JOB_DIR_LABEL, jobdir.to... | java | private boolean setup() throws IOException {
estimateSavings();
final String randomId = getRandomId();
JobClient jClient = new JobClient(jobconf);
Path jobdir = new Path(jClient.getSystemDir(), NAME + "_" + randomId);
LOG.info(JOB_DIR_LABEL + "=" + jobdir);
jobconf.set(JOB_DIR_LABEL, jobdir.to... | [
"private",
"boolean",
"setup",
"(",
")",
"throws",
"IOException",
"{",
"estimateSavings",
"(",
")",
";",
"final",
"String",
"randomId",
"=",
"getRandomId",
"(",
")",
";",
"JobClient",
"jClient",
"=",
"new",
"JobClient",
"(",
"jobconf",
")",
";",
"Path",
"j... | set up input file which has the list of input files.
@return boolean
@throws IOException | [
"set",
"up",
"input",
"file",
"which",
"has",
"the",
"list",
"of",
"input",
"files",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java#L525-L583 |
117,941 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SerializedRecord.java | SerializedRecord.getStrings | private ArrayList<String> getStrings(Object o) {
ArrayList<String> retval = new ArrayList<String>();
retval.clear();
if (o == null)
retval.add("null");
else if (o instanceof String)
retval.add((String) o);
else if (o instanceof Calendar)
retval.add(dateFormatter.format(((Calendar) ... | java | private ArrayList<String> getStrings(Object o) {
ArrayList<String> retval = new ArrayList<String>();
retval.clear();
if (o == null)
retval.add("null");
else if (o instanceof String)
retval.add((String) o);
else if (o instanceof Calendar)
retval.add(dateFormatter.format(((Calendar) ... | [
"private",
"ArrayList",
"<",
"String",
">",
"getStrings",
"(",
"Object",
"o",
")",
"{",
"ArrayList",
"<",
"String",
">",
"retval",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"retval",
".",
"clear",
"(",
")",
";",
"if",
"(",
"o",
"=... | Extract String representations from an Object.
@param o the input object
@return an ArrayList that contains Strings found in o | [
"Extract",
"String",
"representations",
"from",
"an",
"Object",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SerializedRecord.java#L68-L87 |
117,942 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.createNamenode | public static ClientProtocol createNamenode(Configuration conf) throws IOException {
return createNamenode(NameNode.getClientProtocolAddress(conf), conf);
} | java | public static ClientProtocol createNamenode(Configuration conf) throws IOException {
return createNamenode(NameNode.getClientProtocolAddress(conf), conf);
} | [
"public",
"static",
"ClientProtocol",
"createNamenode",
"(",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"createNamenode",
"(",
"NameNode",
".",
"getClientProtocolAddress",
"(",
"conf",
")",
",",
"conf",
")",
";",
"}"
] | The locking hierarchy is to first acquire lock on DFSClient object, followed by
lock on leasechecker, followed by lock on an individual DFSOutputStream. | [
"The",
"locking",
"hierarchy",
"is",
"to",
"first",
"acquire",
"lock",
"on",
"DFSClient",
"object",
"followed",
"by",
"lock",
"on",
"leasechecker",
"followed",
"by",
"lock",
"on",
"an",
"individual",
"DFSOutputStream",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L288-L290 |
117,943 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.createRPCNamenodeIfCompatible | private void createRPCNamenodeIfCompatible(
InetSocketAddress nameNodeAddr,
Configuration conf,
UserGroupInformation ugi) throws IOException {
try {
this.namenodeProtocolProxy = createRPCNamenode(nameNodeAddr, conf, ugi,
namenodeRPCSocketTimeout);
this.rpcNamenode = namenodeP... | java | private void createRPCNamenodeIfCompatible(
InetSocketAddress nameNodeAddr,
Configuration conf,
UserGroupInformation ugi) throws IOException {
try {
this.namenodeProtocolProxy = createRPCNamenode(nameNodeAddr, conf, ugi,
namenodeRPCSocketTimeout);
this.rpcNamenode = namenodeP... | [
"private",
"void",
"createRPCNamenodeIfCompatible",
"(",
"InetSocketAddress",
"nameNodeAddr",
",",
"Configuration",
"conf",
",",
"UserGroupInformation",
"ugi",
")",
"throws",
"IOException",
"{",
"try",
"{",
"this",
".",
"namenodeProtocolProxy",
"=",
"createRPCNamenode",
... | Create a NameNode proxy for the client if the client and NameNode
are compatible
@param nameNodeAddr NameNode address
@param conf configuration
@param ugi ticket
@return a NameNode proxy that's compatible with the client | [
"Create",
"a",
"NameNode",
"proxy",
"for",
"the",
"client",
"if",
"the",
"client",
"and",
"NameNode",
"are",
"compatible"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L314-L333 |
117,944 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.close | public synchronized void close() throws IOException {
if(clientRunning) {
leasechecker.close();
leasechecker.closeRenewal();
if (blockLocationRenewal != null) {
blockLocationRenewal.stop();
}
clientRunning = false;
try {
leasechecker.interruptAndJoin();
if... | java | public synchronized void close() throws IOException {
if(clientRunning) {
leasechecker.close();
leasechecker.closeRenewal();
if (blockLocationRenewal != null) {
blockLocationRenewal.stop();
}
clientRunning = false;
try {
leasechecker.interruptAndJoin();
if... | [
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"clientRunning",
")",
"{",
"leasechecker",
".",
"close",
"(",
")",
";",
"leasechecker",
".",
"closeRenewal",
"(",
")",
";",
"if",
"(",
"blockLocationRenewal",
"!=",... | Close the file system, abandoning all of the leases and files being
created and close connections to the namenode. | [
"Close",
"the",
"file",
"system",
"abandoning",
"all",
"of",
"the",
"leases",
"and",
"files",
"being",
"created",
"and",
"close",
"connections",
"to",
"the",
"namenode",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L665-L684 |
117,945 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.getBlockLocations | public BlockLocation[] getBlockLocations(String src, long start,
long length) throws IOException {
LocatedBlocks blocks = callGetBlockLocations(namenode, src, start, length,
isMetaInfoSuppoted(namenodeProtocolProxy));
return DFSUtil.locatedBlocks2Locations(blocks);
} | java | public BlockLocation[] getBlockLocations(String src, long start,
long length) throws IOException {
LocatedBlocks blocks = callGetBlockLocations(namenode, src, start, length,
isMetaInfoSuppoted(namenodeProtocolProxy));
return DFSUtil.locatedBlocks2Locations(blocks);
} | [
"public",
"BlockLocation",
"[",
"]",
"getBlockLocations",
"(",
"String",
"src",
",",
"long",
"start",
",",
"long",
"length",
")",
"throws",
"IOException",
"{",
"LocatedBlocks",
"blocks",
"=",
"callGetBlockLocations",
"(",
"namenode",
",",
"src",
",",
"start",
... | Get block location info about file
getBlockLocations() returns a list of hostnames that store
data for a specific file region. It returns a set of hostnames
for every block within the indicated region.
This function is very useful when writing code that considers
data-placement when performing operations. For examp... | [
"Get",
"block",
"location",
"info",
"about",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L786-L791 |
117,946 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.open | DFSInputStream open(String src, int buffersize, boolean verifyChecksum,
FileSystem.Statistics stats, boolean clearOsBuffer,
ReadOptions options
) throws IOException {
checkOpen();
incFileReadToStats();
// Get block info from namenode
DFSInputStream stream = new DFSInputStream(this, sr... | java | DFSInputStream open(String src, int buffersize, boolean verifyChecksum,
FileSystem.Statistics stats, boolean clearOsBuffer,
ReadOptions options
) throws IOException {
checkOpen();
incFileReadToStats();
// Get block info from namenode
DFSInputStream stream = new DFSInputStream(this, sr... | [
"DFSInputStream",
"open",
"(",
"String",
"src",
",",
"int",
"buffersize",
",",
"boolean",
"verifyChecksum",
",",
"FileSystem",
".",
"Statistics",
"stats",
",",
"boolean",
"clearOsBuffer",
",",
"ReadOptions",
"options",
")",
"throws",
"IOException",
"{",
"checkOpen... | Create an input stream that obtains a nodelist from the
namenode, and then reads from all the right places. Creates
inner subclass of InputStream that does the right out-of-band
work. | [
"Create",
"an",
"input",
"stream",
"that",
"obtains",
"a",
"nodelist",
"from",
"the",
"namenode",
"and",
"then",
"reads",
"from",
"all",
"the",
"right",
"places",
".",
"Creates",
"inner",
"subclass",
"of",
"InputStream",
"that",
"does",
"the",
"right",
"out"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L821-L835 |
117,947 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.create | public OutputStream create(String src,
boolean overwrite
) throws IOException {
return create(src, overwrite, defaultReplication, defaultBlockSize, null);
} | java | public OutputStream create(String src,
boolean overwrite
) throws IOException {
return create(src, overwrite, defaultReplication, defaultBlockSize, null);
} | [
"public",
"OutputStream",
"create",
"(",
"String",
"src",
",",
"boolean",
"overwrite",
")",
"throws",
"IOException",
"{",
"return",
"create",
"(",
"src",
",",
"overwrite",
",",
"defaultReplication",
",",
"defaultBlockSize",
",",
"null",
")",
";",
"}"
] | Create a new dfs file and return an output stream for writing into it.
@param src stream name
@param overwrite do not check for file existence if true
@return output stream
@throws IOException | [
"Create",
"a",
"new",
"dfs",
"file",
"and",
"return",
"an",
"output",
"stream",
"for",
"writing",
"into",
"it",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L845-L849 |
117,948 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.create | public OutputStream create(String src,
boolean overwrite,
short replication,
long blockSize
) throws IOException {
return create(src, overwrite, replication, blockSize, null);
} | java | public OutputStream create(String src,
boolean overwrite,
short replication,
long blockSize
) throws IOException {
return create(src, overwrite, replication, blockSize, null);
} | [
"public",
"OutputStream",
"create",
"(",
"String",
"src",
",",
"boolean",
"overwrite",
",",
"short",
"replication",
",",
"long",
"blockSize",
")",
"throws",
"IOException",
"{",
"return",
"create",
"(",
"src",
",",
"overwrite",
",",
"replication",
",",
"blockSi... | Create a new dfs file with the specified block replication
and return an output stream for writing into the file.
@param src stream name
@param overwrite do not check for file existence if true
@param replication block replication
@return output stream
@throws IOException | [
"Create",
"a",
"new",
"dfs",
"file",
"with",
"the",
"specified",
"block",
"replication",
"and",
"return",
"an",
"output",
"stream",
"for",
"writing",
"into",
"the",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L877-L883 |
117,949 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.raidFile | public boolean raidFile(String source,
String codecId,
short expectedSourceRepl) throws IOException {
checkOpen();
try {
return namenode.raidFile(source, codecId, expectedSourceRepl);
} catch(RemoteException re) {
throw re.unwrapRemoteException(Acces... | java | public boolean raidFile(String source,
String codecId,
short expectedSourceRepl) throws IOException {
checkOpen();
try {
return namenode.raidFile(source, codecId, expectedSourceRepl);
} catch(RemoteException re) {
throw re.unwrapRemoteException(Acces... | [
"public",
"boolean",
"raidFile",
"(",
"String",
"source",
",",
"String",
"codecId",
",",
"short",
"expectedSourceRepl",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"try",
"{",
"return",
"namenode",
".",
"raidFile",
"(",
"source",
",",
"cod... | Raid a file with given codec
No guarantee file will be raided when the call returns.
Namenode will schedule raiding asynchronously.
If raiding is done when raidFile is called again, namenode will set
replication of source blocks to expectedSourceRepl
@param source
@param codecId
@param expectedSourceRepl
@throws IOExc... | [
"Raid",
"a",
"file",
"with",
"given",
"codec",
"No",
"guarantee",
"file",
"will",
"be",
"raided",
"when",
"the",
"call",
"returns",
".",
"Namenode",
"will",
"schedule",
"raiding",
"asynchronously",
".",
"If",
"raiding",
"is",
"done",
"when",
"raidFile",
"is"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1169-L1180 |
117,950 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.recoverLease | boolean recoverLease(String src, boolean discardLastBlock) throws IOException {
checkOpen();
// We remove the file from local lease checker. Usually it is already been
// removed by the client but we want to be extra safe.
leasechecker.remove(src);
if (this.namenodeProtocolProxy == null) {
re... | java | boolean recoverLease(String src, boolean discardLastBlock) throws IOException {
checkOpen();
// We remove the file from local lease checker. Usually it is already been
// removed by the client but we want to be extra safe.
leasechecker.remove(src);
if (this.namenodeProtocolProxy == null) {
re... | [
"boolean",
"recoverLease",
"(",
"String",
"src",
",",
"boolean",
"discardLastBlock",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"// We remove the file from local lease checker. Usually it is already been",
"// removed by the client but we want to be extra safe."... | Recover a file's lease
@param src a file's path
@return if lease recovery completes
@throws IOException | [
"Recover",
"a",
"file",
"s",
"lease"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1189-L1199 |
117,951 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.versionBasedRecoverLease | private boolean versionBasedRecoverLease(String src) throws IOException {
if (namenodeVersion < ClientProtocol.RECOVER_LEASE_VERSION) {
OutputStream out;
try {
out = append(src, conf.getInt("io.file.buffer.size", 4096), null);
} catch (RemoteException re) {
IOException e = re.unwr... | java | private boolean versionBasedRecoverLease(String src) throws IOException {
if (namenodeVersion < ClientProtocol.RECOVER_LEASE_VERSION) {
OutputStream out;
try {
out = append(src, conf.getInt("io.file.buffer.size", 4096), null);
} catch (RemoteException re) {
IOException e = re.unwr... | [
"private",
"boolean",
"versionBasedRecoverLease",
"(",
"String",
"src",
")",
"throws",
"IOException",
"{",
"if",
"(",
"namenodeVersion",
"<",
"ClientProtocol",
".",
"RECOVER_LEASE_VERSION",
")",
"{",
"OutputStream",
"out",
";",
"try",
"{",
"out",
"=",
"append",
... | recover lease based on version | [
"recover",
"lease",
"based",
"on",
"version"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1202-L1233 |
117,952 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.methodBasedRecoverLease | private boolean methodBasedRecoverLease(String src, boolean discardLastBlock)
throws IOException {
// check if closeRecoverLease(discardLastBlock) is supported
if (namenodeProtocolProxy.isMethodSupported(
"closeRecoverLease", String.class, String.class, boolean.class)) {
try {
return n... | java | private boolean methodBasedRecoverLease(String src, boolean discardLastBlock)
throws IOException {
// check if closeRecoverLease(discardLastBlock) is supported
if (namenodeProtocolProxy.isMethodSupported(
"closeRecoverLease", String.class, String.class, boolean.class)) {
try {
return n... | [
"private",
"boolean",
"methodBasedRecoverLease",
"(",
"String",
"src",
",",
"boolean",
"discardLastBlock",
")",
"throws",
"IOException",
"{",
"// check if closeRecoverLease(discardLastBlock) is supported",
"if",
"(",
"namenodeProtocolProxy",
".",
"isMethodSupported",
"(",
"\"... | recover lease based on method name | [
"recover",
"lease",
"based",
"on",
"method",
"name"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1236-L1282 |
117,953 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.append | OutputStream append(String src, int buffersize, Progressable progress
) throws IOException {
checkOpen();
clearFileStatusCache();
FileStatus stat = null;
LocatedBlock lastBlock = null;
boolean success = false;
try {
stat = getFileInfo(src);
if (namenodeProtocolProxy != nu... | java | OutputStream append(String src, int buffersize, Progressable progress
) throws IOException {
checkOpen();
clearFileStatusCache();
FileStatus stat = null;
LocatedBlock lastBlock = null;
boolean success = false;
try {
stat = getFileInfo(src);
if (namenodeProtocolProxy != nu... | [
"OutputStream",
"append",
"(",
"String",
"src",
",",
"int",
"buffersize",
",",
"Progressable",
"progress",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"FileStatus",
"stat",
"=",
"null",
";",
"LocatedBlo... | Append to an existing HDFS file.
@param src file name
@param buffersize buffer size
@param progress for reporting write-progress
@return an output stream for writing into the file
@throws IOException
@see ClientProtocol#append(String, String) | [
"Append",
"to",
"an",
"existing",
"HDFS",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1366-L1438 |
117,954 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setReplication | public boolean setReplication(String src,
short replication
) throws IOException {
try {
return namenode.setReplication(src, replication);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
... | java | public boolean setReplication(String src,
short replication
) throws IOException {
try {
return namenode.setReplication(src, replication);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
... | [
"public",
"boolean",
"setReplication",
"(",
"String",
"src",
",",
"short",
"replication",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"namenode",
".",
"setReplication",
"(",
"src",
",",
"replication",
")",
";",
"}",
"catch",
"(",
"RemoteException"... | Set replication for an existing file.
@see ClientProtocol#setReplication(String, short)
@param replication
@throws IOException
@return true is successful or false if file does not exist | [
"Set",
"replication",
"for",
"an",
"existing",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1448-L1458 |
117,955 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.merge | public void merge(String parity, String source, String codecId,
int[] checksums) throws IOException {
checkOpen();
try {
namenode.merge(parity, source, codecId, checksums);
} catch (RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
... | java | public void merge(String parity, String source, String codecId,
int[] checksums) throws IOException {
checkOpen();
try {
namenode.merge(parity, source, codecId, checksums);
} catch (RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
... | [
"public",
"void",
"merge",
"(",
"String",
"parity",
",",
"String",
"source",
",",
"String",
"codecId",
",",
"int",
"[",
"]",
"checksums",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"try",
"{",
"namenode",
".",
"merge",
"(",
"parity",
... | Merge parity file and source file together into a raided file | [
"Merge",
"parity",
"file",
"and",
"source",
"file",
"together",
"into",
"a",
"raided",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1490-L1500 |
117,956 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.delete | public boolean delete(String src, boolean recursive) throws IOException {
checkOpen();
clearFileStatusCache();
try {
return namenode.delete(src, recursive);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class);
}
} | java | public boolean delete(String src, boolean recursive) throws IOException {
checkOpen();
clearFileStatusCache();
try {
return namenode.delete(src, recursive);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class);
}
} | [
"public",
"boolean",
"delete",
"(",
"String",
"src",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"try",
"{",
"return",
"namenode",
".",
"delete",
"(",
"src",
",",
"recur... | delete file or directory.
delete contents of the directory if non empty and recursive
set to true | [
"delete",
"file",
"or",
"directory",
".",
"delete",
"contents",
"of",
"the",
"directory",
"if",
"non",
"empty",
"and",
"recursive",
"set",
"to",
"true"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1563-L1572 |
117,957 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.listPaths | public FileStatus[] listPaths(String src) throws IOException {
checkOpen();
metrics.incLsCalls();
try {
if (namenodeProtocolProxy == null) {
return versionBasedListPath(src);
}
return methodBasedListPath(src);
} catch(RemoteException re) {
throw re.unwrapRemoteException(A... | java | public FileStatus[] listPaths(String src) throws IOException {
checkOpen();
metrics.incLsCalls();
try {
if (namenodeProtocolProxy == null) {
return versionBasedListPath(src);
}
return methodBasedListPath(src);
} catch(RemoteException re) {
throw re.unwrapRemoteException(A... | [
"public",
"FileStatus",
"[",
"]",
"listPaths",
"(",
"String",
"src",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"metrics",
".",
"incLsCalls",
"(",
")",
";",
"try",
"{",
"if",
"(",
"namenodeProtocolProxy",
"==",
"null",
")",
"{",
"retu... | Get a listing of the indicated directory | [
"Get",
"a",
"listing",
"of",
"the",
"indicated",
"directory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1594-L1605 |
117,958 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.versionBasedListPathWithLocation | private RemoteIterator<LocatedFileStatus> versionBasedListPathWithLocation(
final String src) throws IOException {
if (namenodeVersion >= ClientProtocol.BULK_BLOCK_LOCATIONS_VERSION) {
return iteratorListing(src);
} else {
return arrayListing(src);
}
} | java | private RemoteIterator<LocatedFileStatus> versionBasedListPathWithLocation(
final String src) throws IOException {
if (namenodeVersion >= ClientProtocol.BULK_BLOCK_LOCATIONS_VERSION) {
return iteratorListing(src);
} else {
return arrayListing(src);
}
} | [
"private",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"versionBasedListPathWithLocation",
"(",
"final",
"String",
"src",
")",
"throws",
"IOException",
"{",
"if",
"(",
"namenodeVersion",
">=",
"ClientProtocol",
".",
"BULK_BLOCK_LOCATIONS_VERSION",
")",
"{",
"return... | List a directory with location based on version | [
"List",
"a",
"directory",
"with",
"location",
"based",
"on",
"version"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1736-L1743 |
117,959 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.methodBasedListPathWithLocation | private RemoteIterator<LocatedFileStatus> methodBasedListPathWithLocation(
final String src) throws IOException {
if (namenodeProtocolProxy.isMethodSupported(
"getLocatedPartialListing", String.class, byte[].class)) {
return iteratorListing(src);
} else {
return arrayListing(src);
... | java | private RemoteIterator<LocatedFileStatus> methodBasedListPathWithLocation(
final String src) throws IOException {
if (namenodeProtocolProxy.isMethodSupported(
"getLocatedPartialListing", String.class, byte[].class)) {
return iteratorListing(src);
} else {
return arrayListing(src);
... | [
"private",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"methodBasedListPathWithLocation",
"(",
"final",
"String",
"src",
")",
"throws",
"IOException",
"{",
"if",
"(",
"namenodeProtocolProxy",
".",
"isMethodSupported",
"(",
"\"getLocatedPartialListing\"",
",",
"String... | List a directory with location based on method | [
"List",
"a",
"directory",
"with",
"location",
"based",
"on",
"method"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1746-L1754 |
117,960 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.arrayListing | private RemoteIterator<LocatedFileStatus> arrayListing(final String src)
throws IOException {
return new RemoteIterator<LocatedFileStatus>() {
private FileStatus[] stats;
private int i = 0;
{ //initializer
stats = listPaths(src);
if (stats == null) {
throw new FileNotF... | java | private RemoteIterator<LocatedFileStatus> arrayListing(final String src)
throws IOException {
return new RemoteIterator<LocatedFileStatus>() {
private FileStatus[] stats;
private int i = 0;
{ //initializer
stats = listPaths(src);
if (stats == null) {
throw new FileNotF... | [
"private",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"arrayListing",
"(",
"final",
"String",
"src",
")",
"throws",
"IOException",
"{",
"return",
"new",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"(",
")",
"{",
"private",
"FileStatus",
"[",
"]",
"sta... | create the iterator from an array of file status | [
"create",
"the",
"iterator",
"from",
"an",
"array",
"of",
"file",
"status"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1757-L1787 |
117,961 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.iteratorListing | private RemoteIterator<LocatedFileStatus> iteratorListing(final String src)
throws IOException {
return new RemoteIterator<LocatedFileStatus>() {
private LocatedDirectoryListing thisListing;
private int i;
{ // initializer
// fetch the first batch of entries in the directory
th... | java | private RemoteIterator<LocatedFileStatus> iteratorListing(final String src)
throws IOException {
return new RemoteIterator<LocatedFileStatus>() {
private LocatedDirectoryListing thisListing;
private int i;
{ // initializer
// fetch the first batch of entries in the directory
th... | [
"private",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"iteratorListing",
"(",
"final",
"String",
"src",
")",
"throws",
"IOException",
"{",
"return",
"new",
"RemoteIterator",
"<",
"LocatedFileStatus",
">",
"(",
")",
"{",
"private",
"LocatedDirectoryListing",
"t... | create the iterator from the iterative listing with block locations | [
"create",
"the",
"iterator",
"from",
"the",
"iterative",
"listing",
"with",
"block",
"locations"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1790-L1831 |
117,962 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.iterativeListing | private FileStatus[] iterativeListing(String src) throws IOException {
// fetch the first batch of entries in the directory
DirectoryListing thisListing = namenode.getPartialListing(
src, HdfsFileStatus.EMPTY_NAME);
if (thisListing == null) { // the directory does not exist
return null;
... | java | private FileStatus[] iterativeListing(String src) throws IOException {
// fetch the first batch of entries in the directory
DirectoryListing thisListing = namenode.getPartialListing(
src, HdfsFileStatus.EMPTY_NAME);
if (thisListing == null) { // the directory does not exist
return null;
... | [
"private",
"FileStatus",
"[",
"]",
"iterativeListing",
"(",
"String",
"src",
")",
"throws",
"IOException",
"{",
"// fetch the first batch of entries in the directory",
"DirectoryListing",
"thisListing",
"=",
"namenode",
".",
"getPartialListing",
"(",
"src",
",",
"HdfsFile... | List the given path iteratively if the directory is large
@param src a path
@return a listing of the path
@throws IOException if any IO error is occurred | [
"List",
"the",
"given",
"path",
"iteratively",
"if",
"the",
"directory",
"is",
"large"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1839-L1882 |
117,963 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.getFileCrc | int getFileCrc(String src) throws IOException {
checkOpen();
return getFileCrc(dataTransferVersion,
src, namenode, namenodeProtocolProxy, socketFactory, socketTimeout);
} | java | int getFileCrc(String src) throws IOException {
checkOpen();
return getFileCrc(dataTransferVersion,
src, namenode, namenodeProtocolProxy, socketFactory, socketTimeout);
} | [
"int",
"getFileCrc",
"(",
"String",
"src",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"return",
"getFileCrc",
"(",
"dataTransferVersion",
",",
"src",
",",
"namenode",
",",
"namenodeProtocolProxy",
",",
"socketFactory",
",",
"socketTimeout",
"... | Get the CRC32 Checksum of a file.
@param src The file path
@return The checksum
@see DistributedFileSystem#getFileCrc(Path) | [
"Get",
"the",
"CRC32",
"Checksum",
"of",
"a",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L1932-L1936 |
117,964 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setPermission | public void setPermission(String src, FsPermission permission
) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setPermission(src, permission);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,... | java | public void setPermission(String src, FsPermission permission
) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setPermission(src, permission);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,... | [
"public",
"void",
"setPermission",
"(",
"String",
"src",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"try",
"{",
"namenode",
".",
"setPermission",
"(",
"src",
",",
"... | Set permissions to a file or directory.
@param src path name.
@param permission
@throws <code>FileNotFoundException</code> is file does not exist. | [
"Set",
"permissions",
"to",
"a",
"file",
"or",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2187-L2198 |
117,965 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setOwner | public void setOwner(String src, String username, String groupname
) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setOwner(src, username, groupname);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.cla... | java | public void setOwner(String src, String username, String groupname
) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setOwner(src, username, groupname);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.cla... | [
"public",
"void",
"setOwner",
"(",
"String",
"src",
",",
"String",
"username",
",",
"String",
"groupname",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"try",
"{",
"namenode",
".",
"setOwner",
"(",
"... | Set file or directory owner.
@param src path name.
@param username user id.
@param groupname user group.
@throws <code>FileNotFoundException</code> is file does not exist. | [
"Set",
"file",
"or",
"directory",
"owner",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2207-L2218 |
117,966 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.versionBasedListCorruptFileBlocks | private CorruptFileBlocks versionBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (namenodeVersion < ClientProtocol.LIST_CORRUPT_FILEBLOCKS_VERSION) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (c... | java | private CorruptFileBlocks versionBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (namenodeVersion < ClientProtocol.LIST_CORRUPT_FILEBLOCKS_VERSION) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (c... | [
"private",
"CorruptFileBlocks",
"versionBasedListCorruptFileBlocks",
"(",
"String",
"path",
",",
"String",
"cookie",
")",
"throws",
"IOException",
"{",
"if",
"(",
"namenodeVersion",
"<",
"ClientProtocol",
".",
"LIST_CORRUPT_FILEBLOCKS_VERSION",
")",
"{",
"LOG",
".",
"... | Version based list corrupt file blocks | [
"Version",
"based",
"list",
"corrupt",
"file",
"blocks"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2289-L2307 |
117,967 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.methodBasedListCorruptFileBlocks | private CorruptFileBlocks methodBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (!namenodeProtocolProxy.isMethodSupported("listCorruptFileBlocks",
String.class, String.class)) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older versio... | java | private CorruptFileBlocks methodBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (!namenodeProtocolProxy.isMethodSupported("listCorruptFileBlocks",
String.class, String.class)) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older versio... | [
"private",
"CorruptFileBlocks",
"methodBasedListCorruptFileBlocks",
"(",
"String",
"path",
",",
"String",
"cookie",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"namenodeProtocolProxy",
".",
"isMethodSupported",
"(",
"\"listCorruptFileBlocks\"",
",",
"String",
"."... | Method based listCorruptFileBlocks | [
"Method",
"based",
"listCorruptFileBlocks"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2310-L2329 |
117,968 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.versionBasedSaveNamespace | private void versionBasedSaveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
if (namenodeVersion >= ClientProtocol.SAVENAMESPACE_FORCE) {
namenode.saveNamespace(force, uncompressed);
} else {
namenode.saveNamespace();
}
} | java | private void versionBasedSaveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
if (namenodeVersion >= ClientProtocol.SAVENAMESPACE_FORCE) {
namenode.saveNamespace(force, uncompressed);
} else {
namenode.saveNamespace();
}
} | [
"private",
"void",
"versionBasedSaveNamespace",
"(",
"boolean",
"force",
",",
"boolean",
"uncompressed",
")",
"throws",
"AccessControlException",
",",
"IOException",
"{",
"if",
"(",
"namenodeVersion",
">=",
"ClientProtocol",
".",
"SAVENAMESPACE_FORCE",
")",
"{",
"name... | Version-based save namespace | [
"Version",
"-",
"based",
"save",
"namespace"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2368-L2375 |
117,969 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.methodBasedSaveNamespace | private void methodBasedSaveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
if (namenodeProtocolProxy.isMethodSupported(
"saveNamespace", boolean.class, boolean.class)) {
namenode.saveNamespace(force, uncompressed);
} else {
namenode.saveNamespac... | java | private void methodBasedSaveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
if (namenodeProtocolProxy.isMethodSupported(
"saveNamespace", boolean.class, boolean.class)) {
namenode.saveNamespace(force, uncompressed);
} else {
namenode.saveNamespac... | [
"private",
"void",
"methodBasedSaveNamespace",
"(",
"boolean",
"force",
",",
"boolean",
"uncompressed",
")",
"throws",
"AccessControlException",
",",
"IOException",
"{",
"if",
"(",
"namenodeProtocolProxy",
".",
"isMethodSupported",
"(",
"\"saveNamespace\"",
",",
"boolea... | Method-based save namespace | [
"Method",
"-",
"based",
"save",
"namespace"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2378-L2386 |
117,970 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setQuota | void setQuota(String src, long namespaceQuota, long diskspaceQuota)
throws IOException {
// sanity check
if ((namespaceQuota <= 0 && namespaceQuota != FSConstants.QUOTA_DONT_SET &&
namespaceQuota != FSConstants.QUOTA_RESET) ||
(diskspaceQuota <= ... | java | void setQuota(String src, long namespaceQuota, long diskspaceQuota)
throws IOException {
// sanity check
if ((namespaceQuota <= 0 && namespaceQuota != FSConstants.QUOTA_DONT_SET &&
namespaceQuota != FSConstants.QUOTA_RESET) ||
(diskspaceQuota <= ... | [
"void",
"setQuota",
"(",
"String",
"src",
",",
"long",
"namespaceQuota",
",",
"long",
"diskspaceQuota",
")",
"throws",
"IOException",
"{",
"// sanity check",
"if",
"(",
"(",
"namespaceQuota",
"<=",
"0",
"&&",
"namespaceQuota",
"!=",
"FSConstants",
".",
"QUOTA_DO... | Sets or resets quotas for a directory.
@see org.apache.hadoop.hdfs.protocol.ClientProtocol#setQuota(String, long, long) | [
"Sets",
"or",
"resets",
"quotas",
"for",
"a",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2525-L2546 |
117,971 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.setTimes | public void setTimes(String src, long mtime, long atime) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setTimes(src, mtime, atime);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
File... | java | public void setTimes(String src, long mtime, long atime) throws IOException {
checkOpen();
clearFileStatusCache();
try {
namenode.setTimes(src, mtime, atime);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
File... | [
"public",
"void",
"setTimes",
"(",
"String",
"src",
",",
"long",
"mtime",
",",
"long",
"atime",
")",
"throws",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"clearFileStatusCache",
"(",
")",
";",
"try",
"{",
"namenode",
".",
"setTimes",
"(",
"src",
","... | set the modification and access time of a file
@throws FileNotFoundException if the path is not a file | [
"set",
"the",
"modification",
"and",
"access",
"time",
"of",
"a",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2552-L2562 |
117,972 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.checkBlockRange | static void checkBlockRange(List<LocatedBlock> blockRange,
long offset, long length) throws IOException {
boolean isValid = false;
if (!blockRange.isEmpty()) {
int numBlocks = blockRange.size();
LocatedBlock firstBlock = blockRange.get(0);
LocatedBlock lastBlock = blockRange.get(numBloc... | java | static void checkBlockRange(List<LocatedBlock> blockRange,
long offset, long length) throws IOException {
boolean isValid = false;
if (!blockRange.isEmpty()) {
int numBlocks = blockRange.size();
LocatedBlock firstBlock = blockRange.get(0);
LocatedBlock lastBlock = blockRange.get(numBloc... | [
"static",
"void",
"checkBlockRange",
"(",
"List",
"<",
"LocatedBlock",
">",
"blockRange",
",",
"long",
"offset",
",",
"long",
"length",
")",
"throws",
"IOException",
"{",
"boolean",
"isValid",
"=",
"false",
";",
"if",
"(",
"!",
"blockRange",
".",
"isEmpty",
... | Checks that the given block range covers the given file segment and
consists of contiguous blocks. This function assumes that the length
of the queried segment is non-zero, and a non-empty block list is
expected.
@param blockRange the set of blocks obtained for the given file segment
@param offset the start offset of t... | [
"Checks",
"that",
"the",
"given",
"block",
"range",
"covers",
"the",
"given",
"file",
"segment",
"and",
"consists",
"of",
"contiguous",
"blocks",
".",
"This",
"function",
"assumes",
"that",
"the",
"length",
"of",
"the",
"queried",
"segment",
"is",
"non",
"-"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2854-L2894 |
117,973 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.reportChecksumFailure | void reportChecksumFailure(String file, LocatedBlock lblocks[]) {
try {
reportBadBlocks(lblocks);
} catch (IOException ie) {
LOG.info("Found corruption while reading " + file
+ ". Error repairing corrupt blocks. Bad blocks remain. "
+ StringUtils.stringifyException(ie... | java | void reportChecksumFailure(String file, LocatedBlock lblocks[]) {
try {
reportBadBlocks(lblocks);
} catch (IOException ie) {
LOG.info("Found corruption while reading " + file
+ ". Error repairing corrupt blocks. Bad blocks remain. "
+ StringUtils.stringifyException(ie... | [
"void",
"reportChecksumFailure",
"(",
"String",
"file",
",",
"LocatedBlock",
"lblocks",
"[",
"]",
")",
"{",
"try",
"{",
"reportBadBlocks",
"(",
"lblocks",
")",
";",
"}",
"catch",
"(",
"IOException",
"ie",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Found corrupt... | just reports checksum failure and ignores any exception during the report. | [
"just",
"reports",
"checksum",
"failure",
"and",
"ignores",
"any",
"exception",
"during",
"the",
"report",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L3051-L3059 |
117,974 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.getDataTransferProtocolVersion | public int getDataTransferProtocolVersion() throws IOException {
synchronized (dataTransferVersion) {
if (dataTransferVersion == -1) {
// Get the version number from NN
try {
int remoteDataTransferVersion = namenode.getDataTransferProtocolVersion();
updateDataTransferProtoc... | java | public int getDataTransferProtocolVersion() throws IOException {
synchronized (dataTransferVersion) {
if (dataTransferVersion == -1) {
// Get the version number from NN
try {
int remoteDataTransferVersion = namenode.getDataTransferProtocolVersion();
updateDataTransferProtoc... | [
"public",
"int",
"getDataTransferProtocolVersion",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"dataTransferVersion",
")",
"{",
"if",
"(",
"dataTransferVersion",
"==",
"-",
"1",
")",
"{",
"// Get the version number from NN",
"try",
"{",
"int",
"remo... | Get the data transfer protocol version supported in the cluster
assuming all the datanodes have the same version.
@return the data transfer protocol version supported in the cluster | [
"Get",
"the",
"data",
"transfer",
"protocol",
"version",
"supported",
"in",
"the",
"cluster",
"assuming",
"all",
"the",
"datanodes",
"have",
"the",
"same",
"version",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L3082-L3104 |
117,975 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.isInLocalRack | public boolean isInLocalRack(InetSocketAddress addr) {
if (dnsToSwitchMapping == null || this.localhostNetworkLocation == null) {
return false;
}
ArrayList<String> tempList = new ArrayList<String>();
tempList.add(addr.getAddress().getHostAddress());
List<String> retList = dnsToSwitchMapping.re... | java | public boolean isInLocalRack(InetSocketAddress addr) {
if (dnsToSwitchMapping == null || this.localhostNetworkLocation == null) {
return false;
}
ArrayList<String> tempList = new ArrayList<String>();
tempList.add(addr.getAddress().getHostAddress());
List<String> retList = dnsToSwitchMapping.re... | [
"public",
"boolean",
"isInLocalRack",
"(",
"InetSocketAddress",
"addr",
")",
"{",
"if",
"(",
"dnsToSwitchMapping",
"==",
"null",
"||",
"this",
".",
"localhostNetworkLocation",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"ArrayList",
"<",
"String",
">"... | Determine whether the input address is in the same rack as local machine | [
"Determine",
"whether",
"the",
"input",
"address",
"is",
"in",
"the",
"same",
"rack",
"as",
"local",
"machine"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L3173-L3185 |
117,976 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/RaidMissingBlocks.java | RaidMissingBlocks.getTotalCount | int getTotalCount() {
int ret = 0;
for (RaidMissingBlocksPerCodec queue : queues.values()) {
ret += queue.getTotalCount();
}
return ret;
} | java | int getTotalCount() {
int ret = 0;
for (RaidMissingBlocksPerCodec queue : queues.values()) {
ret += queue.getTotalCount();
}
return ret;
} | [
"int",
"getTotalCount",
"(",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"for",
"(",
"RaidMissingBlocksPerCodec",
"queue",
":",
"queues",
".",
"values",
"(",
")",
")",
"{",
"ret",
"+=",
"queue",
".",
"getTotalCount",
"(",
")",
";",
"}",
"return",
"ret",
"... | Get the total count of the missing blocks | [
"Get",
"the",
"total",
"count",
"of",
"the",
"missing",
"blocks"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/RaidMissingBlocks.java#L61-L67 |
117,977 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/RaidMissingBlocks.java | RaidMissingBlocks.remove | boolean remove(BlockInfo blockInfo, RaidCodec codec) {
if(queues.get(codec).remove(blockInfo)) {
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug(
"BLOCK* NameSystem.RaidMissingBlocks.remove:"
+ bl... | java | boolean remove(BlockInfo blockInfo, RaidCodec codec) {
if(queues.get(codec).remove(blockInfo)) {
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug(
"BLOCK* NameSystem.RaidMissingBlocks.remove:"
+ bl... | [
"boolean",
"remove",
"(",
"BlockInfo",
"blockInfo",
",",
"RaidCodec",
"codec",
")",
"{",
"if",
"(",
"queues",
".",
"get",
"(",
"codec",
")",
".",
"remove",
"(",
"blockInfo",
")",
")",
"{",
"if",
"(",
"NameNode",
".",
"stateChangeLog",
".",
"isDebugEnable... | Remove a missing Raided block from its codec queue. | [
"Remove",
"a",
"missing",
"Raided",
"block",
"from",
"its",
"codec",
"queue",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/RaidMissingBlocks.java#L89-L101 |
117,978 | facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java | SimulatorJobInProgress.initTasks | @Override
public synchronized void initTasks() throws IOException {
boolean loggingEnabled = LOG.isDebugEnabled();
if (loggingEnabled) {
LOG.debug("(initTasks@SJIP) Starting Initialization for " + jobId);
}
numMapTasks = jobStory.getNumberMaps();
numReduceTasks = jobStory.getNumberReduces();... | java | @Override
public synchronized void initTasks() throws IOException {
boolean loggingEnabled = LOG.isDebugEnabled();
if (loggingEnabled) {
LOG.debug("(initTasks@SJIP) Starting Initialization for " + jobId);
}
numMapTasks = jobStory.getNumberMaps();
numReduceTasks = jobStory.getNumberReduces();... | [
"@",
"Override",
"public",
"synchronized",
"void",
"initTasks",
"(",
")",
"throws",
"IOException",
"{",
"boolean",
"loggingEnabled",
"=",
"LOG",
".",
"isDebugEnabled",
"(",
")",
";",
"if",
"(",
"loggingEnabled",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"(initTa... | for initTasks, update information from JobStory object | [
"for",
"initTasks",
"update",
"information",
"from",
"JobStory",
"object"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java#L116-L196 |
117,979 | facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java | SimulatorJobInProgress.getMapTaskAttemptInfo | @SuppressWarnings("deprecation")
private synchronized TaskAttemptInfo getMapTaskAttemptInfo(
TaskTracker taskTracker, TaskAttemptID taskAttemptID) {
assert (taskAttemptID.isMap());
JobID jobid = (JobID) taskAttemptID.getJobID();
assert (jobid == getJobID());
// Get splits for the TaskAttempt
... | java | @SuppressWarnings("deprecation")
private synchronized TaskAttemptInfo getMapTaskAttemptInfo(
TaskTracker taskTracker, TaskAttemptID taskAttemptID) {
assert (taskAttemptID.isMap());
JobID jobid = (JobID) taskAttemptID.getJobID();
assert (jobid == getJobID());
// Get splits for the TaskAttempt
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"synchronized",
"TaskAttemptInfo",
"getMapTaskAttemptInfo",
"(",
"TaskTracker",
"taskTracker",
",",
"TaskAttemptID",
"taskAttemptID",
")",
"{",
"assert",
"(",
"taskAttemptID",
".",
"isMap",
"(",
")",
")"... | Given the map taskAttemptID, returns the TaskAttemptInfo. Deconstructs the
map's taskAttemptID and looks up the jobStory with the parts taskType, id
of task, id of task attempt.
@param taskTracker
tasktracker
@param taskAttemptID
task-attempt
@return TaskAttemptInfo for the map task-attempt | [
"Given",
"the",
"map",
"taskAttemptID",
"returns",
"the",
"TaskAttemptInfo",
".",
"Deconstructs",
"the",
"map",
"s",
"taskAttemptID",
"and",
"looks",
"up",
"the",
"jobStory",
"with",
"the",
"parts",
"taskType",
"id",
"of",
"task",
"id",
"of",
"task",
"attempt"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java#L230-L260 |
117,980 | facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java | SimulatorJobInProgress.getReduceTaskAttemptInfo | private TaskAttemptInfo getReduceTaskAttemptInfo(TaskTracker taskTracker,
TaskAttemptID taskAttemptID) {
assert (!taskAttemptID.isMap());
TaskID taskId = taskAttemptID.getTaskID();
TaskType taskType;
if (taskAttemptID.isMap()) {
taskType = TaskType.MAP;
} else {
taskType = TaskType... | java | private TaskAttemptInfo getReduceTaskAttemptInfo(TaskTracker taskTracker,
TaskAttemptID taskAttemptID) {
assert (!taskAttemptID.isMap());
TaskID taskId = taskAttemptID.getTaskID();
TaskType taskType;
if (taskAttemptID.isMap()) {
taskType = TaskType.MAP;
} else {
taskType = TaskType... | [
"private",
"TaskAttemptInfo",
"getReduceTaskAttemptInfo",
"(",
"TaskTracker",
"taskTracker",
",",
"TaskAttemptID",
"taskAttemptID",
")",
"{",
"assert",
"(",
"!",
"taskAttemptID",
".",
"isMap",
"(",
")",
")",
";",
"TaskID",
"taskId",
"=",
"taskAttemptID",
".",
"get... | Given the reduce taskAttemptID, returns the TaskAttemptInfo. Deconstructs
the reduce taskAttemptID and looks up the jobStory with the parts taskType,
id of task, id of task attempt.
@param taskTracker
tasktracker
@param taskAttemptID
task-attempt
@return TaskAttemptInfo for the reduce task-attempt | [
"Given",
"the",
"reduce",
"taskAttemptID",
"returns",
"the",
"TaskAttemptInfo",
".",
"Deconstructs",
"the",
"reduce",
"taskAttemptID",
"and",
"looks",
"up",
"the",
"jobStory",
"with",
"the",
"parts",
"taskType",
"id",
"of",
"task",
"id",
"of",
"task",
"attempt",... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorJobInProgress.java#L307-L330 |
117,981 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.alignDatanodes | public static void alignDatanodes(DatanodeInfo[] dstLocs,
DatanodeInfo[] srcLocs) {
for (int i = 0; i < dstLocs.length; i++) {
for (int j = 0; j < srcLocs.length; j++) {
if (i == j)
continue;
if (dstLocs[i].equals(srcLocs[j])) {
if (i < j) {
swap(i, j, src... | java | public static void alignDatanodes(DatanodeInfo[] dstLocs,
DatanodeInfo[] srcLocs) {
for (int i = 0; i < dstLocs.length; i++) {
for (int j = 0; j < srcLocs.length; j++) {
if (i == j)
continue;
if (dstLocs[i].equals(srcLocs[j])) {
if (i < j) {
swap(i, j, src... | [
"public",
"static",
"void",
"alignDatanodes",
"(",
"DatanodeInfo",
"[",
"]",
"dstLocs",
",",
"DatanodeInfo",
"[",
"]",
"srcLocs",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dstLocs",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
... | Aligns the source and destination locations such that common locations
appear at the same index.
@param dstLocs
the destination datanodes
@param srcLocs
the source datanodes | [
"Aligns",
"the",
"source",
"and",
"destination",
"locations",
"such",
"that",
"common",
"locations",
"appear",
"at",
"the",
"same",
"index",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L243-L259 |
117,982 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.shutdown | public void shutdown() throws IOException {
// Clean up RPC connections.
Iterator <ClientDatanodeProtocol> connections =
datanodeMap.values().iterator();
while(connections.hasNext()) {
ClientDatanodeProtocol cnxn = connections.next();
RPC.stopProxy(cnxn);
}
datanodeMap.clear();
... | java | public void shutdown() throws IOException {
// Clean up RPC connections.
Iterator <ClientDatanodeProtocol> connections =
datanodeMap.values().iterator();
while(connections.hasNext()) {
ClientDatanodeProtocol cnxn = connections.next();
RPC.stopProxy(cnxn);
}
datanodeMap.clear();
... | [
"public",
"void",
"shutdown",
"(",
")",
"throws",
"IOException",
"{",
"// Clean up RPC connections.",
"Iterator",
"<",
"ClientDatanodeProtocol",
">",
"connections",
"=",
"datanodeMap",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"conne... | Tears down all RPC connections, you MUST call this once you are done.
@throws IOException | [
"Tears",
"down",
"all",
"RPC",
"connections",
"you",
"MUST",
"call",
"this",
"once",
"you",
"are",
"done",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L921-L936 |
117,983 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.copy | public void copy(List<FastFileCopyRequest> requests) throws Exception {
List<Future<CopyResult>> results = new ArrayList<Future<CopyResult>>();
for (FastFileCopyRequest r : requests) {
Callable<CopyResult> fastFileCopy = new FastFileCopy(r.getSrc(),
r.getDestination(), r.srcFs, r.dstFs);
... | java | public void copy(List<FastFileCopyRequest> requests) throws Exception {
List<Future<CopyResult>> results = new ArrayList<Future<CopyResult>>();
for (FastFileCopyRequest r : requests) {
Callable<CopyResult> fastFileCopy = new FastFileCopy(r.getSrc(),
r.getDestination(), r.srcFs, r.dstFs);
... | [
"public",
"void",
"copy",
"(",
"List",
"<",
"FastFileCopyRequest",
">",
"requests",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Future",
"<",
"CopyResult",
">>",
"results",
"=",
"new",
"ArrayList",
"<",
"Future",
"<",
"CopyResult",
">",
">",
"(",
")",
... | Performs fast copy for a list of fast file copy requests. Uses a thread
pool to perform fast file copy in parallel.
@param requests
the list of fast file copy requests
@throws Exception | [
"Performs",
"fast",
"copy",
"for",
"a",
"list",
"of",
"fast",
"file",
"copy",
"requests",
".",
"Uses",
"a",
"thread",
"pool",
"to",
"perform",
"fast",
"file",
"copy",
"in",
"parallel",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L991-L1004 |
117,984 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.getDirectoryListing | private static void getDirectoryListing(FileStatus root, FileSystem fs,
List<CopyPath> result, Path dstPath) throws IOException {
if (!root.isDir()) {
result.add(new CopyPath(root.getPath(), dstPath));
return;
}
for (FileStatus child : fs.listStatus(root.getPath())) {
getDirectoryLi... | java | private static void getDirectoryListing(FileStatus root, FileSystem fs,
List<CopyPath> result, Path dstPath) throws IOException {
if (!root.isDir()) {
result.add(new CopyPath(root.getPath(), dstPath));
return;
}
for (FileStatus child : fs.listStatus(root.getPath())) {
getDirectoryLi... | [
"private",
"static",
"void",
"getDirectoryListing",
"(",
"FileStatus",
"root",
",",
"FileSystem",
"fs",
",",
"List",
"<",
"CopyPath",
">",
"result",
",",
"Path",
"dstPath",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"root",
".",
"isDir",
"(",
")",
... | Recursively lists out all the files under a given path.
@param root
the path under which we want to list out files
@param fs
the filesystem
@param result
the list which holds all the files.
@throws IOException | [
"Recursively",
"lists",
"out",
"all",
"the",
"files",
"under",
"a",
"given",
"path",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L1179-L1190 |
117,985 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.expandDirectories | private static List<CopyPath> expandDirectories(FileSystem fs,
List<Path> paths, Path dstPath)
throws IOException {
List<CopyPath> newList = new ArrayList<CopyPath>();
FileSystem dstFs = dstPath.getFileSystem(defaultConf);
boolean isDstFile = false;
try {
FileStatus dstPathStatus = ds... | java | private static List<CopyPath> expandDirectories(FileSystem fs,
List<Path> paths, Path dstPath)
throws IOException {
List<CopyPath> newList = new ArrayList<CopyPath>();
FileSystem dstFs = dstPath.getFileSystem(defaultConf);
boolean isDstFile = false;
try {
FileStatus dstPathStatus = ds... | [
"private",
"static",
"List",
"<",
"CopyPath",
">",
"expandDirectories",
"(",
"FileSystem",
"fs",
",",
"List",
"<",
"Path",
">",
"paths",
",",
"Path",
"dstPath",
")",
"throws",
"IOException",
"{",
"List",
"<",
"CopyPath",
">",
"newList",
"=",
"new",
"ArrayL... | Get the listing of all files under the given directories.
@param fs
the filesystem
@param paths
the paths whose directory listing is to be retrieved
@return the directory expansion for all paths provided
@throws IOException | [
"Get",
"the",
"listing",
"of",
"all",
"files",
"under",
"the",
"given",
"directories",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L1202-L1244 |
117,986 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.expandSingle | private static List<CopyPath> expandSingle(Path src, Path dstPath)
throws IOException {
List<Path> expandedPaths = new ArrayList<Path>();
FileSystem fs = src.getFileSystem(defaultConf);
FileStatus[] stats = fs.globStatus(src);
if (stats == null || stats.length == 0) {
throw new IOException("... | java | private static List<CopyPath> expandSingle(Path src, Path dstPath)
throws IOException {
List<Path> expandedPaths = new ArrayList<Path>();
FileSystem fs = src.getFileSystem(defaultConf);
FileStatus[] stats = fs.globStatus(src);
if (stats == null || stats.length == 0) {
throw new IOException("... | [
"private",
"static",
"List",
"<",
"CopyPath",
">",
"expandSingle",
"(",
"Path",
"src",
",",
"Path",
"dstPath",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Path",
">",
"expandedPaths",
"=",
"new",
"ArrayList",
"<",
"Path",
">",
"(",
")",
";",
"FileSy... | Expand a single file, if its a file pattern list out all files matching the
pattern, if its a directory return all files under the directory.
@param src
the file to be expanded
@param dstPath
the destination
@return the expanded file list for this file/filepattern
@throws IOException | [
"Expand",
"a",
"single",
"file",
"if",
"its",
"a",
"file",
"pattern",
"list",
"out",
"all",
"files",
"matching",
"the",
"pattern",
"if",
"its",
"a",
"directory",
"return",
"all",
"files",
"under",
"the",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L1257-L1270 |
117,987 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java | FastCopy.expandSrcs | private static List<CopyPath> expandSrcs(List<Path> srcs, Path dstPath)
throws IOException {
List<CopyPath> expandedSrcs = new ArrayList<CopyPath>();
for (Path src : srcs) {
expandedSrcs.addAll(expandSingle(src, dstPath));
}
return expandedSrcs;
} | java | private static List<CopyPath> expandSrcs(List<Path> srcs, Path dstPath)
throws IOException {
List<CopyPath> expandedSrcs = new ArrayList<CopyPath>();
for (Path src : srcs) {
expandedSrcs.addAll(expandSingle(src, dstPath));
}
return expandedSrcs;
} | [
"private",
"static",
"List",
"<",
"CopyPath",
">",
"expandSrcs",
"(",
"List",
"<",
"Path",
">",
"srcs",
",",
"Path",
"dstPath",
")",
"throws",
"IOException",
"{",
"List",
"<",
"CopyPath",
">",
"expandedSrcs",
"=",
"new",
"ArrayList",
"<",
"CopyPath",
">",
... | Expands all sources, if they are file pattern expand to list out all files
matching the pattern, if they are a directory, expand to list out all files
under the directory.
@param srcs
the files to be expanded
@param dstPath
the destination
@return the fully expanded list of all files for all file/filepatterns
provided... | [
"Expands",
"all",
"sources",
"if",
"they",
"are",
"file",
"pattern",
"expand",
"to",
"list",
"out",
"all",
"files",
"matching",
"the",
"pattern",
"if",
"they",
"are",
"a",
"directory",
"expand",
"to",
"list",
"out",
"all",
"files",
"under",
"the",
"directo... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/FastCopy.java#L1285-L1292 |
117,988 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/input/SequenceFileRecordReader.java | SequenceFileRecordReader.getProgress | public float getProgress() throws IOException {
if (end == start) {
return 0.0f;
} else {
return Math.min(1.0f, (in.getPosition() - start) / (float)(end - start));
}
} | java | public float getProgress() throws IOException {
if (end == start) {
return 0.0f;
} else {
return Math.min(1.0f, (in.getPosition() - start) / (float)(end - start));
}
} | [
"public",
"float",
"getProgress",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"end",
"==",
"start",
")",
"{",
"return",
"0.0f",
";",
"}",
"else",
"{",
"return",
"Math",
".",
"min",
"(",
"1.0f",
",",
"(",
"in",
".",
"getPosition",
"(",
")",
"... | Return the progress within the input split
@return 0.0 to 1.0 of the input byte range | [
"Return",
"the",
"progress",
"within",
"the",
"input",
"split"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/input/SequenceFileRecordReader.java#L93-L99 |
117,989 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/ShellParser.java | ShellParser.findPattern | protected String findPattern(String strPattern, String text, int grp) {
Pattern pattern = Pattern.compile(strPattern, Pattern.MULTILINE);
Matcher matcher = pattern.matcher(text);
if (matcher.find(0))
return matcher.group(grp);
return null;
} | java | protected String findPattern(String strPattern, String text, int grp) {
Pattern pattern = Pattern.compile(strPattern, Pattern.MULTILINE);
Matcher matcher = pattern.matcher(text);
if (matcher.find(0))
return matcher.group(grp);
return null;
} | [
"protected",
"String",
"findPattern",
"(",
"String",
"strPattern",
",",
"String",
"text",
",",
"int",
"grp",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"strPattern",
",",
"Pattern",
".",
"MULTILINE",
")",
";",
"Matcher",
"matcher",
... | Find the first occurence ofa pattern in a piece of text
and return a specific group.
@param strPattern the regular expression to match
@param text the text to search
@param grp the number of the matching group to return
@return a String containing the matched group of the regular expression | [
"Find",
"the",
"first",
"occurence",
"ofa",
"pattern",
"in",
"a",
"piece",
"of",
"text",
"and",
"return",
"a",
"specific",
"group",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/ShellParser.java#L47-L56 |
117,990 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/ShellParser.java | ShellParser.findAll | protected String findAll(String strPattern, String text, int grp,
String separator) {
String retval = "";
boolean firstTime = true;
Pattern pattern = Pattern.compile(strPattern);
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
retval += (firstTime ? "" : separator) +... | java | protected String findAll(String strPattern, String text, int grp,
String separator) {
String retval = "";
boolean firstTime = true;
Pattern pattern = Pattern.compile(strPattern);
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
retval += (firstTime ? "" : separator) +... | [
"protected",
"String",
"findAll",
"(",
"String",
"strPattern",
",",
"String",
"text",
",",
"int",
"grp",
",",
"String",
"separator",
")",
"{",
"String",
"retval",
"=",
"\"\"",
";",
"boolean",
"firstTime",
"=",
"true",
";",
"Pattern",
"pattern",
"=",
"Patte... | Finds all occurences of a pattern in a piece of text and returns
the matching groups.
@param strPattern the regular expression to match
@param text the text to search
@param grp the number of the matching group to return
@param separator the string that separates occurences in the returned value
@return a String that... | [
"Finds",
"all",
"occurences",
"of",
"a",
"pattern",
"in",
"a",
"piece",
"of",
"text",
"and",
"returns",
"the",
"matching",
"groups",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/ShellParser.java#L70-L85 |
117,991 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/jmx/JMXJsonServlet.java | JMXJsonServlet.renderMBeans | private int renderMBeans(JsonGenerator jg, String[] mBeanNames) throws IOException,
MalformedObjectNameException {
jg.writeStartObject();
Set<ObjectName> nameQueries, queriedObjects;
nameQueries = new HashSet<ObjectName>();
queriedObjects = new HashSet<ObjectName>();
// if no mbean names pro... | java | private int renderMBeans(JsonGenerator jg, String[] mBeanNames) throws IOException,
MalformedObjectNameException {
jg.writeStartObject();
Set<ObjectName> nameQueries, queriedObjects;
nameQueries = new HashSet<ObjectName>();
queriedObjects = new HashSet<ObjectName>();
// if no mbean names pro... | [
"private",
"int",
"renderMBeans",
"(",
"JsonGenerator",
"jg",
",",
"String",
"[",
"]",
"mBeanNames",
")",
"throws",
"IOException",
",",
"MalformedObjectNameException",
"{",
"jg",
".",
"writeStartObject",
"(",
")",
";",
"Set",
"<",
"ObjectName",
">",
"nameQueries... | Renders MBean attributes to jg.
The queries parameter allows selection of a subset of mbeans.
@param jg
JsonGenerator that will be written to
@param mBeanNames
Optional list of mbean names to render. If null, every
mbean will be returned.
@return int
Returns the appropriate HTTP status code. | [
"Renders",
"MBean",
"attributes",
"to",
"jg",
".",
"The",
"queries",
"parameter",
"allows",
"selection",
"of",
"a",
"subset",
"of",
"mbeans",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/jmx/JMXJsonServlet.java#L195-L226 |
117,992 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/jmx/JMXJsonServlet.java | JMXJsonServlet.renderMBean | private void renderMBean(JsonGenerator jg, ObjectName objectName) throws IOException {
MBeanInfo beanInfo;
String className;
jg.writeObjectFieldStart(objectName.toString());
jg.writeStringField("beanName", objectName.toString());
try {
beanInfo = mBeanServer.getMBeanInfo(objectName);
c... | java | private void renderMBean(JsonGenerator jg, ObjectName objectName) throws IOException {
MBeanInfo beanInfo;
String className;
jg.writeObjectFieldStart(objectName.toString());
jg.writeStringField("beanName", objectName.toString());
try {
beanInfo = mBeanServer.getMBeanInfo(objectName);
c... | [
"private",
"void",
"renderMBean",
"(",
"JsonGenerator",
"jg",
",",
"ObjectName",
"objectName",
")",
"throws",
"IOException",
"{",
"MBeanInfo",
"beanInfo",
";",
"String",
"className",
";",
"jg",
".",
"writeObjectFieldStart",
"(",
"objectName",
".",
"toString",
"(",... | Render a particular MBean's attributes to jg.
@param jg
JsonGenerator that will be written to
@param objectName
ObjectName for the mbean to render.
@return void | [
"Render",
"a",
"particular",
"MBean",
"s",
"attributes",
"to",
"jg",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/jmx/JMXJsonServlet.java#L237-L273 |
117,993 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/datanode/DatanodeProtocols.java | DatanodeProtocols.sendHeartbeat | public DatanodeCommand[] sendHeartbeat(DatanodeRegistration registration,
long capacity,
long dfsUsed, long remaining,
long namespaceUsed,
int xmitsInProgress,
... | java | public DatanodeCommand[] sendHeartbeat(DatanodeRegistration registration,
long capacity,
long dfsUsed, long remaining,
long namespaceUsed,
int xmitsInProgress,
... | [
"public",
"DatanodeCommand",
"[",
"]",
"sendHeartbeat",
"(",
"DatanodeRegistration",
"registration",
",",
"long",
"capacity",
",",
"long",
"dfsUsed",
",",
"long",
"remaining",
",",
"long",
"namespaceUsed",
",",
"int",
"xmitsInProgress",
",",
"int",
"xceiverCount",
... | This method should not be invoked on the composite
DatanodeProtocols object. You can call these on the individual
DatanodeProcol objects. | [
"This",
"method",
"should",
"not",
"be",
"invoked",
"on",
"the",
"composite",
"DatanodeProtocols",
"object",
".",
"You",
"can",
"call",
"these",
"on",
"the",
"individual",
"DatanodeProcol",
"objects",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/datanode/DatanodeProtocols.java#L142-L149 |
117,994 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java | FileFixer.setPolicyInfo | void setPolicyInfo(Collection<PolicyInfo> all) throws IOException {
this.all = all;
this.pathToPolicy.clear();
// keep a reverse map from all top-level paths to policies
for (PolicyInfo pinfo: all) {
pathToPolicy.add(new PathToPolicy(pinfo.getSrcPath(), pinfo));
for (PathInfo d:pinfo.getDes... | java | void setPolicyInfo(Collection<PolicyInfo> all) throws IOException {
this.all = all;
this.pathToPolicy.clear();
// keep a reverse map from all top-level paths to policies
for (PolicyInfo pinfo: all) {
pathToPolicy.add(new PathToPolicy(pinfo.getSrcPath(), pinfo));
for (PathInfo d:pinfo.getDes... | [
"void",
"setPolicyInfo",
"(",
"Collection",
"<",
"PolicyInfo",
">",
"all",
")",
"throws",
"IOException",
"{",
"this",
".",
"all",
"=",
"all",
";",
"this",
".",
"pathToPolicy",
".",
"clear",
"(",
")",
";",
"// keep a reverse map from all top-level paths to policies... | The list of all configured policies. | [
"The",
"list",
"of",
"all",
"configured",
"policies",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java#L146-L166 |
117,995 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java | FileFixer.run | public void run() {
while (running) {
try {
LOG.info("FileFixer continuing to run...");
doFindFiles();
} catch (Exception e) {
LOG.error(StringUtils.stringifyException(e));
} catch (Error err) {
LOG.error("Exiting after encountering " +
StringUti... | java | public void run() {
while (running) {
try {
LOG.info("FileFixer continuing to run...");
doFindFiles();
} catch (Exception e) {
LOG.error(StringUtils.stringifyException(e));
} catch (Error err) {
LOG.error("Exiting after encountering " +
StringUti... | [
"public",
"void",
"run",
"(",
")",
"{",
"while",
"(",
"running",
")",
"{",
"try",
"{",
"LOG",
".",
"info",
"(",
"\"FileFixer continuing to run...\"",
")",
";",
"doFindFiles",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG",
".",
"... | A singleton thread that finds corrupted files and then schedules
blocks to be copied. This thread talks only to NameNodes and does
not talk to any datanodes. | [
"A",
"singleton",
"thread",
"that",
"finds",
"corrupted",
"files",
"and",
"then",
"schedules",
"blocks",
"to",
"be",
"copied",
".",
"This",
"thread",
"talks",
"only",
"to",
"NameNodes",
"and",
"does",
"not",
"talk",
"to",
"any",
"datanodes",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java#L173-L194 |
117,996 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java | FileFixer.createClientDatanodeProtocolProxy | static ClientDatanodeProtocol createClientDatanodeProtocolProxy (
DatanodeInfo datanodeid, Configuration conf) throws IOException {
InetSocketAddress addr = NetUtils.createSocketAddr(
datanodeid.getHost() + ":" + datanodeid.getIpcPort());
if (ClientDatanodeProtocol.LOG.isDebugEnabled()) {
Clie... | java | static ClientDatanodeProtocol createClientDatanodeProtocolProxy (
DatanodeInfo datanodeid, Configuration conf) throws IOException {
InetSocketAddress addr = NetUtils.createSocketAddr(
datanodeid.getHost() + ":" + datanodeid.getIpcPort());
if (ClientDatanodeProtocol.LOG.isDebugEnabled()) {
Clie... | [
"static",
"ClientDatanodeProtocol",
"createClientDatanodeProtocolProxy",
"(",
"DatanodeInfo",
"datanodeid",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"InetSocketAddress",
"addr",
"=",
"NetUtils",
".",
"createSocketAddr",
"(",
"datanodeid",
".",
"get... | Setup a session with the specified datanode | [
"Setup",
"a",
"session",
"with",
"the",
"specified",
"datanode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java#L441-L462 |
117,997 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.getInstance | public static GaloisField getInstance(int fieldSize,
int primitivePolynomial) {
int key = ((fieldSize << 16) & 0xFFFF0000) + (primitivePolynomial & 0x0000FFFF);
GaloisField gf;
synchronized (instances) {
gf = instances.get(key);
if (gf == null) {
gf = new GaloisField(fieldSize, pri... | java | public static GaloisField getInstance(int fieldSize,
int primitivePolynomial) {
int key = ((fieldSize << 16) & 0xFFFF0000) + (primitivePolynomial & 0x0000FFFF);
GaloisField gf;
synchronized (instances) {
gf = instances.get(key);
if (gf == null) {
gf = new GaloisField(fieldSize, pri... | [
"public",
"static",
"GaloisField",
"getInstance",
"(",
"int",
"fieldSize",
",",
"int",
"primitivePolynomial",
")",
"{",
"int",
"key",
"=",
"(",
"(",
"fieldSize",
"<<",
"16",
")",
"&",
"0xFFFF0000",
")",
"+",
"(",
"primitivePolynomial",
"&",
"0x0000FFFF",
")"... | Get the object performs Galois field arithmetics
@param fieldSize size of the field
@param primitivePolynomial a primitive polynomial corresponds to the size | [
"Get",
"the",
"object",
"performs",
"Galois",
"field",
"arithmetics"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L51-L63 |
117,998 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.add | public int add(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return x ^ y;
} | java | public int add(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return x ^ y;
} | [
"public",
"int",
"add",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"getFieldSize",
"(",
")",
"&&",
"y",
">=",
"0",
"&&",
"y",
"<",
"getFieldSize",
"(",
")",
")",
";",
"return",
"x",
"^",
"y",
... | Compute the sum of two fields
@param x input field
@param y input field
@return result of addition | [
"Compute",
"the",
"sum",
"of",
"two",
"fields"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L139-L142 |
117,999 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.multiply | public int multiply(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return mulTable[x][y];
} | java | public int multiply(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
return mulTable[x][y];
} | [
"public",
"int",
"multiply",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"getFieldSize",
"(",
")",
"&&",
"y",
">=",
"0",
"&&",
"y",
"<",
"getFieldSize",
"(",
")",
")",
";",
"return",
"mulTable",
"[... | Compute the multiplication of two fields
@param x input field
@param y input field
@return result of multiplication | [
"Compute",
"the",
"multiplication",
"of",
"two",
"fields"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L150-L153 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.