id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
119,200 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskGraphServlet.java | TaskGraphServlet.getMapAvarageProgress | private float getMapAvarageProgress(int tasksPerBar, int index
, TaskReport[] reports ) {
float progress = 0f;
int k=0;
for(;k < tasksPerBar && index + k < reports.length; k++) {
progress += reports[index + k].getProgress();
}
progress /= k;
return progress;
} | java | private float getMapAvarageProgress(int tasksPerBar, int index
, TaskReport[] reports ) {
float progress = 0f;
int k=0;
for(;k < tasksPerBar && index + k < reports.length; k++) {
progress += reports[index + k].getProgress();
}
progress /= k;
return progress;
} | [
"private",
"float",
"getMapAvarageProgress",
"(",
"int",
"tasksPerBar",
",",
"int",
"index",
",",
"TaskReport",
"[",
"]",
"reports",
")",
"{",
"float",
"progress",
"=",
"0f",
";",
"int",
"k",
"=",
"0",
";",
"for",
"(",
";",
"k",
"<",
"tasksPerBar",
"&&... | Computes average progress per bar | [
"Computes",
"average",
"progress",
"per",
"bar"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskGraphServlet.java#L177-L186 |
119,201 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskGraphServlet.java | TaskGraphServlet.getReduceAvarageProgresses | private float[] getReduceAvarageProgresses(int tasksPerBar, int index
, TaskReport[] reports ) {
float[] progresses = new float[] {0,0,0};
int k=0;
for(;k < tasksPerBar && index + k < reports.length; k++) {
float progress = reports[index+k].getProgress();
for(int j=0; progress > 0 ; j++, p... | java | private float[] getReduceAvarageProgresses(int tasksPerBar, int index
, TaskReport[] reports ) {
float[] progresses = new float[] {0,0,0};
int k=0;
for(;k < tasksPerBar && index + k < reports.length; k++) {
float progress = reports[index+k].getProgress();
for(int j=0; progress > 0 ; j++, p... | [
"private",
"float",
"[",
"]",
"getReduceAvarageProgresses",
"(",
"int",
"tasksPerBar",
",",
"int",
"index",
",",
"TaskReport",
"[",
"]",
"reports",
")",
"{",
"float",
"[",
"]",
"progresses",
"=",
"new",
"float",
"[",
"]",
"{",
"0",
",",
"0",
",",
"0",
... | Computes average progresses per bar | [
"Computes",
"average",
"progresses",
"per",
"bar"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskGraphServlet.java#L189-L205 |
119,202 | facebookarchive/hadoop-20 | src/contrib/storageservice/src/java/org/apache/hadoop/hdfs/storageservice/NNLatencyBenchmark.java | NNLatencyBenchmark.setUp | private void setUp() throws Exception {
try {
fileSystem = (DistributedFileSystem) FileSystem.get(
StorageServiceConfigKeys.translateToOldSchema(conf, nameserviceId), conf);
InetSocketAddress nameNodeAddr = fileSystem.getClient().getNameNodeAddr();
metaInfo = new RequestMetaInfo(clusterI... | java | private void setUp() throws Exception {
try {
fileSystem = (DistributedFileSystem) FileSystem.get(
StorageServiceConfigKeys.translateToOldSchema(conf, nameserviceId), conf);
InetSocketAddress nameNodeAddr = fileSystem.getClient().getNameNodeAddr();
metaInfo = new RequestMetaInfo(clusterI... | [
"private",
"void",
"setUp",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"fileSystem",
"=",
"(",
"DistributedFileSystem",
")",
"FileSystem",
".",
"get",
"(",
"StorageServiceConfigKeys",
".",
"translateToOldSchema",
"(",
"conf",
",",
"nameserviceId",
")",
",... | Sets up clients before each benchmark | [
"Sets",
"up",
"clients",
"before",
"each",
"benchmark"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/storageservice/src/java/org/apache/hadoop/hdfs/storageservice/NNLatencyBenchmark.java#L122-L151 |
119,203 | facebookarchive/hadoop-20 | src/contrib/storageservice/src/java/org/apache/hadoop/hdfs/storageservice/NNLatencyBenchmark.java | NNLatencyBenchmark.tearDown | private void tearDown() throws Exception {
try {
if (fileSystem != null) {
fileSystem.delete(new Path(ROOT), true, true);
}
} finally {
RPC.stopProxy(proxyClientProxyProtocol);
IOUtils.cleanup(LOG, proxyTClientProxyProtocol, clientManager, fileSystem);
}
} | java | private void tearDown() throws Exception {
try {
if (fileSystem != null) {
fileSystem.delete(new Path(ROOT), true, true);
}
} finally {
RPC.stopProxy(proxyClientProxyProtocol);
IOUtils.cleanup(LOG, proxyTClientProxyProtocol, clientManager, fileSystem);
}
} | [
"private",
"void",
"tearDown",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"fileSystem",
"!=",
"null",
")",
"{",
"fileSystem",
".",
"delete",
"(",
"new",
"Path",
"(",
"ROOT",
")",
",",
"true",
",",
"true",
")",
";",
"}",
"}",
"fina... | Tears down clients after each benchmark | [
"Tears",
"down",
"clients",
"after",
"each",
"benchmark"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/storageservice/src/java/org/apache/hadoop/hdfs/storageservice/NNLatencyBenchmark.java#L154-L163 |
119,204 | facebookarchive/hadoop-20 | src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java | Shard.normalizePath | public static String normalizePath(String path) {
// remove double slashes & backslashes
path = path.replace("//", "/");
path = path.replace("\\", "/");
// trim trailing slash from non-root path (ignoring windows drive)
if (path.length() > 1 && path.endsWith("/")) {
path = path.substring(0, p... | java | public static String normalizePath(String path) {
// remove double slashes & backslashes
path = path.replace("//", "/");
path = path.replace("\\", "/");
// trim trailing slash from non-root path (ignoring windows drive)
if (path.length() > 1 && path.endsWith("/")) {
path = path.substring(0, p... | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"path",
")",
"{",
"// remove double slashes & backslashes",
"path",
"=",
"path",
".",
"replace",
"(",
"\"//\"",
",",
"\"/\"",
")",
";",
"path",
"=",
"path",
".",
"replace",
"(",
"\"\\\\\"",
",",
"... | This method is copied from Path. | [
"This",
"method",
"is",
"copied",
"from",
"Path",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java#L43-L54 |
119,205 | facebookarchive/hadoop-20 | src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java | Shard.createShardFromString | private static Shard createShardFromString(String str) {
int first = str.indexOf("@");
int second = str.indexOf("@", first + 1);
long version = Long.parseLong(str.substring(0, first));
String dir = str.substring(first + 1, second);
long gen = Long.parseLong(str.substring(second + 1));
return new... | java | private static Shard createShardFromString(String str) {
int first = str.indexOf("@");
int second = str.indexOf("@", first + 1);
long version = Long.parseLong(str.substring(0, first));
String dir = str.substring(first + 1, second);
long gen = Long.parseLong(str.substring(second + 1));
return new... | [
"private",
"static",
"Shard",
"createShardFromString",
"(",
"String",
"str",
")",
"{",
"int",
"first",
"=",
"str",
".",
"indexOf",
"(",
"\"@\"",
")",
";",
"int",
"second",
"=",
"str",
".",
"indexOf",
"(",
"\"@\"",
",",
"first",
"+",
"1",
")",
";",
"l... | assume str is formatted correctly as a shard string | [
"assume",
"str",
"is",
"formatted",
"correctly",
"as",
"a",
"shard",
"string"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java#L82-L89 |
119,206 | facebookarchive/hadoop-20 | src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java | Shard.compareTo | public int compareTo(Shard other) {
// compare version
if (version < other.version) {
return -1;
} else if (version > other.version) {
return 1;
}
// compare dir
int result = dir.compareTo(other.dir);
if (result != 0) {
return result;
}
// compare gen
if (gen < ... | java | public int compareTo(Shard other) {
// compare version
if (version < other.version) {
return -1;
} else if (version > other.version) {
return 1;
}
// compare dir
int result = dir.compareTo(other.dir);
if (result != 0) {
return result;
}
// compare gen
if (gen < ... | [
"public",
"int",
"compareTo",
"(",
"Shard",
"other",
")",
"{",
"// compare version",
"if",
"(",
"version",
"<",
"other",
".",
"version",
")",
"{",
"return",
"-",
"1",
";",
"}",
"else",
"if",
"(",
"version",
">",
"other",
".",
"version",
")",
"{",
"re... | Compare to another shard.
@param other another shard
@return compare version first, then directory and finally generation | [
"Compare",
"to",
"another",
"shard",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/Shard.java#L196-L216 |
119,207 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/Shell.java | Shell.getUlimitMemoryCommand | public static String[] getUlimitMemoryCommand(int memoryLimit) {
// ulimit isn't supported on Windows
if (WINDOWS) {
return null;
}
return new String[] {ULIMIT_COMMAND, "-v", String.valueOf(memoryLimit)};
} | java | public static String[] getUlimitMemoryCommand(int memoryLimit) {
// ulimit isn't supported on Windows
if (WINDOWS) {
return null;
}
return new String[] {ULIMIT_COMMAND, "-v", String.valueOf(memoryLimit)};
} | [
"public",
"static",
"String",
"[",
"]",
"getUlimitMemoryCommand",
"(",
"int",
"memoryLimit",
")",
"{",
"// ulimit isn't supported on Windows",
"if",
"(",
"WINDOWS",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"String",
"[",
"]",
"{",
"ULIMIT_COMMAND",... | Get the Unix command for setting the maximum virtual memory available
to a given child process. This is only relevant when we are forking a
process from within the Mapper or the Reducer implementations.
Also see Hadoop Pipes and Hadoop Streaming.
It also checks to ensure that we are running on a *nix platform else
(e.... | [
"Get",
"the",
"Unix",
"command",
"for",
"setting",
"the",
"maximum",
"virtual",
"memory",
"available",
"to",
"a",
"given",
"child",
"process",
".",
"This",
"is",
"only",
"relevant",
"when",
"we",
"are",
"forking",
"a",
"process",
"from",
"within",
"the",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/Shell.java#L125-L132 |
119,208 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/TaskID.java | TaskID.appendTo | protected StringBuilder appendTo(StringBuilder builder) {
return jobId.appendTo(builder).
append(SEPARATOR).
append(isMap ? 'm' : 'r').
append(SEPARATOR).
append(idFormat.format(id));
} | java | protected StringBuilder appendTo(StringBuilder builder) {
return jobId.appendTo(builder).
append(SEPARATOR).
append(isMap ? 'm' : 'r').
append(SEPARATOR).
append(idFormat.format(id));
} | [
"protected",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"builder",
")",
"{",
"return",
"jobId",
".",
"appendTo",
"(",
"builder",
")",
".",
"append",
"(",
"SEPARATOR",
")",
".",
"append",
"(",
"isMap",
"?",
"'",
"'",
":",
"'",
"'",
")",
".",
"ap... | Add the unique string to the given builder.
@param builder the builder to append to
@return the builder that was passed in | [
"Add",
"the",
"unique",
"string",
"to",
"the",
"given",
"builder",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/TaskID.java#L132-L138 |
119,209 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/TaskID.java | TaskID.forName | public static TaskID forName(String str)
throws IllegalArgumentException {
if(str == null)
return null;
try {
String[] parts = str.split("_");
if(parts.length == 5) {
if(parts[0].equals(TASK)) {
boolean isMap = false;
if(parts[3].equals("m")) isMap = true;
... | java | public static TaskID forName(String str)
throws IllegalArgumentException {
if(str == null)
return null;
try {
String[] parts = str.split("_");
if(parts.length == 5) {
if(parts[0].equals(TASK)) {
boolean isMap = false;
if(parts[3].equals("m")) isMap = true;
... | [
"public",
"static",
"TaskID",
"forName",
"(",
"String",
"str",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"String",
"[",
"]",
"parts",
"=",
"str",
".",
"split",
"(",
"\"_\"",
... | Construct a TaskID object from given string
@return constructed TaskID object or null if the given String is null
@throws IllegalArgumentException if the given string is malformed | [
"Construct",
"a",
"TaskID",
"object",
"from",
"given",
"string"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/TaskID.java#L163-L185 |
119,210 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java | FSImageSerialization.readString | @SuppressWarnings("deprecation")
public static String readString(DataInputStream in) throws IOException {
UTF8 ustr = TL_DATA.get().U_STR;
ustr.readFields(in);
return ustr.toString();
} | java | @SuppressWarnings("deprecation")
public static String readString(DataInputStream in) throws IOException {
UTF8 ustr = TL_DATA.get().U_STR;
ustr.readFields(in);
return ustr.toString();
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"String",
"readString",
"(",
"DataInputStream",
"in",
")",
"throws",
"IOException",
"{",
"UTF8",
"ustr",
"=",
"TL_DATA",
".",
"get",
"(",
")",
".",
"U_STR",
";",
"ustr",
".",
"readFiel... | by other code. | [
"by",
"other",
"code",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java#L208-L213 |
119,211 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java | JobMonitor.doMonitor | public void doMonitor() {
while (running) {
String[] keys = null;
// Make a copy of the names of the current jobs.
synchronized(jobs) {
keys = jobs.keySet().toArray(new String[0]);
}
// Check all the jobs. We do not want to block access to `jobs`
// because that will pre... | java | public void doMonitor() {
while (running) {
String[] keys = null;
// Make a copy of the names of the current jobs.
synchronized(jobs) {
keys = jobs.keySet().toArray(new String[0]);
}
// Check all the jobs. We do not want to block access to `jobs`
// because that will pre... | [
"public",
"void",
"doMonitor",
"(",
")",
"{",
"while",
"(",
"running",
")",
"{",
"String",
"[",
"]",
"keys",
"=",
"null",
";",
"// Make a copy of the names of the current jobs.",
"synchronized",
"(",
"jobs",
")",
"{",
"keys",
"=",
"jobs",
".",
"keySet",
"(",... | Periodically checks status of running map-reduce jobs. | [
"Periodically",
"checks",
"status",
"of",
"running",
"map",
"-",
"reduce",
"jobs",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java#L101-L176 |
119,212 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java | JobMonitor.runningJobsCount | int runningJobsCount() {
int total = 0;
synchronized(jobs) {
for (String key: jobs.keySet()) {
total += jobs.get(key).size();
}
}
return total;
} | java | int runningJobsCount() {
int total = 0;
synchronized(jobs) {
for (String key: jobs.keySet()) {
total += jobs.get(key).size();
}
}
return total;
} | [
"int",
"runningJobsCount",
"(",
")",
"{",
"int",
"total",
"=",
"0",
";",
"synchronized",
"(",
"jobs",
")",
"{",
"for",
"(",
"String",
"key",
":",
"jobs",
".",
"keySet",
"(",
")",
")",
"{",
"total",
"+=",
"jobs",
".",
"get",
"(",
"key",
")",
".",
... | For test code | [
"For",
"test",
"code"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java#L179-L187 |
119,213 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/file/tfile/TFile.java | TFile.main | public static void main(String[] args) {
System.out.printf("TFile Dumper (TFile %s, BCFile %s)\n", TFile.API_VERSION
.toString(), BCFile.API_VERSION.toString());
if (args.length == 0) {
System.out
.println("Usage: java ... org.apache.hadoop.io.file.tfile.TFile tfile-path [tfile-path ...]... | java | public static void main(String[] args) {
System.out.printf("TFile Dumper (TFile %s, BCFile %s)\n", TFile.API_VERSION
.toString(), BCFile.API_VERSION.toString());
if (args.length == 0) {
System.out
.println("Usage: java ... org.apache.hadoop.io.file.tfile.TFile tfile-path [tfile-path ...]... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"System",
".",
"out",
".",
"printf",
"(",
"\"TFile Dumper (TFile %s, BCFile %s)\\n\"",
",",
"TFile",
".",
"API_VERSION",
".",
"toString",
"(",
")",
",",
"BCFile",
".",
"API_VERSIO... | Dumping the TFile information.
@param args
A list of TFile paths. | [
"Dumping",
"the",
"TFile",
"information",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/file/tfile/TFile.java#L2335-L2353 |
119,214 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java | TaskLogsMonitor.getAllLogsFileDetails | private Map<Task, Map<LogName, LogFileDetail>> getAllLogsFileDetails(
final List<Task> allAttempts) throws IOException {
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails =
new HashMap<Task, Map<LogName, LogFileDetail>>();
for (Task task : allAttempts) {
Map<LogName, LogFileDetail> a... | java | private Map<Task, Map<LogName, LogFileDetail>> getAllLogsFileDetails(
final List<Task> allAttempts) throws IOException {
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails =
new HashMap<Task, Map<LogName, LogFileDetail>>();
for (Task task : allAttempts) {
Map<LogName, LogFileDetail> a... | [
"private",
"Map",
"<",
"Task",
",",
"Map",
"<",
"LogName",
",",
"LogFileDetail",
">",
">",
"getAllLogsFileDetails",
"(",
"final",
"List",
"<",
"Task",
">",
"allAttempts",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"Task",
",",
"Map",
"<",
"LogName",
... | Get the logFileDetails of all the list of attempts passed.
@param lInfo
@return a map of task to the log-file detail
@throws IOException | [
"Get",
"the",
"logFileDetails",
"of",
"all",
"the",
"list",
"of",
"attempts",
"passed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java#L257-L269 |
119,215 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java | TaskLogsMonitor.isTruncationNeeded | private boolean isTruncationNeeded(PerJVMInfo lInfo,
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails,
LogName logName) {
boolean truncationNeeded = false;
LogFileDetail logFileDetail = null;
for (Task task : lInfo.allAttempts) {
long taskRetainSize =
(task.isMapTask() ?... | java | private boolean isTruncationNeeded(PerJVMInfo lInfo,
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails,
LogName logName) {
boolean truncationNeeded = false;
LogFileDetail logFileDetail = null;
for (Task task : lInfo.allAttempts) {
long taskRetainSize =
(task.isMapTask() ?... | [
"private",
"boolean",
"isTruncationNeeded",
"(",
"PerJVMInfo",
"lInfo",
",",
"Map",
"<",
"Task",
",",
"Map",
"<",
"LogName",
",",
"LogFileDetail",
">",
">",
"taskLogFileDetails",
",",
"LogName",
"logName",
")",
"{",
"boolean",
"truncationNeeded",
"=",
"false",
... | Check if truncation of logs is needed for the given jvmInfo. If all the
tasks that ran in a JVM are within the log-limits, then truncation is not
needed. Otherwise it is needed.
@param lInfo
@param taskLogFileDetails
@param logName
@return true if truncation is needed, false otherwise | [
"Check",
"if",
"truncation",
"of",
"logs",
"is",
"needed",
"for",
"the",
"given",
"jvmInfo",
".",
"If",
"all",
"the",
"tasks",
"that",
"ran",
"in",
"a",
"JVM",
"are",
"within",
"the",
"log",
"-",
"limits",
"then",
"truncation",
"is",
"not",
"needed",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java#L281-L299 |
119,216 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java | TaskLogsMonitor.truncateALogFileOfAnAttempt | private LogFileDetail truncateALogFileOfAnAttempt(
final TaskAttemptID taskID, final LogFileDetail oldLogFileDetail,
final long taskRetainSize, final FileWriter tmpFileWriter,
final FileReader logFileReader) throws IOException {
LogFileDetail newLogFileDetail = new LogFileDetail();
// ///////... | java | private LogFileDetail truncateALogFileOfAnAttempt(
final TaskAttemptID taskID, final LogFileDetail oldLogFileDetail,
final long taskRetainSize, final FileWriter tmpFileWriter,
final FileReader logFileReader) throws IOException {
LogFileDetail newLogFileDetail = new LogFileDetail();
// ///////... | [
"private",
"LogFileDetail",
"truncateALogFileOfAnAttempt",
"(",
"final",
"TaskAttemptID",
"taskID",
",",
"final",
"LogFileDetail",
"oldLogFileDetail",
",",
"final",
"long",
"taskRetainSize",
",",
"final",
"FileWriter",
"tmpFileWriter",
",",
"final",
"FileReader",
"logFile... | Truncate the log file of this task-attempt so that only the last retainSize
many bytes of each log file is retained and the log file is reduced in size
saving disk space.
@param taskID Task whose logs need to be truncated
@param oldLogFileDetail contains the original log details for the attempt
@param taskRetainSize r... | [
"Truncate",
"the",
"log",
"file",
"of",
"this",
"task",
"-",
"attempt",
"so",
"that",
"only",
"the",
"last",
"retainSize",
"many",
"bytes",
"of",
"each",
"log",
"file",
"is",
"retained",
"and",
"the",
"log",
"file",
"is",
"reduced",
"in",
"size",
"saving... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java#L315-L364 |
119,217 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java | TaskLogsMonitor.updateIndicesAfterLogTruncation | private void updateIndicesAfterLogTruncation(TaskAttemptID firstAttempt,
Map<Task, Map<LogName, LogFileDetail>> updatedTaskLogFileDetails) {
for (Entry<Task, Map<LogName, LogFileDetail>> entry :
updatedTaskLogFileDetails.entrySet()) {
Task task = entry.getKey();
Ma... | java | private void updateIndicesAfterLogTruncation(TaskAttemptID firstAttempt,
Map<Task, Map<LogName, LogFileDetail>> updatedTaskLogFileDetails) {
for (Entry<Task, Map<LogName, LogFileDetail>> entry :
updatedTaskLogFileDetails.entrySet()) {
Task task = entry.getKey();
Ma... | [
"private",
"void",
"updateIndicesAfterLogTruncation",
"(",
"TaskAttemptID",
"firstAttempt",
",",
"Map",
"<",
"Task",
",",
"Map",
"<",
"LogName",
",",
"LogFileDetail",
">",
">",
"updatedTaskLogFileDetails",
")",
"{",
"for",
"(",
"Entry",
"<",
"Task",
",",
"Map",
... | Truncation of logs is done. Now sync the index files to reflect the
truncated sizes.
@param firstAttempt
@param updatedTaskLogFileDetails | [
"Truncation",
"of",
"logs",
"is",
"done",
".",
"Now",
"sync",
"the",
"index",
"files",
"to",
"reflect",
"the",
"truncated",
"sizes",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskLogsMonitor.java#L373-L403 |
119,218 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java | CombineFileInputFormat.getStatsString | private String getStatsString() {
SplitTypeStats allTypeStats = splitTypeStatsMap.get(SplitType.ALL);
Map<String, Map<String, Number>> statsMapMap =
new HashMap<String, Map<String, Number>>();
for (Map.Entry<SplitType, SplitTypeStats> entry :
splitTypeStatsMap.entrySet()) {
Map<String, N... | java | private String getStatsString() {
SplitTypeStats allTypeStats = splitTypeStatsMap.get(SplitType.ALL);
Map<String, Map<String, Number>> statsMapMap =
new HashMap<String, Map<String, Number>>();
for (Map.Entry<SplitType, SplitTypeStats> entry :
splitTypeStatsMap.entrySet()) {
Map<String, N... | [
"private",
"String",
"getStatsString",
"(",
")",
"{",
"SplitTypeStats",
"allTypeStats",
"=",
"splitTypeStatsMap",
".",
"get",
"(",
"SplitType",
".",
"ALL",
")",
";",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Number",
">",
">",
"statsMapMap",
"... | Get stats for every split type as a string
@return String of all split type stats | [
"Get",
"stats",
"for",
"every",
"split",
"type",
"as",
"a",
"string"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java#L187-L226 |
119,219 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java | CombineFileInputFormat.createPool | protected void createPool(JobConf conf, List<PathFilter> filters) {
pools.add(new MultiPathFilter(filters));
} | java | protected void createPool(JobConf conf, List<PathFilter> filters) {
pools.add(new MultiPathFilter(filters));
} | [
"protected",
"void",
"createPool",
"(",
"JobConf",
"conf",
",",
"List",
"<",
"PathFilter",
">",
"filters",
")",
"{",
"pools",
".",
"add",
"(",
"new",
"MultiPathFilter",
"(",
"filters",
")",
")",
";",
"}"
] | Create a new pool and add the filters to it.
A split cannot have files from different pools. | [
"Create",
"a",
"new",
"pool",
"and",
"add",
"the",
"filters",
"to",
"it",
".",
"A",
"split",
"cannot",
"have",
"files",
"from",
"different",
"pools",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java#L269-L271 |
119,220 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java | CombineFileInputFormat.sortBlocksBySize | private void sortBlocksBySize(Map<String, List<OneBlockInfo>> nodeToBlocks) {
OneBlockInfoSizeComparator comparator = new OneBlockInfoSizeComparator();
for (Entry<String, List<OneBlockInfo>> entry : nodeToBlocks.entrySet()) {
Collections.sort(entry.getValue(), comparator);
}
} | java | private void sortBlocksBySize(Map<String, List<OneBlockInfo>> nodeToBlocks) {
OneBlockInfoSizeComparator comparator = new OneBlockInfoSizeComparator();
for (Entry<String, List<OneBlockInfo>> entry : nodeToBlocks.entrySet()) {
Collections.sort(entry.getValue(), comparator);
}
} | [
"private",
"void",
"sortBlocksBySize",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"OneBlockInfo",
">",
">",
"nodeToBlocks",
")",
"{",
"OneBlockInfoSizeComparator",
"comparator",
"=",
"new",
"OneBlockInfoSizeComparator",
"(",
")",
";",
"for",
"(",
"Entry",
"<",... | Sort the blocks on each node by size, largest to smallest
@param nodeToBlocks Map of nodes to all blocks on that node | [
"Sort",
"the",
"blocks",
"on",
"each",
"node",
"by",
"size",
"largest",
"to",
"smallest"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java#L456-L461 |
119,221 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.updateMetrics | public void updateMetrics() {
Counters counters = getCounters();
for (Counters.Group group : counters) {
jobMetrics.setTag("group", group.getDisplayName());
for (Counters.Counter counter : group) {
jobMetrics.setTag("counter", counter.getDisplayName());
jobMetrics.setMetric("value", ... | java | public void updateMetrics() {
Counters counters = getCounters();
for (Counters.Group group : counters) {
jobMetrics.setTag("group", group.getDisplayName());
for (Counters.Counter counter : group) {
jobMetrics.setTag("counter", counter.getDisplayName());
jobMetrics.setMetric("value", ... | [
"public",
"void",
"updateMetrics",
"(",
")",
"{",
"Counters",
"counters",
"=",
"getCounters",
"(",
")",
";",
"for",
"(",
"Counters",
".",
"Group",
"group",
":",
"counters",
")",
"{",
"jobMetrics",
".",
"setTag",
"(",
"\"group\"",
",",
"group",
".",
"getD... | Called periodically by JobTrackerMetrics to update the metrics for
this job. | [
"Called",
"periodically",
"by",
"JobTrackerMetrics",
"to",
"update",
"the",
"metrics",
"for",
"this",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L576-L586 |
119,222 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.getTasks | TaskInProgress[] getTasks(TaskType type) {
TaskInProgress[] tasks = null;
switch (type) {
case MAP:
{
tasks = maps;
}
break;
case REDUCE:
{
tasks = reduces;
}
break;
case JOB_SETUP:
{
tasks = setup;
}... | java | TaskInProgress[] getTasks(TaskType type) {
TaskInProgress[] tasks = null;
switch (type) {
case MAP:
{
tasks = maps;
}
break;
case REDUCE:
{
tasks = reduces;
}
break;
case JOB_SETUP:
{
tasks = setup;
}... | [
"TaskInProgress",
"[",
"]",
"getTasks",
"(",
"TaskType",
"type",
")",
"{",
"TaskInProgress",
"[",
"]",
"tasks",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"MAP",
":",
"{",
"tasks",
"=",
"maps",
";",
"}",
"break",
";",
"case",
"REDUCE"... | Get all the tasks of the desired type in this job.
@param type {@link TaskType} of the tasks required
@return An array of {@link TaskInProgress} matching the given type.
Returns an empty array if no tasks are found for the given type. | [
"Get",
"all",
"the",
"tasks",
"of",
"the",
"desired",
"type",
"in",
"this",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1036-L1067 |
119,223 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.canLaunchJobCleanupTask | private synchronized boolean canLaunchJobCleanupTask() {
// check if the job is running
if (status.getRunState() != JobStatus.RUNNING &&
status.getRunState() != JobStatus.PREP) {
return false;
}
// check if cleanup task has been launched already or if setup isn't
// launched already. T... | java | private synchronized boolean canLaunchJobCleanupTask() {
// check if the job is running
if (status.getRunState() != JobStatus.RUNNING &&
status.getRunState() != JobStatus.PREP) {
return false;
}
// check if cleanup task has been launched already or if setup isn't
// launched already. T... | [
"private",
"synchronized",
"boolean",
"canLaunchJobCleanupTask",
"(",
")",
"{",
"// check if the job is running",
"if",
"(",
"status",
".",
"getRunState",
"(",
")",
"!=",
"JobStatus",
".",
"RUNNING",
"&&",
"status",
".",
"getRunState",
"(",
")",
"!=",
"JobStatus",... | Check whether cleanup task can be launched for the job.
Cleanup task can be launched if it is not already launched
or job is Killed
or all maps and reduces are complete
@return true/false | [
"Check",
"whether",
"cleanup",
"task",
"can",
"be",
"launched",
"for",
"the",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1601-L1629 |
119,224 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.canLaunchSetupTask | private synchronized boolean canLaunchSetupTask() {
return (tasksInited.get() && status.getRunState() == JobStatus.PREP &&
!launchedSetup && !jobKilled && !jobFailed);
} | java | private synchronized boolean canLaunchSetupTask() {
return (tasksInited.get() && status.getRunState() == JobStatus.PREP &&
!launchedSetup && !jobKilled && !jobFailed);
} | [
"private",
"synchronized",
"boolean",
"canLaunchSetupTask",
"(",
")",
"{",
"return",
"(",
"tasksInited",
".",
"get",
"(",
")",
"&&",
"status",
".",
"getRunState",
"(",
")",
"==",
"JobStatus",
".",
"PREP",
"&&",
"!",
"launchedSetup",
"&&",
"!",
"jobKilled",
... | Check whether setup task can be launched for the job.
Setup task can be launched after the tasks are inited
and Job is in PREP state
and if it is not already launched
or job is not Killed/Failed
@return true/false | [
"Check",
"whether",
"setup",
"task",
"can",
"be",
"launched",
"for",
"the",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1697-L1700 |
119,225 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.obtainNewReduceTask | public synchronized Task obtainNewReduceTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts
) throws IOException {
if (status.getRunState() != JobStatus.RUNNING) {
... | java | public synchronized Task obtainNewReduceTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts
) throws IOException {
if (status.getRunState() != JobStatus.RUNNING) {
... | [
"public",
"synchronized",
"Task",
"obtainNewReduceTask",
"(",
"TaskTrackerStatus",
"tts",
",",
"int",
"clusterSize",
",",
"int",
"numUniqueHosts",
")",
"throws",
"IOException",
"{",
"if",
"(",
"status",
".",
"getRunState",
"(",
")",
"!=",
"JobStatus",
".",
"RUNN... | Return a ReduceTask, if appropriate, to run on the given tasktracker.
We don't have cache-sensitivity for reduce tasks, as they
work on temporary MapRed files. | [
"Return",
"a",
"ReduceTask",
"if",
"appropriate",
"to",
"run",
"on",
"the",
"given",
"tasktracker",
".",
"We",
"don",
"t",
"have",
"cache",
"-",
"sensitivity",
"for",
"reduce",
"tasks",
"as",
"they",
"work",
"on",
"temporary",
"MapRed",
"files",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1708-L1734 |
119,226 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.getBlackListedTrackers | Map<String, List<String>> getBlackListedTrackers() {
Map<String, List<String>> blackListedTrackers
= new HashMap<String, List<String>>();
for (Map.Entry<String,List<String>> e : trackerToFailuresMap.entrySet()) {
if (e.getValue().size() >= maxTaskFailuresPerTracker) {
blackListedTracke... | java | Map<String, List<String>> getBlackListedTrackers() {
Map<String, List<String>> blackListedTrackers
= new HashMap<String, List<String>>();
for (Map.Entry<String,List<String>> e : trackerToFailuresMap.entrySet()) {
if (e.getValue().size() >= maxTaskFailuresPerTracker) {
blackListedTracke... | [
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getBlackListedTrackers",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"blackListedTrackers",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"String",
">... | Get the black listed trackers for the job and corresponding errors.
@return Map of blacklisted tracker names and the errors for each tracker
that triggered blacklisting | [
"Get",
"the",
"black",
"listed",
"trackers",
"for",
"the",
"job",
"and",
"corresponding",
"errors",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2003-L2014 |
119,227 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.getTaskTrackerErrors | synchronized Map<String, List<String>> getTaskTrackerErrors() {
// Clone the 'trackerToFailuresMap' and return the copy
Map<String, List<String>> trackerErrors =
new TreeMap<String, List<String>>(trackerToFailuresMap);
return trackerErrors;
} | java | synchronized Map<String, List<String>> getTaskTrackerErrors() {
// Clone the 'trackerToFailuresMap' and return the copy
Map<String, List<String>> trackerErrors =
new TreeMap<String, List<String>>(trackerToFailuresMap);
return trackerErrors;
} | [
"synchronized",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getTaskTrackerErrors",
"(",
")",
"{",
"// Clone the 'trackerToFailuresMap' and return the copy",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"trackerErrors",
"=",
"new",
... | Get the information on tasktrackers and no. of errors which occurred
on them for a given job.
@return the map of tasktrackers and no. of errors which occurred
on them for a given job. | [
"Get",
"the",
"information",
"on",
"tasktrackers",
"and",
"no",
".",
"of",
"errors",
"which",
"occurred",
"on",
"them",
"for",
"a",
"given",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2032-L2037 |
119,228 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.scheduleMap | protected synchronized void scheduleMap(TaskInProgress tip) {
runningMapTaskStats.add(0.0f);
runningTaskMapByteProcessingRateStats.add(0.0f);
if (runningMapCache == null) {
LOG.warn("Running cache for maps is missing!! "
+ "Job details are missing.");
return;
}
String[] sp... | java | protected synchronized void scheduleMap(TaskInProgress tip) {
runningMapTaskStats.add(0.0f);
runningTaskMapByteProcessingRateStats.add(0.0f);
if (runningMapCache == null) {
LOG.warn("Running cache for maps is missing!! "
+ "Job details are missing.");
return;
}
String[] sp... | [
"protected",
"synchronized",
"void",
"scheduleMap",
"(",
"TaskInProgress",
"tip",
")",
"{",
"runningMapTaskStats",
".",
"add",
"(",
"0.0f",
")",
";",
"runningTaskMapByteProcessingRateStats",
".",
"add",
"(",
"0.0f",
")",
";",
"if",
"(",
"runningMapCache",
"==",
... | Adds a map tip to the list of running maps.
@param tip the tip that needs to be scheduled as running | [
"Adds",
"a",
"map",
"tip",
"to",
"the",
"list",
"of",
"running",
"maps",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2095-L2125 |
119,229 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.scheduleReduce | protected synchronized void scheduleReduce(TaskInProgress tip) {
runningReduceTaskStats.add(0.0f);
runningTaskCopyProcessingRateStats.add(0.0f);
runningTaskSortProcessingRateStats.add(0.0f);
runningTaskReduceProcessingRateStats.add(0.0f);
if (runningReduces == null) {
LOG.warn("Running cache f... | java | protected synchronized void scheduleReduce(TaskInProgress tip) {
runningReduceTaskStats.add(0.0f);
runningTaskCopyProcessingRateStats.add(0.0f);
runningTaskSortProcessingRateStats.add(0.0f);
runningTaskReduceProcessingRateStats.add(0.0f);
if (runningReduces == null) {
LOG.warn("Running cache f... | [
"protected",
"synchronized",
"void",
"scheduleReduce",
"(",
"TaskInProgress",
"tip",
")",
"{",
"runningReduceTaskStats",
".",
"add",
"(",
"0.0f",
")",
";",
"runningTaskCopyProcessingRateStats",
".",
"add",
"(",
"0.0f",
")",
";",
"runningTaskSortProcessingRateStats",
"... | Adds a reduce tip to the list of running reduces
@param tip the tip that needs to be scheduled as running | [
"Adds",
"a",
"reduce",
"tip",
"to",
"the",
"list",
"of",
"running",
"reduces"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2131-L2142 |
119,230 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.findNewReduceTask | private synchronized int findNewReduceTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts) {
if (numReduceTasks == 0) {
if(LOG.isDebugEnabled()) {
LOG.debug("No reduces to schedule for " + profile.get... | java | private synchronized int findNewReduceTask(TaskTrackerStatus tts,
int clusterSize,
int numUniqueHosts) {
if (numReduceTasks == 0) {
if(LOG.isDebugEnabled()) {
LOG.debug("No reduces to schedule for " + profile.get... | [
"private",
"synchronized",
"int",
"findNewReduceTask",
"(",
"TaskTrackerStatus",
"tts",
",",
"int",
"clusterSize",
",",
"int",
"numUniqueHosts",
")",
"{",
"if",
"(",
"numReduceTasks",
"==",
"0",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")... | Find new reduce task
@param tts The task tracker that is asking for a task
@param clusterSize The number of task trackers in the cluster
@param numUniqueHosts The number of hosts that run task trackers
@param avgProgress The average progress of this kind of task in this job
@return the index in tasks of the selected ta... | [
"Find",
"new",
"reduce",
"task"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L2584-L2635 |
119,231 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.kill | public void kill() {
boolean killNow = false;
synchronized(jobInitKillStatus) {
jobInitKillStatus.killed = true;
//if not in middle of init, terminate it now
if(!jobInitKillStatus.initStarted || jobInitKillStatus.initDone) {
//avoiding nested locking by setting flag
killNow = t... | java | public void kill() {
boolean killNow = false;
synchronized(jobInitKillStatus) {
jobInitKillStatus.killed = true;
//if not in middle of init, terminate it now
if(!jobInitKillStatus.initStarted || jobInitKillStatus.initDone) {
//avoiding nested locking by setting flag
killNow = t... | [
"public",
"void",
"kill",
"(",
")",
"{",
"boolean",
"killNow",
"=",
"false",
";",
"synchronized",
"(",
"jobInitKillStatus",
")",
"{",
"jobInitKillStatus",
".",
"killed",
"=",
"true",
";",
"//if not in middle of init, terminate it now",
"if",
"(",
"!",
"jobInitKill... | Kill the job and all its component tasks. This method should be called from
jobtracker and should return fast as it locks the jobtracker. | [
"Kill",
"the",
"job",
"and",
"all",
"its",
"component",
"tasks",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"jobtracker",
"and",
"should",
"return",
"fast",
"as",
"it",
"locks",
"the",
"jobtracker",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3068-L3081 |
119,232 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.garbageCollect | synchronized void garbageCollect() {
// Cancel task tracker reservation
cancelReservedSlots();
// Remove the remaining speculative tasks counts
totalSpeculativeReduceTasks.addAndGet(-speculativeReduceTasks);
totalSpeculativeMapTasks.addAndGet(-speculativeMapTasks);
garbageCollected = true;
... | java | synchronized void garbageCollect() {
// Cancel task tracker reservation
cancelReservedSlots();
// Remove the remaining speculative tasks counts
totalSpeculativeReduceTasks.addAndGet(-speculativeReduceTasks);
totalSpeculativeMapTasks.addAndGet(-speculativeMapTasks);
garbageCollected = true;
... | [
"synchronized",
"void",
"garbageCollect",
"(",
")",
"{",
"// Cancel task tracker reservation",
"cancelReservedSlots",
"(",
")",
";",
"// Remove the remaining speculative tasks counts",
"totalSpeculativeReduceTasks",
".",
"addAndGet",
"(",
"-",
"speculativeReduceTasks",
")",
";"... | The job is dead. We're now GC'ing it, getting rid of the job
from all tables. Be sure to remove all of this job's tasks
from the various tables. | [
"The",
"job",
"is",
"dead",
".",
"We",
"re",
"now",
"GC",
"ing",
"it",
"getting",
"rid",
"of",
"the",
"job",
"from",
"all",
"tables",
".",
"Be",
"sure",
"to",
"remove",
"all",
"of",
"this",
"job",
"s",
"tasks",
"from",
"the",
"various",
"tables",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3376-L3422 |
119,233 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.findFinishedMap | public synchronized TaskStatus findFinishedMap(int mapId) {
TaskInProgress tip = maps[mapId];
if (tip.isComplete()) {
TaskStatus[] statuses = tip.getTaskStatuses();
for(int i=0; i < statuses.length; i++) {
if (statuses[i].getRunState() == TaskStatus.State.SUCCEEDED) {
return status... | java | public synchronized TaskStatus findFinishedMap(int mapId) {
TaskInProgress tip = maps[mapId];
if (tip.isComplete()) {
TaskStatus[] statuses = tip.getTaskStatuses();
for(int i=0; i < statuses.length; i++) {
if (statuses[i].getRunState() == TaskStatus.State.SUCCEEDED) {
return status... | [
"public",
"synchronized",
"TaskStatus",
"findFinishedMap",
"(",
"int",
"mapId",
")",
"{",
"TaskInProgress",
"tip",
"=",
"maps",
"[",
"mapId",
"]",
";",
"if",
"(",
"tip",
".",
"isComplete",
"(",
")",
")",
"{",
"TaskStatus",
"[",
"]",
"statuses",
"=",
"tip... | Find the details of someplace where a map has finished
@param mapId the id of the map
@return the task status of the completed task | [
"Find",
"the",
"details",
"of",
"someplace",
"where",
"a",
"map",
"has",
"finished"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3434-L3445 |
119,234 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.atSpeculativeCap | private boolean atSpeculativeCap(TaskType type) {
float numTasks = (type == TaskType.MAP) ?
(float)(runningMapTasks - speculativeMapTasks) :
(float)(runningReduceTasks - speculativeReduceTasks);
if (numTasks == 0){
return true; // avoid divide by zero
}
int speculativeTaskCount ... | java | private boolean atSpeculativeCap(TaskType type) {
float numTasks = (type == TaskType.MAP) ?
(float)(runningMapTasks - speculativeMapTasks) :
(float)(runningReduceTasks - speculativeReduceTasks);
if (numTasks == 0){
return true; // avoid divide by zero
}
int speculativeTaskCount ... | [
"private",
"boolean",
"atSpeculativeCap",
"(",
"TaskType",
"type",
")",
"{",
"float",
"numTasks",
"=",
"(",
"type",
"==",
"TaskType",
".",
"MAP",
")",
"?",
"(",
"float",
")",
"(",
"runningMapTasks",
"-",
"speculativeMapTasks",
")",
":",
"(",
"float",
")",
... | Check to see if the maximum number of speculative tasks are
already being executed currently.
@param tasks the set of tasks to test
@param type the type of task (MAP/REDUCE) that we are considering
@return has the cap been reached? | [
"Check",
"to",
"see",
"if",
"the",
"maximum",
"number",
"of",
"speculative",
"tasks",
"are",
"already",
"being",
"executed",
"currently",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3646-L3679 |
119,235 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.isSlowTracker | protected boolean isSlowTracker(String taskTracker) {
if (trackerMapStats.get(taskTracker) != null &&
trackerMapStats.get(taskTracker).mean() -
mapTaskStats.mean() > mapTaskStats.std()*slowNodeThreshold) {
if (LOG.isDebugEnabled()) {
LOG.debug("Tracker " + taskTracker +
" d... | java | protected boolean isSlowTracker(String taskTracker) {
if (trackerMapStats.get(taskTracker) != null &&
trackerMapStats.get(taskTracker).mean() -
mapTaskStats.mean() > mapTaskStats.std()*slowNodeThreshold) {
if (LOG.isDebugEnabled()) {
LOG.debug("Tracker " + taskTracker +
" d... | [
"protected",
"boolean",
"isSlowTracker",
"(",
"String",
"taskTracker",
")",
"{",
"if",
"(",
"trackerMapStats",
".",
"get",
"(",
"taskTracker",
")",
"!=",
"null",
"&&",
"trackerMapStats",
".",
"get",
"(",
"taskTracker",
")",
".",
"mean",
"(",
")",
"-",
"map... | Compares the ave progressRate of tasks that have finished on this
taskTracker to the ave of all succesfull tasks thus far to see if this
TT one is too slow for speculating.
slowNodeThreshold is used to determine the number of standard deviations
@param taskTracker the name of the TaskTracker we are checking
@return is ... | [
"Compares",
"the",
"ave",
"progressRate",
"of",
"tasks",
"that",
"have",
"finished",
"on",
"this",
"taskTracker",
"to",
"the",
"ave",
"of",
"all",
"succesfull",
"tasks",
"thus",
"far",
"to",
"see",
"if",
"this",
"TT",
"one",
"is",
"too",
"slow",
"for",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3732-L3754 |
119,236 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.refresh | void refresh(long now) {
refreshCandidateSpeculativeMaps(now);
refreshCandidateSpeculativeReduces(now);
refreshTaskCountsAndWaitTime(TaskType.MAP, now);
refreshTaskCountsAndWaitTime(TaskType.REDUCE, now);
} | java | void refresh(long now) {
refreshCandidateSpeculativeMaps(now);
refreshCandidateSpeculativeReduces(now);
refreshTaskCountsAndWaitTime(TaskType.MAP, now);
refreshTaskCountsAndWaitTime(TaskType.REDUCE, now);
} | [
"void",
"refresh",
"(",
"long",
"now",
")",
"{",
"refreshCandidateSpeculativeMaps",
"(",
"now",
")",
";",
"refreshCandidateSpeculativeReduces",
"(",
"now",
")",
";",
"refreshTaskCountsAndWaitTime",
"(",
"TaskType",
".",
"MAP",
",",
"now",
")",
";",
"refreshTaskCou... | Refresh speculative task candidates and running tasks. This needs to be
called periodically to obtain fresh values. | [
"Refresh",
"speculative",
"task",
"candidates",
"and",
"running",
"tasks",
".",
"This",
"needs",
"to",
"be",
"called",
"periodically",
"to",
"obtain",
"fresh",
"values",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3836-L3841 |
119,237 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.refreshTaskCountsAndWaitTime | protected void refreshTaskCountsAndWaitTime(TaskType type, long now) {
TaskInProgress[] allTips = getTasks(type);
int finishedTips = 0;
int runningTips = 0;
int runningTaskAttempts = 0;
long totalWaitTime = 0;
long jobStartTime = this.getStartTime();
for (TaskInProgress tip : allTips) {
... | java | protected void refreshTaskCountsAndWaitTime(TaskType type, long now) {
TaskInProgress[] allTips = getTasks(type);
int finishedTips = 0;
int runningTips = 0;
int runningTaskAttempts = 0;
long totalWaitTime = 0;
long jobStartTime = this.getStartTime();
for (TaskInProgress tip : allTips) {
... | [
"protected",
"void",
"refreshTaskCountsAndWaitTime",
"(",
"TaskType",
"type",
",",
"long",
"now",
")",
"{",
"TaskInProgress",
"[",
"]",
"allTips",
"=",
"getTasks",
"(",
"type",
")",
";",
"int",
"finishedTips",
"=",
"0",
";",
"int",
"runningTips",
"=",
"0",
... | Refresh runningTasks, neededTasks and pendingTasks counters
@param type TaskType to refresh | [
"Refresh",
"runningTasks",
"neededTasks",
"and",
"pendingTasks",
"counters"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L3847-L3882 |
119,238 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/server/jobtracker/JobTrackerJspHelper.java | JobTrackerJspHelper.generateSummaryTable | public void generateSummaryTable(JspWriter out,
JobTracker tracker) throws IOException {
ClusterStatus status = tracker.getClusterStatus();
int maxMapTasks = status.getMaxMapTasks();
int maxReduceTasks = status.getMaxReduceTasks();
int numTaskTrackers = status.getTaskT... | java | public void generateSummaryTable(JspWriter out,
JobTracker tracker) throws IOException {
ClusterStatus status = tracker.getClusterStatus();
int maxMapTasks = status.getMaxMapTasks();
int maxReduceTasks = status.getMaxReduceTasks();
int numTaskTrackers = status.getTaskT... | [
"public",
"void",
"generateSummaryTable",
"(",
"JspWriter",
"out",
",",
"JobTracker",
"tracker",
")",
"throws",
"IOException",
"{",
"ClusterStatus",
"status",
"=",
"tracker",
".",
"getClusterStatus",
"(",
")",
";",
"int",
"maxMapTasks",
"=",
"status",
".",
"getM... | Generates an XML-formatted block that summarizes the state of the JobTracker. | [
"Generates",
"an",
"XML",
"-",
"formatted",
"block",
"that",
"summarizes",
"the",
"state",
"of",
"the",
"JobTracker",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/server/jobtracker/JobTrackerJspHelper.java#L85-L105 |
119,239 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/TaskAttemptID.java | TaskAttemptID.appendTo | protected StringBuilder appendTo(StringBuilder builder) {
return taskId.appendTo(builder).append(SEPARATOR).append(id);
} | java | protected StringBuilder appendTo(StringBuilder builder) {
return taskId.appendTo(builder).append(SEPARATOR).append(id);
} | [
"protected",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"builder",
")",
"{",
"return",
"taskId",
".",
"appendTo",
"(",
"builder",
")",
".",
"append",
"(",
"SEPARATOR",
")",
".",
"append",
"(",
"id",
")",
";",
"}"
] | Add the unique string to the StringBuilder
@param builder the builder to append ot
@return the builder that was passed in. | [
"Add",
"the",
"unique",
"string",
"to",
"the",
"StringBuilder"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/TaskAttemptID.java#L108-L110 |
119,240 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/TaskAttemptID.java | TaskAttemptID.compareTo | @Override
public int compareTo(ID o) {
TaskAttemptID that = (TaskAttemptID)o;
int tipComp = this.taskId.compareTo(that.taskId);
if(tipComp == 0) {
return this.id - that.id;
}
else return tipComp;
} | java | @Override
public int compareTo(ID o) {
TaskAttemptID that = (TaskAttemptID)o;
int tipComp = this.taskId.compareTo(that.taskId);
if(tipComp == 0) {
return this.id - that.id;
}
else return tipComp;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"ID",
"o",
")",
"{",
"TaskAttemptID",
"that",
"=",
"(",
"TaskAttemptID",
")",
"o",
";",
"int",
"tipComp",
"=",
"this",
".",
"taskId",
".",
"compareTo",
"(",
"that",
".",
"taskId",
")",
";",
"if",
"(... | Compare TaskIds by first tipIds, then by task numbers. | [
"Compare",
"TaskIds",
"by",
"first",
"tipIds",
"then",
"by",
"task",
"numbers",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/TaskAttemptID.java#L130-L138 |
119,241 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeShare | public static void distributeShare(
double total, final Collection<? extends Schedulable> schedulables,
ScheduleComparator comparator) {
switch (comparator) {
case FIFO:
case DEADLINE:
Schedulable.distributeShareSorted(total, schedulables, comparator);
break;
case FAIR:
Sch... | java | public static void distributeShare(
double total, final Collection<? extends Schedulable> schedulables,
ScheduleComparator comparator) {
switch (comparator) {
case FIFO:
case DEADLINE:
Schedulable.distributeShareSorted(total, schedulables, comparator);
break;
case FAIR:
Sch... | [
"public",
"static",
"void",
"distributeShare",
"(",
"double",
"total",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
",",
"ScheduleComparator",
"comparator",
")",
"{",
"switch",
"(",
"comparator",
")",
"{",
"case",
"FIFO",
... | Distribute the shares among the schedulables based on the comparator
@param total the total share to distribute
@param schedulables the list of schedulables
@param comparator the comparator to use when distributing the share | [
"Distribute",
"the",
"shares",
"among",
"the",
"schedulables",
"based",
"on",
"the",
"comparator"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L170-L187 |
119,242 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeShareSorted | private static void distributeShareSorted(
double total, final Collection<? extends Schedulable> schedulables,
ScheduleComparator comparator) {
List<Schedulable> sches = new ArrayList<Schedulable>(schedulables);
Collections.sort(sches, comparator);
for (Schedulable schedulable : sches) {
i... | java | private static void distributeShareSorted(
double total, final Collection<? extends Schedulable> schedulables,
ScheduleComparator comparator) {
List<Schedulable> sches = new ArrayList<Schedulable>(schedulables);
Collections.sort(sches, comparator);
for (Schedulable schedulable : sches) {
i... | [
"private",
"static",
"void",
"distributeShareSorted",
"(",
"double",
"total",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
",",
"ScheduleComparator",
"comparator",
")",
"{",
"List",
"<",
"Schedulable",
">",
"sches",
"=",
"... | Distribute the share among Schedulables in a greedy manner when
they are sorted based on some comparator and the first Schedulable
has to be fully satisfied before the next one can get any resources
@param total the total amount of share to be distributed
@param schedulables a collection of schedulables to get the sha... | [
"Distribute",
"the",
"share",
"among",
"Schedulables",
"in",
"a",
"greedy",
"manner",
"when",
"they",
"are",
"sorted",
"based",
"on",
"some",
"comparator",
"and",
"the",
"first",
"Schedulable",
"has",
"to",
"be",
"fully",
"satisfied",
"before",
"the",
"next",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L198-L213 |
119,243 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeShareFair | private static void distributeShareFair(
double total, final Collection<? extends Schedulable> schedulables) {
BinarySearcher searcher = new BinarySearcher() {
@Override
protected double targetFunction(double x) {
return totalShareWithRatio(schedulables, x);
}
};
double ratio... | java | private static void distributeShareFair(
double total, final Collection<? extends Schedulable> schedulables) {
BinarySearcher searcher = new BinarySearcher() {
@Override
protected double targetFunction(double x) {
return totalShareWithRatio(schedulables, x);
}
};
double ratio... | [
"private",
"static",
"void",
"distributeShareFair",
"(",
"double",
"total",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
")",
"{",
"BinarySearcher",
"searcher",
"=",
"new",
"BinarySearcher",
"(",
")",
"{",
"@",
"Override",... | Distribute the total share among the list of schedulables according to the
FAIR model.
Finds a way to distribute the share in such a way that all the
min and max reservations of the schedulables are satisfied
@param total the share to be distributed
@param schedulables the list of schedulables | [
"Distribute",
"the",
"total",
"share",
"among",
"the",
"list",
"of",
"schedulables",
"according",
"to",
"the",
"FAIR",
"model",
".",
"Finds",
"a",
"way",
"to",
"distribute",
"the",
"share",
"in",
"such",
"a",
"way",
"that",
"all",
"the",
"min",
"and",
"m... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L223-L235 |
119,244 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.totalShareWithRatio | private static double totalShareWithRatio(
Collection<? extends Schedulable> schedulables,
double weightToShareRatio) {
double totalShare = 0;
for (Schedulable schedulable : schedulables) {
totalShare += shareWithRatio(schedulable, weightToShareRatio);
}
return totalShare;
} | java | private static double totalShareWithRatio(
Collection<? extends Schedulable> schedulables,
double weightToShareRatio) {
double totalShare = 0;
for (Schedulable schedulable : schedulables) {
totalShare += shareWithRatio(schedulable, weightToShareRatio);
}
return totalShare;
} | [
"private",
"static",
"double",
"totalShareWithRatio",
"(",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
",",
"double",
"weightToShareRatio",
")",
"{",
"double",
"totalShare",
"=",
"0",
";",
"for",
"(",
"Schedulable",
"schedulable",
":",
... | Compute the total share of the schedulables given a weightToShareRatio
@param schedulables the list of schedulables to compute the share for
@param weightToShareRatio the weightToShareRatio to compute it for
@return the total share of all the schedulables for a given
weightToShareRatio | [
"Compute",
"the",
"total",
"share",
"of",
"the",
"schedulables",
"given",
"a",
"weightToShareRatio"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L244-L252 |
119,245 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.shareWithRatio | private static double shareWithRatio(
Schedulable schedulable, double weightToShareRatio) {
double share = schedulable.getWeight() * weightToShareRatio;
int min = schedulable.getMinimum();
int max = schedulable.getMaximum();
int requested = schedulable.getRequested();
share = Math.max(min, sha... | java | private static double shareWithRatio(
Schedulable schedulable, double weightToShareRatio) {
double share = schedulable.getWeight() * weightToShareRatio;
int min = schedulable.getMinimum();
int max = schedulable.getMaximum();
int requested = schedulable.getRequested();
share = Math.max(min, sha... | [
"private",
"static",
"double",
"shareWithRatio",
"(",
"Schedulable",
"schedulable",
",",
"double",
"weightToShareRatio",
")",
"{",
"double",
"share",
"=",
"schedulable",
".",
"getWeight",
"(",
")",
"*",
"weightToShareRatio",
";",
"int",
"min",
"=",
"schedulable",
... | Get the share of the schedulable given a weightToShareRatio.
This takes into account the min and the max allocation and is used
to compute the weightToShareRatio globally
@param schedulable the schedulable to compute the share for
@param weightToShareRatio the multiplier for the weight of the schedulable
@return the sh... | [
"Get",
"the",
"share",
"of",
"the",
"schedulable",
"given",
"a",
"weightToShareRatio",
".",
"This",
"takes",
"into",
"account",
"the",
"min",
"and",
"the",
"max",
"allocation",
"and",
"is",
"used",
"to",
"compute",
"the",
"weightToShareRatio",
"globally"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L262-L272 |
119,246 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.assignShareIfUnderAllocated | private static double assignShareIfUnderAllocated(
double totalShare,
final Collection<? extends Schedulable> schedulables) {
double totalMinDemand = 0;
for (Schedulable schedulable : schedulables) {
schedulable.share = 0;
totalMinDemand += Math.min(schedulable.getRequested(),
... | java | private static double assignShareIfUnderAllocated(
double totalShare,
final Collection<? extends Schedulable> schedulables) {
double totalMinDemand = 0;
for (Schedulable schedulable : schedulables) {
schedulable.share = 0;
totalMinDemand += Math.min(schedulable.getRequested(),
... | [
"private",
"static",
"double",
"assignShareIfUnderAllocated",
"(",
"double",
"totalShare",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
")",
"{",
"double",
"totalMinDemand",
"=",
"0",
";",
"for",
"(",
"Schedulable",
"schedul... | Assign fair share if total share < min demand.
@param totalShare The share to be distributed.
@param schedulables The collection of schedulables
@return Excess share after assigning the min demand to each schedulable. | [
"Assign",
"fair",
"share",
"if",
"total",
"share",
"<",
"min",
"demand",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L281-L297 |
119,247 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.generatePriorityGroupedSchedulables | private static TreeMap<Integer, Vector<Schedulable>>
generatePriorityGroupedSchedulables(
final Collection<? extends Schedulable> schedulables) {
TreeMap<Integer, Vector<Schedulable>> prioritizedSchedulableMap =
new TreeMap<Integer, Vector<Schedulable>>();
for (Schedulable schedulable : s... | java | private static TreeMap<Integer, Vector<Schedulable>>
generatePriorityGroupedSchedulables(
final Collection<? extends Schedulable> schedulables) {
TreeMap<Integer, Vector<Schedulable>> prioritizedSchedulableMap =
new TreeMap<Integer, Vector<Schedulable>>();
for (Schedulable schedulable : s... | [
"private",
"static",
"TreeMap",
"<",
"Integer",
",",
"Vector",
"<",
"Schedulable",
">",
">",
"generatePriorityGroupedSchedulables",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"Ve... | Group a collection of schedulables into priority groups
sorted by priority.
@param schedulables Collection of schedulables
@return Sorted map of priority to vector of schedulables
(lowest priority first) | [
"Group",
"a",
"collection",
"of",
"schedulables",
"into",
"priority",
"groups",
"sorted",
"by",
"priority",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L307-L321 |
119,248 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeSharePriority | private static void distributeSharePriority(
double total, final Collection<? extends Schedulable> schedulables) {
// 1) If share < sum(min(demand, min_alloc)) then do fair share and quit.
double residualShare = assignShareIfUnderAllocated(total, schedulables);
if (residualShare <= 0.0) {
retur... | java | private static void distributeSharePriority(
double total, final Collection<? extends Schedulable> schedulables) {
// 1) If share < sum(min(demand, min_alloc)) then do fair share and quit.
double residualShare = assignShareIfUnderAllocated(total, schedulables);
if (residualShare <= 0.0) {
retur... | [
"private",
"static",
"void",
"distributeSharePriority",
"(",
"double",
"total",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulables",
")",
"{",
"// 1) If share < sum(min(demand, min_alloc)) then do fair share and quit.",
"double",
"residualShare... | Distribute the total share among the list of schedulables according to the
PRIORITY model. Note that the eventual intent is to determine if
preemption is necessary. So, we need to assign the most ideal share on
each schedulable beyond which preemption is necessary.
Finds a way to distribute the share in such a way that... | [
"Distribute",
"the",
"total",
"share",
"among",
"the",
"list",
"of",
"schedulables",
"according",
"to",
"the",
"PRIORITY",
"model",
".",
"Note",
"that",
"the",
"eventual",
"intent",
"is",
"to",
"determine",
"if",
"preemption",
"is",
"necessary",
".",
"So",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L386-L401 |
119,249 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeShareMin | private static void distributeShareMin(
Collection<? extends Schedulable> schedulableVector) {
for (Schedulable schedulable : schedulableVector) {
schedulable.share += schedulable.getMinimum();
}
} | java | private static void distributeShareMin(
Collection<? extends Schedulable> schedulableVector) {
for (Schedulable schedulable : schedulableVector) {
schedulable.share += schedulable.getMinimum();
}
} | [
"private",
"static",
"void",
"distributeShareMin",
"(",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulableVector",
")",
"{",
"for",
"(",
"Schedulable",
"schedulable",
":",
"schedulableVector",
")",
"{",
"schedulable",
".",
"share",
"+=",
"schedula... | Increment each of the schedulables' share by
the minimum demand. Note that each pool has to be guaranteed
at least its MIN value according to PRIORITY scheduling.
@param schedulableVector: The collection of schedulables
(all with the same priority) | [
"Increment",
"each",
"of",
"the",
"schedulables",
"share",
"by",
"the",
"minimum",
"demand",
".",
"Note",
"that",
"each",
"pool",
"has",
"to",
"be",
"guaranteed",
"at",
"least",
"its",
"MIN",
"value",
"according",
"to",
"PRIORITY",
"scheduling",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L411-L416 |
119,250 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java | Schedulable.distributeShareMax | private static void distributeShareMax(
Collection<? extends Schedulable> schedulableVector) {
for (Schedulable schedulable : schedulableVector) {
double minShare = Math.max(schedulable.getMinimum(),
schedulable.getRequested());
schedulable.share += Math.min(schedu... | java | private static void distributeShareMax(
Collection<? extends Schedulable> schedulableVector) {
for (Schedulable schedulable : schedulableVector) {
double minShare = Math.max(schedulable.getMinimum(),
schedulable.getRequested());
schedulable.share += Math.min(schedu... | [
"private",
"static",
"void",
"distributeShareMax",
"(",
"Collection",
"<",
"?",
"extends",
"Schedulable",
">",
"schedulableVector",
")",
"{",
"for",
"(",
"Schedulable",
"schedulable",
":",
"schedulableVector",
")",
"{",
"double",
"minShare",
"=",
"Math",
".",
"m... | Increment each of the schedulables' share by
the lesser of its min demand or its maximum.
@param schedulableVector: The collection of schedulables
(all with the same priority) | [
"Increment",
"each",
"of",
"the",
"schedulables",
"share",
"by",
"the",
"lesser",
"of",
"its",
"min",
"demand",
"or",
"its",
"maximum",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Schedulable.java#L425-L433 |
119,251 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SystemLogParser.java | SystemLogParser.parseMonth | private int parseMonth(String month) {
for (int i = 0; i < months.length; i++)
if (months[i].startsWith(month))
return i;
return -1;
} | java | private int parseMonth(String month) {
for (int i = 0; i < months.length; i++)
if (months[i].startsWith(month))
return i;
return -1;
} | [
"private",
"int",
"parseMonth",
"(",
"String",
"month",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"months",
".",
"length",
";",
"i",
"++",
")",
"if",
"(",
"months",
"[",
"i",
"]",
".",
"startsWith",
"(",
"month",
")",
")",
"ret... | Convert the name of a month to the corresponding int value.
@return the int representation of the month. | [
"Convert",
"the",
"name",
"of",
"a",
"month",
"to",
"the",
"corresponding",
"int",
"value",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/SystemLogParser.java#L111-L116 |
119,252 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ReedSolomonDecoder.java | ReedSolomonDecoder.writeFixedBlock | long writeFixedBlock(
FSDataInputStream[] inputs,
int[] erasedLocations,
int erasedLocationToFix,
long limit,
OutputStream out,
Progressable reporter,
ParallelStreamReader parallelReader, CRC32 crc) throws IOException {
LOG.info("Need to write "... | java | long writeFixedBlock(
FSDataInputStream[] inputs,
int[] erasedLocations,
int erasedLocationToFix,
long limit,
OutputStream out,
Progressable reporter,
ParallelStreamReader parallelReader, CRC32 crc) throws IOException {
LOG.info("Need to write "... | [
"long",
"writeFixedBlock",
"(",
"FSDataInputStream",
"[",
"]",
"inputs",
",",
"int",
"[",
"]",
"erasedLocations",
",",
"int",
"erasedLocationToFix",
",",
"long",
"limit",
",",
"OutputStream",
"out",
",",
"Progressable",
"reporter",
",",
"ParallelStreamReader",
"pa... | Decode the inputs provided and write to the output.
@param inputs array of inputs.
@param erasedLocations indexes in the inputs which are known to be erased.
@param erasedLocationToFix index in the inputs which needs to be fixed.
@param limit maximum number of bytes to be written.
@param out the output.
@return size of... | [
"Decode",
"the",
"inputs",
"provided",
"and",
"write",
"to",
"the",
"output",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ReedSolomonDecoder.java#L220-L278 |
119,253 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ClientConfigurationUtil.java | ClientConfigurationUtil.mergeConfiguration | public static Configuration mergeConfiguration(URI uri, Configuration conf)
throws IOException {
try {
Long lastBadAccess = badURIs.get(uri.getHost());
if (lastBadAccess != null) {
if (System.currentTimeMillis() - lastBadAccess < BAD_URI_EXPIRY) {
return conf;
... | java | public static Configuration mergeConfiguration(URI uri, Configuration conf)
throws IOException {
try {
Long lastBadAccess = badURIs.get(uri.getHost());
if (lastBadAccess != null) {
if (System.currentTimeMillis() - lastBadAccess < BAD_URI_EXPIRY) {
return conf;
... | [
"public",
"static",
"Configuration",
"mergeConfiguration",
"(",
"URI",
"uri",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Long",
"lastBadAccess",
"=",
"badURIs",
".",
"get",
"(",
"uri",
".",
"getHost",
"(",
")",
")",
";",
... | Retrieves a modified version of the configuration from the supplied
configuration. This is used to override the configuration supplied with the
client side configuration retried from a different source.
@param uri
the URI for the FileSystem whose conf is needed
@param conf
the default configuration
@return the modifie... | [
"Retrieves",
"a",
"modified",
"version",
"of",
"the",
"configuration",
"from",
"the",
"supplied",
"configuration",
".",
"This",
"is",
"used",
"to",
"override",
"the",
"configuration",
"supplied",
"with",
"the",
"client",
"side",
"configuration",
"retried",
"from",... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ClientConfigurationUtil.java#L65-L113 |
119,254 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JVMId.java | JVMId.forName | public static JVMId forName(String str)
throws IllegalArgumentException {
if(str == null)
return null;
try {
String[] parts = str.split("_");
if(parts.length == 5) {
if(parts[0].equals(JVM)) {
boolean isMap = false;
if(parts[3].equals("m")) isMap = true;
... | java | public static JVMId forName(String str)
throws IllegalArgumentException {
if(str == null)
return null;
try {
String[] parts = str.split("_");
if(parts.length == 5) {
if(parts[0].equals(JVM)) {
boolean isMap = false;
if(parts[3].equals("m")) isMap = true;
... | [
"public",
"static",
"JVMId",
"forName",
"(",
"String",
"str",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"String",
"[",
"]",
"parts",
"=",
"str",
".",
"split",
"(",
"\"_\"",
"... | Construct a JVMId object from given string
@return constructed JVMId object or null if the given String is null
@throws IllegalArgumentException if the given string is malformed | [
"Construct",
"a",
"JVMId",
"object",
"from",
"given",
"string"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JVMId.java#L126-L146 |
119,255 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java | LinuxUtilizationGauger.readFile | private String[] readFile(String fileName) throws IOException {
ArrayList<String> result = new ArrayList<String>();
FileReader fReader = new FileReader(fileName);
BufferedReader bReader = new BufferedReader(fReader);
while (true) {
String line = bReader.readLine();
if (line == null) {
... | java | private String[] readFile(String fileName) throws IOException {
ArrayList<String> result = new ArrayList<String>();
FileReader fReader = new FileReader(fileName);
BufferedReader bReader = new BufferedReader(fReader);
while (true) {
String line = bReader.readLine();
if (line == null) {
... | [
"private",
"String",
"[",
"]",
"readFile",
"(",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"FileReader",
"fReader",
"=",
"new",
"FileReader... | Read a file line by line
@param fileName
@return String[] contains lines
@throws IOException | [
"Read",
"a",
"file",
"line",
"by",
"line"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java#L75-L89 |
119,256 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java | LinuxUtilizationGauger.getPS | protected String[] getPS() {
ShellCommandExecutor shellExecutor = new ShellCommandExecutor(CMD);
try {
shellExecutor.execute();
}
catch (IOException e) {
LOG.error(StringUtils.stringifyException(e));
return null;
}
return shellExecutor.getOutput().split("\n");
} | java | protected String[] getPS() {
ShellCommandExecutor shellExecutor = new ShellCommandExecutor(CMD);
try {
shellExecutor.execute();
}
catch (IOException e) {
LOG.error(StringUtils.stringifyException(e));
return null;
}
return shellExecutor.getOutput().split("\n");
} | [
"protected",
"String",
"[",
"]",
"getPS",
"(",
")",
"{",
"ShellCommandExecutor",
"shellExecutor",
"=",
"new",
"ShellCommandExecutor",
"(",
"CMD",
")",
";",
"try",
"{",
"shellExecutor",
".",
"execute",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
"... | Execute "ps -eo pid,ppid,pcpu,rss,command"
@return String[] which contains the execution result | [
"Execute",
"ps",
"-",
"eo",
"pid",
"ppid",
"pcpu",
"rss",
"command"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java#L131-L141 |
119,257 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java | LinuxUtilizationGauger.parsePS | private String[][] parsePS(String[] psStrings) {
String[][] result = new String[psStrings.length-1][NUM_FIELDS];
for (int i = 1; i < psStrings.length; i++) {
Matcher matcher = psPattern.matcher(psStrings[i]);
if (matcher.find()) {
for (int j = 0; j < NUM_FIELDS; j++) {
result[i-1][... | java | private String[][] parsePS(String[] psStrings) {
String[][] result = new String[psStrings.length-1][NUM_FIELDS];
for (int i = 1; i < psStrings.length; i++) {
Matcher matcher = psPattern.matcher(psStrings[i]);
if (matcher.find()) {
for (int j = 0; j < NUM_FIELDS; j++) {
result[i-1][... | [
"private",
"String",
"[",
"]",
"[",
"]",
"parsePS",
"(",
"String",
"[",
"]",
"psStrings",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"result",
"=",
"new",
"String",
"[",
"psStrings",
".",
"length",
"-",
"1",
"]",
"[",
"NUM_FIELDS",
"]",
";",
"for",
... | Parse PS results into fields
@param psStrings
@return fields contains the PS information | [
"Parse",
"PS",
"results",
"into",
"fields"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java#L148-L159 |
119,258 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java | LinuxUtilizationGauger.percentageToGHz | private double percentageToGHz(double cpuUsage) {
cpuUsage /= 100;
cpuUsage /= ttUtilization.getNumCpu();
cpuUsage *= ttUtilization.getCpuTotalGHz();
return cpuUsage;
} | java | private double percentageToGHz(double cpuUsage) {
cpuUsage /= 100;
cpuUsage /= ttUtilization.getNumCpu();
cpuUsage *= ttUtilization.getCpuTotalGHz();
return cpuUsage;
} | [
"private",
"double",
"percentageToGHz",
"(",
"double",
"cpuUsage",
")",
"{",
"cpuUsage",
"/=",
"100",
";",
"cpuUsage",
"/=",
"ttUtilization",
".",
"getNumCpu",
"(",
")",
";",
"cpuUsage",
"*=",
"ttUtilization",
".",
"getCpuTotalGHz",
"(",
")",
";",
"return",
... | "ps -eo pcpu" gives per core %. We convert it to GHz | [
"ps",
"-",
"eo",
"pcpu",
"gives",
"per",
"core",
"%",
".",
"We",
"convert",
"it",
"to",
"GHz"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java#L162-L167 |
119,259 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java | LinuxUtilizationGauger.getSubProcessUsage | private double[] getSubProcessUsage(String pid,
Map<String, String[]> pidToContent,
Map<String, LinkedList<String>> pidToChildPid) {
double cpuMemUsage[] = new double[2];
Queue<String> pidQueue = new LinkedList<String>();
pidQueue.add(pid);
while ... | java | private double[] getSubProcessUsage(String pid,
Map<String, String[]> pidToContent,
Map<String, LinkedList<String>> pidToChildPid) {
double cpuMemUsage[] = new double[2];
Queue<String> pidQueue = new LinkedList<String>();
pidQueue.add(pid);
while ... | [
"private",
"double",
"[",
"]",
"getSubProcessUsage",
"(",
"String",
"pid",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"pidToContent",
",",
"Map",
"<",
"String",
",",
"LinkedList",
"<",
"String",
">",
">",
"pidToChildPid",
")",
"{",
"double"... | A function computes the Memory and CPU usage of all subprocess
@param pid PID of the process we are interested in
@param pidToContent Map between pid and the PS content
@param pidToChildPid Map between pid and pid of its child process
@return A 2-element array which contants CPU and memory usage | [
"A",
"function",
"computes",
"the",
"Memory",
"and",
"CPU",
"usage",
"of",
"all",
"subprocess"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/LinuxUtilizationGauger.java#L285-L307 |
119,260 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java | UnderReplicatedBlocks.clear | void clear() {
for(int i=0; i<LEVEL; i++) {
priorityQueues.get(i).clear();
}
raidQueue.clear();
} | java | void clear() {
for(int i=0; i<LEVEL; i++) {
priorityQueues.get(i).clear();
}
raidQueue.clear();
} | [
"void",
"clear",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"LEVEL",
";",
"i",
"++",
")",
"{",
"priorityQueues",
".",
"get",
"(",
"i",
")",
".",
"clear",
"(",
")",
";",
"}",
"raidQueue",
".",
"clear",
"(",
")",
";",
"}"... | Empty the queues. | [
"Empty",
"the",
"queues",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java#L52-L57 |
119,261 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java | UnderReplicatedBlocks.size | synchronized int size( int priority) {
if (priority < 0 || priority >= LEVEL) {
throw new IllegalArgumentException("Unsupported priority: " + priority);
}
return priorityQueues.get(priority).size();
} | java | synchronized int size( int priority) {
if (priority < 0 || priority >= LEVEL) {
throw new IllegalArgumentException("Unsupported priority: " + priority);
}
return priorityQueues.get(priority).size();
} | [
"synchronized",
"int",
"size",
"(",
"int",
"priority",
")",
"{",
"if",
"(",
"priority",
"<",
"0",
"||",
"priority",
">=",
"LEVEL",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unsupported priority: \"",
"+",
"priority",
")",
";",
"}",
"retur... | Return the number of under replication blocks of priority | [
"Return",
"the",
"number",
"of",
"under",
"replication",
"blocks",
"of",
"priority"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java#L81-L86 |
119,262 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java | UnderReplicatedBlocks.getSize | synchronized int getSize( int priority ) {
int size = 0;
for (int i=priority; i<LEVEL; i++) {
size += priorityQueues.get(i).size();
}
return size;
} | java | synchronized int getSize( int priority ) {
int size = 0;
for (int i=priority; i<LEVEL; i++) {
size += priorityQueues.get(i).size();
}
return size;
} | [
"synchronized",
"int",
"getSize",
"(",
"int",
"priority",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"priority",
";",
"i",
"<",
"LEVEL",
";",
"i",
"++",
")",
"{",
"size",
"+=",
"priorityQueues",
".",
"get",
"(",
"i",
")"... | get the number of under replicated blocks with equal or higher priority | [
"get",
"the",
"number",
"of",
"under",
"replicated",
"blocks",
"with",
"equal",
"or",
"higher",
"priority"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/UnderReplicatedBlocks.java#L89-L95 |
119,263 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeSnapshot.java | NodeSnapshot.removeNode | public void removeNode(ClusterNode node) {
String host = node.getHost();
NodeContainer container = hostToRunnableNode.get(host);
if (container != null) {
if (container.removeNode(node)) {
runnableNodeCount--;
}
if (container.isEmpty()) {
hostToRunnableNode.remove(host);
... | java | public void removeNode(ClusterNode node) {
String host = node.getHost();
NodeContainer container = hostToRunnableNode.get(host);
if (container != null) {
if (container.removeNode(node)) {
runnableNodeCount--;
}
if (container.isEmpty()) {
hostToRunnableNode.remove(host);
... | [
"public",
"void",
"removeNode",
"(",
"ClusterNode",
"node",
")",
"{",
"String",
"host",
"=",
"node",
".",
"getHost",
"(",
")",
";",
"NodeContainer",
"container",
"=",
"hostToRunnableNode",
".",
"get",
"(",
"host",
")",
";",
"if",
"(",
"container",
"!=",
... | Remove a node from the snapshot.
@param node The node. | [
"Remove",
"a",
"node",
"from",
"the",
"snapshot",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeSnapshot.java#L84-L103 |
119,264 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java | ImageVisitor.visit | void visit(ImageElement element, int value) throws IOException {
visit(element, Integer.toString(value));
} | java | void visit(ImageElement element, int value) throws IOException {
visit(element, Integer.toString(value));
} | [
"void",
"visit",
"(",
"ImageElement",
"element",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"visit",
"(",
"element",
",",
"Integer",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Convenience methods to automatically convert numeric value types to strings | [
"Convenience",
"methods",
"to",
"automatically",
"convert",
"numeric",
"value",
"types",
"to",
"strings"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java#L112-L114 |
119,265 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java | ImageVisitor.visitEnclosingElement | void visitEnclosingElement(ImageElement element,
ImageElement key, int value)
throws IOException {
visitEnclosingElement(element, key, Integer.toString(value));
} | java | void visitEnclosingElement(ImageElement element,
ImageElement key, int value)
throws IOException {
visitEnclosingElement(element, key, Integer.toString(value));
} | [
"void",
"visitEnclosingElement",
"(",
"ImageElement",
"element",
",",
"ImageElement",
"key",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"visitEnclosingElement",
"(",
"element",
",",
"key",
",",
"Integer",
".",
"toString",
"(",
"value",
")",
")",
"... | Convenience methods to automatically convert value types to strings | [
"Convenience",
"methods",
"to",
"automatically",
"convert",
"value",
"types",
"to",
"strings"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java#L149-L153 |
119,266 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.addSession | public void addSession(String id, Session session) {
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.addSession(id, session);
}
} | java | public void addSession(String id, Session session) {
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.addSession(id, session);
}
} | [
"public",
"void",
"addSession",
"(",
"String",
"id",
",",
"Session",
"session",
")",
"{",
"for",
"(",
"SchedulerForType",
"scheduleThread",
":",
"schedulersForTypes",
".",
"values",
"(",
")",
")",
"{",
"scheduleThread",
".",
"addSession",
"(",
"id",
",",
"se... | Add a session for scheduling.
@param id Identifies the session
@param session Actual session to be scheduled | [
"Add",
"a",
"session",
"for",
"scheduling",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L124-L128 |
119,267 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.start | public void start() {
for (Thread schedulerForType : schedulersForTypes.values()) {
LOG.info("Starting " + schedulerForType.getName());
schedulerForType.start();
}
configManager.start();
} | java | public void start() {
for (Thread schedulerForType : schedulersForTypes.values()) {
LOG.info("Starting " + schedulerForType.getName());
schedulerForType.start();
}
configManager.start();
} | [
"public",
"void",
"start",
"(",
")",
"{",
"for",
"(",
"Thread",
"schedulerForType",
":",
"schedulersForTypes",
".",
"values",
"(",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Starting \"",
"+",
"schedulerForType",
".",
"getName",
"(",
")",
")",
";",
"sche... | Start the scheduling as well as the reloadable configuration manager. | [
"Start",
"the",
"scheduling",
"as",
"well",
"as",
"the",
"reloadable",
"configuration",
"manager",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L133-L139 |
119,268 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.close | public void close() {
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.close();
}
for (Thread scheduleThread : schedulersForTypes.values()) {
Utilities.waitThreadTermination(scheduleThread);
}
configManager.close();
} | java | public void close() {
for (SchedulerForType scheduleThread : schedulersForTypes.values()) {
scheduleThread.close();
}
for (Thread scheduleThread : schedulersForTypes.values()) {
Utilities.waitThreadTermination(scheduleThread);
}
configManager.close();
} | [
"public",
"void",
"close",
"(",
")",
"{",
"for",
"(",
"SchedulerForType",
"scheduleThread",
":",
"schedulersForTypes",
".",
"values",
"(",
")",
")",
"{",
"scheduleThread",
".",
"close",
"(",
")",
";",
"}",
"for",
"(",
"Thread",
"scheduleThread",
":",
"sche... | Stop the scheduling and disable the reloadable configuration manager. | [
"Stop",
"the",
"scheduling",
"and",
"disable",
"the",
"reloadable",
"configuration",
"manager",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L152-L160 |
119,269 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.getPoolInfoMetrics | public Map<PoolInfo, PoolInfoMetrics> getPoolInfoMetrics(ResourceType type) {
return schedulersForTypes.get(type).getPoolInfoMetrics();
} | java | public Map<PoolInfo, PoolInfoMetrics> getPoolInfoMetrics(ResourceType type) {
return schedulersForTypes.get(type).getPoolInfoMetrics();
} | [
"public",
"Map",
"<",
"PoolInfo",
",",
"PoolInfoMetrics",
">",
"getPoolInfoMetrics",
"(",
"ResourceType",
"type",
")",
"{",
"return",
"schedulersForTypes",
".",
"get",
"(",
"type",
")",
".",
"getPoolInfoMetrics",
"(",
")",
";",
"}"
] | Get an unmodifiable snapshot of the mapping from pool info to associated
metrics.
@param type Type of resource.
@return Unmodifiable snapshot of mapping from pool info to metrics | [
"Get",
"an",
"unmodifiable",
"snapshot",
"of",
"the",
"mapping",
"from",
"pool",
"info",
"to",
"associated",
"metrics",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L181-L183 |
119,270 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.getPoolInfos | public List<PoolInfo> getPoolInfos() {
Set<PoolInfo> poolInfos = new HashSet<PoolInfo>();
for (ResourceType type : types) {
poolInfos.addAll(getPoolInfoMetrics(type).keySet());
}
List<PoolInfo> result = new ArrayList<PoolInfo>();
result.addAll(poolInfos);
Collections.sort(result);
retu... | java | public List<PoolInfo> getPoolInfos() {
Set<PoolInfo> poolInfos = new HashSet<PoolInfo>();
for (ResourceType type : types) {
poolInfos.addAll(getPoolInfoMetrics(type).keySet());
}
List<PoolInfo> result = new ArrayList<PoolInfo>();
result.addAll(poolInfos);
Collections.sort(result);
retu... | [
"public",
"List",
"<",
"PoolInfo",
">",
"getPoolInfos",
"(",
")",
"{",
"Set",
"<",
"PoolInfo",
">",
"poolInfos",
"=",
"new",
"HashSet",
"<",
"PoolInfo",
">",
"(",
")",
";",
"for",
"(",
"ResourceType",
"type",
":",
"types",
")",
"{",
"poolInfos",
".",
... | Get a snapshot of the pool infos that is sorted.
@return Sorted snapshot of the pool infos. | [
"Get",
"a",
"snapshot",
"of",
"the",
"pool",
"infos",
"that",
"is",
"sorted",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L224-L233 |
119,271 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java | Scheduler.submitMetrics | public void submitMetrics(MetricsRecord metricsRecord) {
List<PoolMetadata> poolMetadatas = getPoolMetadataList();
PoolFairnessCalculator.calculateFairness(poolMetadatas, metricsRecord);
for (SchedulerForType scheduler: schedulersForTypes.values()) {
scheduler.submitMetrics();
}
} | java | public void submitMetrics(MetricsRecord metricsRecord) {
List<PoolMetadata> poolMetadatas = getPoolMetadataList();
PoolFairnessCalculator.calculateFairness(poolMetadatas, metricsRecord);
for (SchedulerForType scheduler: schedulersForTypes.values()) {
scheduler.submitMetrics();
}
} | [
"public",
"void",
"submitMetrics",
"(",
"MetricsRecord",
"metricsRecord",
")",
"{",
"List",
"<",
"PoolMetadata",
">",
"poolMetadatas",
"=",
"getPoolMetadataList",
"(",
")",
";",
"PoolFairnessCalculator",
".",
"calculateFairness",
"(",
"poolMetadatas",
",",
"metricsRec... | Submit the metrics.
@param metricsRecord Where the metrics will be submitted | [
"Submit",
"the",
"metrics",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Scheduler.java#L240-L246 |
119,272 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.downloadImageToStorage | static MD5Hash downloadImageToStorage(String fsName, long imageTxId,
FSImage fsImage, boolean needDigest) throws IOException {
// by default do not disable throttling
return downloadImageToStorage(fsName, imageTxId, fsImage, needDigest,
false);
} | java | static MD5Hash downloadImageToStorage(String fsName, long imageTxId,
FSImage fsImage, boolean needDigest) throws IOException {
// by default do not disable throttling
return downloadImageToStorage(fsName, imageTxId, fsImage, needDigest,
false);
} | [
"static",
"MD5Hash",
"downloadImageToStorage",
"(",
"String",
"fsName",
",",
"long",
"imageTxId",
",",
"FSImage",
"fsImage",
",",
"boolean",
"needDigest",
")",
"throws",
"IOException",
"{",
"// by default do not disable throttling",
"return",
"downloadImageToStorage",
"("... | Download image to local storage with throttling. | [
"Download",
"image",
"to",
"local",
"storage",
"with",
"throttling",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L65-L70 |
119,273 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.downloadImageToStorage | static MD5Hash downloadImageToStorage(String fsName, long imageTxId,
FSImage dstImage, boolean needDigest, boolean disableThrottle)
throws IOException {
String fileid = GetImageServlet.getParamStringForImage(
imageTxId, dstImage.storage, disableThrottle);
List<OutputStream> outputStrea... | java | static MD5Hash downloadImageToStorage(String fsName, long imageTxId,
FSImage dstImage, boolean needDigest, boolean disableThrottle)
throws IOException {
String fileid = GetImageServlet.getParamStringForImage(
imageTxId, dstImage.storage, disableThrottle);
List<OutputStream> outputStrea... | [
"static",
"MD5Hash",
"downloadImageToStorage",
"(",
"String",
"fsName",
",",
"long",
"imageTxId",
",",
"FSImage",
"dstImage",
",",
"boolean",
"needDigest",
",",
"boolean",
"disableThrottle",
")",
"throws",
"IOException",
"{",
"String",
"fileid",
"=",
"GetImageServle... | Download image to local storage.
Throttling can be disabled. | [
"Download",
"image",
"to",
"local",
"storage",
".",
"Throttling",
"can",
"be",
"disabled",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L76-L92 |
119,274 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.uploadImageFromStorage | static void uploadImageFromStorage(String fsName,
String machine, int port,
NNStorage storage, long txid) throws IOException {
String fileid = GetImageServlet.getParamStringToPutImage(
txid, machine, port, storage);
LOG.info("Image upload: Posted URL " + fsName + fileid);
// t... | java | static void uploadImageFromStorage(String fsName,
String machine, int port,
NNStorage storage, long txid) throws IOException {
String fileid = GetImageServlet.getParamStringToPutImage(
txid, machine, port, storage);
LOG.info("Image upload: Posted URL " + fsName + fileid);
// t... | [
"static",
"void",
"uploadImageFromStorage",
"(",
"String",
"fsName",
",",
"String",
"machine",
",",
"int",
"port",
",",
"NNStorage",
"storage",
",",
"long",
"txid",
")",
"throws",
"IOException",
"{",
"String",
"fileid",
"=",
"GetImageServlet",
".",
"getParamStri... | Requests that the NameNode download an image from this node.
@param fsName the http address for the remote NN
@param imageListenAddress the host/port where the local node is running an
HTTPServer hosting GetImageServlet
@param storage the storage directory to transfer the image from
@param txid the transaction ID of t... | [
"Requests",
"that",
"the",
"NameNode",
"download",
"an",
"image",
"from",
"this",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L137-L151 |
119,275 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.getFileServer | public static void getFileServer(OutputStream outstream, File localfile,
DataTransferThrottler throttler)
throws IOException {
byte buf[] = new byte[BUFFER_SIZE];
InputStream infile = null;
try {
infile = new BufferedInputStream(new FileInputStream(localfile), BUFFER_SIZE);
if (Injecti... | java | public static void getFileServer(OutputStream outstream, File localfile,
DataTransferThrottler throttler)
throws IOException {
byte buf[] = new byte[BUFFER_SIZE];
InputStream infile = null;
try {
infile = new BufferedInputStream(new FileInputStream(localfile), BUFFER_SIZE);
if (Injecti... | [
"public",
"static",
"void",
"getFileServer",
"(",
"OutputStream",
"outstream",
",",
"File",
"localfile",
",",
"DataTransferThrottler",
"throttler",
")",
"throws",
"IOException",
"{",
"byte",
"buf",
"[",
"]",
"=",
"new",
"byte",
"[",
"BUFFER_SIZE",
"]",
";",
"I... | A server-side method to respond to a getfile http request
Copies the contents of the local file into the output stream. | [
"A",
"server",
"-",
"side",
"method",
"to",
"respond",
"to",
"a",
"getfile",
"http",
"request",
"Copies",
"the",
"contents",
"of",
"the",
"local",
"file",
"into",
"the",
"output",
"stream",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L158-L204 |
119,276 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.getFileServerForPartialFiles | public static void getFileServerForPartialFiles(OutputStream outstream,
String filename, InputStream infile, DataTransferThrottler throttler,
long startPosition, long lengthToSend) throws IOException {
byte buf[] = new byte[BUFFER_SIZE];
try {
int num = 1;
while (num > 0) {
num =... | java | public static void getFileServerForPartialFiles(OutputStream outstream,
String filename, InputStream infile, DataTransferThrottler throttler,
long startPosition, long lengthToSend) throws IOException {
byte buf[] = new byte[BUFFER_SIZE];
try {
int num = 1;
while (num > 0) {
num =... | [
"public",
"static",
"void",
"getFileServerForPartialFiles",
"(",
"OutputStream",
"outstream",
",",
"String",
"filename",
",",
"InputStream",
"infile",
",",
"DataTransferThrottler",
"throttler",
",",
"long",
"startPosition",
",",
"long",
"lengthToSend",
")",
"throws",
... | A server-side method to respond to a getfile http request
Copies the contents of the local file into the output stream,
starting at the given position, sending lengthToSend bytes. | [
"A",
"server",
"-",
"side",
"method",
"to",
"respond",
"to",
"a",
"getfile",
"http",
"request",
"Copies",
"the",
"contents",
"of",
"the",
"local",
"file",
"into",
"the",
"output",
"stream",
"starting",
"at",
"the",
"given",
"position",
"sending",
"lengthToSe... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L211-L244 |
119,277 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.getHttpTimeout | private static int getHttpTimeout(Storage st) {
if (!(st instanceof NNStorage))
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
NNStorage storage = (NNStorage) st;
if (storage == null || storage.getConf() == null) {
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
}
return storage.getConf().getInt... | java | private static int getHttpTimeout(Storage st) {
if (!(st instanceof NNStorage))
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
NNStorage storage = (NNStorage) st;
if (storage == null || storage.getConf() == null) {
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
}
return storage.getConf().getInt... | [
"private",
"static",
"int",
"getHttpTimeout",
"(",
"Storage",
"st",
")",
"{",
"if",
"(",
"!",
"(",
"st",
"instanceof",
"NNStorage",
")",
")",
"return",
"DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT",
";",
"NNStorage",
"storage",
"=",
"(",
"NNStorage",
")",
"st",
";",
... | Get connection and read timeout. | [
"Get",
"connection",
"and",
"read",
"timeout",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L249-L258 |
119,278 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java | TransferFsImage.printProgress | private static int printProgress(String str, long received,
long advertisedSize, int lastPrinted) {
if (advertisedSize == 0)
return 0;
int currentPercent = (int) ((received * 100) / advertisedSize);
if (currentPercent != lastPrinted)
FLOG.info("Downloading: " + str + ", completed: " + curr... | java | private static int printProgress(String str, long received,
long advertisedSize, int lastPrinted) {
if (advertisedSize == 0)
return 0;
int currentPercent = (int) ((received * 100) / advertisedSize);
if (currentPercent != lastPrinted)
FLOG.info("Downloading: " + str + ", completed: " + curr... | [
"private",
"static",
"int",
"printProgress",
"(",
"String",
"str",
",",
"long",
"received",
",",
"long",
"advertisedSize",
",",
"int",
"lastPrinted",
")",
"{",
"if",
"(",
"advertisedSize",
"==",
"0",
")",
"return",
"0",
";",
"int",
"currentPercent",
"=",
"... | Print progress when downloading files. | [
"Print",
"progress",
"when",
"downloading",
"files",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/TransferFsImage.java#L378-L386 |
119,279 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.reverseDns | @Deprecated
public static String reverseDns(InetAddress hostIp, String ns)
throws NamingException {
//
// Builds the reverse IP lookup form
// This is formed by reversing the IP numbers and appending in-addr.arpa
//
String[] parts = hostIp.getHostAddress().split("\\.");
String reverseIP = ... | java | @Deprecated
public static String reverseDns(InetAddress hostIp, String ns)
throws NamingException {
//
// Builds the reverse IP lookup form
// This is formed by reversing the IP numbers and appending in-addr.arpa
//
String[] parts = hostIp.getHostAddress().split("\\.");
String reverseIP = ... | [
"@",
"Deprecated",
"public",
"static",
"String",
"reverseDns",
"(",
"InetAddress",
"hostIp",
",",
"String",
"ns",
")",
"throws",
"NamingException",
"{",
"//",
"// Builds the reverse IP lookup form",
"// This is formed by reversing the IP numbers and appending in-addr.arpa",
"//... | Returns the hostname associated with the specified IP address by the
provided nameserver.
@param hostIp
The address to reverse lookup
@param ns
The host name of a reachable DNS server
@return The host name associated with the provided IP
@throws NamingException
If a NamingException is encountered
@deprecated Reliance ... | [
"Returns",
"the",
"hostname",
"associated",
"with",
"the",
"specified",
"IP",
"address",
"by",
"the",
"provided",
"nameserver",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L58-L78 |
119,280 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.getIPs | public static String[] getIPs(String strInterface)
throws UnknownHostException {
try {
boolean toGetIpv4 = true;
if (System.getProperty(PREFER_IPV6_ADDRESS_PROPERTY) != null) {
toGetIpv4 = "false".equals(System
.getProperty(PREFER_IPV6_ADDRESS_PROPERTY));
}
NetworkInt... | java | public static String[] getIPs(String strInterface)
throws UnknownHostException {
try {
boolean toGetIpv4 = true;
if (System.getProperty(PREFER_IPV6_ADDRESS_PROPERTY) != null) {
toGetIpv4 = "false".equals(System
.getProperty(PREFER_IPV6_ADDRESS_PROPERTY));
}
NetworkInt... | [
"public",
"static",
"String",
"[",
"]",
"getIPs",
"(",
"String",
"strInterface",
")",
"throws",
"UnknownHostException",
"{",
"try",
"{",
"boolean",
"toGetIpv4",
"=",
"true",
";",
"if",
"(",
"System",
".",
"getProperty",
"(",
"PREFER_IPV6_ADDRESS_PROPERTY",
")",
... | Returns all the IPs associated with the provided interface, if any, in
textual form.
@param strInterface
The name of the network interface to query (e.g. eth0)
@return A string vector of all the IPs associated with the provided
interface
@throws UnknownHostException
If an UnknownHostException is encountered in queryin... | [
"Returns",
"all",
"the",
"IPs",
"associated",
"with",
"the",
"provided",
"interface",
"if",
"any",
"in",
"textual",
"form",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L93-L120 |
119,281 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.getDefaultIP | public static String getDefaultIP(String strInterface)
throws UnknownHostException {
String[] ips = getIPs(strInterface);
return ips[0];
} | java | public static String getDefaultIP(String strInterface)
throws UnknownHostException {
String[] ips = getIPs(strInterface);
return ips[0];
} | [
"public",
"static",
"String",
"getDefaultIP",
"(",
"String",
"strInterface",
")",
"throws",
"UnknownHostException",
"{",
"String",
"[",
"]",
"ips",
"=",
"getIPs",
"(",
"strInterface",
")",
";",
"return",
"ips",
"[",
"0",
"]",
";",
"}"
] | Returns the first available IP address associated with the provided
network interface
@param strInterface
The name of the network interface to query (e.g. eth0)
@return The IP address in text form
@throws UnknownHostException
If one is encountered in querying the default interface | [
"Returns",
"the",
"first",
"available",
"IP",
"address",
"associated",
"with",
"the",
"provided",
"network",
"interface"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L132-L136 |
119,282 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.getHosts | @Deprecated
public static String[] getHosts(String strInterface, String nameserver)
throws UnknownHostException {
String[] ips = getIPs(strInterface);
Vector<String> hosts = new Vector<String>();
for (int ctr = 0; ctr < ips.length; ctr++)
try {
hosts.add(reverseDns(InetAddress.getByName(... | java | @Deprecated
public static String[] getHosts(String strInterface, String nameserver)
throws UnknownHostException {
String[] ips = getIPs(strInterface);
Vector<String> hosts = new Vector<String>();
for (int ctr = 0; ctr < ips.length; ctr++)
try {
hosts.add(reverseDns(InetAddress.getByName(... | [
"@",
"Deprecated",
"public",
"static",
"String",
"[",
"]",
"getHosts",
"(",
"String",
"strInterface",
",",
"String",
"nameserver",
")",
"throws",
"UnknownHostException",
"{",
"String",
"[",
"]",
"ips",
"=",
"getIPs",
"(",
"strInterface",
")",
";",
"Vector",
... | Returns all the host names associated by the provided nameserver with the
address bound to the specified network interface
@param strInterface
The name of the network interface to query (e.g. eth0)
@param nameserver
The DNS host name
@return A string vector of all host names associated with the IPs tied to
the specifi... | [
"Returns",
"all",
"the",
"host",
"names",
"associated",
"by",
"the",
"provided",
"nameserver",
"with",
"the",
"address",
"bound",
"to",
"the",
"specified",
"network",
"interface"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L150-L166 |
119,283 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.refreshCachedData | private synchronized void refreshCachedData() throws IOException {
IOUtils.closeStream(committedTxnId);
File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
this.lastPromisedEpoch = new PersistentLongFile(
new File(currentDir, LAST_PROMISED_FILENAME), 0);
this.lastWrite... | java | private synchronized void refreshCachedData() throws IOException {
IOUtils.closeStream(committedTxnId);
File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
this.lastPromisedEpoch = new PersistentLongFile(
new File(currentDir, LAST_PROMISED_FILENAME), 0);
this.lastWrite... | [
"private",
"synchronized",
"void",
"refreshCachedData",
"(",
")",
"throws",
"IOException",
"{",
"IOUtils",
".",
"closeStream",
"(",
"committedTxnId",
")",
";",
"File",
"currentDir",
"=",
"journalStorage",
".",
"getSingularStorageDir",
"(",
")",
".",
"getCurrentDir",... | Reload any data that may have been cached. This is necessary
when we first load the Journal, but also after any formatting
operation, since the cached data is no longer relevant.
@throws IOException | [
"Reload",
"any",
"data",
"that",
"may",
"have",
"been",
"cached",
".",
"This",
"is",
"necessary",
"when",
"we",
"first",
"load",
"the",
"Journal",
"but",
"also",
"after",
"any",
"formatting",
"operation",
"since",
"the",
"cached",
"data",
"is",
"no",
"long... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L193-L205 |
119,284 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.copyMetaFilesForUpgrade | private synchronized void copyMetaFilesForUpgrade() throws IOException {
Configuration conf = new Configuration();
File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
File prevDir = journalStorage.getSingularStorageDir().getPreviousTmp();
FileSystem fs = FileSystem.getLocal(conf).g... | java | private synchronized void copyMetaFilesForUpgrade() throws IOException {
Configuration conf = new Configuration();
File currentDir = journalStorage.getSingularStorageDir().getCurrentDir();
File prevDir = journalStorage.getSingularStorageDir().getPreviousTmp();
FileSystem fs = FileSystem.getLocal(conf).g... | [
"private",
"synchronized",
"void",
"copyMetaFilesForUpgrade",
"(",
")",
"throws",
"IOException",
"{",
"Configuration",
"conf",
"=",
"new",
"Configuration",
"(",
")",
";",
"File",
"currentDir",
"=",
"journalStorage",
".",
"getSingularStorageDir",
"(",
")",
".",
"ge... | After an upgrade we must ensure that the current directory still holds all
epoch, committed txid and paxos files that it had before we did the
upgrade. | [
"After",
"an",
"upgrade",
"we",
"must",
"ensure",
"that",
"the",
"current",
"directory",
"still",
"holds",
"all",
"epoch",
"committed",
"txid",
"and",
"paxos",
"files",
"that",
"it",
"had",
"before",
"we",
"did",
"the",
"upgrade",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L212-L226 |
119,285 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.rollbackImage | public void rollbackImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getLayoutVersion() != 0,
"can't rollback with uninitialized layout version: %s",
nsInfo.toColonSeparatedString());
LOG.info("Rolling back image " + this.getJournalId()
+ " with namespace ... | java | public void rollbackImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getLayoutVersion() != 0,
"can't rollback with uninitialized layout version: %s",
nsInfo.toColonSeparatedString());
LOG.info("Rolling back image " + this.getJournalId()
+ " with namespace ... | [
"public",
"void",
"rollbackImage",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getLayoutVersion",
"(",
")",
"!=",
"0",
",",
"\"can't rollback with uninitialized layout version: %s\"",
",",
... | Rollback the local image storage with the given namespace. | [
"Rollback",
"the",
"local",
"image",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L334-L341 |
119,286 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.doUpgradeImage | private void doUpgradeImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Upgrading image " + this.getJournalId()
+ " with namespace info... | java | private void doUpgradeImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Upgrading image " + this.getJournalId()
+ " with namespace info... | [
"private",
"void",
"doUpgradeImage",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getNamespaceID",
"(",
")",
"!=",
"0",
",",
"\"can't upgrade with uninitialized namespace info: %s\"",
",",
... | Upgrade the local image storage with the given namespace. | [
"Upgrade",
"the",
"local",
"image",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L346-L358 |
119,287 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.completeUpgradeImage | private void completeUpgradeImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Completing Upgrading image " + this.getJournalId()
+ " wi... | java | private void completeUpgradeImage(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Completing Upgrading image " + this.getJournalId()
+ " wi... | [
"private",
"void",
"completeUpgradeImage",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getNamespaceID",
"(",
")",
"!=",
"0",
",",
"\"can't upgrade with uninitialized namespace info: %s\"",
"... | Complete the upgrade for local image storage with the given namespace. | [
"Complete",
"the",
"upgrade",
"for",
"local",
"image",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L363-L372 |
119,288 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.completeUpgradeJournal | private void completeUpgradeJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Completing Upgrading journal" + this.getJournalId()
+ "... | java | private void completeUpgradeJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Completing Upgrading journal" + this.getJournalId()
+ "... | [
"private",
"void",
"completeUpgradeJournal",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getNamespaceID",
"(",
")",
"!=",
"0",
",",
"\"can't upgrade with uninitialized namespace info: %s\"",
... | Complete the upgrade for local journal storage with the given namespace. | [
"Complete",
"the",
"upgrade",
"for",
"local",
"journal",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L391-L398 |
119,289 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.rollbackJournal | public void rollbackJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getLayoutVersion() != 0,
"can't rollback with uninitialized layout version : %s",
nsInfo.toColonSeparatedString());
LOG.info("Rolling back journal " + this.getJournalId()
+ " with names... | java | public void rollbackJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getLayoutVersion() != 0,
"can't rollback with uninitialized layout version : %s",
nsInfo.toColonSeparatedString());
LOG.info("Rolling back journal " + this.getJournalId()
+ " with names... | [
"public",
"void",
"rollbackJournal",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getLayoutVersion",
"(",
")",
"!=",
"0",
",",
"\"can't rollback with uninitialized layout version : %s\"",
","... | Rollback the local journal storage with the given namespace. | [
"Rollback",
"the",
"local",
"journal",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L411-L420 |
119,290 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.doUpgradeJournal | private void doUpgradeJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Upgrading journal " + this.getJournalId()
+ " with namespace ... | java | private void doUpgradeJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't upgrade with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Upgrading journal " + this.getJournalId()
+ " with namespace ... | [
"private",
"void",
"doUpgradeJournal",
"(",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"nsInfo",
".",
"getNamespaceID",
"(",
")",
"!=",
"0",
",",
"\"can't upgrade with uninitialized namespace info: %s\"",
",",
... | Upgrade the local journal storage with the given namespace. | [
"Upgrade",
"the",
"local",
"journal",
"storage",
"with",
"the",
"given",
"namespace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L425-L435 |
119,291 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.recoverJournal | private void recoverJournal(StartupOption startOpt) throws IOException {
LOG.info("Recovering journal " + this.getJournalId());
journalStorage.recover(startOpt);
} | java | private void recoverJournal(StartupOption startOpt) throws IOException {
LOG.info("Recovering journal " + this.getJournalId());
journalStorage.recover(startOpt);
} | [
"private",
"void",
"recoverJournal",
"(",
"StartupOption",
"startOpt",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Recovering journal \"",
"+",
"this",
".",
"getJournalId",
"(",
")",
")",
";",
"journalStorage",
".",
"recover",
"(",
"startOpt",... | Recover the local journal storage. | [
"Recover",
"the",
"local",
"journal",
"storage",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L440-L443 |
119,292 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.recoverImage | private void recoverImage(StartupOption startOpt) throws IOException {
LOG.info("Recovering image" + this.getJournalId());
imageStorage.recover(startOpt);
} | java | private void recoverImage(StartupOption startOpt) throws IOException {
LOG.info("Recovering image" + this.getJournalId());
imageStorage.recover(startOpt);
} | [
"private",
"void",
"recoverImage",
"(",
"StartupOption",
"startOpt",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Recovering image\"",
"+",
"this",
".",
"getJournalId",
"(",
")",
")",
";",
"imageStorage",
".",
"recover",
"(",
"startOpt",
")",... | Recover the local image storage. | [
"Recover",
"the",
"local",
"image",
"storage",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L448-L451 |
119,293 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.close | @Override // Closeable
public void close() throws IOException {
journalStorage.close();
imageStorage.close();
IOUtils.closeStream(committedTxnId);
} | java | @Override // Closeable
public void close() throws IOException {
journalStorage.close();
imageStorage.close();
IOUtils.closeStream(committedTxnId);
} | [
"@",
"Override",
"// Closeable",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"journalStorage",
".",
"close",
"(",
")",
";",
"imageStorage",
".",
"close",
"(",
")",
";",
"IOUtils",
".",
"closeStream",
"(",
"committedTxnId",
")",
";",
... | Unlock and release resources. | [
"Unlock",
"and",
"release",
"resources",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L456-L462 |
119,294 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.newEpoch | synchronized NewEpochResponseProto newEpoch(
NamespaceInfo nsInfo, long epoch) throws IOException {
checkJournalStorageFormatted();
journalStorage.checkConsistentNamespace(nsInfo);
// if we are storing image too, check consistency as well
if (imageStorage.isFormatted()) {
imageStorage.... | java | synchronized NewEpochResponseProto newEpoch(
NamespaceInfo nsInfo, long epoch) throws IOException {
checkJournalStorageFormatted();
journalStorage.checkConsistentNamespace(nsInfo);
// if we are storing image too, check consistency as well
if (imageStorage.isFormatted()) {
imageStorage.... | [
"synchronized",
"NewEpochResponseProto",
"newEpoch",
"(",
"NamespaceInfo",
"nsInfo",
",",
"long",
"epoch",
")",
"throws",
"IOException",
"{",
"checkJournalStorageFormatted",
"(",
")",
";",
"journalStorage",
".",
"checkConsistentNamespace",
"(",
"nsInfo",
")",
";",
"//... | Try to create a new epoch for this journal.
@param nsInfo the namespace, which is verified for consistency or used to
format, if the Journal has not yet been written to.
@param epoch the epoch to start
@return the status information necessary to begin recovery
@throws IOException if the node has already made a promise ... | [
"Try",
"to",
"create",
"a",
"new",
"epoch",
"for",
"this",
"journal",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L528-L557 |
119,295 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.checkRequest | private synchronized void checkRequest(RequestInfo reqInfo) throws IOException {
// Invariant 25 from ZAB paper
if (reqInfo.getEpoch() < lastPromisedEpoch.get()) {
throw new IOException("IPC's epoch " + reqInfo.getEpoch() +
" is less than the last promised epoch " +
lastPromisedEpoch.g... | java | private synchronized void checkRequest(RequestInfo reqInfo) throws IOException {
// Invariant 25 from ZAB paper
if (reqInfo.getEpoch() < lastPromisedEpoch.get()) {
throw new IOException("IPC's epoch " + reqInfo.getEpoch() +
" is less than the last promised epoch " +
lastPromisedEpoch.g... | [
"private",
"synchronized",
"void",
"checkRequest",
"(",
"RequestInfo",
"reqInfo",
")",
"throws",
"IOException",
"{",
"// Invariant 25 from ZAB paper",
"if",
"(",
"reqInfo",
".",
"getEpoch",
"(",
")",
"<",
"lastPromisedEpoch",
".",
"get",
"(",
")",
")",
"{",
"thr... | Ensure that the given request is coming from the correct writer and in-order.
@param reqInfo the request info
@throws IOException if the request is invalid. | [
"Ensure",
"that",
"the",
"given",
"request",
"is",
"coming",
"from",
"the",
"correct",
"writer",
"and",
"in",
"-",
"order",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L671-L706 |
119,296 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.startLogSegment | public synchronized void startLogSegment(RequestInfo reqInfo, long txid)
throws IOException {
assert fjm != null;
checkJournalStorageFormatted();
checkRequest(reqInfo);
if (curSegment != null) {
LOG.warn("Client is requesting a new log segment " + txid +
" though we are alrea... | java | public synchronized void startLogSegment(RequestInfo reqInfo, long txid)
throws IOException {
assert fjm != null;
checkJournalStorageFormatted();
checkRequest(reqInfo);
if (curSegment != null) {
LOG.warn("Client is requesting a new log segment " + txid +
" though we are alrea... | [
"public",
"synchronized",
"void",
"startLogSegment",
"(",
"RequestInfo",
"reqInfo",
",",
"long",
"txid",
")",
"throws",
"IOException",
"{",
"assert",
"fjm",
"!=",
"null",
";",
"checkJournalStorageFormatted",
"(",
")",
";",
"checkRequest",
"(",
"reqInfo",
")",
";... | Start a new segment at the given txid. The previous segment
must have already been finalized. | [
"Start",
"a",
"new",
"segment",
"at",
"the",
"given",
"txid",
".",
"The",
"previous",
"segment",
"must",
"have",
"already",
"been",
"finalized",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L795-L857 |
119,297 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.finalizeLogSegment | public synchronized void finalizeLogSegment(RequestInfo reqInfo, long startTxId,
long endTxId) throws IOException {
checkJournalStorageFormatted();
checkRequest(reqInfo);
boolean needsValidation = true;
// Finalizing the log that the writer was just writing.
if (startTxId == curSegmentTx... | java | public synchronized void finalizeLogSegment(RequestInfo reqInfo, long startTxId,
long endTxId) throws IOException {
checkJournalStorageFormatted();
checkRequest(reqInfo);
boolean needsValidation = true;
// Finalizing the log that the writer was just writing.
if (startTxId == curSegmentTx... | [
"public",
"synchronized",
"void",
"finalizeLogSegment",
"(",
"RequestInfo",
"reqInfo",
",",
"long",
"startTxId",
",",
"long",
"endTxId",
")",
"throws",
"IOException",
"{",
"checkJournalStorageFormatted",
"(",
")",
";",
"checkRequest",
"(",
"reqInfo",
")",
";",
"bo... | Finalize the log segment at the given transaction ID. | [
"Finalize",
"the",
"log",
"segment",
"at",
"the",
"given",
"transaction",
"ID",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L862-L916 |
119,298 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.purgePaxosDecision | private void purgePaxosDecision(long segmentTxId) throws IOException {
File paxosFile = journalStorage.getPaxosFile(segmentTxId);
if (paxosFile.exists()) {
if (!paxosFile.delete()) {
throw new IOException("Unable to delete paxos file " + paxosFile);
}
}
} | java | private void purgePaxosDecision(long segmentTxId) throws IOException {
File paxosFile = journalStorage.getPaxosFile(segmentTxId);
if (paxosFile.exists()) {
if (!paxosFile.delete()) {
throw new IOException("Unable to delete paxos file " + paxosFile);
}
}
} | [
"private",
"void",
"purgePaxosDecision",
"(",
"long",
"segmentTxId",
")",
"throws",
"IOException",
"{",
"File",
"paxosFile",
"=",
"journalStorage",
".",
"getPaxosFile",
"(",
"segmentTxId",
")",
";",
"if",
"(",
"paxosFile",
".",
"exists",
"(",
")",
")",
"{",
... | Remove the previously-recorded 'accepted recovery' information
for a given log segment, once it is no longer necessary.
@param segmentTxId the transaction ID to purge
@throws IOException if the file could not be deleted | [
"Remove",
"the",
"previously",
"-",
"recorded",
"accepted",
"recovery",
"information",
"for",
"a",
"given",
"log",
"segment",
"once",
"it",
"is",
"no",
"longer",
"necessary",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L950-L957 |
119,299 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.syncLog | File syncLog(RequestInfo reqInfo, final SegmentStateProto segment,
final URL url) throws IOException {
long startTxId = segment.getStartTxId();
long epoch = reqInfo.getEpoch();
return syncLog(epoch, segment.getStartTxId(), url, segment.toString(),
journalStorage.getSyncLogTemporaryFile(startTx... | java | File syncLog(RequestInfo reqInfo, final SegmentStateProto segment,
final URL url) throws IOException {
long startTxId = segment.getStartTxId();
long epoch = reqInfo.getEpoch();
return syncLog(epoch, segment.getStartTxId(), url, segment.toString(),
journalStorage.getSyncLogTemporaryFile(startTx... | [
"File",
"syncLog",
"(",
"RequestInfo",
"reqInfo",
",",
"final",
"SegmentStateProto",
"segment",
",",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"long",
"startTxId",
"=",
"segment",
".",
"getStartTxId",
"(",
")",
";",
"long",
"epoch",
"=",
"req... | Synchronize a log segment from another JournalNode. The log is
downloaded from the provided URL into a temporary location on disk,
which is named based on the current request's epoch.
@return the temporary location of the downloaded file | [
"Synchronize",
"a",
"log",
"segment",
"from",
"another",
"JournalNode",
".",
"The",
"log",
"is",
"downloaded",
"from",
"the",
"provided",
"URL",
"into",
"a",
"temporary",
"location",
"on",
"disk",
"which",
"is",
"named",
"based",
"on",
"the",
"current",
"req... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L1166-L1172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.