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,100 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.getTipCounters | Counters getTipCounters(TaskID tipid) {
TaskInProgress tip = getTip(tipid);
return (tip == null ? null : tip.getCounters());
} | java | Counters getTipCounters(TaskID tipid) {
TaskInProgress tip = getTip(tipid);
return (tip == null ? null : tip.getCounters());
} | [
"Counters",
"getTipCounters",
"(",
"TaskID",
"tipid",
")",
"{",
"TaskInProgress",
"tip",
"=",
"getTip",
"(",
"tipid",
")",
";",
"return",
"(",
"tip",
"==",
"null",
"?",
"null",
":",
"tip",
".",
"getCounters",
"(",
")",
")",
";",
"}"
] | Returns the counters for the specified task in progress. | [
"Returns",
"the",
"counters",
"for",
"the",
"specified",
"task",
"in",
"progress",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3557-L3560 |
119,101 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.setJobPriority | synchronized void setJobPriority(JobID jobId, JobPriority priority) {
JobInProgress job = jobs.get(jobId);
if (job != null) {
synchronized (taskScheduler) {
JobStatus oldStatus = (JobStatus)job.getStatus().clone();
job.setPriority(priority);
JobStatus newStatus = (JobStatus)job.get... | java | synchronized void setJobPriority(JobID jobId, JobPriority priority) {
JobInProgress job = jobs.get(jobId);
if (job != null) {
synchronized (taskScheduler) {
JobStatus oldStatus = (JobStatus)job.getStatus().clone();
job.setPriority(priority);
JobStatus newStatus = (JobStatus)job.get... | [
"synchronized",
"void",
"setJobPriority",
"(",
"JobID",
"jobId",
",",
"JobPriority",
"priority",
")",
"{",
"JobInProgress",
"job",
"=",
"jobs",
".",
"get",
"(",
"jobId",
")",
";",
"if",
"(",
"job",
"!=",
"null",
")",
"{",
"synchronized",
"(",
"taskSchedule... | Change the run-time priority of the given job.
@param jobId job id
@param priority new {@link JobPriority} for the job | [
"Change",
"the",
"run",
"-",
"time",
"priority",
"of",
"the",
"given",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3643-L3658 |
119,102 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.updateTaskStatuses | void updateTaskStatuses(TaskTrackerStatus status) {
String trackerName = status.getTrackerName();
for (TaskStatus report : status.getTaskReports()) {
report.setTaskTracker(trackerName);
TaskAttemptID taskId = report.getTaskID();
// Remove it from the expired task list
if (report.getRunS... | java | void updateTaskStatuses(TaskTrackerStatus status) {
String trackerName = status.getTrackerName();
for (TaskStatus report : status.getTaskReports()) {
report.setTaskTracker(trackerName);
TaskAttemptID taskId = report.getTaskID();
// Remove it from the expired task list
if (report.getRunS... | [
"void",
"updateTaskStatuses",
"(",
"TaskTrackerStatus",
"status",
")",
"{",
"String",
"trackerName",
"=",
"status",
".",
"getTrackerName",
"(",
")",
";",
"for",
"(",
"TaskStatus",
"report",
":",
"status",
".",
"getTaskReports",
"(",
")",
")",
"{",
"report",
... | Accept and process a new TaskTracker profile. We might
have known about the TaskTracker previously, or it might
be brand-new. All task-tracker structures have already
been updated. Just process the contained tasks and any
jobs that might be affected. | [
"Accept",
"and",
"process",
"a",
"new",
"TaskTracker",
"profile",
".",
"We",
"might",
"have",
"known",
"about",
"the",
"TaskTracker",
"previously",
"or",
"it",
"might",
"be",
"brand",
"-",
"new",
".",
"All",
"task",
"-",
"tracker",
"structures",
"have",
"a... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3670-L3752 |
119,103 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.lostTaskTracker | void lostTaskTracker(TaskTracker taskTracker) {
String trackerName = taskTracker.getTrackerName();
LOG.info("Lost tracker '" + trackerName + "'");
// remove the tracker from the local structures
synchronized (trackerToJobsToCleanup) {
trackerToJobsToCleanup.remove(trackerName);
}
synchro... | java | void lostTaskTracker(TaskTracker taskTracker) {
String trackerName = taskTracker.getTrackerName();
LOG.info("Lost tracker '" + trackerName + "'");
// remove the tracker from the local structures
synchronized (trackerToJobsToCleanup) {
trackerToJobsToCleanup.remove(trackerName);
}
synchro... | [
"void",
"lostTaskTracker",
"(",
"TaskTracker",
"taskTracker",
")",
"{",
"String",
"trackerName",
"=",
"taskTracker",
".",
"getTrackerName",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Lost tracker '\"",
"+",
"trackerName",
"+",
"\"'\"",
")",
";",
"// remove the t... | We lost the task tracker! All task-tracker structures have
already been updated. Just process the contained tasks and any
jobs that might be affected. | [
"We",
"lost",
"the",
"task",
"tracker!",
"All",
"task",
"-",
"tracker",
"structures",
"have",
"already",
"been",
"updated",
".",
"Just",
"process",
"the",
"contained",
"tasks",
"and",
"any",
"jobs",
"that",
"might",
"be",
"affected",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3759-L3831 |
119,104 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.removeTracker | private void removeTracker(TaskTracker tracker) {
String trackerName = tracker.getTrackerName();
// Remove completely after marking the tasks as 'KILLED'
lostTaskTracker(tracker);
TaskTrackerStatus status = tracker.getStatus();
// tracker is lost, and if it is blacklisted, remove
// it from the... | java | private void removeTracker(TaskTracker tracker) {
String trackerName = tracker.getTrackerName();
// Remove completely after marking the tasks as 'KILLED'
lostTaskTracker(tracker);
TaskTrackerStatus status = tracker.getStatus();
// tracker is lost, and if it is blacklisted, remove
// it from the... | [
"private",
"void",
"removeTracker",
"(",
"TaskTracker",
"tracker",
")",
"{",
"String",
"trackerName",
"=",
"tracker",
".",
"getTrackerName",
"(",
")",
";",
"// Remove completely after marking the tasks as 'KILLED'",
"lostTaskTracker",
"(",
"tracker",
")",
";",
"TaskTrac... | Remove a tracker from the system | [
"Remove",
"a",
"tracker",
"from",
"the",
"system"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3870-L3884 |
119,105 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.main | public static void main(String argv[]
) throws IOException, InterruptedException {
StringUtils.startupShutdownMessage(JobTracker.class, argv, LOG);
try {
if (argv.length == 0) {
JobTracker tracker = startTracker(new JobConf());
tracker.offerService();
ret... | java | public static void main(String argv[]
) throws IOException, InterruptedException {
StringUtils.startupShutdownMessage(JobTracker.class, argv, LOG);
try {
if (argv.length == 0) {
JobTracker tracker = startTracker(new JobConf());
tracker.offerService();
ret... | [
"public",
"static",
"void",
"main",
"(",
"String",
"argv",
"[",
"]",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"StringUtils",
".",
"startupShutdownMessage",
"(",
"JobTracker",
".",
"class",
",",
"argv",
",",
"LOG",
")",
";",
"try",
"{",... | Start the JobTracker process. This is used only for debugging. As a rule,
JobTracker should be run as part of the DFS Namenode process. | [
"Start",
"the",
"JobTracker",
"process",
".",
"This",
"is",
"used",
"only",
"for",
"debugging",
".",
"As",
"a",
"rule",
"JobTracker",
"should",
"be",
"run",
"as",
"part",
"of",
"the",
"DFS",
"Namenode",
"process",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3954-L3986 |
119,106 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.dumpConfiguration | private static void dumpConfiguration(Writer writer) throws IOException {
Configuration.dumpConfiguration(new JobConf(), writer);
writer.write("\n");
// get the QueueManager configuration properties
QueueManager.dumpConfiguration(writer);
writer.write("\n");
} | java | private static void dumpConfiguration(Writer writer) throws IOException {
Configuration.dumpConfiguration(new JobConf(), writer);
writer.write("\n");
// get the QueueManager configuration properties
QueueManager.dumpConfiguration(writer);
writer.write("\n");
} | [
"private",
"static",
"void",
"dumpConfiguration",
"(",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"Configuration",
".",
"dumpConfiguration",
"(",
"new",
"JobConf",
"(",
")",
",",
"writer",
")",
";",
"writer",
".",
"write",
"(",
"\"\\n\"",
")",
";... | Dumps the configuration properties in Json format
@param writer {@link}Writer object to which the output is written
@throws IOException | [
"Dumps",
"the",
"configuration",
"properties",
"in",
"Json",
"format"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L3993-L3999 |
119,107 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.checkMemoryRequirements | private void checkMemoryRequirements(JobInProgress job)
throws IOException {
if (!perTaskMemoryConfigurationSetOnJT()) {
LOG.debug("Per-Task memory configuration is not set on JT. "
+ "Not checking the job for invalid memory requirements.");
return;
}
boolean invalidJob = false;... | java | private void checkMemoryRequirements(JobInProgress job)
throws IOException {
if (!perTaskMemoryConfigurationSetOnJT()) {
LOG.debug("Per-Task memory configuration is not set on JT. "
+ "Not checking the job for invalid memory requirements.");
return;
}
boolean invalidJob = false;... | [
"private",
"void",
"checkMemoryRequirements",
"(",
"JobInProgress",
"job",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"perTaskMemoryConfigurationSetOnJT",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Per-Task memory configuration is not set on JT. \"",
"+",
... | Check the job if it has invalid requirements and throw and IOException if does have.
@param job
@throws IOException | [
"Check",
"the",
"job",
"if",
"it",
"has",
"invalid",
"requirements",
"and",
"throw",
"and",
"IOException",
"if",
"does",
"have",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L4128-L4162 |
119,108 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.updateTotalTaskCapacity | private void updateTotalTaskCapacity(TaskTrackerStatus status) {
int mapSlots = taskScheduler.getMaxSlots(status, TaskType.MAP);
String trackerName = status.getTrackerName();
Integer oldMapSlots = trackerNameToMapSlots.get(trackerName);
if (oldMapSlots == null) {
oldMapSlots = 0;
}
int del... | java | private void updateTotalTaskCapacity(TaskTrackerStatus status) {
int mapSlots = taskScheduler.getMaxSlots(status, TaskType.MAP);
String trackerName = status.getTrackerName();
Integer oldMapSlots = trackerNameToMapSlots.get(trackerName);
if (oldMapSlots == null) {
oldMapSlots = 0;
}
int del... | [
"private",
"void",
"updateTotalTaskCapacity",
"(",
"TaskTrackerStatus",
"status",
")",
"{",
"int",
"mapSlots",
"=",
"taskScheduler",
".",
"getMaxSlots",
"(",
"status",
",",
"TaskType",
".",
"MAP",
")",
";",
"String",
"trackerName",
"=",
"status",
".",
"getTracke... | Update totalMapTaskCapacity and totalReduceTaskCapacity to resolve the
number of slots changed in a tasktracker. The change could be from
TaskScheduler or TaskTrackerStatus
@param status The status of the tasktracker | [
"Update",
"totalMapTaskCapacity",
"and",
"totalReduceTaskCapacity",
"to",
"resolve",
"the",
"number",
"of",
"slots",
"changed",
"in",
"a",
"tasktracker",
".",
"The",
"change",
"could",
"be",
"from",
"TaskScheduler",
"or",
"TaskTrackerStatus"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L4208-L4241 |
119,109 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.removeTaskTrackerCapacity | private void removeTaskTrackerCapacity(TaskTrackerStatus status) {
Integer mapSlots = trackerNameToMapSlots.remove(status.getTrackerName());
if (mapSlots == null) {
mapSlots = 0;
}
totalMapTaskCapacity -= mapSlots;
Integer reduceSlots = trackerNameToReduceSlots.remove(status.getTrackerName())... | java | private void removeTaskTrackerCapacity(TaskTrackerStatus status) {
Integer mapSlots = trackerNameToMapSlots.remove(status.getTrackerName());
if (mapSlots == null) {
mapSlots = 0;
}
totalMapTaskCapacity -= mapSlots;
Integer reduceSlots = trackerNameToReduceSlots.remove(status.getTrackerName())... | [
"private",
"void",
"removeTaskTrackerCapacity",
"(",
"TaskTrackerStatus",
"status",
")",
"{",
"Integer",
"mapSlots",
"=",
"trackerNameToMapSlots",
".",
"remove",
"(",
"status",
".",
"getTrackerName",
"(",
")",
")",
";",
"if",
"(",
"mapSlots",
"==",
"null",
")",
... | Update totalMapTaskCapacity and totalReduceTaskCapacity for removing
a tasktracker
@param status The status of the tasktracker | [
"Update",
"totalMapTaskCapacity",
"and",
"totalReduceTaskCapacity",
"for",
"removing",
"a",
"tasktracker"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L4249-L4265 |
119,110 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java | JournalNodeJournalSyncer.recoverSegments | void recoverSegments(SyncTask task) throws IOException {
// obtain the list of segments that are valid
if (!prepareRecovery(task)) {
return;
}
// iterate through all nodes
for (InetSocketAddress jn : journalNodes) {
if (isLocalIpAddress(jn.getAddress())
&& jn.getPort() == jour... | java | void recoverSegments(SyncTask task) throws IOException {
// obtain the list of segments that are valid
if (!prepareRecovery(task)) {
return;
}
// iterate through all nodes
for (InetSocketAddress jn : journalNodes) {
if (isLocalIpAddress(jn.getAddress())
&& jn.getPort() == jour... | [
"void",
"recoverSegments",
"(",
"SyncTask",
"task",
")",
"throws",
"IOException",
"{",
"// obtain the list of segments that are valid",
"if",
"(",
"!",
"prepareRecovery",
"(",
"task",
")",
")",
"{",
"return",
";",
"}",
"// iterate through all nodes",
"for",
"(",
"In... | Recovers a single segment
@param elf
descriptor of the segment to be recovered
@param task
contains journal description
@throws IOException | [
"Recovers",
"a",
"single",
"segment"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java#L185-L219 |
119,111 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java | JournalNodeJournalSyncer.getManifest | private List<EditLogFile> getManifest(InetSocketAddress jn, Journal journal,
long minTxId) throws IOException {
String m = DFSUtil.getHTMLContentWithTimeout(
new URL("http", jn.getAddress().getHostAddress(), jn.getPort(),
GetJournalManifestServlet.buildPath(journal.getJournalId(),
... | java | private List<EditLogFile> getManifest(InetSocketAddress jn, Journal journal,
long minTxId) throws IOException {
String m = DFSUtil.getHTMLContentWithTimeout(
new URL("http", jn.getAddress().getHostAddress(), jn.getPort(),
GetJournalManifestServlet.buildPath(journal.getJournalId(),
... | [
"private",
"List",
"<",
"EditLogFile",
">",
"getManifest",
"(",
"InetSocketAddress",
"jn",
",",
"Journal",
"journal",
",",
"long",
"minTxId",
")",
"throws",
"IOException",
"{",
"String",
"m",
"=",
"DFSUtil",
".",
"getHTMLContentWithTimeout",
"(",
"new",
"URL",
... | Fetch manifest from a single given journal node over http. | [
"Fetch",
"manifest",
"from",
"a",
"single",
"given",
"journal",
"node",
"over",
"http",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java#L300-L308 |
119,112 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java | JournalNodeJournalSyncer.convertJsonToListManifest | public static List<EditLogFile> convertJsonToListManifest(String json)
throws IOException {
if (json == null || json.isEmpty()) {
return new ArrayList<EditLogFile>();
}
// get the list of strings from the http response
TypeReference<List<String>> type = new TypeReference<List<String>>() {
... | java | public static List<EditLogFile> convertJsonToListManifest(String json)
throws IOException {
if (json == null || json.isEmpty()) {
return new ArrayList<EditLogFile>();
}
// get the list of strings from the http response
TypeReference<List<String>> type = new TypeReference<List<String>>() {
... | [
"public",
"static",
"List",
"<",
"EditLogFile",
">",
"convertJsonToListManifest",
"(",
"String",
"json",
")",
"throws",
"IOException",
"{",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"ArrayList",
"<"... | Get the map corresponding to the JSON string. | [
"Get",
"the",
"map",
"corresponding",
"to",
"the",
"JSON",
"string",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java#L313-L329 |
119,113 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java | JournalNodeJournalSyncer.isLocalIpAddress | private boolean isLocalIpAddress(InetAddress addr) {
if (addr.isAnyLocalAddress() || addr.isLoopbackAddress())
return true;
try {
return NetworkInterface.getByInetAddress(addr) != null;
} catch (SocketException e) {
return false;
}
} | java | private boolean isLocalIpAddress(InetAddress addr) {
if (addr.isAnyLocalAddress() || addr.isLoopbackAddress())
return true;
try {
return NetworkInterface.getByInetAddress(addr) != null;
} catch (SocketException e) {
return false;
}
} | [
"private",
"boolean",
"isLocalIpAddress",
"(",
"InetAddress",
"addr",
")",
"{",
"if",
"(",
"addr",
".",
"isAnyLocalAddress",
"(",
")",
"||",
"addr",
".",
"isLoopbackAddress",
"(",
")",
")",
"return",
"true",
";",
"try",
"{",
"return",
"NetworkInterface",
"."... | Checks if the address is local. | [
"Checks",
"if",
"the",
"address",
"is",
"local",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeJournalSyncer.java#L472-L480 |
119,114 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/QueueManager.java | QueueManager.refreshAcls | synchronized void refreshAcls(Configuration conf) throws IOException {
try {
HashMap<String, AccessControlList> newAclsMap =
getQueueAcls(conf);
aclsMap = newAclsMap;
} catch (Throwable t) {
String exceptionString = StringUtils.stringifyException(t);
LOG.warn("Queue ACLs could n... | java | synchronized void refreshAcls(Configuration conf) throws IOException {
try {
HashMap<String, AccessControlList> newAclsMap =
getQueueAcls(conf);
aclsMap = newAclsMap;
} catch (Throwable t) {
String exceptionString = StringUtils.stringifyException(t);
LOG.warn("Queue ACLs could n... | [
"synchronized",
"void",
"refreshAcls",
"(",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"try",
"{",
"HashMap",
"<",
"String",
",",
"AccessControlList",
">",
"newAclsMap",
"=",
"getQueueAcls",
"(",
"conf",
")",
";",
"aclsMap",
"=",
"newAclsMap",
... | Refresh the acls for the configured queues in the system by reading
it from mapred-queue-acls.xml.
The previous acls are removed. Previously configured queues and
if or not acl is disabled is retained.
@throws IOException when queue ACL configuration file is invalid. | [
"Refresh",
"the",
"acls",
"for",
"the",
"configured",
"queues",
"in",
"the",
"system",
"by",
"reading",
"it",
"from",
"mapred",
"-",
"queue",
"-",
"acls",
".",
"xml",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/QueueManager.java#L246-L259 |
119,115 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/SocketCache.java | SocketCache.get | public Socket get(SocketAddress remote) {
synchronized(multimap) {
List<Socket> sockList = multimap.get(remote);
if (sockList == null) {
return null;
}
Iterator<Socket> iter = sockList.iterator();
while (iter.hasNext()) {
Socket candidate = iter.next();
i... | java | public Socket get(SocketAddress remote) {
synchronized(multimap) {
List<Socket> sockList = multimap.get(remote);
if (sockList == null) {
return null;
}
Iterator<Socket> iter = sockList.iterator();
while (iter.hasNext()) {
Socket candidate = iter.next();
i... | [
"public",
"Socket",
"get",
"(",
"SocketAddress",
"remote",
")",
"{",
"synchronized",
"(",
"multimap",
")",
"{",
"List",
"<",
"Socket",
">",
"sockList",
"=",
"multimap",
".",
"get",
"(",
"remote",
")",
";",
"if",
"(",
"sockList",
"==",
"null",
")",
"{",... | Get a cached socket to the given address
@param remote Remote address the socket is connected to.
@return A socket with unknown state, possibly closed underneath. Or null. | [
"Get",
"a",
"cached",
"socket",
"to",
"the",
"given",
"address"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/SocketCache.java#L58-L75 |
119,116 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/SocketCache.java | SocketCache.put | public void put(Socket sock) {
Preconditions.checkNotNull(sock);
SocketAddress remoteAddr = sock.getRemoteSocketAddress();
if (remoteAddr == null) {
LOG.warn("Cannot cache (unconnected) socket with no remote address: " +
sock);
IOUtils.closeSocket(sock);
return;
}
... | java | public void put(Socket sock) {
Preconditions.checkNotNull(sock);
SocketAddress remoteAddr = sock.getRemoteSocketAddress();
if (remoteAddr == null) {
LOG.warn("Cannot cache (unconnected) socket with no remote address: " +
sock);
IOUtils.closeSocket(sock);
return;
}
... | [
"public",
"void",
"put",
"(",
"Socket",
"sock",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"sock",
")",
";",
"SocketAddress",
"remoteAddr",
"=",
"sock",
".",
"getRemoteSocketAddress",
"(",
")",
";",
"if",
"(",
"remoteAddr",
"==",
"null",
")",
"{"... | Give an unused socket to the cache.
@param sock Socket not used by anyone. | [
"Give",
"an",
"unused",
"socket",
"to",
"the",
"cache",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/SocketCache.java#L81-L103 |
119,117 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/SocketCache.java | SocketCache.evictOldest | private Socket evictOldest() {
Iterator<Entry<SocketAddress, Socket>> iter =
multimap.entries().iterator();
if (!iter.hasNext()) {
throw new IllegalArgumentException("Cannot evict from empty cache!");
}
Entry<SocketAddress, Socket> entry = iter.next();
iter.remove();
return e... | java | private Socket evictOldest() {
Iterator<Entry<SocketAddress, Socket>> iter =
multimap.entries().iterator();
if (!iter.hasNext()) {
throw new IllegalArgumentException("Cannot evict from empty cache!");
}
Entry<SocketAddress, Socket> entry = iter.next();
iter.remove();
return e... | [
"private",
"Socket",
"evictOldest",
"(",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"SocketAddress",
",",
"Socket",
">",
">",
"iter",
"=",
"multimap",
".",
"entries",
"(",
")",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"!",
"iter",
".",
"hasNext",
"("... | Evict the oldest entry in the cache. | [
"Evict",
"the",
"oldest",
"entry",
"in",
"the",
"cache",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/SocketCache.java#L114-L124 |
119,118 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/SocketCache.java | SocketCache.clear | public void clear() {
List<Socket> socketsToClear = new LinkedList<Socket>();
synchronized(multimap) {
for (Socket sock : multimap.values()) {
socketsToClear.add(sock);
}
multimap.clear();
}
for (Socket sock : socketsToClear) {
IOUtils.closeSocket(sock);
}
} | java | public void clear() {
List<Socket> socketsToClear = new LinkedList<Socket>();
synchronized(multimap) {
for (Socket sock : multimap.values()) {
socketsToClear.add(sock);
}
multimap.clear();
}
for (Socket sock : socketsToClear) {
IOUtils.closeSocket(sock);
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"List",
"<",
"Socket",
">",
"socketsToClear",
"=",
"new",
"LinkedList",
"<",
"Socket",
">",
"(",
")",
";",
"synchronized",
"(",
"multimap",
")",
"{",
"for",
"(",
"Socket",
"sock",
":",
"multimap",
".",
"values"... | Empty the cache, and close all sockets. | [
"Empty",
"the",
"cache",
"and",
"close",
"all",
"sockets",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/SocketCache.java#L129-L141 |
119,119 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/PersistentLongFile.java | PersistentLongFile.writeFile | public static void writeFile(File file, long val) throws IOException {
AtomicFileOutputStream fos = new AtomicFileOutputStream(file);
try {
fos.write(String.valueOf(val).getBytes(Charsets.UTF_8));
fos.write('\n');
fos.close();
fos = null;
} finally {
if (fos != null) {
... | java | public static void writeFile(File file, long val) throws IOException {
AtomicFileOutputStream fos = new AtomicFileOutputStream(file);
try {
fos.write(String.valueOf(val).getBytes(Charsets.UTF_8));
fos.write('\n');
fos.close();
fos = null;
} finally {
if (fos != null) {
... | [
"public",
"static",
"void",
"writeFile",
"(",
"File",
"file",
",",
"long",
"val",
")",
"throws",
"IOException",
"{",
"AtomicFileOutputStream",
"fos",
"=",
"new",
"AtomicFileOutputStream",
"(",
"file",
")",
";",
"try",
"{",
"fos",
".",
"write",
"(",
"String",... | Atomically write the given value to the given file, including fsyncing.
@param file destination file
@param val value to write
@throws IOException if the file cannot be written | [
"Atomically",
"write",
"the",
"given",
"value",
"to",
"the",
"given",
"file",
"including",
"fsyncing",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/PersistentLongFile.java#L77-L89 |
119,120 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/NodeBase.java | NodeBase.normalize | static public String normalize(String path) {
if (path == null || path.length() == 0) return ROOT;
if (path.charAt(0) != PATH_SEPARATOR) {
throw new IllegalArgumentException(
"Network Location path does not start with "
... | java | static public String normalize(String path) {
if (path == null || path.length() == 0) return ROOT;
if (path.charAt(0) != PATH_SEPARATOR) {
throw new IllegalArgumentException(
"Network Location path does not start with "
... | [
"static",
"public",
"String",
"normalize",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
"||",
"path",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"ROOT",
";",
"if",
"(",
"path",
".",
"charAt",
"(",
"0",
")",
"!=",
"PAT... | Normalize a path | [
"Normalize",
"a",
"path"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NodeBase.java#L101-L115 |
119,121 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.recoverClusterManagerFromDisk | private void recoverClusterManagerFromDisk(HostsFileReader hostsReader)
throws IOException {
LOG.info("Restoring state from " +
new java.io.File(conf.getCMStateFile()).getAbsolutePath());
// This will prevent the expireNodes and expireSessions threads from
// expiring the nodes and sessions respe... | java | private void recoverClusterManagerFromDisk(HostsFileReader hostsReader)
throws IOException {
LOG.info("Restoring state from " +
new java.io.File(conf.getCMStateFile()).getAbsolutePath());
// This will prevent the expireNodes and expireSessions threads from
// expiring the nodes and sessions respe... | [
"private",
"void",
"recoverClusterManagerFromDisk",
"(",
"HostsFileReader",
"hostsReader",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Restoring state from \"",
"+",
"new",
"java",
".",
"io",
".",
"File",
"(",
"conf",
".",
"getCMStateFile",
"(",... | This method is used when the ClusterManager is restarting after going down
while in Safe Mode. It starts the process of recovering the original
CM state by reading back the state in JSON form.
@param hostsReader The HostsReader instance
@throws IOException | [
"This",
"method",
"is",
"used",
"when",
"the",
"ClusterManager",
"is",
"restarting",
"after",
"going",
"down",
"while",
"in",
"Safe",
"Mode",
".",
"It",
"starts",
"the",
"process",
"of",
"recovering",
"the",
"original",
"CM",
"state",
"by",
"reading",
"back"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L198-L231 |
119,122 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.initLegalTypes | protected void initLegalTypes() {
Map<Integer, Map<ResourceType, Integer>> cpuToResourcePartitioning =
conf.getCpuToResourcePartitioning();
for (Map.Entry<Integer, Map<ResourceType, Integer>> entry :
cpuToResourcePartitioning.entrySet()) {
for (ResourceType type : entry.getValue().keySet(... | java | protected void initLegalTypes() {
Map<Integer, Map<ResourceType, Integer>> cpuToResourcePartitioning =
conf.getCpuToResourcePartitioning();
for (Map.Entry<Integer, Map<ResourceType, Integer>> entry :
cpuToResourcePartitioning.entrySet()) {
for (ResourceType type : entry.getValue().keySet(... | [
"protected",
"void",
"initLegalTypes",
"(",
")",
"{",
"Map",
"<",
"Integer",
",",
"Map",
"<",
"ResourceType",
",",
"Integer",
">",
">",
"cpuToResourcePartitioning",
"=",
"conf",
".",
"getCpuToResourcePartitioning",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Ent... | Prepare the legal types allowed based on the resources available | [
"Prepare",
"the",
"legal",
"types",
"allowed",
"based",
"on",
"the",
"resources",
"available"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L236-L247 |
119,123 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.checkResourceRequestType | protected boolean checkResourceRequestType(
List<ResourceRequest> requestList) {
for (ResourceRequest req: requestList) {
if (!legalTypeSet.contains(req.type)) {
return false;
}
}
return true;
} | java | protected boolean checkResourceRequestType(
List<ResourceRequest> requestList) {
for (ResourceRequest req: requestList) {
if (!legalTypeSet.contains(req.type)) {
return false;
}
}
return true;
} | [
"protected",
"boolean",
"checkResourceRequestType",
"(",
"List",
"<",
"ResourceRequest",
">",
"requestList",
")",
"{",
"for",
"(",
"ResourceRequest",
"req",
":",
"requestList",
")",
"{",
"if",
"(",
"!",
"legalTypeSet",
".",
"contains",
"(",
"req",
".",
"type",... | Check all the resource requests and ensure that they are legal.
@param requestList List of resource requests to check
@return True if the resources are legal, false otherwise | [
"Check",
"all",
"the",
"resource",
"requests",
"and",
"ensure",
"that",
"they",
"are",
"legal",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L435-L443 |
119,124 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.checkResourceRequestLimit | protected void checkResourceRequestLimit(
List<ResourceRequest> requestList, String handle)
throws InvalidSessionHandle {
ConfigManager configManager = getScheduler().getConfigManager();
Session session = sessionManager.getSession(handle);
PoolInfo poolInfo = session.getPoolInfo();
// Only ... | java | protected void checkResourceRequestLimit(
List<ResourceRequest> requestList, String handle)
throws InvalidSessionHandle {
ConfigManager configManager = getScheduler().getConfigManager();
Session session = sessionManager.getSession(handle);
PoolInfo poolInfo = session.getPoolInfo();
// Only ... | [
"protected",
"void",
"checkResourceRequestLimit",
"(",
"List",
"<",
"ResourceRequest",
">",
"requestList",
",",
"String",
"handle",
")",
"throws",
"InvalidSessionHandle",
"{",
"ConfigManager",
"configManager",
"=",
"getScheduler",
"(",
")",
".",
"getConfigManager",
"(... | Count the resources requested and fail the job if they are above the limit
@param requestList List of resource requests to check | [
"Count",
"the",
"resources",
"requested",
"and",
"fail",
"the",
"job",
"if",
"they",
"are",
"above",
"the",
"limit"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L469-L503 |
119,125 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.setSafeMode | @Override
public synchronized boolean setSafeMode(boolean safeMode) {
/**
* If we are switching off the safe mode, so we need to reset the last
* heartbeat timestamp for each of the sessions and nodes.
*/
if (safeMode == false) {
LOG.info("Resetting the heartbeat times for all sessions");... | java | @Override
public synchronized boolean setSafeMode(boolean safeMode) {
/**
* If we are switching off the safe mode, so we need to reset the last
* heartbeat timestamp for each of the sessions and nodes.
*/
if (safeMode == false) {
LOG.info("Resetting the heartbeat times for all sessions");... | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"setSafeMode",
"(",
"boolean",
"safeMode",
")",
"{",
"/**\n * If we are switching off the safe mode, so we need to reset the last\n * heartbeat timestamp for each of the sessions and nodes.\n */",
"if",
"(",
"safeMode",
... | Sets the Safe Mode flag on the Cluster Manager, and on the ProxyJobTracker.
If we fail to set the flag on the ProxyJobTracker, return false, which
signals that setting the flag on the ProxyJobTracker failed. In that case,
we should run coronaadmin with the -forceSetSafeModeOnPJT or
-forceUnsetSafeModeOnPJT options.
If... | [
"Sets",
"the",
"Safe",
"Mode",
"flag",
"on",
"the",
"Cluster",
"Manager",
"and",
"on",
"the",
"ProxyJobTracker",
".",
"If",
"we",
"fail",
"to",
"set",
"the",
"flag",
"on",
"the",
"ProxyJobTracker",
"return",
"false",
"which",
"signals",
"that",
"setting",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L647-L680 |
119,126 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.persistState | @Override
public boolean persistState() {
if (!safeMode) {
LOG.info(
"Cannot persist state because ClusterManager is not in Safe Mode");
return false;
}
try {
JsonGenerator jsonGenerator = CoronaSerializer.createJsonGenerator(conf);
jsonGenerator.writeStartObject();
... | java | @Override
public boolean persistState() {
if (!safeMode) {
LOG.info(
"Cannot persist state because ClusterManager is not in Safe Mode");
return false;
}
try {
JsonGenerator jsonGenerator = CoronaSerializer.createJsonGenerator(conf);
jsonGenerator.writeStartObject();
... | [
"@",
"Override",
"public",
"boolean",
"persistState",
"(",
")",
"{",
"if",
"(",
"!",
"safeMode",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Cannot persist state because ClusterManager is not in Safe Mode\"",
")",
";",
"return",
"false",
";",
"}",
"try",
"{",
"JsonGen... | This function saves the state of the ClusterManager to disk.
@return A boolean. True if saving the state succeeded, false otherwise. | [
"This",
"function",
"saves",
"the",
"state",
"of",
"the",
"ClusterManager",
"to",
"disk",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L693-L724 |
119,127 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.nodeTimeout | public void nodeTimeout(String nodeName) {
if (nodeRestarter != null) {
nodeRestarter.delete(nodeName);
}
Set<String> sessions = nodeManager.getNodeSessions(nodeName);
Set<ClusterNode.GrantId> grantsToRevoke = nodeManager.deleteNode(nodeName);
if (grantsToRevoke == null) {
return;
}
... | java | public void nodeTimeout(String nodeName) {
if (nodeRestarter != null) {
nodeRestarter.delete(nodeName);
}
Set<String> sessions = nodeManager.getNodeSessions(nodeName);
Set<ClusterNode.GrantId> grantsToRevoke = nodeManager.deleteNode(nodeName);
if (grantsToRevoke == null) {
return;
}
... | [
"public",
"void",
"nodeTimeout",
"(",
"String",
"nodeName",
")",
"{",
"if",
"(",
"nodeRestarter",
"!=",
"null",
")",
"{",
"nodeRestarter",
".",
"delete",
"(",
"nodeName",
")",
";",
"}",
"Set",
"<",
"String",
">",
"sessions",
"=",
"nodeManager",
".",
"get... | This is an internal api called to tell the cluster manager that a
a particular node seems dysfunctional and that it should be removed
from the cluster.
@param nodeName Node to be removed | [
"This",
"is",
"an",
"internal",
"api",
"called",
"to",
"tell",
"the",
"cluster",
"manager",
"that",
"a",
"a",
"particular",
"node",
"seems",
"dysfunctional",
"and",
"that",
"it",
"should",
"be",
"removed",
"from",
"the",
"cluster",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L811-L823 |
119,128 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.nodeAppRemoved | public void nodeAppRemoved(String nodeName, ResourceType type) {
Set<String> sessions = nodeManager.getNodeSessions(nodeName);
Set<ClusterNode.GrantId> grantsToRevoke =
nodeManager.deleteAppFromNode(nodeName, type);
if (grantsToRevoke == null) {
return;
}
Set<String> affectedSessions = n... | java | public void nodeAppRemoved(String nodeName, ResourceType type) {
Set<String> sessions = nodeManager.getNodeSessions(nodeName);
Set<ClusterNode.GrantId> grantsToRevoke =
nodeManager.deleteAppFromNode(nodeName, type);
if (grantsToRevoke == null) {
return;
}
Set<String> affectedSessions = n... | [
"public",
"void",
"nodeAppRemoved",
"(",
"String",
"nodeName",
",",
"ResourceType",
"type",
")",
"{",
"Set",
"<",
"String",
">",
"sessions",
"=",
"nodeManager",
".",
"getNodeSessions",
"(",
"nodeName",
")",
";",
"Set",
"<",
"ClusterNode",
".",
"GrantId",
">"... | This is an internal api called to tell the cluster manager that a
particular type of resource is no longer available on a node.
@param nodeName
Name of the node on which the resource is removed.
@param type
The type of resource to be removed. | [
"This",
"is",
"an",
"internal",
"api",
"called",
"to",
"tell",
"the",
"cluster",
"manager",
"that",
"a",
"particular",
"type",
"of",
"resource",
"is",
"no",
"longer",
"available",
"on",
"a",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L847-L870 |
119,129 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.handleRevokedGrants | private void handleRevokedGrants(
String nodeName, Set<ClusterNode.GrantId> grantsToRevoke) {
for (ClusterNode.GrantId grantId: grantsToRevoke) {
String sessionHandle = grantId.getSessionId();
try {
sessionManager.revokeResource(sessionHandle,
Collections.singletonList(grantId... | java | private void handleRevokedGrants(
String nodeName, Set<ClusterNode.GrantId> grantsToRevoke) {
for (ClusterNode.GrantId grantId: grantsToRevoke) {
String sessionHandle = grantId.getSessionId();
try {
sessionManager.revokeResource(sessionHandle,
Collections.singletonList(grantId... | [
"private",
"void",
"handleRevokedGrants",
"(",
"String",
"nodeName",
",",
"Set",
"<",
"ClusterNode",
".",
"GrantId",
">",
"grantsToRevoke",
")",
"{",
"for",
"(",
"ClusterNode",
".",
"GrantId",
"grantId",
":",
"grantsToRevoke",
")",
"{",
"String",
"sessionHandle"... | Process the grants removed from a node.
@param nodeName
The node name.
@param grantsToRevoke
The grants to revoke. | [
"Process",
"the",
"grants",
"removed",
"from",
"a",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L880-L894 |
119,130 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.handleDeadNode | private void handleDeadNode(String nodeName, Set<String> sessions) {
LOG.info("Notify sessions: " + sessions + " about dead node " + nodeName);
for (String session : sessions) {
sessionNotifier.notifyDeadNode(session, nodeName);
}
} | java | private void handleDeadNode(String nodeName, Set<String> sessions) {
LOG.info("Notify sessions: " + sessions + " about dead node " + nodeName);
for (String session : sessions) {
sessionNotifier.notifyDeadNode(session, nodeName);
}
} | [
"private",
"void",
"handleDeadNode",
"(",
"String",
"nodeName",
",",
"Set",
"<",
"String",
">",
"sessions",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Notify sessions: \"",
"+",
"sessions",
"+",
"\" about dead node \"",
"+",
"nodeName",
")",
";",
"for",
"(",
"Str... | All the sessions that had grants on this node should get notified
@param nodeName the name of the node that went dead | [
"All",
"the",
"sessions",
"that",
"had",
"grants",
"on",
"this",
"node",
"should",
"get",
"notified"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L900-L905 |
119,131 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.updateCurrentThreadName | private void updateCurrentThreadName(String status) {
StringBuilder sb = new StringBuilder();
sb.append("DataXceiver for client ");
InetAddress ia;
if (s != null && (ia = s.getInetAddress()) != null) {
sb.append(ia.toString());
} else {
sb.append("unknown");
}
if (status !... | java | private void updateCurrentThreadName(String status) {
StringBuilder sb = new StringBuilder();
sb.append("DataXceiver for client ");
InetAddress ia;
if (s != null && (ia = s.getInetAddress()) != null) {
sb.append(ia.toString());
} else {
sb.append("unknown");
}
if (status !... | [
"private",
"void",
"updateCurrentThreadName",
"(",
"String",
"status",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"DataXceiver for client \"",
")",
";",
"InetAddress",
"ia",
";",
"if",
"(",
"s",
"... | Update the thread name to contain the current status.
Use this only after this receiver has started on its thread, i.e.,
outside the constructor. | [
"Update",
"the",
"thread",
"name",
"to",
"contain",
"the",
"current",
"status",
".",
"Use",
"this",
"only",
"after",
"this",
"receiver",
"has",
"started",
"on",
"its",
"thread",
"i",
".",
"e",
".",
"outside",
"the",
"constructor",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L120-L134 |
119,132 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.readMetadata | void readMetadata(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
ReadMetadataHeader readMetadataHeader =
new ReadMetadataHeader(versionAndOpcode);
readMetadataHeader.readFields(in);
final int namespaceId = readMetadataHeader.getNamespaceId();
Block block = new... | java | void readMetadata(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
ReadMetadataHeader readMetadataHeader =
new ReadMetadataHeader(versionAndOpcode);
readMetadataHeader.readFields(in);
final int namespaceId = readMetadataHeader.getNamespaceId();
Block block = new... | [
"void",
"readMetadata",
"(",
"DataInputStream",
"in",
",",
"VersionAndOpcode",
"versionAndOpcode",
")",
"throws",
"IOException",
"{",
"ReadMetadataHeader",
"readMetadataHeader",
"=",
"new",
"ReadMetadataHeader",
"(",
"versionAndOpcode",
")",
";",
"readMetadataHeader",
"."... | Reads the metadata and sends the data in one 'DATA_CHUNK'.
@param in | [
"Reads",
"the",
"metadata",
"and",
"sends",
"the",
"data",
"in",
"one",
"DATA_CHUNK",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L891-L924 |
119,133 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.getBlockCrc | void getBlockCrc(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
// header
BlockChecksumHeader blockChecksumHeader =
new BlockChecksumHeader(versionAndOpcode);
blockChecksumHeader.readFields(in);
final int namespaceId = blockChecksumHeader.getNamespaceId();
... | java | void getBlockCrc(DataInputStream in, VersionAndOpcode versionAndOpcode)
throws IOException {
// header
BlockChecksumHeader blockChecksumHeader =
new BlockChecksumHeader(versionAndOpcode);
blockChecksumHeader.readFields(in);
final int namespaceId = blockChecksumHeader.getNamespaceId();
... | [
"void",
"getBlockCrc",
"(",
"DataInputStream",
"in",
",",
"VersionAndOpcode",
"versionAndOpcode",
")",
"throws",
"IOException",
"{",
"// header",
"BlockChecksumHeader",
"blockChecksumHeader",
"=",
"new",
"BlockChecksumHeader",
"(",
"versionAndOpcode",
")",
";",
"blockChec... | Get block data's CRC32 checksum.
@param in
@param versionAndOpcode | [
"Get",
"block",
"data",
"s",
"CRC32",
"checksum",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L931-L985 |
119,134 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.copyBlock | private void copyBlock(DataInputStream in,
VersionAndOpcode versionAndOpcode) throws IOException {
// Read in the header
CopyBlockHeader copyBlockHeader = new CopyBlockHeader(versionAndOpcode);
copyBlockHeader.readFields(in);
long startTime = System.currentTimeMillis();
int namespaceId = ... | java | private void copyBlock(DataInputStream in,
VersionAndOpcode versionAndOpcode) throws IOException {
// Read in the header
CopyBlockHeader copyBlockHeader = new CopyBlockHeader(versionAndOpcode);
copyBlockHeader.readFields(in);
long startTime = System.currentTimeMillis();
int namespaceId = ... | [
"private",
"void",
"copyBlock",
"(",
"DataInputStream",
"in",
",",
"VersionAndOpcode",
"versionAndOpcode",
")",
"throws",
"IOException",
"{",
"// Read in the header",
"CopyBlockHeader",
"copyBlockHeader",
"=",
"new",
"CopyBlockHeader",
"(",
"versionAndOpcode",
")",
";",
... | Read a block from the disk and then sends it to a destination.
@param in The stream to read from
@throws IOException | [
"Read",
"a",
"block",
"from",
"the",
"disk",
"and",
"then",
"sends",
"it",
"to",
"a",
"destination",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L1107-L1172 |
119,135 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.sendResponse | private void sendResponse(Socket s, short opStatus, long timeout)
throws IOException {
DataOutputStream reply =
new DataOutputStream(NetUtils.getOutputStream(s, timeout));
reply.writeShort(opStatus);
reply.flush();
} | java | private void sendResponse(Socket s, short opStatus, long timeout)
throws IOException {
DataOutputStream reply =
new DataOutputStream(NetUtils.getOutputStream(s, timeout));
reply.writeShort(opStatus);
reply.flush();
} | [
"private",
"void",
"sendResponse",
"(",
"Socket",
"s",
",",
"short",
"opStatus",
",",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"reply",
"=",
"new",
"DataOutputStream",
"(",
"NetUtils",
".",
"getOutputStream",
"(",
"s",
",",
"ti... | Utility function for sending a response.
@param s socket to write to
@param opStatus status message to write
@param timeout send timeout | [
"Utility",
"function",
"for",
"sending",
"a",
"response",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L1298-L1305 |
119,136 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/rumen/JsonObjectMapperParser.java | JsonObjectMapperParser.getNext | public T getNext() throws IOException {
try {
return mapper.readValue(jsonParser, clazz);
} catch (EOFException e) {
return null;
}
} | java | public T getNext() throws IOException {
try {
return mapper.readValue(jsonParser, clazz);
} catch (EOFException e) {
return null;
}
} | [
"public",
"T",
"getNext",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"mapper",
".",
"readValue",
"(",
"jsonParser",
",",
"clazz",
")",
";",
"}",
"catch",
"(",
"EOFException",
"e",
")",
"{",
"return",
"null",
";",
"}",
"}"
] | Get the next object from the trace.
@return The next instance of the object. Or null if we reach the end of
stream.
@throws IOException | [
"Get",
"the",
"next",
"object",
"from",
"the",
"trace",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/rumen/JsonObjectMapperParser.java#L98-L104 |
119,137 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DBUtils.java | DBUtils.runInsertSelect | public static List<List<Object>> runInsertSelect(
DBConnectionFactory connectionFactory, String sql,
List<Object> sqlParams, boolean isWrite, int numRetries,
int retryMaxInternalSec, boolean insert, boolean getGeneratedKeys)
throws IOException {
int waitMS = 3000; // wait for at least 3s befor... | java | public static List<List<Object>> runInsertSelect(
DBConnectionFactory connectionFactory, String sql,
List<Object> sqlParams, boolean isWrite, int numRetries,
int retryMaxInternalSec, boolean insert, boolean getGeneratedKeys)
throws IOException {
int waitMS = 3000; // wait for at least 3s befor... | [
"public",
"static",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"runInsertSelect",
"(",
"DBConnectionFactory",
"connectionFactory",
",",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"sqlParams",
",",
"boolean",
"isWrite",
",",
"int",
"numRetries",
",",
... | returned by the query. In the case of an insert, returns null. | [
"returned",
"by",
"the",
"query",
".",
"In",
"the",
"case",
"of",
"an",
"insert",
"returns",
"null",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DBUtils.java#L176-L262 |
119,138 | facebookarchive/hadoop-20 | src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/IntermediateForm.java | IntermediateForm.process | public void process(DocumentAndOp doc, Analyzer analyzer) throws IOException {
if (doc.getOp() == DocumentAndOp.Op.DELETE
|| doc.getOp() == DocumentAndOp.Op.UPDATE) {
deleteList.add(doc.getTerm());
}
if (doc.getOp() == DocumentAndOp.Op.INSERT
|| doc.getOp() == DocumentAndOp.O... | java | public void process(DocumentAndOp doc, Analyzer analyzer) throws IOException {
if (doc.getOp() == DocumentAndOp.Op.DELETE
|| doc.getOp() == DocumentAndOp.Op.UPDATE) {
deleteList.add(doc.getTerm());
}
if (doc.getOp() == DocumentAndOp.Op.INSERT
|| doc.getOp() == DocumentAndOp.O... | [
"public",
"void",
"process",
"(",
"DocumentAndOp",
"doc",
",",
"Analyzer",
"analyzer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"doc",
".",
"getOp",
"(",
")",
"==",
"DocumentAndOp",
".",
"Op",
".",
"DELETE",
"||",
"doc",
".",
"getOp",
"(",
")",
"=... | This method is used by the index update mapper and process a document
operation into the current intermediate form.
@param doc input document operation
@param analyzer the analyzer
@throws IOException | [
"This",
"method",
"is",
"used",
"by",
"the",
"index",
"update",
"mapper",
"and",
"process",
"a",
"document",
"operation",
"into",
"the",
"current",
"intermediate",
"form",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/mapred/IntermediateForm.java#L96-L115 |
119,139 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/CompressedWritable.java | CompressedWritable.ensureInflated | protected void ensureInflated() {
if (compressed != null) {
try {
ByteArrayInputStream deflated = new ByteArrayInputStream(compressed);
DataInput inflater =
new DataInputStream(new InflaterInputStream(deflated));
readFieldsCompressed(inflater);
compressed = null;
... | java | protected void ensureInflated() {
if (compressed != null) {
try {
ByteArrayInputStream deflated = new ByteArrayInputStream(compressed);
DataInput inflater =
new DataInputStream(new InflaterInputStream(deflated));
readFieldsCompressed(inflater);
compressed = null;
... | [
"protected",
"void",
"ensureInflated",
"(",
")",
"{",
"if",
"(",
"compressed",
"!=",
"null",
")",
"{",
"try",
"{",
"ByteArrayInputStream",
"deflated",
"=",
"new",
"ByteArrayInputStream",
"(",
"compressed",
")",
";",
"DataInput",
"inflater",
"=",
"new",
"DataIn... | Must be called by all methods which access fields to ensure that the data
has been uncompressed. | [
"Must",
"be",
"called",
"by",
"all",
"methods",
"which",
"access",
"fields",
"to",
"ensure",
"that",
"the",
"data",
"has",
"been",
"uncompressed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/CompressedWritable.java#L50-L62 |
119,140 | facebookarchive/hadoop-20 | src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java | ProxyUgiManager.getUgiForUser | public static synchronized UnixUserGroupInformation getUgiForUser(
String userName) {
long now = System.currentTimeMillis();
long cutoffTime = now - ugiLifetime;
CachedUgi cachedUgi = ugiCache.get(userName);
if (cachedUgi != null && cachedUgi.getInitTime() > cutoffTime)
return cachedUgi.getU... | java | public static synchronized UnixUserGroupInformation getUgiForUser(
String userName) {
long now = System.currentTimeMillis();
long cutoffTime = now - ugiLifetime;
CachedUgi cachedUgi = ugiCache.get(userName);
if (cachedUgi != null && cachedUgi.getInitTime() > cutoffTime)
return cachedUgi.getU... | [
"public",
"static",
"synchronized",
"UnixUserGroupInformation",
"getUgiForUser",
"(",
"String",
"userName",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"cutoffTime",
"=",
"now",
"-",
"ugiLifetime",
";",
"CachedUgi",
"... | retrieve an ugi for a user. try the cache first, if not found, get it by
running a shell command | [
"retrieve",
"an",
"ugi",
"for",
"a",
"user",
".",
"try",
"the",
"cache",
"first",
"if",
"not",
"found",
"get",
"it",
"by",
"running",
"a",
"shell",
"command"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java#L49-L73 |
119,141 | facebookarchive/hadoop-20 | src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java | ProxyUgiManager.saveToCache | static synchronized void saveToCache(UnixUserGroupInformation ugi) {
ugiCache.put(ugi.getUserName(), new CachedUgi(ugi, System
.currentTimeMillis()));
} | java | static synchronized void saveToCache(UnixUserGroupInformation ugi) {
ugiCache.put(ugi.getUserName(), new CachedUgi(ugi, System
.currentTimeMillis()));
} | [
"static",
"synchronized",
"void",
"saveToCache",
"(",
"UnixUserGroupInformation",
"ugi",
")",
"{",
"ugiCache",
".",
"put",
"(",
"ugi",
".",
"getUserName",
"(",
")",
",",
"new",
"CachedUgi",
"(",
"ugi",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
... | save an ugi to cache, only for junit testing purposes | [
"save",
"an",
"ugi",
"to",
"cache",
"only",
"for",
"junit",
"testing",
"purposes"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java#L86-L89 |
119,142 | facebookarchive/hadoop-20 | src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java | ProxyUgiManager.getUgi | private static UnixUserGroupInformation getUgi(String userName)
throws IOException {
if (userName == null || !USERNAME_PATTERN.matcher(userName).matches())
throw new IOException("Invalid username=" + userName);
String[] cmd = new String[] { "bash", "-c", "id -Gn '" + userName + "'"};
String[] gr... | java | private static UnixUserGroupInformation getUgi(String userName)
throws IOException {
if (userName == null || !USERNAME_PATTERN.matcher(userName).matches())
throw new IOException("Invalid username=" + userName);
String[] cmd = new String[] { "bash", "-c", "id -Gn '" + userName + "'"};
String[] gr... | [
"private",
"static",
"UnixUserGroupInformation",
"getUgi",
"(",
"String",
"userName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"userName",
"==",
"null",
"||",
"!",
"USERNAME_PATTERN",
".",
"matcher",
"(",
"userName",
")",
".",
"matches",
"(",
")",
")",
... | Get the ugi for a user by running shell command "id -Gn"
@param userName name of the user
@return ugi of the user
@throws IOException if encounter any error while running the command | [
"Get",
"the",
"ugi",
"for",
"a",
"user",
"by",
"running",
"shell",
"command",
"id",
"-",
"Gn"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUgiManager.java#L103-L110 |
119,143 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java | NodeHealthCheckerService.start | void start() {
// if health script path is not configured don't start the thread.
if (!shouldRun(conf)) {
LOG.info("Not starting node health monitor");
return;
}
nodeHealthScriptScheduler = new Timer("NodeHealthMonitor-Timer", true);
// Start the timer task immediately and
// then pe... | java | void start() {
// if health script path is not configured don't start the thread.
if (!shouldRun(conf)) {
LOG.info("Not starting node health monitor");
return;
}
nodeHealthScriptScheduler = new Timer("NodeHealthMonitor-Timer", true);
// Start the timer task immediately and
// then pe... | [
"void",
"start",
"(",
")",
"{",
"// if health script path is not configured don't start the thread.",
"if",
"(",
"!",
"shouldRun",
"(",
"conf",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Not starting node health monitor\"",
")",
";",
"return",
";",
"}",
"nodeHealthS... | Method used to start the Node health monitoring. | [
"Method",
"used",
"to",
"start",
"the",
"Node",
"health",
"monitoring",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java#L228-L238 |
119,144 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java | NodeHealthCheckerService.stop | void stop() {
if (!shouldRun(conf)) {
return;
}
nodeHealthScriptScheduler.cancel();
if (shexec != null) {
Process p = shexec.getProcess();
if (p != null) {
p.destroy();
}
}
} | java | void stop() {
if (!shouldRun(conf)) {
return;
}
nodeHealthScriptScheduler.cancel();
if (shexec != null) {
Process p = shexec.getProcess();
if (p != null) {
p.destroy();
}
}
} | [
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"shouldRun",
"(",
"conf",
")",
")",
"{",
"return",
";",
"}",
"nodeHealthScriptScheduler",
".",
"cancel",
"(",
")",
";",
"if",
"(",
"shexec",
"!=",
"null",
")",
"{",
"Process",
"p",
"=",
"shexec",
".",
... | Method used to terminate the node health monitoring service. | [
"Method",
"used",
"to",
"terminate",
"the",
"node",
"health",
"monitoring",
"service",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java#L244-L255 |
119,145 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/WritableName.java | WritableName.setName | public static synchronized void setName(Class writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | java | public static synchronized void setName(Class writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | [
"public",
"static",
"synchronized",
"void",
"setName",
"(",
"Class",
"writableClass",
",",
"String",
"name",
")",
"{",
"CLASS_TO_NAME",
".",
"put",
"(",
"writableClass",
",",
"name",
")",
";",
"NAME_TO_CLASS",
".",
"put",
"(",
"name",
",",
"writableClass",
"... | Set the name that a class should be known as to something other than the
class name. | [
"Set",
"the",
"name",
"that",
"a",
"class",
"should",
"be",
"known",
"as",
"to",
"something",
"other",
"than",
"the",
"class",
"name",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/WritableName.java#L46-L49 |
119,146 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ParityFilePair.java | ParityFilePair.parityExists | public static boolean parityExists(FileStatus src, Codec codec,
Configuration conf) throws IOException {
return ParityFilePair.getParityFile(codec, src, conf) != null;
} | java | public static boolean parityExists(FileStatus src, Codec codec,
Configuration conf) throws IOException {
return ParityFilePair.getParityFile(codec, src, conf) != null;
} | [
"public",
"static",
"boolean",
"parityExists",
"(",
"FileStatus",
"src",
",",
"Codec",
"codec",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"ParityFilePair",
".",
"getParityFile",
"(",
"codec",
",",
"src",
",",
"conf",
")",
"!=",... | Return whether if parity file of the source file exists or not
@param src The FileStatus of the source file.
@param codec The Codec of the parity to check
@param conf
@return
@throws IOException | [
"Return",
"whether",
"if",
"parity",
"file",
"of",
"the",
"source",
"file",
"exists",
"or",
"not"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ParityFilePair.java#L57-L60 |
119,147 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerAvailabilityChecker.java | ClusterManagerAvailabilityChecker.getPJTClient | public static CoronaProxyJobTrackerService.Client
getPJTClient(CoronaConf conf) throws IOException {
InetSocketAddress address =
NetUtils.createSocketAddr(conf.getProxyJobTrackerThriftAddress());
TFramedTransport transport = new TFramedTransport(
new TSocket(address.getHostName(), address.getPor... | java | public static CoronaProxyJobTrackerService.Client
getPJTClient(CoronaConf conf) throws IOException {
InetSocketAddress address =
NetUtils.createSocketAddr(conf.getProxyJobTrackerThriftAddress());
TFramedTransport transport = new TFramedTransport(
new TSocket(address.getHostName(), address.getPor... | [
"public",
"static",
"CoronaProxyJobTrackerService",
".",
"Client",
"getPJTClient",
"(",
"CoronaConf",
"conf",
")",
"throws",
"IOException",
"{",
"InetSocketAddress",
"address",
"=",
"NetUtils",
".",
"createSocketAddr",
"(",
"conf",
".",
"getProxyJobTrackerThriftAddress",
... | Used for getting a client to the CoronaProxyJobTracker
@param conf
@return Returns a client to the CPJT
@throws IOException | [
"Used",
"for",
"getting",
"a",
"client",
"to",
"the",
"CoronaProxyJobTracker"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerAvailabilityChecker.java#L44-L58 |
119,148 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerAvailabilityChecker.java | ClusterManagerAvailabilityChecker.waitWhileClusterManagerInSafeMode | public static void waitWhileClusterManagerInSafeMode(CoronaConf conf)
throws IOException {
CoronaProxyJobTrackerService.Client pjtClient = getPJTClient(conf);
while (true) {
try {
// If this condition holds true, then two things can happen:
// 1. The CM was never in Safe Mode
... | java | public static void waitWhileClusterManagerInSafeMode(CoronaConf conf)
throws IOException {
CoronaProxyJobTrackerService.Client pjtClient = getPJTClient(conf);
while (true) {
try {
// If this condition holds true, then two things can happen:
// 1. The CM was never in Safe Mode
... | [
"public",
"static",
"void",
"waitWhileClusterManagerInSafeMode",
"(",
"CoronaConf",
"conf",
")",
"throws",
"IOException",
"{",
"CoronaProxyJobTrackerService",
".",
"Client",
"pjtClient",
"=",
"getPJTClient",
"(",
"conf",
")",
";",
"while",
"(",
"true",
")",
"{",
"... | This helper method simply polls the ProxyJobTracker if and until the
clusterManagerSafeMode flag is set there.
@param conf
@throws IOException | [
"This",
"helper",
"method",
"simply",
"polls",
"the",
"ProxyJobTracker",
"if",
"and",
"until",
"the",
"clusterManagerSafeMode",
"flag",
"is",
"set",
"there",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManagerAvailabilityChecker.java#L66-L92 |
119,149 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShellCommand.java | AvatarShellCommand.noZeroOrOneOrAddress | void noZeroOrOneOrAddress(String command) {
if (isZeroCommand || isOneCommand) {
throwException(CMD + command + " (zero|one) should not be specified");
}
if (isAddressCommand) {
throwException(CMD + command + " address should not be specified");
}
} | java | void noZeroOrOneOrAddress(String command) {
if (isZeroCommand || isOneCommand) {
throwException(CMD + command + " (zero|one) should not be specified");
}
if (isAddressCommand) {
throwException(CMD + command + " address should not be specified");
}
} | [
"void",
"noZeroOrOneOrAddress",
"(",
"String",
"command",
")",
"{",
"if",
"(",
"isZeroCommand",
"||",
"isOneCommand",
")",
"{",
"throwException",
"(",
"CMD",
"+",
"command",
"+",
"\" (zero|one) should not be specified\"",
")",
";",
"}",
"if",
"(",
"isAddressComman... | For commands that directly obtain information from zk | [
"For",
"commands",
"that",
"directly",
"obtain",
"information",
"from",
"zk"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShellCommand.java#L115-L122 |
119,150 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShellCommand.java | AvatarShellCommand.eitherZeroOrOneOrAddress | void eitherZeroOrOneOrAddress(String command) {
if (!isAddressCommand && !(isZeroCommand ^ isOneCommand)) {
throwException(CMD + command + ": (zero|one) specified incorrectly");
}
if (isAddressCommand && (isZeroCommand || isOneCommand)) {
throwException(CMD + command + ": cannot specify address ... | java | void eitherZeroOrOneOrAddress(String command) {
if (!isAddressCommand && !(isZeroCommand ^ isOneCommand)) {
throwException(CMD + command + ": (zero|one) specified incorrectly");
}
if (isAddressCommand && (isZeroCommand || isOneCommand)) {
throwException(CMD + command + ": cannot specify address ... | [
"void",
"eitherZeroOrOneOrAddress",
"(",
"String",
"command",
")",
"{",
"if",
"(",
"!",
"isAddressCommand",
"&&",
"!",
"(",
"isZeroCommand",
"^",
"isOneCommand",
")",
")",
"{",
"throwException",
"(",
"CMD",
"+",
"command",
"+",
"\": (zero|one) specified incorrectl... | Check if either -zero -one or -address are specified. | [
"Check",
"if",
"either",
"-",
"zero",
"-",
"one",
"or",
"-",
"address",
"are",
"specified",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarShellCommand.java#L127-L134 |
119,151 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightGSet.java | LightWeightGSet.actualArrayLength | private static int actualArrayLength(int recommended) {
if (recommended > MAX_ARRAY_LENGTH) {
return MAX_ARRAY_LENGTH;
} else if (recommended < MIN_ARRAY_LENGTH) {
return MIN_ARRAY_LENGTH;
} else {
final int a = Integer.highestOneBit(recommended);
return a == recommended? a: a << 1;
... | java | private static int actualArrayLength(int recommended) {
if (recommended > MAX_ARRAY_LENGTH) {
return MAX_ARRAY_LENGTH;
} else if (recommended < MIN_ARRAY_LENGTH) {
return MIN_ARRAY_LENGTH;
} else {
final int a = Integer.highestOneBit(recommended);
return a == recommended? a: a << 1;
... | [
"private",
"static",
"int",
"actualArrayLength",
"(",
"int",
"recommended",
")",
"{",
"if",
"(",
"recommended",
">",
"MAX_ARRAY_LENGTH",
")",
"{",
"return",
"MAX_ARRAY_LENGTH",
";",
"}",
"else",
"if",
"(",
"recommended",
"<",
"MIN_ARRAY_LENGTH",
")",
"{",
"ret... | compute actual length | [
"compute",
"actual",
"length"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightGSet.java#L87-L96 |
119,152 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightGSet.java | LightWeightGSet.shardIterator | @Override
public Iterator<E> shardIterator(int shardId, int numShards) {
if (shardId >= entries.length) {
return null;
}
if (shardId >= numShards) {
throw new IllegalArgumentException(
"Shard id must be less than total shards, shardId: " + shardId
+ ", numShards: " + nu... | java | @Override
public Iterator<E> shardIterator(int shardId, int numShards) {
if (shardId >= entries.length) {
return null;
}
if (shardId >= numShards) {
throw new IllegalArgumentException(
"Shard id must be less than total shards, shardId: " + shardId
+ ", numShards: " + nu... | [
"@",
"Override",
"public",
"Iterator",
"<",
"E",
">",
"shardIterator",
"(",
"int",
"shardId",
",",
"int",
"numShards",
")",
"{",
"if",
"(",
"shardId",
">=",
"entries",
".",
"length",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"shardId",
">=",
"... | Get iterator over a part of the blocks map.
@param shardId index of the starting bucket
@param numShards next bucket is obtained by index+=numShards | [
"Get",
"iterator",
"over",
"a",
"part",
"of",
"the",
"blocks",
"map",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightGSet.java#L223-L234 |
119,153 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ConfServlet.java | ConfServlet.getConfFromContext | private Configuration getConfFromContext() {
Configuration conf = (Configuration)getServletContext().getAttribute(
HttpServer.CONF_CONTEXT_ATTRIBUTE);
assert conf != null;
return conf;
} | java | private Configuration getConfFromContext() {
Configuration conf = (Configuration)getServletContext().getAttribute(
HttpServer.CONF_CONTEXT_ATTRIBUTE);
assert conf != null;
return conf;
} | [
"private",
"Configuration",
"getConfFromContext",
"(",
")",
"{",
"Configuration",
"conf",
"=",
"(",
"Configuration",
")",
"getServletContext",
"(",
")",
".",
"getAttribute",
"(",
"HttpServer",
".",
"CONF_CONTEXT_ATTRIBUTE",
")",
";",
"assert",
"conf",
"!=",
"null"... | Return the Configuration of the daemon hosting this servlet.
This is populated when the HttpServer starts. | [
"Return",
"the",
"Configuration",
"of",
"the",
"daemon",
"hosting",
"this",
"servlet",
".",
"This",
"is",
"populated",
"when",
"the",
"HttpServer",
"starts",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ConfServlet.java#L45-L50 |
119,154 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ConfServlet.java | ConfServlet.writeResponse | static void writeResponse(Configuration conf, Writer out, String format)
throws IOException, BadFormatException {
if (FORMAT_JSON.equals(format)) {
Configuration.dumpConfiguration(conf, out);
} else if (FORMAT_XML.equals(format)) {
conf.writeXml(out);
} else {
throw new BadFormatExcept... | java | static void writeResponse(Configuration conf, Writer out, String format)
throws IOException, BadFormatException {
if (FORMAT_JSON.equals(format)) {
Configuration.dumpConfiguration(conf, out);
} else if (FORMAT_XML.equals(format)) {
conf.writeXml(out);
} else {
throw new BadFormatExcept... | [
"static",
"void",
"writeResponse",
"(",
"Configuration",
"conf",
",",
"Writer",
"out",
",",
"String",
"format",
")",
"throws",
"IOException",
",",
"BadFormatException",
"{",
"if",
"(",
"FORMAT_JSON",
".",
"equals",
"(",
"format",
")",
")",
"{",
"Configuration"... | Guts of the servlet - extracted for easy testing. | [
"Guts",
"of",
"the",
"servlet",
"-",
"extracted",
"for",
"easy",
"testing",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ConfServlet.java#L78-L87 |
119,155 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.create | @Override
public FSDataOutputStream create(Path file, FsPermission permission,
boolean overwrite, int bufferSize, short replication, long blockSize,
Progressable progress) throws IOException {
final FTPClient client = connect();
Path workDir = new Path(client.printWorkingDirectory());
Path abs... | java | @Override
public FSDataOutputStream create(Path file, FsPermission permission,
boolean overwrite, int bufferSize, short replication, long blockSize,
Progressable progress) throws IOException {
final FTPClient client = connect();
Path workDir = new Path(client.printWorkingDirectory());
Path abs... | [
"@",
"Override",
"public",
"FSDataOutputStream",
"create",
"(",
"Path",
"file",
",",
"FsPermission",
"permission",
",",
"boolean",
"overwrite",
",",
"int",
"bufferSize",
",",
"short",
"replication",
",",
"long",
"blockSize",
",",
"Progressable",
"progress",
")",
... | A stream obtained via this call must be closed before using other APIs of
this class or else the invocation will block. | [
"A",
"stream",
"obtained",
"via",
"this",
"call",
"must",
"be",
"closed",
"before",
"using",
"other",
"APIs",
"of",
"this",
"class",
"or",
"else",
"the",
"invocation",
"will",
"block",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L194-L245 |
119,156 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeInputSplit.java | CompositeInputSplit.add | public void add(InputSplit s) throws IOException {
if (null == splits) {
throw new IOException("Uninitialized InputSplit");
}
if (fill == splits.length) {
throw new IOException("Too many splits");
}
splits[fill++] = s;
totsize += s.getLength();
} | java | public void add(InputSplit s) throws IOException {
if (null == splits) {
throw new IOException("Uninitialized InputSplit");
}
if (fill == splits.length) {
throw new IOException("Too many splits");
}
splits[fill++] = s;
totsize += s.getLength();
} | [
"public",
"void",
"add",
"(",
"InputSplit",
"s",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"==",
"splits",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Uninitialized InputSplit\"",
")",
";",
"}",
"if",
"(",
"fill",
"==",
"splits",
".",
"l... | Add an InputSplit to this collection.
@throws IOException If capacity was not specified during construction
or if capacity has been reached. | [
"Add",
"an",
"InputSplit",
"to",
"this",
"collection",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeInputSplit.java#L52-L61 |
119,157 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeInputSplit.java | CompositeInputSplit.getLocations | public String[] getLocations() throws IOException {
HashSet<String> hosts = new HashSet<String>();
for (InputSplit s : splits) {
String[] hints = s.getLocations();
if (hints != null && hints.length > 0) {
for (String host : hints) {
hosts.add(host);
}
}
}
retu... | java | public String[] getLocations() throws IOException {
HashSet<String> hosts = new HashSet<String>();
for (InputSplit s : splits) {
String[] hints = s.getLocations();
if (hints != null && hints.length > 0) {
for (String host : hints) {
hosts.add(host);
}
}
}
retu... | [
"public",
"String",
"[",
"]",
"getLocations",
"(",
")",
"throws",
"IOException",
"{",
"HashSet",
"<",
"String",
">",
"hosts",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"InputSplit",
"s",
":",
"splits",
")",
"{",
"String",
... | Collect a set of hosts from all child InputSplits. | [
"Collect",
"a",
"set",
"of",
"hosts",
"from",
"all",
"child",
"InputSplits",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeInputSplit.java#L87-L98 |
119,158 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/zk/ConnectionWatcher.java | ConnectionWatcher.await | public boolean await(long timeoutMillis) throws IOException {
try {
return connectLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
interruptedException(
"Interrupted waiting for connection (timeout = " + timeoutMillis +
"ms.)", e);
r... | java | public boolean await(long timeoutMillis) throws IOException {
try {
return connectLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
interruptedException(
"Interrupted waiting for connection (timeout = " + timeoutMillis +
"ms.)", e);
r... | [
"public",
"boolean",
"await",
"(",
"long",
"timeoutMillis",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"connectLatch",
".",
"await",
"(",
"timeoutMillis",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
... | Wait until either a specified timeout expires or a connection is
created to ZooKeeper.
@see {@link CountDownLatch#await(long, TimeUnit)}
@param timeoutMillis Wait this long (in milliseconds) for a connection
to be established to ZooKeeper.
@return True if a connection was established within the specified timeout,
fals... | [
"Wait",
"until",
"either",
"a",
"specified",
"timeout",
"expires",
"or",
"a",
"connection",
"is",
"created",
"to",
"ZooKeeper",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/zk/ConnectionWatcher.java#L66-L75 |
119,159 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.readIdToRequest | private void readIdToRequest(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToRequest");
// Expecting the START_OBJECT token for idToRequest
coronaSerializer.readStartObjectToken("idToRequest");
JsonToken current = coronaSerializer.nextToken();
while (curre... | java | private void readIdToRequest(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToRequest");
// Expecting the START_OBJECT token for idToRequest
coronaSerializer.readStartObjectToken("idToRequest");
JsonToken current = coronaSerializer.nextToken();
while (curre... | [
"private",
"void",
"readIdToRequest",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"idToRequest\"",
")",
";",
"// Expecting the START_OBJECT token for idToRequest",
"coronaSerializer",
".",
"readS... | Reads the idToRequest map from a JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"idToRequest",
"map",
"from",
"a",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L212-L224 |
119,160 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.readIdToPendingRequests | private void readIdToPendingRequests(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToPendingRequests");
// Expecting the START_ARRAY token for idToPendingRequests
coronaSerializer.readStartArrayToken("idToPendingRequests");
JsonToken current = coronaSerializer... | java | private void readIdToPendingRequests(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToPendingRequests");
// Expecting the START_ARRAY token for idToPendingRequests
coronaSerializer.readStartArrayToken("idToPendingRequests");
JsonToken current = coronaSerializer... | [
"private",
"void",
"readIdToPendingRequests",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"idToPendingRequests\"",
")",
";",
"// Expecting the START_ARRAY token for idToPendingRequests",
"coronaSeria... | Reads the idToPendingRequests map from a JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"idToPendingRequests",
"map",
"from",
"a",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L233-L244 |
119,161 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.readIdToGrant | private void readIdToGrant(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToGrant");
// Expecting the START_OBJECT token for idToGrant
coronaSerializer.readStartObjectToken("idToGrant");
JsonToken current = coronaSerializer.nextToken();
while (current != Js... | java | private void readIdToGrant(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("idToGrant");
// Expecting the START_OBJECT token for idToGrant
coronaSerializer.readStartObjectToken("idToGrant");
JsonToken current = coronaSerializer.nextToken();
while (current != Js... | [
"private",
"void",
"readIdToGrant",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"idToGrant\"",
")",
";",
"// Expecting the START_OBJECT token for idToGrant",
"coronaSerializer",
".",
"readStartOb... | Reads the idToGrant map from a JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"idToGrant",
"map",
"from",
"a",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L253-L267 |
119,162 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.readTypeToFirstWait | private void readTypeToFirstWait(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("typeToFirstWait");
// Expecting the START_OBJECT token for typeToFirstWait
coronaSerializer.readStartObjectToken("typeToFirstWait");
JsonToken current = coronaSerializer.nextToken();
... | java | private void readTypeToFirstWait(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("typeToFirstWait");
// Expecting the START_OBJECT token for typeToFirstWait
coronaSerializer.readStartObjectToken("typeToFirstWait");
JsonToken current = coronaSerializer.nextToken();
... | [
"private",
"void",
"readTypeToFirstWait",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"typeToFirstWait\"",
")",
";",
"// Expecting the START_OBJECT token for typeToFirstWait",
"coronaSerializer",
"... | Reads the typeToFirstWait map from the JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"typeToFirstWait",
"map",
"from",
"the",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L276-L292 |
119,163 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.write | public void write(JsonGenerator jsonGenerator) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeFieldName("idToRequest");
jsonGenerator.writeStartObject();
for (Integer id : idToRequest.keySet()) {
jsonGenerator.writeFieldName(id.toString());
idToRequest.get(id).wri... | java | public void write(JsonGenerator jsonGenerator) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeFieldName("idToRequest");
jsonGenerator.writeStartObject();
for (Integer id : idToRequest.keySet()) {
jsonGenerator.writeFieldName(id.toString());
idToRequest.get(id).wri... | [
"public",
"void",
"write",
"(",
"JsonGenerator",
"jsonGenerator",
")",
"throws",
"IOException",
"{",
"jsonGenerator",
".",
"writeStartObject",
"(",
")",
";",
"jsonGenerator",
".",
"writeFieldName",
"(",
"\"idToRequest\"",
")",
";",
"jsonGenerator",
".",
"writeStartO... | Used to write the state of the Session instance to disk, when we are
persisting the state of the ClusterManager
@param jsonGenerator The JsonGenerator instance being used to write JSON
to disk
@throws IOException | [
"Used",
"to",
"write",
"the",
"state",
"of",
"the",
"Session",
"instance",
"to",
"disk",
"when",
"we",
"are",
"persisting",
"the",
"state",
"of",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L302-L364 |
119,164 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.restoreAfterSafeModeRestart | public void restoreAfterSafeModeRestart() {
for (Integer pendingRequestId : pendingRequestsList) {
ResourceRequestInfo request = idToRequest.get(pendingRequestId);
incrementRequestCount(request.getType(), 1);
addPendingRequest(request);
}
for (Integer grantedRequestId : idToGrant.keySet()... | java | public void restoreAfterSafeModeRestart() {
for (Integer pendingRequestId : pendingRequestsList) {
ResourceRequestInfo request = idToRequest.get(pendingRequestId);
incrementRequestCount(request.getType(), 1);
addPendingRequest(request);
}
for (Integer grantedRequestId : idToGrant.keySet()... | [
"public",
"void",
"restoreAfterSafeModeRestart",
"(",
")",
"{",
"for",
"(",
"Integer",
"pendingRequestId",
":",
"pendingRequestsList",
")",
"{",
"ResourceRequestInfo",
"request",
"=",
"idToRequest",
".",
"get",
"(",
"pendingRequestId",
")",
";",
"incrementRequestCount... | This method rebuilds members related to the Session instance, which were
not directly persisted themselves. | [
"This",
"method",
"rebuilds",
"members",
"related",
"to",
"the",
"Session",
"instance",
"which",
"were",
"not",
"directly",
"persisted",
"themselves",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L370-L382 |
119,165 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.updateInfoUrlAndName | public void updateInfoUrlAndName(String url, String name) {
this.info.url = url;
this.info.name = name;
} | java | public void updateInfoUrlAndName(String url, String name) {
this.info.url = url;
this.info.name = name;
} | [
"public",
"void",
"updateInfoUrlAndName",
"(",
"String",
"url",
",",
"String",
"name",
")",
"{",
"this",
".",
"info",
".",
"url",
"=",
"url",
";",
"this",
".",
"info",
".",
"name",
"=",
"name",
";",
"}"
] | Only update the session info url and name.
@param url New session info url
@param name New session name | [
"Only",
"update",
"the",
"session",
"info",
"url",
"and",
"name",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L465-L468 |
119,166 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getPendingRequestOnHost | public ResourceRequestInfo getPendingRequestOnHost(
String host, ResourceType type) {
Context c = getContext(type);
List<ResourceRequestInfo> hostReqs = c.hostToPendingRequests.get(host);
if (hostReqs != null) {
// Returning the first element in the list makes the subsequent
// call to Utili... | java | public ResourceRequestInfo getPendingRequestOnHost(
String host, ResourceType type) {
Context c = getContext(type);
List<ResourceRequestInfo> hostReqs = c.hostToPendingRequests.get(host);
if (hostReqs != null) {
// Returning the first element in the list makes the subsequent
// call to Utili... | [
"public",
"ResourceRequestInfo",
"getPendingRequestOnHost",
"(",
"String",
"host",
",",
"ResourceType",
"type",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"type",
")",
";",
"List",
"<",
"ResourceRequestInfo",
">",
"hostReqs",
"=",
"c",
".",
"hostToPending... | Find a pending request that wants to run on a given host.
@param host the host
@param type the type of the request
@return The resource request info for the matching request | [
"Find",
"a",
"pending",
"request",
"that",
"wants",
"to",
"run",
"on",
"a",
"given",
"host",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L494-L504 |
119,167 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getPendingRequestOnRack | public ResourceRequestInfo getPendingRequestOnRack(
String host, Node rack, ResourceType type) {
Context c = getContext(type);
List<ResourceRequestInfo> rackReqs = c.rackToPendingRequests.get(rack);
if (rackReqs != null) {
for (ResourceRequestInfo req: rackReqs) {
Set<String> excluded = re... | java | public ResourceRequestInfo getPendingRequestOnRack(
String host, Node rack, ResourceType type) {
Context c = getContext(type);
List<ResourceRequestInfo> rackReqs = c.rackToPendingRequests.get(rack);
if (rackReqs != null) {
for (ResourceRequestInfo req: rackReqs) {
Set<String> excluded = re... | [
"public",
"ResourceRequestInfo",
"getPendingRequestOnRack",
"(",
"String",
"host",
",",
"Node",
"rack",
",",
"ResourceType",
"type",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"type",
")",
";",
"List",
"<",
"ResourceRequestInfo",
">",
"rackReqs",
"=",
"... | Find a pending request that wants to run on a given rack.
@param host The host we are considering
@param rack The rack of the host
@param type the type of the request
@return The resource request info for the matching request | [
"Find",
"a",
"pending",
"request",
"that",
"wants",
"to",
"run",
"on",
"a",
"given",
"rack",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L513-L526 |
119,168 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getPendingRequestForAny | public ResourceRequestInfo getPendingRequestForAny(
String host, ResourceType type) {
Context c = getContext(type);
for (ResourceRequestInfo req: c.anyHostRequests) {
Set<String> excluded = req.getExcludeHosts();
if (!excluded.contains(host)) {
return req;
}
}
return null;
... | java | public ResourceRequestInfo getPendingRequestForAny(
String host, ResourceType type) {
Context c = getContext(type);
for (ResourceRequestInfo req: c.anyHostRequests) {
Set<String> excluded = req.getExcludeHosts();
if (!excluded.contains(host)) {
return req;
}
}
return null;
... | [
"public",
"ResourceRequestInfo",
"getPendingRequestForAny",
"(",
"String",
"host",
",",
"ResourceType",
"type",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"type",
")",
";",
"for",
"(",
"ResourceRequestInfo",
"req",
":",
"c",
".",
"anyHostRequests",
")",
... | Find a pending request that can run on any machine.
@param host The host we are considering
@param type the type of the request
@return The resource request info for the matching request | [
"Find",
"a",
"pending",
"request",
"that",
"can",
"run",
"on",
"any",
"machine",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L534-L544 |
119,169 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getContext | protected Context getContext(ResourceType type) {
Context c = typeToContext.get(type);
if (c == null) {
c = new Context();
typeToContext.put(type, c);
}
return c;
} | java | protected Context getContext(ResourceType type) {
Context c = typeToContext.get(type);
if (c == null) {
c = new Context();
typeToContext.put(type, c);
}
return c;
} | [
"protected",
"Context",
"getContext",
"(",
"ResourceType",
"type",
")",
"{",
"Context",
"c",
"=",
"typeToContext",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"c",
"=",
"new",
"Context",
"(",
")",
";",
"typeToContext",
... | Get the context for a resource type. Creates the context
on demand if it doesn't exist.
@param type Type of resource
@return Appropriate resource context | [
"Get",
"the",
"context",
"for",
"a",
"resource",
"type",
".",
"Creates",
"the",
"context",
"on",
"demand",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L604-L611 |
119,170 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.incrementRequestCount | protected void incrementRequestCount(ResourceType type, int delta) {
Context c = getContext(type);
int newRequestCount = c.requestCount + delta;
c.requestCount = newRequestCount;
if (newRequestCount > c.maxConcurrentRequestCount) {
c.maxConcurrentRequestCount = newRequestCount;
}
} | java | protected void incrementRequestCount(ResourceType type, int delta) {
Context c = getContext(type);
int newRequestCount = c.requestCount + delta;
c.requestCount = newRequestCount;
if (newRequestCount > c.maxConcurrentRequestCount) {
c.maxConcurrentRequestCount = newRequestCount;
}
} | [
"protected",
"void",
"incrementRequestCount",
"(",
"ResourceType",
"type",
",",
"int",
"delta",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"type",
")",
";",
"int",
"newRequestCount",
"=",
"c",
".",
"requestCount",
"+",
"delta",
";",
"c",
".",
"reque... | Increase a request count for a resource for this session. It cannot
exceed the max concurrent request count.
@param type Resource type
@param delta incremental request count | [
"Increase",
"a",
"request",
"count",
"for",
"a",
"resource",
"for",
"this",
"session",
".",
"It",
"cannot",
"exceed",
"the",
"max",
"concurrent",
"request",
"count",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L620-L627 |
119,171 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.addPendingRequestForType | protected void addPendingRequestForType(ResourceRequestInfo req) {
Context c = getContext(req.getType());
c.pendingRequests.add(req);
c.pendingRequestCount++;
} | java | protected void addPendingRequestForType(ResourceRequestInfo req) {
Context c = getContext(req.getType());
c.pendingRequests.add(req);
c.pendingRequestCount++;
} | [
"protected",
"void",
"addPendingRequestForType",
"(",
"ResourceRequestInfo",
"req",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"req",
".",
"getType",
"(",
")",
")",
";",
"c",
".",
"pendingRequests",
".",
"add",
"(",
"req",
")",
";",
"c",
".",
"pen... | Add a pending request for a resource type.
@param req Resource request to add | [
"Add",
"a",
"pending",
"request",
"for",
"a",
"resource",
"type",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L634-L638 |
119,172 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.removePendingRequestForType | protected void removePendingRequestForType(ResourceRequestInfo req) {
Context c = getContext(req.getType());
Object removed = Utilities.removeReference(c.pendingRequests, req);
if (removed != null) {
c.pendingRequestCount--;
}
} | java | protected void removePendingRequestForType(ResourceRequestInfo req) {
Context c = getContext(req.getType());
Object removed = Utilities.removeReference(c.pendingRequests, req);
if (removed != null) {
c.pendingRequestCount--;
}
} | [
"protected",
"void",
"removePendingRequestForType",
"(",
"ResourceRequestInfo",
"req",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"req",
".",
"getType",
"(",
")",
")",
";",
"Object",
"removed",
"=",
"Utilities",
".",
"removeReference",
"(",
"c",
".",
... | Remove a pending resource request for a resource type
@param req Resource request to remove | [
"Remove",
"a",
"pending",
"resource",
"request",
"for",
"a",
"resource",
"type"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L645-L651 |
119,173 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.addGrantedRequest | protected void addGrantedRequest(ResourceRequestInfo req) {
Context c = getContext(req.getType());
c.grantedRequests.add(req);
// assume a granted resource is going to be fully used
c.fulfilledRequestCount++;
} | java | protected void addGrantedRequest(ResourceRequestInfo req) {
Context c = getContext(req.getType());
c.grantedRequests.add(req);
// assume a granted resource is going to be fully used
c.fulfilledRequestCount++;
} | [
"protected",
"void",
"addGrantedRequest",
"(",
"ResourceRequestInfo",
"req",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"req",
".",
"getType",
"(",
")",
")",
";",
"c",
".",
"grantedRequests",
".",
"add",
"(",
"req",
")",
";",
"// assume a granted reso... | Add a granted request for a resource type.
@param req Resource request to add | [
"Add",
"a",
"granted",
"request",
"for",
"a",
"resource",
"type",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L658-L664 |
119,174 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.removeGrantedRequest | protected void removeGrantedRequest(
ResourceRequestInfo req, boolean isRevoked) {
Context c = getContext(req.getType());
Utilities.removeReference(c.grantedRequests, req);
// if revoked - we didn't fulfill this request
if (isRevoked) {
c.fulfilledRequestCount--;
c.revokedRequestCount++... | java | protected void removeGrantedRequest(
ResourceRequestInfo req, boolean isRevoked) {
Context c = getContext(req.getType());
Utilities.removeReference(c.grantedRequests, req);
// if revoked - we didn't fulfill this request
if (isRevoked) {
c.fulfilledRequestCount--;
c.revokedRequestCount++... | [
"protected",
"void",
"removeGrantedRequest",
"(",
"ResourceRequestInfo",
"req",
",",
"boolean",
"isRevoked",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
"req",
".",
"getType",
"(",
")",
")",
";",
"Utilities",
".",
"removeReference",
"(",
"c",
".",
"gra... | Remove a granted request for a resource type.
@param req Resource request to remove
@param isRevoked Was this request revoked from the cluster manager? | [
"Remove",
"a",
"granted",
"request",
"for",
"a",
"resource",
"type",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L672-L682 |
119,175 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.requestResource | public void requestResource(List<ResourceRequestInfo> requestList) {
if (deleted) {
throw new RuntimeException("Session: " + sessionId +
" has been deleted");
}
for (ResourceRequestInfo req : requestList) {
boolean newRequest = idToRequest.put(req.getId(), req) == null;
if (!new... | java | public void requestResource(List<ResourceRequestInfo> requestList) {
if (deleted) {
throw new RuntimeException("Session: " + sessionId +
" has been deleted");
}
for (ResourceRequestInfo req : requestList) {
boolean newRequest = idToRequest.put(req.getId(), req) == null;
if (!new... | [
"public",
"void",
"requestResource",
"(",
"List",
"<",
"ResourceRequestInfo",
">",
"requestList",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Session: \"",
"+",
"sessionId",
"+",
"\" has been deleted\"",
")",
";",
"}",
... | Request a list of resources
@param requestList List of resource requests | [
"Request",
"a",
"list",
"of",
"resources"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L866-L884 |
119,176 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.setTypeRequested | private void setTypeRequested(ResourceType type) {
synchronized (typeToFirstWait) {
if (!typeToFirstWait.containsKey(type)) {
typeToFirstWait.put(type, null);
}
}
} | java | private void setTypeRequested(ResourceType type) {
synchronized (typeToFirstWait) {
if (!typeToFirstWait.containsKey(type)) {
typeToFirstWait.put(type, null);
}
}
} | [
"private",
"void",
"setTypeRequested",
"(",
"ResourceType",
"type",
")",
"{",
"synchronized",
"(",
"typeToFirstWait",
")",
"{",
"if",
"(",
"!",
"typeToFirstWait",
".",
"containsKey",
"(",
"type",
")",
")",
"{",
"typeToFirstWait",
".",
"put",
"(",
"type",
","... | Set the resource type to requested for first wait metrics. The value will
be set to null to denote the difference between waiting and requested and
not waiting.
@param type Resource type that is will be set to requested for metrics. | [
"Set",
"the",
"resource",
"type",
"to",
"requested",
"for",
"first",
"wait",
"metrics",
".",
"The",
"value",
"will",
"be",
"set",
"to",
"null",
"to",
"denote",
"the",
"difference",
"between",
"waiting",
"and",
"requested",
"and",
"not",
"waiting",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L893-L899 |
119,177 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.addPendingRequest | private void addPendingRequest(ResourceRequestInfo req) {
idToPendingRequests.put(req.getId(), req);
if (req.getHosts() != null && req.getHosts().size() > 0) {
Context c = getContext(req.getType());
for (RequestedNode node: req.getRequestedNodes()) {
String host = node.getHost();
Lis... | java | private void addPendingRequest(ResourceRequestInfo req) {
idToPendingRequests.put(req.getId(), req);
if (req.getHosts() != null && req.getHosts().size() > 0) {
Context c = getContext(req.getType());
for (RequestedNode node: req.getRequestedNodes()) {
String host = node.getHost();
Lis... | [
"private",
"void",
"addPendingRequest",
"(",
"ResourceRequestInfo",
"req",
")",
"{",
"idToPendingRequests",
".",
"put",
"(",
"req",
".",
"getId",
"(",
")",
",",
"req",
")",
";",
"if",
"(",
"req",
".",
"getHosts",
"(",
")",
"!=",
"null",
"&&",
"req",
".... | Add a request to the list of pending
@param req the request to add | [
"Add",
"a",
"request",
"to",
"the",
"list",
"of",
"pending"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L905-L930 |
119,178 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.removePendingRequest | private void removePendingRequest(ResourceRequestInfo req) {
ResourceRequestInfo removed = idToPendingRequests.remove(req.getId());
if (removed != null) {
if (req.getHosts() != null && req.getHosts().size() > 0) {
Context c = getContext(req.getType());
for (RequestedNode node : req.getRequ... | java | private void removePendingRequest(ResourceRequestInfo req) {
ResourceRequestInfo removed = idToPendingRequests.remove(req.getId());
if (removed != null) {
if (req.getHosts() != null && req.getHosts().size() > 0) {
Context c = getContext(req.getType());
for (RequestedNode node : req.getRequ... | [
"private",
"void",
"removePendingRequest",
"(",
"ResourceRequestInfo",
"req",
")",
"{",
"ResourceRequestInfo",
"removed",
"=",
"idToPendingRequests",
".",
"remove",
"(",
"req",
".",
"getId",
"(",
")",
")",
";",
"if",
"(",
"removed",
"!=",
"null",
")",
"{",
"... | Removes the request from the list of pending
@param req the request to remove | [
"Removes",
"the",
"request",
"from",
"the",
"list",
"of",
"pending"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L936-L963 |
119,179 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.releaseResource | public List<ResourceGrant> releaseResource(List<Integer> idList) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
List<ResourceGrant> canceledGrants = new ArrayList<ResourceGrant>();
for (Integer id : idList) {
ResourceRequestInfo req =... | java | public List<ResourceGrant> releaseResource(List<Integer> idList) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
List<ResourceGrant> canceledGrants = new ArrayList<ResourceGrant>();
for (Integer id : idList) {
ResourceRequestInfo req =... | [
"public",
"List",
"<",
"ResourceGrant",
">",
"releaseResource",
"(",
"List",
"<",
"Integer",
">",
"idList",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Session: \"",
"+",
"sessionId",
"+",
"\" has been deleted\"",
")",... | Release the resources that are no longer needed from the session
@param idList the list of resources to release
@return the list of resources that have been released | [
"Release",
"the",
"resources",
"that",
"are",
"no",
"longer",
"needed",
"from",
"the",
"session"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L971-L996 |
119,180 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.grantResource | public void grantResource(ResourceRequestInfo req, ResourceGrant grant) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
removePendingRequest(req);
idToGrant.put(req.getId(), grant);
addGrantedRequest(req);
// Handle the first wait m... | java | public void grantResource(ResourceRequestInfo req, ResourceGrant grant) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
removePendingRequest(req);
idToGrant.put(req.getId(), grant);
addGrantedRequest(req);
// Handle the first wait m... | [
"public",
"void",
"grantResource",
"(",
"ResourceRequestInfo",
"req",
",",
"ResourceGrant",
"grant",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Session: \"",
"+",
"sessionId",
"+",
"\" has been deleted\"",
")",
";",
"}"... | Grant a resource to a session to satisfy a request. Update the finalized
first resource type times if not already set
@param req the request being satisfied
@param grant the grant satisfying the request | [
"Grant",
"a",
"resource",
"to",
"a",
"session",
"to",
"satisfy",
"a",
"request",
".",
"Update",
"the",
"finalized",
"first",
"resource",
"type",
"times",
"if",
"not",
"already",
"set"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1004-L1026 |
119,181 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.revokeResource | public List<ResourceGrant> revokeResource(List<Integer> idList) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
List<ResourceGrant> canceledGrants = new ArrayList<ResourceGrant>();
for (Integer id : idList) {
ResourceRequestInfo req = ... | java | public List<ResourceGrant> revokeResource(List<Integer> idList) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
List<ResourceGrant> canceledGrants = new ArrayList<ResourceGrant>();
for (Integer id : idList) {
ResourceRequestInfo req = ... | [
"public",
"List",
"<",
"ResourceGrant",
">",
"revokeResource",
"(",
"List",
"<",
"Integer",
">",
"idList",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Session: \"",
"+",
"sessionId",
"+",
"\" has been deleted\"",
")",
... | Revoke a list of resources from a session
@param idList the list of resources to revoke
@return the list of resource grants that have been revoked | [
"Revoke",
"a",
"list",
"of",
"resources",
"from",
"a",
"session"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1033-L1057 |
119,182 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getGrantReportList | public List<GrantReport> getGrantReportList() {
Map<Integer, GrantReport> grantReportMap =
new TreeMap<Integer, GrantReport>();
for (Map.Entry<Integer, ResourceGrant> entry : idToGrant.entrySet()) {
grantReportMap.put(entry.getKey(),
new GrantReport(entry.getKey().intValue(),
... | java | public List<GrantReport> getGrantReportList() {
Map<Integer, GrantReport> grantReportMap =
new TreeMap<Integer, GrantReport>();
for (Map.Entry<Integer, ResourceGrant> entry : idToGrant.entrySet()) {
grantReportMap.put(entry.getKey(),
new GrantReport(entry.getKey().intValue(),
... | [
"public",
"List",
"<",
"GrantReport",
">",
"getGrantReportList",
"(",
")",
"{",
"Map",
"<",
"Integer",
",",
"GrantReport",
">",
"grantReportMap",
"=",
"new",
"TreeMap",
"<",
"Integer",
",",
"GrantReport",
">",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entr... | Get a snapshot of the grants used for this session for the web server.
This method should be synchronized by the caller around the session.
@return List of {@link GrantReport} objects for this session sorted by id. | [
"Get",
"a",
"snapshot",
"of",
"the",
"grants",
"used",
"for",
"this",
"session",
"for",
"the",
"web",
"server",
".",
"This",
"method",
"should",
"be",
"synchronized",
"by",
"the",
"caller",
"around",
"the",
"session",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1084-L1095 |
119,183 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.checkHeartbeatInfo | public boolean checkHeartbeatInfo(HeartbeatArgs jtInfo) {
if (expectedInfo.requestId != jtInfo.requestId){
LOG.fatal("heartbeat out-of-sync:" + sessionId +
" CM:" + expectedInfo.requestId + " " + expectedInfo.grantId +
" JT:" + jtInfo.requestId + " " + jtInfo.grantId);
return false;
... | java | public boolean checkHeartbeatInfo(HeartbeatArgs jtInfo) {
if (expectedInfo.requestId != jtInfo.requestId){
LOG.fatal("heartbeat out-of-sync:" + sessionId +
" CM:" + expectedInfo.requestId + " " + expectedInfo.grantId +
" JT:" + jtInfo.requestId + " " + jtInfo.grantId);
return false;
... | [
"public",
"boolean",
"checkHeartbeatInfo",
"(",
"HeartbeatArgs",
"jtInfo",
")",
"{",
"if",
"(",
"expectedInfo",
".",
"requestId",
"!=",
"jtInfo",
".",
"requestId",
")",
"{",
"LOG",
".",
"fatal",
"(",
"\"heartbeat out-of-sync:\"",
"+",
"sessionId",
"+",
"\" CM:\"... | Check if the heartbeatInfo between JT and CM are in sync.
If this method returns false, it means JT and CM are out
of sync very badly, and the session will be killed. | [
"Check",
"if",
"the",
"heartbeatInfo",
"between",
"JT",
"and",
"CM",
"are",
"in",
"sync",
".",
"If",
"this",
"method",
"returns",
"false",
"it",
"means",
"JT",
"and",
"CM",
"are",
"out",
"of",
"sync",
"very",
"badly",
"and",
"the",
"session",
"will",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1131-L1169 |
119,184 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getGrantsToPreempt | public List<Integer> getGrantsToPreempt(
int maxGrantsToPreempt, long maxRunningTime, ResourceType type) {
if (deleted) {
LOG.warn("Attempt to preempt from deleted session " + getSessionId());
return Collections.emptyList();
}
List<ResourceGrant> candidates = getGrantsYoungerThan(maxRunnin... | java | public List<Integer> getGrantsToPreempt(
int maxGrantsToPreempt, long maxRunningTime, ResourceType type) {
if (deleted) {
LOG.warn("Attempt to preempt from deleted session " + getSessionId());
return Collections.emptyList();
}
List<ResourceGrant> candidates = getGrantsYoungerThan(maxRunnin... | [
"public",
"List",
"<",
"Integer",
">",
"getGrantsToPreempt",
"(",
"int",
"maxGrantsToPreempt",
",",
"long",
"maxRunningTime",
",",
"ResourceType",
"type",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Attempt to preempt from deleted session... | Obtain a list of grants to be preempted
@param maxGrantsToPreempt The maximum number of grants to preempt
@param maxRunningTime The running time of the preempted grants cannot be
larger than this number (in ms)
@param type The task type of the grants
@return The list of grant id to be preempted | [
"Obtain",
"a",
"list",
"of",
"grants",
"to",
"be",
"preempted"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1201-L1227 |
119,185 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.getGrantsYoungerThan | private List<ResourceGrant> getGrantsYoungerThan(
long maxRunningTime, ResourceType type) {
long now = ClusterManager.clock.getTime();
List<ResourceGrant> candidates = new ArrayList<ResourceGrant>();
for (ResourceGrant grant : getGrants()) {
if (now - grant.getGrantedTime() < maxRunningTime &&
... | java | private List<ResourceGrant> getGrantsYoungerThan(
long maxRunningTime, ResourceType type) {
long now = ClusterManager.clock.getTime();
List<ResourceGrant> candidates = new ArrayList<ResourceGrant>();
for (ResourceGrant grant : getGrants()) {
if (now - grant.getGrantedTime() < maxRunningTime &&
... | [
"private",
"List",
"<",
"ResourceGrant",
">",
"getGrantsYoungerThan",
"(",
"long",
"maxRunningTime",
",",
"ResourceType",
"type",
")",
"{",
"long",
"now",
"=",
"ClusterManager",
".",
"clock",
".",
"getTime",
"(",
")",
";",
"List",
"<",
"ResourceGrant",
">",
... | Get all the grants that have been running for less than maxRunningTime
@param maxRunningTime the threshold to check against
@param type the type of the grants to return
@return the list of grants of a given type that have been granted less
than maxRunningTime ago | [
"Get",
"all",
"the",
"grants",
"that",
"have",
"been",
"running",
"for",
"less",
"than",
"maxRunningTime"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1236-L1247 |
119,186 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.sortGrantsByStartTime | private void sortGrantsByStartTime(List<ResourceGrant> grants) {
Collections.sort(grants, new Comparator<ResourceGrant>() {
@Override
public int compare(ResourceGrant g1, ResourceGrant g2) {
if (g1.grantedTime < g2.grantedTime) {
return 1;
}
if (g1.grantedTime > g2.gran... | java | private void sortGrantsByStartTime(List<ResourceGrant> grants) {
Collections.sort(grants, new Comparator<ResourceGrant>() {
@Override
public int compare(ResourceGrant g1, ResourceGrant g2) {
if (g1.grantedTime < g2.grantedTime) {
return 1;
}
if (g1.grantedTime > g2.gran... | [
"private",
"void",
"sortGrantsByStartTime",
"(",
"List",
"<",
"ResourceGrant",
">",
"grants",
")",
"{",
"Collections",
".",
"sort",
"(",
"grants",
",",
"new",
"Comparator",
"<",
"ResourceGrant",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare"... | Sort grants on granted time in descending order
@param grants the list of grants to sort | [
"Sort",
"grants",
"on",
"granted",
"time",
"in",
"descending",
"order"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1253-L1266 |
119,187 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/SocketIOWithTimeout.java | SocketIOWithTimeout.checkChannelValidity | static void checkChannelValidity(Object channel) throws IOException {
if (channel == null) {
/* Most common reason is that original socket does not have a channel.
* So making this an IOException rather than a RuntimeException.
*/
throw new IOException("Channel is null. Check " +
... | java | static void checkChannelValidity(Object channel) throws IOException {
if (channel == null) {
/* Most common reason is that original socket does not have a channel.
* So making this an IOException rather than a RuntimeException.
*/
throw new IOException("Channel is null. Check " +
... | [
"static",
"void",
"checkChannelValidity",
"(",
"Object",
"channel",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"/* Most common reason is that original socket does not have a channel.\n * So making this an IOException rather than a Runtime... | Utility function to check if channel is ok.
Mainly to throw IOException instead of runtime exception
in case of mismatch. This mismatch can occur for many runtime
reasons. | [
"Utility",
"function",
"to",
"check",
"if",
"channel",
"is",
"ok",
".",
"Mainly",
"to",
"throw",
"IOException",
"instead",
"of",
"runtime",
"exception",
"in",
"case",
"of",
"mismatch",
".",
"This",
"mismatch",
"can",
"occur",
"for",
"many",
"runtime",
"reaso... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/SocketIOWithTimeout.java#L87-L99 |
119,188 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/SocketIOWithTimeout.java | SocketIOWithTimeout.doIO | int doIO(ByteBuffer buf, int ops) throws IOException {
/* For now only one thread is allowed. If user want to read or write
* from multiple threads, multiple streams could be created. In that
* case multiple threads work as well as underlying channel supports it.
*/
if (!buf.hasRemaining()) ... | java | int doIO(ByteBuffer buf, int ops) throws IOException {
/* For now only one thread is allowed. If user want to read or write
* from multiple threads, multiple streams could be created. In that
* case multiple threads work as well as underlying channel supports it.
*/
if (!buf.hasRemaining()) ... | [
"int",
"doIO",
"(",
"ByteBuffer",
"buf",
",",
"int",
"ops",
")",
"throws",
"IOException",
"{",
"/* For now only one thread is allowed. If user want to read or write\n * from multiple threads, multiple streams could be created. In that\n * case multiple threads work as well as underly... | Performs one IO and returns number of bytes read or written.
It waits up to the specified timeout. If the channel is
not read before the timeout, SocketTimeoutException is thrown.
@param buf buffer for IO
@param ops Selection Ops used for waiting. Suggested values:
SelectionKey.OP_READ while reading and SelectionKey.O... | [
"Performs",
"one",
"IO",
"and",
"returns",
"number",
"of",
"bytes",
"read",
"or",
"written",
".",
"It",
"waits",
"up",
"to",
"the",
"specified",
"timeout",
".",
"If",
"the",
"channel",
"is",
"not",
"read",
"before",
"the",
"timeout",
"SocketTimeoutException"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/SocketIOWithTimeout.java#L125-L171 |
119,189 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java | JNStorage.findFinalizedEditsFile | File findFinalizedEditsFile(long startTxId, long endTxId) throws IOException {
File ret = new File(sd.getCurrentDir(),
NNStorage.getFinalizedEditsFileName(startTxId, endTxId));
if (!ret.exists()) {
throw new IOException(
"No edits file for range " + startTxId + "-" + endTxId);
}
... | java | File findFinalizedEditsFile(long startTxId, long endTxId) throws IOException {
File ret = new File(sd.getCurrentDir(),
NNStorage.getFinalizedEditsFileName(startTxId, endTxId));
if (!ret.exists()) {
throw new IOException(
"No edits file for range " + startTxId + "-" + endTxId);
}
... | [
"File",
"findFinalizedEditsFile",
"(",
"long",
"startTxId",
",",
"long",
"endTxId",
")",
"throws",
"IOException",
"{",
"File",
"ret",
"=",
"new",
"File",
"(",
"sd",
".",
"getCurrentDir",
"(",
")",
",",
"NNStorage",
".",
"getFinalizedEditsFileName",
"(",
"start... | Find an edits file spanning the given transaction ID range.
If no such file exists, an exception is thrown. | [
"Find",
"an",
"edits",
"file",
"spanning",
"the",
"given",
"transaction",
"ID",
"range",
".",
"If",
"no",
"such",
"file",
"exists",
"an",
"exception",
"is",
"thrown",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java#L101-L109 |
119,190 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java | JNStorage.getSyncLogTemporaryFile | File getSyncLogTemporaryFile(long segmentTxId, long endTxId, long stamp) {
String name = NNStorage.getFinalizedEditsFileName(segmentTxId, endTxId) +
".tmp=" + stamp;
return new File(sd.getCurrentDir(), name);
} | java | File getSyncLogTemporaryFile(long segmentTxId, long endTxId, long stamp) {
String name = NNStorage.getFinalizedEditsFileName(segmentTxId, endTxId) +
".tmp=" + stamp;
return new File(sd.getCurrentDir(), name);
} | [
"File",
"getSyncLogTemporaryFile",
"(",
"long",
"segmentTxId",
",",
"long",
"endTxId",
",",
"long",
"stamp",
")",
"{",
"String",
"name",
"=",
"NNStorage",
".",
"getFinalizedEditsFileName",
"(",
"segmentTxId",
",",
"endTxId",
")",
"+",
"\".tmp=\"",
"+",
"stamp",
... | Get name for temporary file used for log syncing, after a journal node
crashed. | [
"Get",
"name",
"for",
"temporary",
"file",
"used",
"for",
"log",
"syncing",
"after",
"a",
"journal",
"node",
"crashed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java#L145-L149 |
119,191 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java | JNStorage.getSyncLogDestFile | File getSyncLogDestFile(long segmentTxId, long endTxId) {
String name = NNStorage.getFinalizedEditsFileName(segmentTxId, endTxId);
return new File(sd.getCurrentDir(), name);
} | java | File getSyncLogDestFile(long segmentTxId, long endTxId) {
String name = NNStorage.getFinalizedEditsFileName(segmentTxId, endTxId);
return new File(sd.getCurrentDir(), name);
} | [
"File",
"getSyncLogDestFile",
"(",
"long",
"segmentTxId",
",",
"long",
"endTxId",
")",
"{",
"String",
"name",
"=",
"NNStorage",
".",
"getFinalizedEditsFileName",
"(",
"segmentTxId",
",",
"endTxId",
")",
";",
"return",
"new",
"File",
"(",
"sd",
".",
"getCurrent... | Get name for destination file used for log syncing, after a journal node
crashed. | [
"Get",
"name",
"for",
"destination",
"file",
"used",
"for",
"log",
"syncing",
"after",
"a",
"journal",
"node",
"crashed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java#L155-L158 |
119,192 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java | JNStorage.purgeDataOlderThan | void purgeDataOlderThan(long minTxIdToKeep) throws IOException {
if (isImageDir) {
purgeMatching(sd.getCurrentDir(), IMAGE_CURRENT_DIR_PURGE_REGEXES,
minTxIdToKeep);
} else {
purgeMatching(sd.getCurrentDir(), EDITS_CURRENT_DIR_PURGE_REGEXES,
minTxIdToKeep);
purgeMatching(ge... | java | void purgeDataOlderThan(long minTxIdToKeep) throws IOException {
if (isImageDir) {
purgeMatching(sd.getCurrentDir(), IMAGE_CURRENT_DIR_PURGE_REGEXES,
minTxIdToKeep);
} else {
purgeMatching(sd.getCurrentDir(), EDITS_CURRENT_DIR_PURGE_REGEXES,
minTxIdToKeep);
purgeMatching(ge... | [
"void",
"purgeDataOlderThan",
"(",
"long",
"minTxIdToKeep",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isImageDir",
")",
"{",
"purgeMatching",
"(",
"sd",
".",
"getCurrentDir",
"(",
")",
",",
"IMAGE_CURRENT_DIR_PURGE_REGEXES",
",",
"minTxIdToKeep",
")",
";",
... | Remove any log files and associated paxos files which are older than
the given txid. | [
"Remove",
"any",
"log",
"files",
"and",
"associated",
"paxos",
"files",
"which",
"are",
"older",
"than",
"the",
"given",
"txid",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java#L182-L191 |
119,193 | facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java | Gridmix.writeInputData | protected void writeInputData(long genbytes, Path ioPath)
throws IOException, InterruptedException {
final Configuration conf = getConf();
final GridmixJob genData = new GenerateData(conf, ioPath, genbytes);
submitter.add(genData);
LOG.info("Generating " + StringUtils.humanReadableInt(genbytes) +
... | java | protected void writeInputData(long genbytes, Path ioPath)
throws IOException, InterruptedException {
final Configuration conf = getConf();
final GridmixJob genData = new GenerateData(conf, ioPath, genbytes);
submitter.add(genData);
LOG.info("Generating " + StringUtils.humanReadableInt(genbytes) +
... | [
"protected",
"void",
"writeInputData",
"(",
"long",
"genbytes",
",",
"Path",
"ioPath",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"final",
"Configuration",
"conf",
"=",
"getConf",
"(",
")",
";",
"final",
"GridmixJob",
"genData",
"=",
"new",
... | Write random bytes at the path provided.
@see org.apache.hadoop.mapred.gridmix.GenerateData | [
"Write",
"random",
"bytes",
"at",
"the",
"path",
"provided",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java#L93-L111 |
119,194 | facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java | Gridmix.startThreads | private void startThreads(Configuration conf, String traceIn, Path ioPath,
Path scratchDir, CountDownLatch startFlag) throws IOException {
monitor = createJobMonitor();
submitter = createJobSubmitter(monitor,
conf.getInt(GRIDMIX_SUB_THR,
Runtime.getRuntime().availableProcessors() + 1),
... | java | private void startThreads(Configuration conf, String traceIn, Path ioPath,
Path scratchDir, CountDownLatch startFlag) throws IOException {
monitor = createJobMonitor();
submitter = createJobSubmitter(monitor,
conf.getInt(GRIDMIX_SUB_THR,
Runtime.getRuntime().availableProcessors() + 1),
... | [
"private",
"void",
"startThreads",
"(",
"Configuration",
"conf",
",",
"String",
"traceIn",
",",
"Path",
"ioPath",
",",
"Path",
"scratchDir",
",",
"CountDownLatch",
"startFlag",
")",
"throws",
"IOException",
"{",
"monitor",
"=",
"createJobMonitor",
"(",
")",
";",... | Create each component in the pipeline and start it.
@param conf Configuration data, no keys specific to this context
@param traceIn Either a Path to the trace data or "-" for
stdin
@param ioPath Path from which input data is read
@param scratchDir Path into which job output is written
@param startFlag Semapho... | [
"Create",
"each",
"component",
"in",
"the",
"pipeline",
"and",
"start",
"it",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java#L130-L142 |
119,195 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java | ClusterJspHelper.generateClusterHealthReport | ClusterStatus generateClusterHealthReport() {
ClusterStatus cs = new ClusterStatus();
List<InetSocketAddress> isas = null;
ArrayList<String> suffixes = null;
if (isAvatar) {
suffixes = new ArrayList<String>();
suffixes.add("0"); suffixes.add("1");
}
try {
cs.nnAddrs = isas = DF... | java | ClusterStatus generateClusterHealthReport() {
ClusterStatus cs = new ClusterStatus();
List<InetSocketAddress> isas = null;
ArrayList<String> suffixes = null;
if (isAvatar) {
suffixes = new ArrayList<String>();
suffixes.add("0"); suffixes.add("1");
}
try {
cs.nnAddrs = isas = DF... | [
"ClusterStatus",
"generateClusterHealthReport",
"(",
")",
"{",
"ClusterStatus",
"cs",
"=",
"new",
"ClusterStatus",
"(",
")",
";",
"List",
"<",
"InetSocketAddress",
">",
"isas",
"=",
"null",
";",
"ArrayList",
"<",
"String",
">",
"suffixes",
"=",
"null",
";",
... | JSP helper function that generates cluster health report. When
encountering exception while getting Namenode status, the exception will
be listed in the page with corresponding stack trace. | [
"JSP",
"helper",
"function",
"that",
"generates",
"cluster",
"health",
"report",
".",
"When",
"encountering",
"exception",
"while",
"getting",
"Namenode",
"status",
"the",
"exception",
"will",
"be",
"listed",
"in",
"the",
"page",
"with",
"corresponding",
"stack",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java#L214-L251 |
119,196 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java | ClusterJspHelper.generateDecommissioningReport | DecommissionStatus generateDecommissioningReport() {
List<InetSocketAddress> isas = null;
ArrayList<String> suffixes = null;
if (isAvatar) {
suffixes = new ArrayList<String>();
suffixes.add("0"); suffixes.add("1");
}
try {
isas = DFSUtil.getClientRpcAddresses(conf, suffixes);
... | java | DecommissionStatus generateDecommissioningReport() {
List<InetSocketAddress> isas = null;
ArrayList<String> suffixes = null;
if (isAvatar) {
suffixes = new ArrayList<String>();
suffixes.add("0"); suffixes.add("1");
}
try {
isas = DFSUtil.getClientRpcAddresses(conf, suffixes);
... | [
"DecommissionStatus",
"generateDecommissioningReport",
"(",
")",
"{",
"List",
"<",
"InetSocketAddress",
">",
"isas",
"=",
"null",
";",
"ArrayList",
"<",
"String",
">",
"suffixes",
"=",
"null",
";",
"if",
"(",
"isAvatar",
")",
"{",
"suffixes",
"=",
"new",
"Ar... | Helper function that generates the decommissioning report. | [
"Helper",
"function",
"that",
"generates",
"the",
"decommissioning",
"report",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java#L267-L316 |
119,197 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java | ClusterJspHelper.updateUnknownStatus | private void updateUnknownStatus(Map<String, Map<String, String>> statusMap,
List<String> unreportedNn) {
if (unreportedNn == null || unreportedNn.isEmpty()) {
// no unreported namenodes
return;
}
for (Map.Entry<String, Map<String,String>> entry : statusMap.entrySet()) {
String ... | java | private void updateUnknownStatus(Map<String, Map<String, String>> statusMap,
List<String> unreportedNn) {
if (unreportedNn == null || unreportedNn.isEmpty()) {
// no unreported namenodes
return;
}
for (Map.Entry<String, Map<String,String>> entry : statusMap.entrySet()) {
String ... | [
"private",
"void",
"updateUnknownStatus",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"statusMap",
",",
"List",
"<",
"String",
">",
"unreportedNn",
")",
"{",
"if",
"(",
"unreportedNn",
"==",
"null",
"||",
"unreportedNn",
... | update unknown status in datanode status map for every unreported namenode | [
"update",
"unknown",
"status",
"in",
"datanode",
"status",
"map",
"for",
"every",
"unreported",
"namenode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java#L402-L417 |
119,198 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java | ClusterJspHelper.getDatanodeHttpPort | private int getDatanodeHttpPort(Configuration conf) {
String address = conf.get("dfs.datanode.http.address", "");
if (address.equals("")) {
return -1;
}
return Integer.parseInt(address.split(":")[1]);
} | java | private int getDatanodeHttpPort(Configuration conf) {
String address = conf.get("dfs.datanode.http.address", "");
if (address.equals("")) {
return -1;
}
return Integer.parseInt(address.split(":")[1]);
} | [
"private",
"int",
"getDatanodeHttpPort",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"address",
"=",
"conf",
".",
"get",
"(",
"\"dfs.datanode.http.address\"",
",",
"\"\"",
")",
";",
"if",
"(",
"address",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"re... | Get datanode http port from configration | [
"Get",
"datanode",
"http",
"port",
"from",
"configration"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ClusterJspHelper.java#L422-L428 |
119,199 | facebookarchive/hadoop-20 | src/contrib/vaidya/src/java/org/apache/hadoop/vaidya/postexdiagnosis/PostExPerformanceDiagnoser.java | PostExPerformanceDiagnoser.readJobInformation | private void readJobInformation(JobConf jobConf, JobInfo jobInfo) throws Exception {
/*
* Convert the input strings to URL
*/
URL jobConfFileUrl = new URL(this._jobConfFile);
URL jobHistoryFileUrl = new URL (this._jobHistoryFile);
/*
* Read the Job Configuration from the jobConfFi... | java | private void readJobInformation(JobConf jobConf, JobInfo jobInfo) throws Exception {
/*
* Convert the input strings to URL
*/
URL jobConfFileUrl = new URL(this._jobConfFile);
URL jobHistoryFileUrl = new URL (this._jobHistoryFile);
/*
* Read the Job Configuration from the jobConfFi... | [
"private",
"void",
"readJobInformation",
"(",
"JobConf",
"jobConf",
",",
"JobInfo",
"jobInfo",
")",
"throws",
"Exception",
"{",
"/*\n * Convert the input strings to URL\n */",
"URL",
"jobConfFileUrl",
"=",
"new",
"URL",
"(",
"this",
".",
"_jobConfFile",
")",
"... | read and populate job statistics information. | [
"read",
"and",
"populate",
"job",
"statistics",
"information",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/vaidya/src/java/org/apache/hadoop/vaidya/postexdiagnosis/PostExPerformanceDiagnoser.java#L119-L142 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.