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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
118,600 | facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobInitializationPoller.java | JobInitializationPoller.cleanUpInitializedJobsList | void cleanUpInitializedJobsList() {
Iterator<Entry<JobID, JobInProgress>> jobsIterator =
initializedJobs.entrySet().iterator();
while(jobsIterator.hasNext()) {
Entry<JobID,JobInProgress> entry = jobsIterator.next();
JobInProgress job = entry.getValue();
if (job.getStatus().getRunState()... | java | void cleanUpInitializedJobsList() {
Iterator<Entry<JobID, JobInProgress>> jobsIterator =
initializedJobs.entrySet().iterator();
while(jobsIterator.hasNext()) {
Entry<JobID,JobInProgress> entry = jobsIterator.next();
JobInProgress job = entry.getValue();
if (job.getStatus().getRunState()... | [
"void",
"cleanUpInitializedJobsList",
"(",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"JobID",
",",
"JobInProgress",
">",
">",
"jobsIterator",
"=",
"initializedJobs",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"jobsIterator",
".",... | Method which is used internally to clean up the initialized jobs
data structure which the job initialization poller uses to check
if a job is initalized or not.
Algorithm for cleaning up task is as follows:
<ul>
<li> For jobs in <b>initalizedJobs</b> list </li>
<ul>
<li> If job is running</li>
<ul>
<li> If job is sch... | [
"Method",
"which",
"is",
"used",
"internally",
"to",
"clean",
"up",
"the",
"initialized",
"jobs",
"data",
"structure",
"which",
"the",
"job",
"initialization",
"poller",
"uses",
"to",
"check",
"if",
"a",
"job",
"is",
"initalized",
"or",
"not",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobInitializationPoller.java#L528-L549 |
118,601 | facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobInitializationPoller.java | JobInitializationPoller.isScheduled | private boolean isScheduled(JobInProgress job) {
return ((job.pendingMaps() < job.desiredMaps())
|| (job.pendingReduces() < job.desiredReduces()));
} | java | private boolean isScheduled(JobInProgress job) {
return ((job.pendingMaps() < job.desiredMaps())
|| (job.pendingReduces() < job.desiredReduces()));
} | [
"private",
"boolean",
"isScheduled",
"(",
"JobInProgress",
"job",
")",
"{",
"return",
"(",
"(",
"job",
".",
"pendingMaps",
"(",
")",
"<",
"job",
".",
"desiredMaps",
"(",
")",
")",
"||",
"(",
"job",
".",
"pendingReduces",
"(",
")",
"<",
"job",
".",
"d... | Convenience method to check if job has been scheduled or not.
The method may return false in case of job which has failure but
has not failed the tip.
@param job
@return | [
"Convenience",
"method",
"to",
"check",
"if",
"job",
"has",
"been",
"scheduled",
"or",
"not",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobInitializationPoller.java#L559-L562 |
118,602 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java | BlockCrcFileReader.readHeader | void readHeader() throws IOException {
int version = in.readInt();
if (version != BlockCrcInfoWritable.LATEST_BLOCK_CRC_FILE_VERSION) {
throw new IOException("Version " + version + " is not supported.");
}
numBuckets = in.readInt();
currentBucket = -1;
numRecordsReadInBucket = 0;
numRe... | java | void readHeader() throws IOException {
int version = in.readInt();
if (version != BlockCrcInfoWritable.LATEST_BLOCK_CRC_FILE_VERSION) {
throw new IOException("Version " + version + " is not supported.");
}
numBuckets = in.readInt();
currentBucket = -1;
numRecordsReadInBucket = 0;
numRe... | [
"void",
"readHeader",
"(",
")",
"throws",
"IOException",
"{",
"int",
"version",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"if",
"(",
"version",
"!=",
"BlockCrcInfoWritable",
".",
"LATEST_BLOCK_CRC_FILE_VERSION",
")",
"{",
"throw",
"new",
"IOException",
"(",
... | Read header of the file
@throws IOException | [
"Read",
"header",
"of",
"the",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java#L86-L95 |
118,603 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java | BlockCrcFileReader.moveToNextRecordAndGetItsBucketId | int moveToNextRecordAndGetItsBucketId() throws IOException {
while (numRecordsReadInBucket >= numRecordsInBucket) {
if (currentBucket + 1>= numBuckets) {
// We've finished all the records.
return -1;
} else {
numRecordsInBucket = in.readInt();
currentBucket++;
num... | java | int moveToNextRecordAndGetItsBucketId() throws IOException {
while (numRecordsReadInBucket >= numRecordsInBucket) {
if (currentBucket + 1>= numBuckets) {
// We've finished all the records.
return -1;
} else {
numRecordsInBucket = in.readInt();
currentBucket++;
num... | [
"int",
"moveToNextRecordAndGetItsBucketId",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"numRecordsReadInBucket",
">=",
"numRecordsInBucket",
")",
"{",
"if",
"(",
"currentBucket",
"+",
"1",
">=",
"numBuckets",
")",
"{",
"// We've finished all the records.",
... | Find the bucket ID for the next record. If current bucket hasn't yet been
finished, then the current bucket ID will be returned. Otherwise, it will
keep reading the input file until it finds the next non-empty bucket and
return this bucket's ID.
After the call, the position of the input stream will be just before the
... | [
"Find",
"the",
"bucket",
"ID",
"for",
"the",
"next",
"record",
".",
"If",
"current",
"bucket",
"hasn",
"t",
"yet",
"been",
"finished",
"then",
"the",
"current",
"bucket",
"ID",
"will",
"be",
"returned",
".",
"Otherwise",
"it",
"will",
"keep",
"reading",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java#L109-L121 |
118,604 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java | BlockCrcFileReader.getNextRecord | BlockCrcInfoWritable getNextRecord() throws IOException {
// By calling getBucketIdForNextRecord(), we make sure the next field
// to read is the next record (if there is any record left in the file)
// Also, by checking the return value, we know whether we've finished
// the file.
if (moveToNextRec... | java | BlockCrcInfoWritable getNextRecord() throws IOException {
// By calling getBucketIdForNextRecord(), we make sure the next field
// to read is the next record (if there is any record left in the file)
// Also, by checking the return value, we know whether we've finished
// the file.
if (moveToNextRec... | [
"BlockCrcInfoWritable",
"getNextRecord",
"(",
")",
"throws",
"IOException",
"{",
"// By calling getBucketIdForNextRecord(), we make sure the next field",
"// to read is the next record (if there is any record left in the file)",
"// Also, by checking the return value, we know whether we've finishe... | Get information for the next blockCRC record. NULL if not more left.
@return
@throws IOException | [
"Get",
"information",
"for",
"the",
"next",
"blockCRC",
"record",
".",
"NULL",
"if",
"not",
"more",
"left",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockCrcFileReader.java#L128-L141 |
118,605 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java | DistBlockIntegrityMonitor.startOneJob | public static Job startOneJob(Worker newWorker,
Priority pri, Set<String> jobFiles, long detectTime,
AtomicLong numFilesSubmitted, AtomicLong lastCheckingTime,
long maxPendingJobs)
throws IOException, InterruptedException, ClassNotFoundException {
if (lastCheckingTime != null) {
... | java | public static Job startOneJob(Worker newWorker,
Priority pri, Set<String> jobFiles, long detectTime,
AtomicLong numFilesSubmitted, AtomicLong lastCheckingTime,
long maxPendingJobs)
throws IOException, InterruptedException, ClassNotFoundException {
if (lastCheckingTime != null) {
... | [
"public",
"static",
"Job",
"startOneJob",
"(",
"Worker",
"newWorker",
",",
"Priority",
"pri",
",",
"Set",
"<",
"String",
">",
"jobFiles",
",",
"long",
"detectTime",
",",
"AtomicLong",
"numFilesSubmitted",
",",
"AtomicLong",
"lastCheckingTime",
",",
"long",
"maxP... | Return true if succeed to start one job | [
"Return",
"true",
"if",
"succeed",
"to",
"start",
"one",
"job"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java#L293-L323 |
118,606 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java | DistBlockIntegrityMonitor.getLostStripes | private Map<Integer, Integer> getLostStripes(
Configuration conf, FileStatus stat, FileSystem fs)
throws IOException {
Map<Integer, Integer> lostStripes = new HashMap<Integer, Integer>();
RaidInfo raidInfo = RaidUtils.getFileRaidInfo(stat, conf);
if (raidInfo.codec == null) ... | java | private Map<Integer, Integer> getLostStripes(
Configuration conf, FileStatus stat, FileSystem fs)
throws IOException {
Map<Integer, Integer> lostStripes = new HashMap<Integer, Integer>();
RaidInfo raidInfo = RaidUtils.getFileRaidInfo(stat, conf);
if (raidInfo.codec == null) ... | [
"private",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getLostStripes",
"(",
"Configuration",
"conf",
",",
"FileStatus",
"stat",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"lostStripes",
"=",
"new... | Get the lost blocks numbers per stripe in the source file. | [
"Get",
"the",
"lost",
"blocks",
"numbers",
"per",
"stripe",
"in",
"the",
"source",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java#L1163-L1183 |
118,607 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java | DistBlockIntegrityMonitor.getLostFiles | protected Map<String, Integer> getLostFiles(
Pattern pattern, String[] dfsckArgs) throws IOException {
Map<String, Integer> lostFiles = new HashMap<String, Integer>();
BufferedReader reader = getLostFileReader(dfsckArgs);
String line = reader.readLine(); // remove the header line
while ((line = r... | java | protected Map<String, Integer> getLostFiles(
Pattern pattern, String[] dfsckArgs) throws IOException {
Map<String, Integer> lostFiles = new HashMap<String, Integer>();
BufferedReader reader = getLostFileReader(dfsckArgs);
String line = reader.readLine(); // remove the header line
while ((line = r... | [
"protected",
"Map",
"<",
"String",
",",
"Integer",
">",
"getLostFiles",
"(",
"Pattern",
"pattern",
",",
"String",
"[",
"]",
"dfsckArgs",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"lostFiles",
"=",
"new",
"HashMap",
"<",
... | Gets a list of lost files from the name node via DFSck
@param pattern A pattern matching a single file in DFSck's output
@param dfsckArgs Arguments to pass to DFSck
@return A map of lost files' filenames to num lost blocks for that file | [
"Gets",
"a",
"list",
"of",
"lost",
"files",
"from",
"the",
"name",
"node",
"via",
"DFSck"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java#L1804-L1828 |
118,608 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java | DistBlockIntegrityMonitor.getAggregateStatus | @Override
public BlockIntegrityMonitor.Status getAggregateStatus() {
Status fixer = corruptionWorker.getStatus();
Status copier = decommissioningWorker.getStatus();
List<JobStatus> jobs = new ArrayList<JobStatus>();
List<JobStatus> simFailedJobs = new ArrayList<JobStatus>();
List<JobStatus> faile... | java | @Override
public BlockIntegrityMonitor.Status getAggregateStatus() {
Status fixer = corruptionWorker.getStatus();
Status copier = decommissioningWorker.getStatus();
List<JobStatus> jobs = new ArrayList<JobStatus>();
List<JobStatus> simFailedJobs = new ArrayList<JobStatus>();
List<JobStatus> faile... | [
"@",
"Override",
"public",
"BlockIntegrityMonitor",
".",
"Status",
"getAggregateStatus",
"(",
")",
"{",
"Status",
"fixer",
"=",
"corruptionWorker",
".",
"getStatus",
"(",
")",
";",
"Status",
"copier",
"=",
"decommissioningWorker",
".",
"getStatus",
"(",
")",
";"... | Get the status of the entire block integrity monitor.
The status returned represents the aggregation of the statuses of all the
integrity monitor's components.
@return The status of the block integrity monitor | [
"Get",
"the",
"status",
"of",
"the",
"entire",
"block",
"integrity",
"monitor",
".",
"The",
"status",
"returned",
"represents",
"the",
"aggregation",
"of",
"the",
"statuses",
"of",
"all",
"the",
"integrity",
"monitor",
"s",
"components",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/DistBlockIntegrityMonitor.java#L2112-L2149 |
118,609 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJTFallbackCaller.java | CoronaJTFallbackCaller.makeCall | public final T makeCall() throws IOException {
while (true) {
try {
return call();
} catch (ConnectException e) {
// We fall back only after ConnectException
try {
// Fall back to secondary tracker and reconnect to new JT
reconnectToNewJobTracker(0);
}... | java | public final T makeCall() throws IOException {
while (true) {
try {
return call();
} catch (ConnectException e) {
// We fall back only after ConnectException
try {
// Fall back to secondary tracker and reconnect to new JT
reconnectToNewJobTracker(0);
}... | [
"public",
"final",
"T",
"makeCall",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"return",
"call",
"(",
")",
";",
"}",
"catch",
"(",
"ConnectException",
"e",
")",
"{",
"// We fall back only after ConnectException",
"try... | Template function to make the call. Throws if can not fallback.
@return The generic return value.
@throws IOException | [
"Template",
"function",
"to",
"make",
"the",
"call",
".",
"Throws",
"if",
"can",
"not",
"fallback",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJTFallbackCaller.java#L106-L126 |
118,610 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJTFallbackCaller.java | CoronaJTFallbackCaller.reconnectToNewJobTracker | private final void reconnectToNewJobTracker(int connectNum) throws IOException {
if (connectNum >= CONNECT_MAX_NUMBER) {
LOG.error("reconnectToNewJobTracker has reached its max number.");
throw new IOException("reconnectToNewJobTracker has reached its max number.");
}
InetSocketAddress seco... | java | private final void reconnectToNewJobTracker(int connectNum) throws IOException {
if (connectNum >= CONNECT_MAX_NUMBER) {
LOG.error("reconnectToNewJobTracker has reached its max number.");
throw new IOException("reconnectToNewJobTracker has reached its max number.");
}
InetSocketAddress seco... | [
"private",
"final",
"void",
"reconnectToNewJobTracker",
"(",
"int",
"connectNum",
")",
"throws",
"IOException",
"{",
"if",
"(",
"connectNum",
">=",
"CONNECT_MAX_NUMBER",
")",
"{",
"LOG",
".",
"error",
"(",
"\"reconnectToNewJobTracker has reached its max number.\"",
")",... | Reconnects to new address obtained from secondary address via
InterCoronaTrackerProtocol
@throws IOException | [
"Reconnects",
"to",
"new",
"address",
"obtained",
"from",
"secondary",
"address",
"via",
"InterCoronaTrackerProtocol"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJTFallbackCaller.java#L133-L179 |
118,611 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/ResourceCalculatorPlugin.java | ResourceCalculatorPlugin.getResourceCalculatorPlugin | public static ResourceCalculatorPlugin getResourceCalculatorPlugin(
Class<? extends ResourceCalculatorPlugin> clazz, Configuration conf) {
if (clazz != null) {
return ReflectionUtils.newInstance(clazz, conf);
}
// No class given, try a os specific class
try {
String osName = System.g... | java | public static ResourceCalculatorPlugin getResourceCalculatorPlugin(
Class<? extends ResourceCalculatorPlugin> clazz, Configuration conf) {
if (clazz != null) {
return ReflectionUtils.newInstance(clazz, conf);
}
// No class given, try a os specific class
try {
String osName = System.g... | [
"public",
"static",
"ResourceCalculatorPlugin",
"getResourceCalculatorPlugin",
"(",
"Class",
"<",
"?",
"extends",
"ResourceCalculatorPlugin",
">",
"clazz",
",",
"Configuration",
"conf",
")",
"{",
"if",
"(",
"clazz",
"!=",
"null",
")",
"{",
"return",
"ReflectionUtils... | Get the ResourceCalculatorPlugin from the class name and configure it. If
class name is null, this method will try and return a memory calculator
plugin available for this system.
@param clazz class-name
@param conf configure the plugin with this.
@return ResourceCalculatorPlugin | [
"Get",
"the",
"ResourceCalculatorPlugin",
"from",
"the",
"class",
"name",
"and",
"configure",
"it",
".",
"If",
"class",
"name",
"is",
"null",
"this",
"method",
"will",
"try",
"and",
"return",
"a",
"memory",
"calculator",
"plugin",
"available",
"for",
"this",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ResourceCalculatorPlugin.java#L140-L160 |
118,612 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ParallelStreamReader.java | ParallelStreamReader.performReads | private void performReads(ReadResult readResult) throws InterruptedException {
long start = System.currentTimeMillis();
for (int i = 0; i < streams.length; ) {
boolean acquired = slots.tryAcquire(1, 10, TimeUnit.SECONDS);
reporter.progress();
if (acquired) {
readPool.execute(new ReadOp... | java | private void performReads(ReadResult readResult) throws InterruptedException {
long start = System.currentTimeMillis();
for (int i = 0; i < streams.length; ) {
boolean acquired = slots.tryAcquire(1, 10, TimeUnit.SECONDS);
reporter.progress();
if (acquired) {
readPool.execute(new ReadOp... | [
"private",
"void",
"performReads",
"(",
"ReadResult",
"readResult",
")",
"throws",
"InterruptedException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"streams",
".",
"lengt... | Performs a batch of reads from the given streams and waits
for the reads to finish. | [
"Performs",
"a",
"batch",
"of",
"reads",
"from",
"the",
"given",
"streams",
"and",
"waits",
"for",
"the",
"reads",
"to",
"finish",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ParallelStreamReader.java#L284-L307 |
118,613 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java | BalancePlan.logImbalancedNodes | private void logImbalancedNodes() {
if (LOG.isInfoEnabled()) {
int underUtilized = 0, overUtilized = 0;
for (BalancerDatanode node : this.datanodes.values()) {
if (isUnderUtilized(node))
underUtilized++;
else if (isOverUtilized(node))
overUtilized++;
}
Str... | java | private void logImbalancedNodes() {
if (LOG.isInfoEnabled()) {
int underUtilized = 0, overUtilized = 0;
for (BalancerDatanode node : this.datanodes.values()) {
if (isUnderUtilized(node))
underUtilized++;
else if (isOverUtilized(node))
overUtilized++;
}
Str... | [
"private",
"void",
"logImbalancedNodes",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"int",
"underUtilized",
"=",
"0",
",",
"overUtilized",
"=",
"0",
";",
"for",
"(",
"BalancerDatanode",
"node",
":",
"this",
".",
"datanodes... | Log the over utilized & under utilized nodes | [
"Log",
"the",
"over",
"utilized",
"&",
"under",
"utilized",
"nodes"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java#L142-L172 |
118,614 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java | BalancePlan.logPlanOutcome | private void logPlanOutcome() {
if (LOG.isInfoEnabled()) {
LOG.info("Predicted plan outcome: bytesLeftToMove: "
+ bytesLeftToMove + ", bytesToMove: " + bytesToMove);
for (BalancerDatanode node : this.datanodes.values()) {
LOG.info(node.getName() + " remaining: " + node.getCurrentRemain... | java | private void logPlanOutcome() {
if (LOG.isInfoEnabled()) {
LOG.info("Predicted plan outcome: bytesLeftToMove: "
+ bytesLeftToMove + ", bytesToMove: " + bytesToMove);
for (BalancerDatanode node : this.datanodes.values()) {
LOG.info(node.getName() + " remaining: " + node.getCurrentRemain... | [
"private",
"void",
"logPlanOutcome",
"(",
")",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Predicted plan outcome: bytesLeftToMove: \"",
"+",
"bytesLeftToMove",
"+",
"\", bytesToMove: \"",
"+",
"bytesToMove",
")",
... | Log node utilization after the plan execution | [
"Log",
"node",
"utilization",
"after",
"the",
"plan",
"execution"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java#L175-L183 |
118,615 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java | BalancePlan.scheduleTask | private void scheduleTask(Source source, long size, Target target) {
NodeTask nodeTask = new NodeTask(target, size);
source.addNodeTask(nodeTask);
target.addNodeTask(nodeTask);
sources.add(source);
targets.add(target);
LOG.info("scheduled " + size + " bytes : " + source.getName() + " -> " + targ... | java | private void scheduleTask(Source source, long size, Target target) {
NodeTask nodeTask = new NodeTask(target, size);
source.addNodeTask(nodeTask);
target.addNodeTask(nodeTask);
sources.add(source);
targets.add(target);
LOG.info("scheduled " + size + " bytes : " + source.getName() + " -> " + targ... | [
"private",
"void",
"scheduleTask",
"(",
"Source",
"source",
",",
"long",
"size",
",",
"Target",
"target",
")",
"{",
"NodeTask",
"nodeTask",
"=",
"new",
"NodeTask",
"(",
"target",
",",
"size",
")",
";",
"source",
".",
"addNodeTask",
"(",
"nodeTask",
")",
... | Pairs up given nodes in balancing plan | [
"Pairs",
"up",
"given",
"nodes",
"in",
"balancing",
"plan"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java#L186-L193 |
118,616 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java | BalancePlan.logDataDistribution | public static void logDataDistribution(DatanodeInfo[] report) {
if (LOG.isInfoEnabled()) {
double avgRemaining = computeAvgRemaining(Arrays.asList(report));
StringBuilder msg = new StringBuilder("Data distribution report: avgRemaining "
+ avgRemaining);
for (DatanodeInfo node : report) {... | java | public static void logDataDistribution(DatanodeInfo[] report) {
if (LOG.isInfoEnabled()) {
double avgRemaining = computeAvgRemaining(Arrays.asList(report));
StringBuilder msg = new StringBuilder("Data distribution report: avgRemaining "
+ avgRemaining);
for (DatanodeInfo node : report) {... | [
"public",
"static",
"void",
"logDataDistribution",
"(",
"DatanodeInfo",
"[",
"]",
"report",
")",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"double",
"avgRemaining",
"=",
"computeAvgRemaining",
"(",
"Arrays",
".",
"asList",
"(",
"report... | Prints data distribution based on report from NameNode | [
"Prints",
"data",
"distribution",
"based",
"on",
"report",
"from",
"NameNode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/BalancePlan.java#L331-L343 |
118,617 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.setJarByClass | public void setJarByClass(Class cls) {
String jar = findContainingJar(cls);
if (jar != null) {
setJar(jar);
}
} | java | public void setJarByClass(Class cls) {
String jar = findContainingJar(cls);
if (jar != null) {
setJar(jar);
}
} | [
"public",
"void",
"setJarByClass",
"(",
"Class",
"cls",
")",
"{",
"String",
"jar",
"=",
"findContainingJar",
"(",
"cls",
")",
";",
"if",
"(",
"jar",
"!=",
"null",
")",
"{",
"setJar",
"(",
"jar",
")",
";",
"}",
"}"
] | Set the job's jar file by finding an example class location.
@param cls the example class. | [
"Set",
"the",
"job",
"s",
"jar",
"file",
"by",
"finding",
"an",
"example",
"class",
"location",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L481-L486 |
118,618 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.deleteLocalFiles | @Deprecated
public void deleteLocalFiles() throws IOException {
String[] localDirs = getLocalDirs();
for (int i = 0; i < localDirs.length; i++) {
FileSystem.getLocal(this).delete(new Path(localDirs[i]));
}
} | java | @Deprecated
public void deleteLocalFiles() throws IOException {
String[] localDirs = getLocalDirs();
for (int i = 0; i < localDirs.length; i++) {
FileSystem.getLocal(this).delete(new Path(localDirs[i]));
}
} | [
"@",
"Deprecated",
"public",
"void",
"deleteLocalFiles",
"(",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"localDirs",
"=",
"getLocalDirs",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"localDirs",
".",
"length",
";",
"i",... | Use MRAsyncDiskService.moveAndDeleteAllVolumes instead.
@see org.apache.hadoop.util.MRAsyncDiskService#cleanupAllVolumes() | [
"Use",
"MRAsyncDiskService",
".",
"moveAndDeleteAllVolumes",
"instead",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L500-L506 |
118,619 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.getWorkingDirectory | public Path getWorkingDirectory() {
String name = get("mapred.working.dir");
if (name != null) {
return new Path(name);
} else {
try {
Path dir = FileSystem.get(this).getWorkingDirectory();
set("mapred.working.dir", dir.toString());
return dir;
} catch (IOException ... | java | public Path getWorkingDirectory() {
String name = get("mapred.working.dir");
if (name != null) {
return new Path(name);
} else {
try {
Path dir = FileSystem.get(this).getWorkingDirectory();
set("mapred.working.dir", dir.toString());
return dir;
} catch (IOException ... | [
"public",
"Path",
"getWorkingDirectory",
"(",
")",
"{",
"String",
"name",
"=",
"get",
"(",
"\"mapred.working.dir\"",
")",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"return",
"new",
"Path",
"(",
"name",
")",
";",
"}",
"else",
"{",
"try",
"{",
"P... | Get the current working directory for the default file system.
@return the directory name. | [
"Get",
"the",
"current",
"working",
"directory",
"for",
"the",
"default",
"file",
"system",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L606-L619 |
118,620 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.getMemoryForMapTask | public long getMemoryForMapTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
} | java | public long getMemoryForMapTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
} | [
"public",
"long",
"getMemoryForMapTask",
"(",
")",
"{",
"long",
"value",
"=",
"getDeprecatedMemoryValue",
"(",
")",
";",
"if",
"(",
"value",
"==",
"DISABLED_MEMORY_LIMIT",
")",
"{",
"value",
"=",
"normalizeMemoryConfigValue",
"(",
"getLong",
"(",
"JobConf",
".",... | Get memory required to run a map task of the job, in MB.
If a value is specified in the configuration, it is returned.
Else, it returns {@link #DISABLED_MEMORY_LIMIT}.
<p/>
For backward compatibility, if the job configuration sets the
key {@link #MAPRED_TASK_MAXVMEM_PROPERTY} to a value different
from {@link #DISABLED... | [
"Get",
"memory",
"required",
"to",
"run",
"a",
"map",
"task",
"of",
"the",
"job",
"in",
"MB",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L1869-L1877 |
118,621 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.getMemoryForReduceTask | public long getMemoryForReduceTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
} | java | public long getMemoryForReduceTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
} | [
"public",
"long",
"getMemoryForReduceTask",
"(",
")",
"{",
"long",
"value",
"=",
"getDeprecatedMemoryValue",
"(",
")",
";",
"if",
"(",
"value",
"==",
"DISABLED_MEMORY_LIMIT",
")",
"{",
"value",
"=",
"normalizeMemoryConfigValue",
"(",
"getLong",
"(",
"JobConf",
"... | Get memory required to run a reduce task of the job, in MB.
If a value is specified in the configuration, it is returned.
Else, it returns {@link #DISABLED_MEMORY_LIMIT}.
<p/>
For backward compatibility, if the job configuration sets the
key {@link #MAPRED_TASK_MAXVMEM_PROPERTY} to a value different
from {@link #DISAB... | [
"Get",
"memory",
"required",
"to",
"run",
"a",
"reduce",
"task",
"of",
"the",
"job",
"in",
"MB",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L1896-L1904 |
118,622 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.computeNumSlotsPerMap | int computeNumSlotsPerMap(long slotSizePerMap) {
if ((slotSizePerMap==DISABLED_MEMORY_LIMIT) ||
(getMemoryForMapTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return (int)(Math.ceil((float)getMemoryForMapTask() / (float)slotSizePerMap));
} | java | int computeNumSlotsPerMap(long slotSizePerMap) {
if ((slotSizePerMap==DISABLED_MEMORY_LIMIT) ||
(getMemoryForMapTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return (int)(Math.ceil((float)getMemoryForMapTask() / (float)slotSizePerMap));
} | [
"int",
"computeNumSlotsPerMap",
"(",
"long",
"slotSizePerMap",
")",
"{",
"if",
"(",
"(",
"slotSizePerMap",
"==",
"DISABLED_MEMORY_LIMIT",
")",
"||",
"(",
"getMemoryForMapTask",
"(",
")",
"==",
"DISABLED_MEMORY_LIMIT",
")",
")",
"{",
"return",
"1",
";",
"}",
"r... | Compute the number of slots required to run a single map task-attempt
of this job.
@param slotSizePerMap cluster-wide value of the amount of memory required
to run a map-task
@return the number of slots required to run a single map task-attempt
1 if memory parameters are disabled. | [
"Compute",
"the",
"number",
"of",
"slots",
"required",
"to",
"run",
"a",
"single",
"map",
"task",
"-",
"attempt",
"of",
"this",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L1972-L1978 |
118,623 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.computeNumSlotsPerReduce | int computeNumSlotsPerReduce(long slotSizePerReduce) {
if ((slotSizePerReduce==DISABLED_MEMORY_LIMIT) ||
(getMemoryForReduceTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return
(int)(Math.ceil((float)getMemoryForReduceTask() / (float)slotSizePerReduce));
} | java | int computeNumSlotsPerReduce(long slotSizePerReduce) {
if ((slotSizePerReduce==DISABLED_MEMORY_LIMIT) ||
(getMemoryForReduceTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return
(int)(Math.ceil((float)getMemoryForReduceTask() / (float)slotSizePerReduce));
} | [
"int",
"computeNumSlotsPerReduce",
"(",
"long",
"slotSizePerReduce",
")",
"{",
"if",
"(",
"(",
"slotSizePerReduce",
"==",
"DISABLED_MEMORY_LIMIT",
")",
"||",
"(",
"getMemoryForReduceTask",
"(",
")",
"==",
"DISABLED_MEMORY_LIMIT",
")",
")",
"{",
"return",
"1",
";",... | Compute the number of slots required to run a single reduce task-attempt
of this job.
@param slotSizePerReduce cluster-wide value of the amount of memory
required to run a reduce-task
@return the number of slots required to run a single reduce task-attempt
1 if memory parameters are disabled. | [
"Compute",
"the",
"number",
"of",
"slots",
"required",
"to",
"run",
"a",
"single",
"reduce",
"task",
"-",
"attempt",
"of",
"this",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L1988-L1995 |
118,624 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.findContainingJar | private static String findContainingJar(Class my_class) {
ClassLoader loader = my_class.getClassLoader();
String class_file = my_class.getName().replaceAll("\\.", "/") + ".class";
try {
for(Enumeration itr = loader.getResources(class_file);
itr.hasMoreElements();) {
URL url = (URL) i... | java | private static String findContainingJar(Class my_class) {
ClassLoader loader = my_class.getClassLoader();
String class_file = my_class.getName().replaceAll("\\.", "/") + ".class";
try {
for(Enumeration itr = loader.getResources(class_file);
itr.hasMoreElements();) {
URL url = (URL) i... | [
"private",
"static",
"String",
"findContainingJar",
"(",
"Class",
"my_class",
")",
"{",
"ClassLoader",
"loader",
"=",
"my_class",
".",
"getClassLoader",
"(",
")",
";",
"String",
"class_file",
"=",
"my_class",
".",
"getName",
"(",
")",
".",
"replaceAll",
"(",
... | Find a jar that contains a class of the same name, if any.
It will return a jar file, even if that is not the first thing
on the class path that has a class with the same name.
@param my_class the class to find.
@return a jar file that contains the class, or null.
@throws IOException | [
"Find",
"a",
"jar",
"that",
"contains",
"a",
"class",
"of",
"the",
"same",
"name",
"if",
"any",
".",
"It",
"will",
"return",
"a",
"jar",
"file",
"even",
"if",
"that",
"is",
"not",
"the",
"first",
"thing",
"on",
"the",
"class",
"path",
"that",
"has",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L2006-L2026 |
118,625 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobConf.java | JobConf.overrideConfiguration | public static void overrideConfiguration(JobConf conf, int instance) {
final String CONFIG_KEYS[] =
new String[]{"mapred.job.tracker", "mapred.local.dir",
"mapred.fairscheduler.server.address"};
for (String configKey : CONFIG_KEYS) {
String value = conf.get(configKey + "-" + i... | java | public static void overrideConfiguration(JobConf conf, int instance) {
final String CONFIG_KEYS[] =
new String[]{"mapred.job.tracker", "mapred.local.dir",
"mapred.fairscheduler.server.address"};
for (String configKey : CONFIG_KEYS) {
String value = conf.get(configKey + "-" + i... | [
"public",
"static",
"void",
"overrideConfiguration",
"(",
"JobConf",
"conf",
",",
"int",
"instance",
")",
"{",
"final",
"String",
"CONFIG_KEYS",
"[",
"]",
"=",
"new",
"String",
"[",
"]",
"{",
"\"mapred.job.tracker\"",
",",
"\"mapred.local.dir\"",
",",
"\"mapred.... | Replce the jobtracker configuration with the configuration of 0 or 1
instance. This allows switching two sets of configurations in the
command line option.
@param conf The jobConf to be overwritten
@param instance 0 or 1 instance of the jobtracker | [
"Replce",
"the",
"jobtracker",
"configuration",
"with",
"the",
"configuration",
"of",
"0",
"or",
"1",
"instance",
".",
"This",
"allows",
"switching",
"two",
"sets",
"of",
"configurations",
"in",
"the",
"command",
"line",
"option",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobConf.java#L2142-L2154 |
118,626 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ReconfigurationException.java | ReconfigurationException.constructMessage | private static String constructMessage(String property,
String newVal, String oldVal) {
String message = "Could not change property " + property;
if (oldVal != null) {
message += " from \'" + oldVal;
}
if (newVal != null) {
message += "\' to \'" + ne... | java | private static String constructMessage(String property,
String newVal, String oldVal) {
String message = "Could not change property " + property;
if (oldVal != null) {
message += " from \'" + oldVal;
}
if (newVal != null) {
message += "\' to \'" + ne... | [
"private",
"static",
"String",
"constructMessage",
"(",
"String",
"property",
",",
"String",
"newVal",
",",
"String",
"oldVal",
")",
"{",
"String",
"message",
"=",
"\"Could not change property \"",
"+",
"property",
";",
"if",
"(",
"oldVal",
"!=",
"null",
")",
... | Construct the exception message. | [
"Construct",
"the",
"exception",
"message",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ReconfigurationException.java#L37-L47 |
118,627 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java | NameSpaceSliceStorage.recoverTransitionRead | void recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo,
Collection<File> dataDirs, StartupOption startOpt) throws IOException {
assert FSConstants.LAYOUT_VERSION == nsInfo.getLayoutVersion()
: "Block-pool and name-node layout versions must be the same.";
// 1. For each Namespace data... | java | void recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo,
Collection<File> dataDirs, StartupOption startOpt) throws IOException {
assert FSConstants.LAYOUT_VERSION == nsInfo.getLayoutVersion()
: "Block-pool and name-node layout versions must be the same.";
// 1. For each Namespace data... | [
"void",
"recoverTransitionRead",
"(",
"DataNode",
"datanode",
",",
"NamespaceInfo",
"nsInfo",
",",
"Collection",
"<",
"File",
">",
"dataDirs",
",",
"StartupOption",
"startOpt",
")",
"throws",
"IOException",
"{",
"assert",
"FSConstants",
".",
"LAYOUT_VERSION",
"==",
... | Analyze storage directories. Recover from previous transitions if required.
@param datanode Datanode to which this storage belongs to
@param nsInfo namespace information
@param dataDirs storage directories of namespace
@param startOpt startup option
@throws IOException on error | [
"Analyze",
"storage",
"directories",
".",
"Recover",
"from",
"previous",
"transitions",
"if",
"required",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java#L89-L149 |
118,628 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java | NameSpaceSliceStorage.setFields | @Override
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
props.setProperty(NAMESPACE_ID, String.valueOf(namespaceID));
props.setProperty(CHECK_TIME, String.valueOf(cTime));
props.setProperty(LAYOUT_VERSION, String.valueOf(layoutVersion));
} | java | @Override
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
props.setProperty(NAMESPACE_ID, String.valueOf(namespaceID));
props.setProperty(CHECK_TIME, String.valueOf(cTime));
props.setProperty(LAYOUT_VERSION, String.valueOf(layoutVersion));
} | [
"@",
"Override",
"protected",
"void",
"setFields",
"(",
"Properties",
"props",
",",
"StorageDirectory",
"sd",
")",
"throws",
"IOException",
"{",
"props",
".",
"setProperty",
"(",
"NAMESPACE_ID",
",",
"String",
".",
"valueOf",
"(",
"namespaceID",
")",
")",
";",... | Set layoutVersion, namespaceID and blockpoolID into namespace storage
VERSION file | [
"Set",
"layoutVersion",
"namespaceID",
"and",
"blockpoolID",
"into",
"namespace",
"storage",
"VERSION",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java#L191-L197 |
118,629 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java | NameSpaceSliceStorage.setNameSpaceID | private void setNameSpaceID(File storage, String nsid)
throws InconsistentFSStateException {
if (nsid == null || nsid.equals("")) {
throw new InconsistentFSStateException(storage, "file "
+ STORAGE_FILE_VERSION + " is invalid.");
}
int newNsId = Integer.parseInt(nsid);
if (namespac... | java | private void setNameSpaceID(File storage, String nsid)
throws InconsistentFSStateException {
if (nsid == null || nsid.equals("")) {
throw new InconsistentFSStateException(storage, "file "
+ STORAGE_FILE_VERSION + " is invalid.");
}
int newNsId = Integer.parseInt(nsid);
if (namespac... | [
"private",
"void",
"setNameSpaceID",
"(",
"File",
"storage",
",",
"String",
"nsid",
")",
"throws",
"InconsistentFSStateException",
"{",
"if",
"(",
"nsid",
"==",
"null",
"||",
"nsid",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"throw",
"new",
"InconsistentFSS... | Validate and set namespace ID | [
"Validate",
"and",
"set",
"namespace",
"ID"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java#L200-L212 |
118,630 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java | NameSpaceSliceStorage.doUpgrade | private void doUpgrade(List<StorageDirectory> sds,
List<StorageInfo> sdsInfo,
final NamespaceInfo nsInfo
) throws IOException {
assert sds.size() == sdsInfo.size();
UpgradeThread[] upgradeThreads = new UpgradeThread[sds.size()];
// start to upgrade
for ... | java | private void doUpgrade(List<StorageDirectory> sds,
List<StorageInfo> sdsInfo,
final NamespaceInfo nsInfo
) throws IOException {
assert sds.size() == sdsInfo.size();
UpgradeThread[] upgradeThreads = new UpgradeThread[sds.size()];
// start to upgrade
for ... | [
"private",
"void",
"doUpgrade",
"(",
"List",
"<",
"StorageDirectory",
">",
"sds",
",",
"List",
"<",
"StorageInfo",
">",
"sdsInfo",
",",
"final",
"NamespaceInfo",
"nsInfo",
")",
"throws",
"IOException",
"{",
"assert",
"sds",
".",
"size",
"(",
")",
"==",
"sd... | Move current storage into a backup directory,
and hardlink all its blocks into the new current directory. | [
"Move",
"current",
"storage",
"into",
"a",
"backup",
"directory",
"and",
"hardlink",
"all",
"its",
"blocks",
"into",
"the",
"new",
"current",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NameSpaceSliceStorage.java#L335-L376 |
118,631 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/VersionedWritable.java | VersionedWritable.readFields | public void readFields(DataInput in) throws IOException {
byte version = in.readByte(); // read version
if (version != getVersion())
throw new VersionMismatchException(getVersion(), version);
} | java | public void readFields(DataInput in) throws IOException {
byte version = in.readByte(); // read version
if (version != getVersion())
throw new VersionMismatchException(getVersion(), version);
} | [
"public",
"void",
"readFields",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"version",
"=",
"in",
".",
"readByte",
"(",
")",
";",
"// read version",
"if",
"(",
"version",
"!=",
"getVersion",
"(",
")",
")",
"throw",
"new",
"VersionMis... | javadoc from Writable | [
"javadoc",
"from",
"Writable"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/VersionedWritable.java#L43-L47 |
118,632 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java | CGroupMemoryWatcher.failTasksWithMaxMemory | private void failTasksWithMaxMemory(long memoryToRelease) {
List<TaskAttemptID> allTasks = new ArrayList<TaskAttemptID>();
allTasks.addAll(processTreeInfoMap.keySet());
// Sort the tasks descendingly according to RSS memory usage
Collections.sort(allTasks, new Comparator<TaskAttemptID>() {
@... | java | private void failTasksWithMaxMemory(long memoryToRelease) {
List<TaskAttemptID> allTasks = new ArrayList<TaskAttemptID>();
allTasks.addAll(processTreeInfoMap.keySet());
// Sort the tasks descendingly according to RSS memory usage
Collections.sort(allTasks, new Comparator<TaskAttemptID>() {
@... | [
"private",
"void",
"failTasksWithMaxMemory",
"(",
"long",
"memoryToRelease",
")",
"{",
"List",
"<",
"TaskAttemptID",
">",
"allTasks",
"=",
"new",
"ArrayList",
"<",
"TaskAttemptID",
">",
"(",
")",
";",
"allTasks",
".",
"addAll",
"(",
"processTreeInfoMap",
".",
... | Starting from the tasks use the highest amount of memory,
fail the tasks until the memory released meets the requirement
@param memoryToRelease the mix memory to get released | [
"Starting",
"from",
"the",
"tasks",
"use",
"the",
"highest",
"amount",
"of",
"memory",
"fail",
"the",
"tasks",
"until",
"the",
"memory",
"released",
"meets",
"the",
"requirement"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java#L668-L703 |
118,633 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java | CGroupMemoryWatcher.killTask | private void killTask(TaskAttemptID tid, String msg, boolean wasFailure) {
// Kill the task and mark it as killed.
taskTracker.cleanUpOverMemoryTask(tid, wasFailure, msg);
// Now destroy the ProcessTree, remove it from monitoring map.
CGroupProcessTreeInfo ptInfo = processTreeInfoMap.get(tid);
try {... | java | private void killTask(TaskAttemptID tid, String msg, boolean wasFailure) {
// Kill the task and mark it as killed.
taskTracker.cleanUpOverMemoryTask(tid, wasFailure, msg);
// Now destroy the ProcessTree, remove it from monitoring map.
CGroupProcessTreeInfo ptInfo = processTreeInfoMap.get(tid);
try {... | [
"private",
"void",
"killTask",
"(",
"TaskAttemptID",
"tid",
",",
"String",
"msg",
",",
"boolean",
"wasFailure",
")",
"{",
"// Kill the task and mark it as killed.",
"taskTracker",
".",
"cleanUpOverMemoryTask",
"(",
"tid",
",",
"wasFailure",
",",
"msg",
")",
";",
"... | Kill the task and clean up CGroupProcessTreeInfo
@param tid task attempt ID of the task to be killed.
@param msg diagonostic message
@param wasFailure if true, fail the task | [
"Kill",
"the",
"task",
"and",
"clean",
"up",
"CGroupProcessTreeInfo"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java#L788-L800 |
118,634 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java | CGroupMemoryWatcher.isKillable | private boolean isKillable(TaskAttemptID tid) {
TaskInProgress tip = taskTracker.runningTasks.get(tid);
return tip != null && !tip.wasKilled() &&
(tip.getRunState() == TaskStatus.State.RUNNING ||
tip.getRunState() == TaskStatus.State.COMMIT_PENDING);
} | java | private boolean isKillable(TaskAttemptID tid) {
TaskInProgress tip = taskTracker.runningTasks.get(tid);
return tip != null && !tip.wasKilled() &&
(tip.getRunState() == TaskStatus.State.RUNNING ||
tip.getRunState() == TaskStatus.State.COMMIT_PENDING);
} | [
"private",
"boolean",
"isKillable",
"(",
"TaskAttemptID",
"tid",
")",
"{",
"TaskInProgress",
"tip",
"=",
"taskTracker",
".",
"runningTasks",
".",
"get",
"(",
"tid",
")",
";",
"return",
"tip",
"!=",
"null",
"&&",
"!",
"tip",
".",
"wasKilled",
"(",
")",
"&... | Check if a task can be killed to increase free memory
@param tid task attempt ID
@return true if the task can be killed | [
"Check",
"if",
"a",
"task",
"can",
"be",
"killed",
"to",
"increase",
"free",
"memory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/CGroupMemoryWatcher.java#L807-L812 |
118,635 | facebookarchive/hadoop-20 | src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationShell.java | UtilizationShell.getResponse | public String getResponse(String[] argv) throws IOException {
String result = "";
if (argv.length < 1) {
return result;
}
if (argv[0].equals("-all")) {
result += rpcCollector.getClusterUtilization();
result += JobUtilization.legendString +
JobUtilization.unitString;
... | java | public String getResponse(String[] argv) throws IOException {
String result = "";
if (argv.length < 1) {
return result;
}
if (argv[0].equals("-all")) {
result += rpcCollector.getClusterUtilization();
result += JobUtilization.legendString +
JobUtilization.unitString;
... | [
"public",
"String",
"getResponse",
"(",
"String",
"[",
"]",
"argv",
")",
"throws",
"IOException",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"argv",
".",
"length",
"<",
"1",
")",
"{",
"return",
"result",
";",
"}",
"if",
"(",
"argv",
"[",
... | Obtain the result to print in command line
@param argv
@return the response to show users
@throws IOException | [
"Obtain",
"the",
"result",
"to",
"print",
"in",
"command",
"line"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hmon/src/java/org/apache/hadoop/mapred/UtilizationShell.java#L45-L99 |
118,636 | facebookarchive/hadoop-20 | src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java | PipeMapRed.splitKeyVal | void splitKeyVal(byte[] line, Text key, Text val) throws IOException {
int pos = UTF8ByteArrayUtils.findNthByte(line, (byte)this.getFieldSeparator(), this.getNumOfKeyFields());
try {
if (pos == -1) {
key.set(line);
val.set("");
} else {
UTF8ByteArrayUtils.splitKeyVal(line, ke... | java | void splitKeyVal(byte[] line, Text key, Text val) throws IOException {
int pos = UTF8ByteArrayUtils.findNthByte(line, (byte)this.getFieldSeparator(), this.getNumOfKeyFields());
try {
if (pos == -1) {
key.set(line);
val.set("");
} else {
UTF8ByteArrayUtils.splitKeyVal(line, ke... | [
"void",
"splitKeyVal",
"(",
"byte",
"[",
"]",
"line",
",",
"Text",
"key",
",",
"Text",
"val",
")",
"throws",
"IOException",
"{",
"int",
"pos",
"=",
"UTF8ByteArrayUtils",
".",
"findNthByte",
"(",
"line",
",",
"(",
"byte",
")",
"this",
".",
"getFieldSepara... | Split a line into key and value. Assume the delimitor is a tab.
@param line: a byte array of line containing UTF-8 bytes
@param key: key of a record
@param val: value of a record
@throws IOException | [
"Split",
"a",
"line",
"into",
"key",
"and",
"value",
".",
"Assume",
"the",
"delimitor",
"is",
"a",
"tab",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java#L335-L347 |
118,637 | facebookarchive/hadoop-20 | src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java | PipeMapRed.write | void write(Writable value) throws IOException {
byte[] bval;
int valSize;
if (value instanceof BytesWritable) {
BytesWritable val = (BytesWritable) value;
bval = val.get();
valSize = val.getSize();
} else if (value instanceof Text) {
Text val = (Text) value;
bval = val.getB... | java | void write(Writable value) throws IOException {
byte[] bval;
int valSize;
if (value instanceof BytesWritable) {
BytesWritable val = (BytesWritable) value;
bval = val.get();
valSize = val.getSize();
} else if (value instanceof Text) {
Text val = (Text) value;
bval = val.getB... | [
"void",
"write",
"(",
"Writable",
"value",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bval",
";",
"int",
"valSize",
";",
"if",
"(",
"value",
"instanceof",
"BytesWritable",
")",
"{",
"BytesWritable",
"val",
"=",
"(",
"BytesWritable",
")",
"value"... | Write a writable value to the output stream using UTF-8 encoding
@param value output value
@throws IOException | [
"Write",
"a",
"writable",
"value",
"to",
"the",
"output",
"stream",
"using",
"UTF",
"-",
"8",
"encoding"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java#L564-L581 |
118,638 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.cleanUpHistory | private void cleanUpHistory() {
long oldestAllowedTimestamp = System.currentTimeMillis() - historyLength;
int trashedNotifications = 0;
if (LOG.isDebugEnabled()) {
LOG.debug("History cleanup: Checking old notifications to remove from history list ...");
}
HistoryTreeEntry key = new H... | java | private void cleanUpHistory() {
long oldestAllowedTimestamp = System.currentTimeMillis() - historyLength;
int trashedNotifications = 0;
if (LOG.isDebugEnabled()) {
LOG.debug("History cleanup: Checking old notifications to remove from history list ...");
}
HistoryTreeEntry key = new H... | [
"private",
"void",
"cleanUpHistory",
"(",
")",
"{",
"long",
"oldestAllowedTimestamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"historyLength",
";",
"int",
"trashedNotifications",
"=",
"0",
";",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",... | Checks if there are notifications in our tree which are older than
historyLength. It removes does which are older. | [
"Checks",
"if",
"there",
"are",
"notifications",
"in",
"our",
"tree",
"which",
"are",
"older",
"than",
"historyLength",
".",
"It",
"removes",
"does",
"which",
"are",
"older",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L142-L197 |
118,639 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.cleanUpHistoryTree | private void cleanUpHistoryTree(HistoryNode node) {
if (node == null || node.children == null) {
return;
}
Iterator<HistoryNode> iterator = node.children.iterator();
while (iterator.hasNext()) {
HistoryNode child = iterator.next();
// clean up child
cleanUpHistoryTree... | java | private void cleanUpHistoryTree(HistoryNode node) {
if (node == null || node.children == null) {
return;
}
Iterator<HistoryNode> iterator = node.children.iterator();
while (iterator.hasNext()) {
HistoryNode child = iterator.next();
// clean up child
cleanUpHistoryTree... | [
"private",
"void",
"cleanUpHistoryTree",
"(",
"HistoryNode",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
"||",
"node",
".",
"children",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Iterator",
"<",
"HistoryNode",
">",
"iterator",
"=",
"node",
".",
... | Clean up the Tree by DFS traversal.
Remove the node that has no children and no notifications associated
with them.
@param node | [
"Clean",
"up",
"the",
"Tree",
"by",
"DFS",
"traversal",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L206-L223 |
118,640 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.shouldRemoveNode | private boolean shouldRemoveNode(HistoryNode node) {
if (node == null) {
return true;
}
int sizeOfChildren = 0;
if (node.children != null) {
sizeOfChildren = node.children.size();
}
if (sizeOfChildren > 0) {
return false;
}
int sizeOfNotifications = 0;
... | java | private boolean shouldRemoveNode(HistoryNode node) {
if (node == null) {
return true;
}
int sizeOfChildren = 0;
if (node.children != null) {
sizeOfChildren = node.children.size();
}
if (sizeOfChildren > 0) {
return false;
}
int sizeOfNotifications = 0;
... | [
"private",
"boolean",
"shouldRemoveNode",
"(",
"HistoryNode",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"int",
"sizeOfChildren",
"=",
"0",
";",
"if",
"(",
"node",
".",
"children",
"!=",
"null",
")",
"{",
... | Should remove the node from the history tree if both the notifications
and children list are empty.
@param node
@return | [
"Should",
"remove",
"the",
"node",
"from",
"the",
"history",
"tree",
"if",
"both",
"the",
"notifications",
"and",
"children",
"list",
"are",
"empty",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L231-L258 |
118,641 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.storeNotification | @Override
public void storeNotification(NamespaceNotification notification) {
int notificationsCount = 0;
historyLock.writeLock().lock();
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Storing into history: " + NotifierUtils.asString(notification));
}
String[] paths = DFSUti... | java | @Override
public void storeNotification(NamespaceNotification notification) {
int notificationsCount = 0;
historyLock.writeLock().lock();
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Storing into history: " + NotifierUtils.asString(notification));
}
String[] paths = DFSUti... | [
"@",
"Override",
"public",
"void",
"storeNotification",
"(",
"NamespaceNotification",
"notification",
")",
"{",
"int",
"notificationsCount",
"=",
"0",
";",
"historyLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"LOG",
... | Called when we should store a notification in the our history.
The timestamp used to store it is generated when this method is
called.
It doesn't provide ordering if it is called with miss-ordered
notifications (e.g. it's called once with a notification with
the transaction id "i" and after some time with a notificati... | [
"Called",
"when",
"we",
"should",
"store",
"a",
"notification",
"in",
"the",
"our",
"history",
".",
"The",
"timestamp",
"used",
"to",
"store",
"it",
"is",
"generated",
"when",
"this",
"method",
"is",
"called",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L296-L342 |
118,642 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.addNotificationsToQueue | @Override
public void addNotificationsToQueue(NamespaceEvent event, long txId,
Queue<NamespaceNotification> notifications)
throws TransactionIdTooOldException {
if (LOG.isDebugEnabled()) {
LOG.debug("Got addNotificationsToQueue for: " +
NotifierUtils.asString(event) + " and tx... | java | @Override
public void addNotificationsToQueue(NamespaceEvent event, long txId,
Queue<NamespaceNotification> notifications)
throws TransactionIdTooOldException {
if (LOG.isDebugEnabled()) {
LOG.debug("Got addNotificationsToQueue for: " +
NotifierUtils.asString(event) + " and tx... | [
"@",
"Override",
"public",
"void",
"addNotificationsToQueue",
"(",
"NamespaceEvent",
"event",
",",
"long",
"txId",
",",
"Queue",
"<",
"NamespaceNotification",
">",
"notifications",
")",
"throws",
"TransactionIdTooOldException",
"{",
"if",
"(",
"LOG",
".",
"isDebugEn... | Checks what notifications are saved in history for the given event and
adds those notifications in the given queue. Only the notifications
which happened strictly after the edit log operations with the given
transaction id are put in the queue.
The notifications are put in the queue in the order of their
transaction id... | [
"Checks",
"what",
"notifications",
"are",
"saved",
"in",
"history",
"for",
"the",
"given",
"event",
"and",
"adds",
"those",
"notifications",
"in",
"the",
"given",
"queue",
".",
"Only",
"the",
"notifications",
"which",
"happened",
"strictly",
"after",
"the",
"e... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L361-L413 |
118,643 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageDecompressor.java | OfflineImageDecompressor.printProgress | private void printProgress(long read, long size) {
int progress = Math.min(100, (int) ((100 * read) / size));
if (progress > lastProgress) {
lastProgress = progress;
System.out.println("Completed " + lastProgress + " % ");
}
} | java | private void printProgress(long read, long size) {
int progress = Math.min(100, (int) ((100 * read) / size));
if (progress > lastProgress) {
lastProgress = progress;
System.out.println("Completed " + lastProgress + " % ");
}
} | [
"private",
"void",
"printProgress",
"(",
"long",
"read",
",",
"long",
"size",
")",
"{",
"int",
"progress",
"=",
"Math",
".",
"min",
"(",
"100",
",",
"(",
"int",
")",
"(",
"(",
"100",
"*",
"read",
")",
"/",
"size",
")",
")",
";",
"if",
"(",
"pro... | Print the progress. | [
"Print",
"the",
"progress",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageDecompressor.java#L158-L164 |
118,644 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java | MultipleOutputs.checkNamedOutput | private static void checkNamedOutput(JobConf conf, String namedOutput,
boolean alreadyDefined) {
List<String> definedChannels = getNamedOutputsList(conf);
if (alreadyDefined && definedChannels.contains(namedOutput)) {
throw new IllegalArgumentException("Named output ... | java | private static void checkNamedOutput(JobConf conf, String namedOutput,
boolean alreadyDefined) {
List<String> definedChannels = getNamedOutputsList(conf);
if (alreadyDefined && definedChannels.contains(namedOutput)) {
throw new IllegalArgumentException("Named output ... | [
"private",
"static",
"void",
"checkNamedOutput",
"(",
"JobConf",
"conf",
",",
"String",
"namedOutput",
",",
"boolean",
"alreadyDefined",
")",
"{",
"List",
"<",
"String",
">",
"definedChannels",
"=",
"getNamedOutputsList",
"(",
"conf",
")",
";",
"if",
"(",
"alr... | Checks if a named output is alreadyDefined or not.
@param conf job conf
@param namedOutput named output names
@param alreadyDefined whether the existence/non-existence of
the named output is to be checked
@throws IllegalArgumentException if the output name is alreadyDefined or
not depending on the value o... | [
"Checks",
"if",
"a",
"named",
"output",
"is",
"alreadyDefined",
"or",
"not",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java#L145-L155 |
118,645 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java | MultipleOutputs.checkTokenName | private static void checkTokenName(String namedOutput) {
if (namedOutput == null || namedOutput.length() == 0) {
throw new IllegalArgumentException(
"Name cannot be NULL or emtpy");
}
for (char ch : namedOutput.toCharArray()) {
if ((ch >= 'A') && (ch <= 'Z')) {
continue;
}
... | java | private static void checkTokenName(String namedOutput) {
if (namedOutput == null || namedOutput.length() == 0) {
throw new IllegalArgumentException(
"Name cannot be NULL or emtpy");
}
for (char ch : namedOutput.toCharArray()) {
if ((ch >= 'A') && (ch <= 'Z')) {
continue;
}
... | [
"private",
"static",
"void",
"checkTokenName",
"(",
"String",
"namedOutput",
")",
"{",
"if",
"(",
"namedOutput",
"==",
"null",
"||",
"namedOutput",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Name cannot be... | Checks if a named output name is valid token.
@param namedOutput named output Name
@throws IllegalArgumentException if the output name is not valid. | [
"Checks",
"if",
"a",
"named",
"output",
"name",
"is",
"valid",
"token",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java#L163-L181 |
118,646 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java | MultipleOutputs.isMultiNamedOutput | public static boolean isMultiNamedOutput(JobConf conf, String namedOutput) {
checkNamedOutput(conf, namedOutput, false);
return conf.getBoolean(MO_PREFIX + namedOutput + MULTI, false);
} | java | public static boolean isMultiNamedOutput(JobConf conf, String namedOutput) {
checkNamedOutput(conf, namedOutput, false);
return conf.getBoolean(MO_PREFIX + namedOutput + MULTI, false);
} | [
"public",
"static",
"boolean",
"isMultiNamedOutput",
"(",
"JobConf",
"conf",
",",
"String",
"namedOutput",
")",
"{",
"checkNamedOutput",
"(",
"conf",
",",
"namedOutput",
",",
"false",
")",
";",
"return",
"conf",
".",
"getBoolean",
"(",
"MO_PREFIX",
"+",
"named... | Returns if a named output is multiple.
@param conf job conf
@param namedOutput named output
@return <code>true</code> if the name output is multi, <code>false</code>
if it is single. If the name output is not defined it returns
<code>false</code> | [
"Returns",
"if",
"a",
"named",
"output",
"is",
"multiple",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java#L223-L226 |
118,647 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/HostsFileReader.java | HostsFileReader.isAllowedHost | public synchronized boolean isAllowedHost(String host) {
boolean isIncluded = includes.isEmpty() || includes.contains(host);
boolean isExcluded = excludes.contains(host);
return isIncluded && !isExcluded;
} | java | public synchronized boolean isAllowedHost(String host) {
boolean isIncluded = includes.isEmpty() || includes.contains(host);
boolean isExcluded = excludes.contains(host);
return isIncluded && !isExcluded;
} | [
"public",
"synchronized",
"boolean",
"isAllowedHost",
"(",
"String",
"host",
")",
"{",
"boolean",
"isIncluded",
"=",
"includes",
".",
"isEmpty",
"(",
")",
"||",
"includes",
".",
"contains",
"(",
"host",
")",
";",
"boolean",
"isExcluded",
"=",
"excludes",
"."... | Checks if a host is part of the cluster as per configuration.
For this the host must be "included" and not "excluded".
An empty includes files means the host is "included".
@param host The host name.
@return A boolean indicating if the host is allowed. | [
"Checks",
"if",
"a",
"host",
"is",
"part",
"of",
"the",
"cluster",
"as",
"per",
"configuration",
".",
"For",
"this",
"the",
"host",
"must",
"be",
"included",
"and",
"not",
"excluded",
".",
"An",
"empty",
"includes",
"files",
"means",
"the",
"host",
"is",... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/HostsFileReader.java#L201-L205 |
118,648 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/Counter.java | Counter.readFields | @Override
public synchronized void readFields(DataInput in) throws IOException {
name = CounterNames.intern(Text.readString(in));
if (in.readBoolean()) {
displayName = CounterNames.intern(Text.readString(in));
} else {
displayName = name;
}
value = WritableUtils.readVLong(in);
} | java | @Override
public synchronized void readFields(DataInput in) throws IOException {
name = CounterNames.intern(Text.readString(in));
if (in.readBoolean()) {
displayName = CounterNames.intern(Text.readString(in));
} else {
displayName = name;
}
value = WritableUtils.readVLong(in);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"readFields",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"name",
"=",
"CounterNames",
".",
"intern",
"(",
"Text",
".",
"readString",
"(",
"in",
")",
")",
";",
"if",
"(",
"in",
".",
"readB... | Read the binary representation of the counter | [
"Read",
"the",
"binary",
"representation",
"of",
"the",
"counter"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/Counter.java#L61-L70 |
118,649 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/Counter.java | Counter.write | @Override
public synchronized void write(DataOutput out) throws IOException {
Text.writeString(out, name);
boolean distinctDisplayName = ! name.equals(displayName);
out.writeBoolean(distinctDisplayName);
if (distinctDisplayName) {
Text.writeString(out, displayName);
}
WritableUtils.write... | java | @Override
public synchronized void write(DataOutput out) throws IOException {
Text.writeString(out, name);
boolean distinctDisplayName = ! name.equals(displayName);
out.writeBoolean(distinctDisplayName);
if (distinctDisplayName) {
Text.writeString(out, displayName);
}
WritableUtils.write... | [
"@",
"Override",
"public",
"synchronized",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"Text",
".",
"writeString",
"(",
"out",
",",
"name",
")",
";",
"boolean",
"distinctDisplayName",
"=",
"!",
"name",
".",
"equals",
"(",
... | Write the binary representation of the counter | [
"Write",
"the",
"binary",
"representation",
"of",
"the",
"counter"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/Counter.java#L75-L84 |
118,650 | facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java | FilePool.getInputFiles | public long getInputFiles(long minSize, Collection<FileStatus> files)
throws IOException {
updateLock.readLock().lock();
try {
return root.selectFiles(minSize, files);
} finally {
updateLock.readLock().unlock();
}
} | java | public long getInputFiles(long minSize, Collection<FileStatus> files)
throws IOException {
updateLock.readLock().lock();
try {
return root.selectFiles(minSize, files);
} finally {
updateLock.readLock().unlock();
}
} | [
"public",
"long",
"getInputFiles",
"(",
"long",
"minSize",
",",
"Collection",
"<",
"FileStatus",
">",
"files",
")",
"throws",
"IOException",
"{",
"updateLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"root",
".",
"sel... | Gather a collection of files at least as large as minSize.
@return The total size of files returned. | [
"Gather",
"a",
"collection",
"of",
"files",
"at",
"least",
"as",
"large",
"as",
"minSize",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java#L82-L90 |
118,651 | facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java | FilePool.locationsFor | public BlockLocation[] locationsFor(FileStatus stat, long start, long len)
throws IOException {
// TODO cache
return fs.getFileBlockLocations(stat, start, len);
} | java | public BlockLocation[] locationsFor(FileStatus stat, long start, long len)
throws IOException {
// TODO cache
return fs.getFileBlockLocations(stat, start, len);
} | [
"public",
"BlockLocation",
"[",
"]",
"locationsFor",
"(",
"FileStatus",
"stat",
",",
"long",
"start",
",",
"long",
"len",
")",
"throws",
"IOException",
"{",
"// TODO cache",
"return",
"fs",
".",
"getFileBlockLocations",
"(",
"stat",
",",
"start",
",",
"len",
... | Get a set of locations for the given file. | [
"Get",
"a",
"set",
"of",
"locations",
"for",
"the",
"given",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/FilePool.java#L112-L116 |
118,652 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/RunJar.java | RunJar.unJar | public static void unJar(File jarFile, File toDir) throws IOException {
JarFile jar = new JarFile(jarFile);
try {
Enumeration entries = jar.entries();
while (entries.hasMoreElements()) {
JarEntry entry = (JarEntry)entries.nextElement();
if (!entry.isDirectory()) {
InputStre... | java | public static void unJar(File jarFile, File toDir) throws IOException {
JarFile jar = new JarFile(jarFile);
try {
Enumeration entries = jar.entries();
while (entries.hasMoreElements()) {
JarEntry entry = (JarEntry)entries.nextElement();
if (!entry.isDirectory()) {
InputStre... | [
"public",
"static",
"void",
"unJar",
"(",
"File",
"jarFile",
",",
"File",
"toDir",
")",
"throws",
"IOException",
"{",
"JarFile",
"jar",
"=",
"new",
"JarFile",
"(",
"jarFile",
")",
";",
"try",
"{",
"Enumeration",
"entries",
"=",
"jar",
".",
"entries",
"("... | Unpack a jar file into a directory. | [
"Unpack",
"a",
"jar",
"file",
"into",
"a",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/RunJar.java#L35-L69 |
118,653 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeRpcServer.java | JournalNodeRpcServer.init | public static void init() {
try {
FastProtocolRegister.register(FastProtocolId.SERIAL_VERSION_ID_1,
QJournalProtocol.class.getMethod("journal",
JournalRequestInfo.class));
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static void init() {
try {
FastProtocolRegister.register(FastProtocolId.SERIAL_VERSION_ID_1,
QJournalProtocol.class.getMethod("journal",
JournalRequestInfo.class));
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"init",
"(",
")",
"{",
"try",
"{",
"FastProtocolRegister",
".",
"register",
"(",
"FastProtocolId",
".",
"SERIAL_VERSION_ID_1",
",",
"QJournalProtocol",
".",
"class",
".",
"getMethod",
"(",
"\"journal\"",
",",
"JournalRequestInfo",
".",
... | register fast protocol | [
"register",
"fast",
"protocol"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/JournalNodeRpcServer.java#L273-L281 |
118,654 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HardLink.java | HardLink.createHardLink | public static void createHardLink(File file, File linkName)
throws IOException {
if (file == null) {
throw new IOException(
"invalid arguments to createHardLink: source file is null");
}
if (linkName == null) {
throw new IOException(
"invalid arguments to createHardLink: l... | java | public static void createHardLink(File file, File linkName)
throws IOException {
if (file == null) {
throw new IOException(
"invalid arguments to createHardLink: source file is null");
}
if (linkName == null) {
throw new IOException(
"invalid arguments to createHardLink: l... | [
"public",
"static",
"void",
"createHardLink",
"(",
"File",
"file",
",",
"File",
"linkName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"invalid arguments to createHardLink: source file is null\... | Creates a hardlink
@param file - existing source file
@param linkName - desired target link file | [
"Creates",
"a",
"hardlink"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HardLink.java#L416-L444 |
118,655 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HardLink.java | HardLink.getLinkCount | public static int getLinkCount(File fileName) throws IOException {
if (fileName == null) {
throw new IOException(
"invalid argument to getLinkCount: file name is null");
}
if (!fileName.exists()) {
throw new FileNotFoundException(fileName + " not found.");
}
// construct and e... | java | public static int getLinkCount(File fileName) throws IOException {
if (fileName == null) {
throw new IOException(
"invalid argument to getLinkCount: file name is null");
}
if (!fileName.exists()) {
throw new FileNotFoundException(fileName + " not found.");
}
// construct and e... | [
"public",
"static",
"int",
"getLinkCount",
"(",
"File",
"fileName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fileName",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"invalid argument to getLinkCount: file name is null\"",
")",
";",
"}",
"if"... | Retrieves the number of links to the specified file. | [
"Retrieves",
"the",
"number",
"of",
"links",
"to",
"the",
"specified",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HardLink.java#L538-L582 |
118,656 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java | DfsServlet.createRedirectUri | protected URI createRedirectUri(String servletpath, UserGroupInformation ugi,
DatanodeID host, HttpServletRequest request, NameNode nn) throws URISyntaxException {
final String hostname = host instanceof DatanodeInfo?
((DatanodeInfo)host).getHostName(): host.getHost();
final String scheme = reques... | java | protected URI createRedirectUri(String servletpath, UserGroupInformation ugi,
DatanodeID host, HttpServletRequest request, NameNode nn) throws URISyntaxException {
final String hostname = host instanceof DatanodeInfo?
((DatanodeInfo)host).getHostName(): host.getHost();
final String scheme = reques... | [
"protected",
"URI",
"createRedirectUri",
"(",
"String",
"servletpath",
",",
"UserGroupInformation",
"ugi",
",",
"DatanodeID",
"host",
",",
"HttpServletRequest",
"request",
",",
"NameNode",
"nn",
")",
"throws",
"URISyntaxException",
"{",
"final",
"String",
"hostname",
... | Create a URI for redirecting request to a datanode | [
"Create",
"a",
"URI",
"for",
"redirecting",
"request",
"to",
"a",
"datanode"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java#L88-L102 |
118,657 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java | DfsServlet.getFilename | protected String getFilename(HttpServletRequest request,
HttpServletResponse response) throws IOException {
final String filename = request.getParameter("filename");
if (filename == null || filename.length() == 0) {
throw new IOException("Invalid filename");
}
return filename;
} | java | protected String getFilename(HttpServletRequest request,
HttpServletResponse response) throws IOException {
final String filename = request.getParameter("filename");
if (filename == null || filename.length() == 0) {
throw new IOException("Invalid filename");
}
return filename;
} | [
"protected",
"String",
"getFilename",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"final",
"String",
"filename",
"=",
"request",
".",
"getParameter",
"(",
"\"filename\"",
")",
";",
"if",
"(",
"fi... | Get filename from the request | [
"Get",
"filename",
"from",
"the",
"request"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java#L105-L112 |
118,658 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java | DfsServlet.createUri | protected URI createUri(String file,
DatanodeID[] candidates, UnixUserGroupInformation ugi,
HttpServletRequest request) throws URISyntaxException {
String scheme = request.getScheme();
final DatanodeID host = candidates[0];
final String hostname;
if (host instanceof DatanodeInfo) {
ho... | java | protected URI createUri(String file,
DatanodeID[] candidates, UnixUserGroupInformation ugi,
HttpServletRequest request) throws URISyntaxException {
String scheme = request.getScheme();
final DatanodeID host = candidates[0];
final String hostname;
if (host instanceof DatanodeInfo) {
ho... | [
"protected",
"URI",
"createUri",
"(",
"String",
"file",
",",
"DatanodeID",
"[",
"]",
"candidates",
",",
"UnixUserGroupInformation",
"ugi",
",",
"HttpServletRequest",
"request",
")",
"throws",
"URISyntaxException",
"{",
"String",
"scheme",
"=",
"request",
".",
"get... | Create a URI for streaming a file | [
"Create",
"a",
"URI",
"for",
"streaming",
"a",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DfsServlet.java#L115-L159 |
118,659 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/FailoverClientHandler.java | FailoverClientHandler.handleFailure | void handleFailure(IOException ex, int failures)
throws IOException {
// Check if the exception was thrown by the network stack
if (failoverClient.isShuttingdown() || !shouldHandleException(ex)) {
throw ex;
}
if (failures > FAILURE_RETRY) {
throw ex;
}
try {
// This might... | java | void handleFailure(IOException ex, int failures)
throws IOException {
// Check if the exception was thrown by the network stack
if (failoverClient.isShuttingdown() || !shouldHandleException(ex)) {
throw ex;
}
if (failures > FAILURE_RETRY) {
throw ex;
}
try {
// This might... | [
"void",
"handleFailure",
"(",
"IOException",
"ex",
",",
"int",
"failures",
")",
"throws",
"IOException",
"{",
"// Check if the exception was thrown by the network stack",
"if",
"(",
"failoverClient",
".",
"isShuttingdown",
"(",
")",
"||",
"!",
"shouldHandleException",
"... | This function should be called within try..finally which releases
readlock, if this fails. | [
"This",
"function",
"should",
"be",
"called",
"within",
"try",
"..",
"finally",
"which",
"releases",
"readlock",
"if",
"this",
"fails",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/FailoverClientHandler.java#L126-L159 |
118,660 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/PosixPathNameChecker.java | PosixPathNameChecker.isValidPosixFileChar | public boolean isValidPosixFileChar(char c) {
if ((((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) ||
((c >= '0') && (c <= '9'))
|| (c == '.') || (c == '_') || (c == '-'))) {
return true;
} else {
return false;
}
} | java | public boolean isValidPosixFileChar(char c) {
if ((((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) ||
((c >= '0') && (c <= '9'))
|| (c == '.') || (c == '_') || (c == '-'))) {
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"isValidPosixFileChar",
"(",
"char",
"c",
")",
"{",
"if",
"(",
"(",
"(",
"(",
"c",
">=",
"'",
"'",
")",
"&&",
"(",
"c",
"<=",
"'",
"'",
")",
")",
"||",
"(",
"(",
"c",
">=",
"'",
"'",
")",
"&&",
"(",
"c",
"<=",
"'",
"'... | Test whether the character c belongs to the accepted list of posix
filename characters A-Za-z0-9._-
@param c
@return | [
"Test",
"whether",
"the",
"character",
"c",
"belongs",
"to",
"the",
"accepted",
"list",
"of",
"posix",
"filename",
"characters",
"A",
"-",
"Za",
"-",
"z0",
"-",
"9",
".",
"_",
"-"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/PosixPathNameChecker.java#L31-L39 |
118,661 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/PosixPathNameChecker.java | PosixPathNameChecker.isValidPosixFileName | public boolean isValidPosixFileName(String name) {
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
if (i == 0) {
if (c == '-') {
return false;
}
}
if (!isValidPosixFileChar(c)) {
return false;
}
}
return true;
} | java | public boolean isValidPosixFileName(String name) {
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
if (i == 0) {
if (c == '-') {
return false;
}
}
if (!isValidPosixFileChar(c)) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"isValidPosixFileName",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"name",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"c",
"=",
"name",
".",
"charAt",
"(",
"i",
")",
";... | Test whether filename is a valid posix filename
A posix filename must contain characters A-Za-z0-9._- and - must not be
the first character | [
"Test",
"whether",
"filename",
"is",
"a",
"valid",
"posix",
"filename",
"A",
"posix",
"filename",
"must",
"contain",
"characters",
"A",
"-",
"Za",
"-",
"z0",
"-",
"9",
".",
"_",
"-",
"and",
"-",
"must",
"not",
"be",
"the",
"first",
"character"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/PosixPathNameChecker.java#L47-L60 |
118,662 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/rumen/LoggedJob.java | LoggedJob.compareStrings | private void compareStrings(List<String> c1, List<String> c2, TreePath loc,
String eltname) throws DeepInequalityException {
if (c1 == null && c2 == null) {
return;
}
TreePath recursePath = new TreePath(loc, eltname);
if (c1 == null || c2 == null || !c1.equals(c2)) {
throw new DeepIn... | java | private void compareStrings(List<String> c1, List<String> c2, TreePath loc,
String eltname) throws DeepInequalityException {
if (c1 == null && c2 == null) {
return;
}
TreePath recursePath = new TreePath(loc, eltname);
if (c1 == null || c2 == null || !c1.equals(c2)) {
throw new DeepIn... | [
"private",
"void",
"compareStrings",
"(",
"List",
"<",
"String",
">",
"c1",
",",
"List",
"<",
"String",
">",
"c2",
",",
"TreePath",
"loc",
",",
"String",
"eltname",
")",
"throws",
"DeepInequalityException",
"{",
"if",
"(",
"c1",
"==",
"null",
"&&",
"c2",... | I'll treat this as an atomic object type | [
"I",
"ll",
"treat",
"this",
"as",
"an",
"atomic",
"object",
"type"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/rumen/LoggedJob.java#L476-L487 |
118,663 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/TextWriterImageVisitor.java | TextWriterImageVisitor.rollIfNeeded | void rollIfNeeded() throws IOException {
if (numberOfParts == 1 || numberOfFiles < 1) {
return;
}
filesCount++;
if (filesCount % filesPerRoll == 0) {
out.close();
currentPart++;
createOutputStream();
}
} | java | void rollIfNeeded() throws IOException {
if (numberOfParts == 1 || numberOfFiles < 1) {
return;
}
filesCount++;
if (filesCount % filesPerRoll == 0) {
out.close();
currentPart++;
createOutputStream();
}
} | [
"void",
"rollIfNeeded",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"numberOfParts",
"==",
"1",
"||",
"numberOfFiles",
"<",
"1",
")",
"{",
"return",
";",
"}",
"filesCount",
"++",
";",
"if",
"(",
"filesCount",
"%",
"filesPerRoll",
"==",
"0",
")",
... | Close current segment and start a new one if needed | [
"Close",
"current",
"segment",
"and",
"start",
"a",
"new",
"one",
"if",
"needed"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/TextWriterImageVisitor.java#L143-L153 |
118,664 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionSchedulable.java | SessionSchedulable.adjustLocalityRequirement | public void adjustLocalityRequirement(
long now, long nodeWait, long rackWait) {
if (!localityWaitStarted) {
return;
}
if (localityRequired == LocalityLevel.ANY) {
return;
}
if (localityRequired == LocalityLevel.NODE) {
if (now - localityWaitStartTime > nodeWait) {
se... | java | public void adjustLocalityRequirement(
long now, long nodeWait, long rackWait) {
if (!localityWaitStarted) {
return;
}
if (localityRequired == LocalityLevel.ANY) {
return;
}
if (localityRequired == LocalityLevel.NODE) {
if (now - localityWaitStartTime > nodeWait) {
se... | [
"public",
"void",
"adjustLocalityRequirement",
"(",
"long",
"now",
",",
"long",
"nodeWait",
",",
"long",
"rackWait",
")",
"{",
"if",
"(",
"!",
"localityWaitStarted",
")",
"{",
"return",
";",
"}",
"if",
"(",
"localityRequired",
"==",
"LocalityLevel",
".",
"AN... | Adjust the locality requirement based on the current
locality and the locality wait times.
If the current required locality is node and enough time
has passed - update it to rack.
If the current is rack and enough time has passed - update to any
@param now current time
@param nodeWait node locality wait
@param rackWai... | [
"Adjust",
"the",
"locality",
"requirement",
"based",
"on",
"the",
"current",
"locality",
"and",
"the",
"locality",
"wait",
"times",
".",
"If",
"the",
"current",
"required",
"locality",
"is",
"node",
"and",
"enough",
"time",
"has",
"passed",
"-",
"update",
"i... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionSchedulable.java#L134-L152 |
118,665 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionSchedulable.java | SessionSchedulable.setLocalityLevel | public void setLocalityLevel(LocalityLevel level) {
localityRequired = level;
lastLocality = level;
localityWaitStarted = false;
localityWaitStartTime = Long.MAX_VALUE;
} | java | public void setLocalityLevel(LocalityLevel level) {
localityRequired = level;
lastLocality = level;
localityWaitStarted = false;
localityWaitStartTime = Long.MAX_VALUE;
} | [
"public",
"void",
"setLocalityLevel",
"(",
"LocalityLevel",
"level",
")",
"{",
"localityRequired",
"=",
"level",
";",
"lastLocality",
"=",
"level",
";",
"localityWaitStarted",
"=",
"false",
";",
"localityWaitStartTime",
"=",
"Long",
".",
"MAX_VALUE",
";",
"}"
] | Update the required locality level for the session
@param level the new required locality level | [
"Update",
"the",
"required",
"locality",
"level",
"for",
"the",
"session"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionSchedulable.java#L158-L163 |
118,666 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UnixUserGroupInformation.java | UnixUserGroupInformation.readFields | public void readFields(DataInput in) throws IOException {
// read UGI type first
String ugiType = Text.readString(in);
if (!UGI_TECHNOLOGY.equals(ugiType)) {
throw new IOException("Expect UGI prefix: " + UGI_TECHNOLOGY +
", but receive a prefix: " + ugiType);
}
// read this obje... | java | public void readFields(DataInput in) throws IOException {
// read UGI type first
String ugiType = Text.readString(in);
if (!UGI_TECHNOLOGY.equals(ugiType)) {
throw new IOException("Expect UGI prefix: " + UGI_TECHNOLOGY +
", but receive a prefix: " + ugiType);
}
// read this obje... | [
"public",
"void",
"readFields",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"// read UGI type first",
"String",
"ugiType",
"=",
"Text",
".",
"readString",
"(",
"in",
")",
";",
"if",
"(",
"!",
"UGI_TECHNOLOGY",
".",
"equals",
"(",
"ugiType",
")... | Deserialize this object
First check if this is a UGI in the string format.
If no, throw an IOException; otherwise
set this object's fields by reading them from the given data input
@param in input stream
@exception IOException is thrown if encounter any error when reading | [
"Deserialize",
"this",
"object",
"First",
"check",
"if",
"this",
"is",
"a",
"UGI",
"in",
"the",
"string",
"format",
".",
"If",
"no",
"throw",
"an",
"IOException",
";",
"otherwise",
"set",
"this",
"object",
"s",
"fields",
"by",
"reading",
"them",
"from",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UnixUserGroupInformation.java#L152-L167 |
118,667 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UnixUserGroupInformation.java | UnixUserGroupInformation.write | public void write(DataOutput out) throws IOException {
// write a prefix indicating the type of UGI being written
Text.writeString(out, UGI_TECHNOLOGY);
// write this object
Text.writeString(out, userName);
WritableUtils.writeVInt(out, groupNames.length);
for (String groupName : groupNames) {
... | java | public void write(DataOutput out) throws IOException {
// write a prefix indicating the type of UGI being written
Text.writeString(out, UGI_TECHNOLOGY);
// write this object
Text.writeString(out, userName);
WritableUtils.writeVInt(out, groupNames.length);
for (String groupName : groupNames) {
... | [
"public",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"// write a prefix indicating the type of UGI being written",
"Text",
".",
"writeString",
"(",
"out",
",",
"UGI_TECHNOLOGY",
")",
";",
"// write this object",
"Text",
".",
"writeStri... | Serialize this object
First write a string marking that this is a UGI in the string format,
then write this object's serialized form to the given data output
@param out output stream
@exception IOException if encounter any error during writing | [
"Serialize",
"this",
"object",
"First",
"write",
"a",
"string",
"marking",
"that",
"this",
"is",
"a",
"UGI",
"in",
"the",
"string",
"format",
"then",
"write",
"this",
"object",
"s",
"serialized",
"form",
"to",
"the",
"given",
"data",
"output"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UnixUserGroupInformation.java#L176-L185 |
118,668 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UnixUserGroupInformation.java | UnixUserGroupInformation.login | public static UnixUserGroupInformation login() throws LoginException {
try {
String userName;
// if an exception occurs, then uses the
// default user
try {
userName = getUnixUserName();
} catch (Exception e) {
userName = DEFAULT_USERNAME;
}
// check if t... | java | public static UnixUserGroupInformation login() throws LoginException {
try {
String userName;
// if an exception occurs, then uses the
// default user
try {
userName = getUnixUserName();
} catch (Exception e) {
userName = DEFAULT_USERNAME;
}
// check if t... | [
"public",
"static",
"UnixUserGroupInformation",
"login",
"(",
")",
"throws",
"LoginException",
"{",
"try",
"{",
"String",
"userName",
";",
"// if an exception occurs, then uses the",
"// default user",
"try",
"{",
"userName",
"=",
"getUnixUserName",
"(",
")",
";",
"}"... | Get current user's name and the names of all its groups from Unix.
It's assumed that there is only one UGI per user. If this user already
has a UGI in the ugi map, return the ugi in the map.
Otherwise get the current user's information from Unix, store it
in the map, and return it.
If the current user's UNIX username ... | [
"Get",
"current",
"user",
"s",
"name",
"and",
"the",
"names",
"of",
"all",
"its",
"groups",
"from",
"Unix",
".",
"It",
"s",
"assumed",
"that",
"there",
"is",
"only",
"one",
"UGI",
"per",
"user",
".",
"If",
"this",
"user",
"already",
"has",
"a",
"UGI"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UnixUserGroupInformation.java#L256-L295 |
118,669 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UnixUserGroupInformation.java | UnixUserGroupInformation.login | public static UnixUserGroupInformation login(Configuration conf, boolean save
) throws LoginException {
UnixUserGroupInformation ugi = readFromConf(conf, UGI_PROPERTY_NAME);
if (ugi == null) {
ugi = login();
LOG.debug("Unix Login: " + ugi);
if (save) {
saveToConf(conf, UGI_PROPER... | java | public static UnixUserGroupInformation login(Configuration conf, boolean save
) throws LoginException {
UnixUserGroupInformation ugi = readFromConf(conf, UGI_PROPERTY_NAME);
if (ugi == null) {
ugi = login();
LOG.debug("Unix Login: " + ugi);
if (save) {
saveToConf(conf, UGI_PROPER... | [
"public",
"static",
"UnixUserGroupInformation",
"login",
"(",
"Configuration",
"conf",
",",
"boolean",
"save",
")",
"throws",
"LoginException",
"{",
"UnixUserGroupInformation",
"ugi",
"=",
"readFromConf",
"(",
"conf",
",",
"UGI_PROPERTY_NAME",
")",
";",
"if",
"(",
... | Get a user's name & its group names from the given configuration;
If it is not defined in the configuration, get the current user's
information from Unix.
If the user has a UGI in the ugi map, return the one in
the UGI map.
@param conf either a job configuration or client's configuration
@param save saving it to conf?... | [
"Get",
"a",
"user",
"s",
"name",
"&",
"its",
"group",
"names",
"from",
"the",
"given",
"configuration",
";",
"If",
"it",
"is",
"not",
"defined",
"in",
"the",
"configuration",
"get",
"the",
"current",
"user",
"s",
"information",
"from",
"Unix",
".",
"If",... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UnixUserGroupInformation.java#L314-L325 |
118,670 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java | RecordTypeInfo.addField | public void addField(String fieldName, TypeID tid) {
sTid.getFieldTypeInfos().add(new FieldTypeInfo(fieldName, tid));
} | java | public void addField(String fieldName, TypeID tid) {
sTid.getFieldTypeInfos().add(new FieldTypeInfo(fieldName, tid));
} | [
"public",
"void",
"addField",
"(",
"String",
"fieldName",
",",
"TypeID",
"tid",
")",
"{",
"sTid",
".",
"getFieldTypeInfos",
"(",
")",
".",
"add",
"(",
"new",
"FieldTypeInfo",
"(",
"fieldName",
",",
"tid",
")",
")",
";",
"}"
] | Add a field.
@param fieldName Name of the field
@param tid Type ID of the field | [
"Add",
"a",
"field",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java#L89-L91 |
118,671 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java | RecordTypeInfo.getNestedStructTypeInfo | public RecordTypeInfo getNestedStructTypeInfo(String name) {
StructTypeID stid = sTid.findStruct(name);
if (null == stid) return null;
return new RecordTypeInfo(name, stid);
} | java | public RecordTypeInfo getNestedStructTypeInfo(String name) {
StructTypeID stid = sTid.findStruct(name);
if (null == stid) return null;
return new RecordTypeInfo(name, stid);
} | [
"public",
"RecordTypeInfo",
"getNestedStructTypeInfo",
"(",
"String",
"name",
")",
"{",
"StructTypeID",
"stid",
"=",
"sTid",
".",
"findStruct",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"stid",
")",
"return",
"null",
";",
"return",
"new",
"RecordTypeIn... | Return the type info of a nested record. We only consider nesting
to one level.
@param name Name of the nested record | [
"Return",
"the",
"type",
"info",
"of",
"a",
"nested",
"record",
".",
"We",
"only",
"consider",
"nesting",
"to",
"one",
"level",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java#L109-L113 |
118,672 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java | RecordTypeInfo.serialize | public void serialize(RecordOutput rout, String tag) throws IOException {
// write out any header, version info, here
rout.startRecord(this, tag);
rout.writeString(name, tag);
sTid.writeRest(rout, tag);
rout.endRecord(this, tag);
} | java | public void serialize(RecordOutput rout, String tag) throws IOException {
// write out any header, version info, here
rout.startRecord(this, tag);
rout.writeString(name, tag);
sTid.writeRest(rout, tag);
rout.endRecord(this, tag);
} | [
"public",
"void",
"serialize",
"(",
"RecordOutput",
"rout",
",",
"String",
"tag",
")",
"throws",
"IOException",
"{",
"// write out any header, version info, here",
"rout",
".",
"startRecord",
"(",
"this",
",",
"tag",
")",
";",
"rout",
".",
"writeString",
"(",
"n... | Serialize the type information for a record | [
"Serialize",
"the",
"type",
"information",
"for",
"a",
"record"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java#L118-L124 |
118,673 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java | RecordTypeInfo.deserialize | public void deserialize(RecordInput rin, String tag) throws IOException {
// read in any header, version info
rin.startRecord(tag);
// name
this.name = rin.readString(tag);
sTid.read(rin, tag);
rin.endRecord(tag);
} | java | public void deserialize(RecordInput rin, String tag) throws IOException {
// read in any header, version info
rin.startRecord(tag);
// name
this.name = rin.readString(tag);
sTid.read(rin, tag);
rin.endRecord(tag);
} | [
"public",
"void",
"deserialize",
"(",
"RecordInput",
"rin",
",",
"String",
"tag",
")",
"throws",
"IOException",
"{",
"// read in any header, version info ",
"rin",
".",
"startRecord",
"(",
"tag",
")",
";",
"// name",
"this",
".",
"name",
"=",
"rin",
".",
"read... | Deserialize the type information for a record | [
"Deserialize",
"the",
"type",
"information",
"for",
"a",
"record"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/RecordTypeInfo.java#L129-L136 |
118,674 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/ganglia/GangliaContext.java | GangliaContext.xdr_string | private void xdr_string(String s) {
byte[] bytes = s.getBytes();
int len = bytes.length;
xdr_int(len);
System.arraycopy(bytes, 0, buffer, offset, len);
offset += len;
pad();
} | java | private void xdr_string(String s) {
byte[] bytes = s.getBytes();
int len = bytes.length;
xdr_int(len);
System.arraycopy(bytes, 0, buffer, offset, len);
offset += len;
pad();
} | [
"private",
"void",
"xdr_string",
"(",
"String",
"s",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"s",
".",
"getBytes",
"(",
")",
";",
"int",
"len",
"=",
"bytes",
".",
"length",
";",
"xdr_int",
"(",
"len",
")",
";",
"System",
".",
"arraycopy",
"(",
... | Puts a string into the buffer by first writing the size of the string
as an int, followed by the bytes of the string, padded if necessary to
a multiple of 4. | [
"Puts",
"a",
"string",
"into",
"the",
"buffer",
"by",
"first",
"writing",
"the",
"size",
"of",
"the",
"string",
"as",
"an",
"int",
"followed",
"by",
"the",
"bytes",
"of",
"the",
"string",
"padded",
"if",
"necessary",
"to",
"a",
"multiple",
"of",
"4",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/ganglia/GangliaContext.java#L203-L210 |
118,675 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/ganglia/GangliaContext.java | GangliaContext.xdr_int | private void xdr_int(int i) {
buffer[offset++] = (byte)((i >> 24) & 0xff);
buffer[offset++] = (byte)((i >> 16) & 0xff);
buffer[offset++] = (byte)((i >> 8) & 0xff);
buffer[offset++] = (byte)(i & 0xff);
} | java | private void xdr_int(int i) {
buffer[offset++] = (byte)((i >> 24) & 0xff);
buffer[offset++] = (byte)((i >> 16) & 0xff);
buffer[offset++] = (byte)((i >> 8) & 0xff);
buffer[offset++] = (byte)(i & 0xff);
} | [
"private",
"void",
"xdr_int",
"(",
"int",
"i",
")",
"{",
"buffer",
"[",
"offset",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"(",
"i",
">>",
"24",
")",
"&",
"0xff",
")",
";",
"buffer",
"[",
"offset",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"(",
... | Puts an integer into the buffer as 4 bytes, big-endian. | [
"Puts",
"an",
"integer",
"into",
"the",
"buffer",
"as",
"4",
"bytes",
"big",
"-",
"endian",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/ganglia/GangliaContext.java#L225-L230 |
118,676 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/NamespaceMap.java | NamespaceMap.getBlockCrcPerVolume | Map<FSVolume, List<Map<Block, DatanodeBlockInfo>>> getBlockCrcPerVolume(
List<FSVolume> volumes) {
Map<FSVolume, List<Map<Block, DatanodeBlockInfo>>> retMap =
new HashMap<FSVolume, List<Map<Block, DatanodeBlockInfo>>>();
for (FSVolume volume : volumes) {
List<Map<Block, DatanodeBlockInfo>> n... | java | Map<FSVolume, List<Map<Block, DatanodeBlockInfo>>> getBlockCrcPerVolume(
List<FSVolume> volumes) {
Map<FSVolume, List<Map<Block, DatanodeBlockInfo>>> retMap =
new HashMap<FSVolume, List<Map<Block, DatanodeBlockInfo>>>();
for (FSVolume volume : volumes) {
List<Map<Block, DatanodeBlockInfo>> n... | [
"Map",
"<",
"FSVolume",
",",
"List",
"<",
"Map",
"<",
"Block",
",",
"DatanodeBlockInfo",
">",
">",
">",
"getBlockCrcPerVolume",
"(",
"List",
"<",
"FSVolume",
">",
"volumes",
")",
"{",
"Map",
"<",
"FSVolume",
",",
"List",
"<",
"Map",
"<",
"Block",
",",
... | get a list of block info with CRC information per FS volume.
@param volumes
Volumes are interested in get the list
@return a map from FSVolume to buckets -> (Block -> DatanodeBlockInfo) in
the volume and has CRC information. The first level value is a
list, each one on the list is for a bucket. The order on the list
i... | [
"get",
"a",
"list",
"of",
"block",
"info",
"with",
"CRC",
"information",
"per",
"FS",
"volume",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/NamespaceMap.java#L379-L395 |
118,677 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.key | public K key() {
if (jc.hasNext()) {
return jc.key();
}
if (!q.isEmpty()) {
return q.peek().key();
}
return null;
} | java | public K key() {
if (jc.hasNext()) {
return jc.key();
}
if (!q.isEmpty()) {
return q.peek().key();
}
return null;
} | [
"public",
"K",
"key",
"(",
")",
"{",
"if",
"(",
"jc",
".",
"hasNext",
"(",
")",
")",
"{",
"return",
"jc",
".",
"key",
"(",
")",
";",
"}",
"if",
"(",
"!",
"q",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"q",
".",
"peek",
"(",
")",
".",
... | Return the key for the current join or the value at the top of the
RecordReader heap. | [
"Return",
"the",
"key",
"for",
"the",
"current",
"join",
"or",
"the",
"value",
"at",
"the",
"top",
"of",
"the",
"RecordReader",
"heap",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L310-L318 |
118,678 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.skip | public void skip(K key) throws IOException {
ArrayList<ComposableRecordReader<K,?>> tmp =
new ArrayList<ComposableRecordReader<K,?>>();
while (!q.isEmpty() && cmp.compare(q.peek().key(), key) <= 0) {
tmp.add(q.poll());
}
for (ComposableRecordReader<K,?> rr : tmp) {
rr.skip(key);
... | java | public void skip(K key) throws IOException {
ArrayList<ComposableRecordReader<K,?>> tmp =
new ArrayList<ComposableRecordReader<K,?>>();
while (!q.isEmpty() && cmp.compare(q.peek().key(), key) <= 0) {
tmp.add(q.poll());
}
for (ComposableRecordReader<K,?> rr : tmp) {
rr.skip(key);
... | [
"public",
"void",
"skip",
"(",
"K",
"key",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"ComposableRecordReader",
"<",
"K",
",",
"?",
">",
">",
"tmp",
"=",
"new",
"ArrayList",
"<",
"ComposableRecordReader",
"<",
"K",
",",
"?",
">",
">",
"(",
")... | Pass skip key to child RRs. | [
"Pass",
"skip",
"key",
"to",
"child",
"RRs",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L337-L349 |
118,679 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.accept | @SuppressWarnings("unchecked") // No values from static EMPTY class
public void accept(CompositeRecordReader.JoinCollector jc, K key)
throws IOException {
if (hasNext() && 0 == cmp.compare(key, key())) {
fillJoinCollector(createKey());
jc.add(id, getDelegate());
return;
}
jc.add(id... | java | @SuppressWarnings("unchecked") // No values from static EMPTY class
public void accept(CompositeRecordReader.JoinCollector jc, K key)
throws IOException {
if (hasNext() && 0 == cmp.compare(key, key())) {
fillJoinCollector(createKey());
jc.add(id, getDelegate());
return;
}
jc.add(id... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// No values from static EMPTY class",
"public",
"void",
"accept",
"(",
"CompositeRecordReader",
".",
"JoinCollector",
"jc",
",",
"K",
"key",
")",
"throws",
"IOException",
"{",
"if",
"(",
"hasNext",
"(",
")",
"&... | If key provided matches that of this Composite, give JoinCollector
iterator over values it may emit. | [
"If",
"key",
"provided",
"matches",
"that",
"of",
"this",
"Composite",
"give",
"JoinCollector",
"iterator",
"over",
"values",
"it",
"may",
"emit",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L361-L370 |
118,680 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.fillJoinCollector | protected void fillJoinCollector(K iterkey) throws IOException {
if (!q.isEmpty()) {
q.peek().key(iterkey);
while (0 == cmp.compare(q.peek().key(), iterkey)) {
ComposableRecordReader<K,?> t = q.poll();
t.accept(jc, iterkey);
if (t.hasNext()) {
q.add(t);
} else i... | java | protected void fillJoinCollector(K iterkey) throws IOException {
if (!q.isEmpty()) {
q.peek().key(iterkey);
while (0 == cmp.compare(q.peek().key(), iterkey)) {
ComposableRecordReader<K,?> t = q.poll();
t.accept(jc, iterkey);
if (t.hasNext()) {
q.add(t);
} else i... | [
"protected",
"void",
"fillJoinCollector",
"(",
"K",
"iterkey",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"q",
".",
"isEmpty",
"(",
")",
")",
"{",
"q",
".",
"peek",
"(",
")",
".",
"key",
"(",
"iterkey",
")",
";",
"while",
"(",
"0",
"==",
... | For all child RRs offering the key provided, obtain an iterator
at that position in the JoinCollector. | [
"For",
"all",
"child",
"RRs",
"offering",
"the",
"key",
"provided",
"obtain",
"an",
"iterator",
"at",
"that",
"position",
"in",
"the",
"JoinCollector",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L376-L389 |
118,681 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.createKey | @SuppressWarnings("unchecked") // Explicit check for key class agreement
public K createKey() {
if (null == keyclass) {
final Class<?> cls = kids[0].createKey().getClass();
for (RecordReader<K,? extends Writable> rr : kids) {
if (!cls.equals(rr.createKey().getClass())) {
throw new Cl... | java | @SuppressWarnings("unchecked") // Explicit check for key class agreement
public K createKey() {
if (null == keyclass) {
final Class<?> cls = kids[0].createKey().getClass();
for (RecordReader<K,? extends Writable> rr : kids) {
if (!cls.equals(rr.createKey().getClass())) {
throw new Cl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// Explicit check for key class agreement",
"public",
"K",
"createKey",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"keyclass",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"cls",
"=",
"kids",
"[",
"0",
"]",
"... | Create a new key value common to all child RRs.
@throws ClassCastException if key classes differ. | [
"Create",
"a",
"new",
"key",
"value",
"common",
"to",
"all",
"child",
"RRs",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L403-L415 |
118,682 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.createInternalValue | protected TupleWritable createInternalValue() {
Writable[] vals = new Writable[kids.length];
for (int i = 0; i < vals.length; ++i) {
vals[i] = kids[i].createValue();
}
return new TupleWritable(vals);
} | java | protected TupleWritable createInternalValue() {
Writable[] vals = new Writable[kids.length];
for (int i = 0; i < vals.length; ++i) {
vals[i] = kids[i].createValue();
}
return new TupleWritable(vals);
} | [
"protected",
"TupleWritable",
"createInternalValue",
"(",
")",
"{",
"Writable",
"[",
"]",
"vals",
"=",
"new",
"Writable",
"[",
"kids",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vals",
".",
"length",
";",
"++",
"i",
... | Create a value to be used internally for joins. | [
"Create",
"a",
"value",
"to",
"be",
"used",
"internally",
"for",
"joins",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L420-L426 |
118,683 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.close | public void close() throws IOException {
if (kids != null) {
for (RecordReader<K,? extends Writable> rr : kids) {
rr.close();
}
}
if (jc != null) {
jc.close();
}
} | java | public void close() throws IOException {
if (kids != null) {
for (RecordReader<K,? extends Writable> rr : kids) {
rr.close();
}
}
if (jc != null) {
jc.close();
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"kids",
"!=",
"null",
")",
"{",
"for",
"(",
"RecordReader",
"<",
"K",
",",
"?",
"extends",
"Writable",
">",
"rr",
":",
"kids",
")",
"{",
"rr",
".",
"close",
"(",
")",
"... | Close all child RRs. | [
"Close",
"all",
"child",
"RRs",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L438-L447 |
118,684 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java | CompositeRecordReader.getProgress | public float getProgress() throws IOException {
float ret = 1.0f;
for (RecordReader<K,? extends Writable> rr : kids) {
ret = Math.min(ret, rr.getProgress());
}
return ret;
} | java | public float getProgress() throws IOException {
float ret = 1.0f;
for (RecordReader<K,? extends Writable> rr : kids) {
ret = Math.min(ret, rr.getProgress());
}
return ret;
} | [
"public",
"float",
"getProgress",
"(",
")",
"throws",
"IOException",
"{",
"float",
"ret",
"=",
"1.0f",
";",
"for",
"(",
"RecordReader",
"<",
"K",
",",
"?",
"extends",
"Writable",
">",
"rr",
":",
"kids",
")",
"{",
"ret",
"=",
"Math",
".",
"min",
"(",
... | Report progress as the minimum of all child RR progress. | [
"Report",
"progress",
"as",
"the",
"minimum",
"of",
"all",
"child",
"RR",
"progress",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/join/CompositeRecordReader.java#L452-L458 |
118,685 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/db/DBConfiguration.java | DBConfiguration.getConnection | Connection getConnection() throws ClassNotFoundException, SQLException{
Class.forName(job.get(DBConfiguration.DRIVER_CLASS_PROPERTY));
if(job.get(DBConfiguration.USERNAME_PROPERTY) == null) {
return DriverManager.getConnection(job.get(DBConfiguration.URL_PROPERTY));
} else {
return DriverManag... | java | Connection getConnection() throws ClassNotFoundException, SQLException{
Class.forName(job.get(DBConfiguration.DRIVER_CLASS_PROPERTY));
if(job.get(DBConfiguration.USERNAME_PROPERTY) == null) {
return DriverManager.getConnection(job.get(DBConfiguration.URL_PROPERTY));
} else {
return DriverManag... | [
"Connection",
"getConnection",
"(",
")",
"throws",
"ClassNotFoundException",
",",
"SQLException",
"{",
"Class",
".",
"forName",
"(",
"job",
".",
"get",
"(",
"DBConfiguration",
".",
"DRIVER_CLASS_PROPERTY",
")",
")",
";",
"if",
"(",
"job",
".",
"get",
"(",
"D... | Returns a connection object o the DB
@throws ClassNotFoundException
@throws SQLException | [
"Returns",
"a",
"connection",
"object",
"o",
"the",
"DB"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/db/DBConfiguration.java#L121-L133 |
118,686 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/FastWritableRegister.java | FastWritableRegister.tryGetInstance | public static FastWritable tryGetInstance(String name, Configuration conf) {
if (name.length() != NAME_LEN) {
// we use it to fast discard the request without doing map lookup
return null;
}
FastWritable fw = register.get(name);
return fw == null ? null : fw.getFastWritableInstance(conf);
... | java | public static FastWritable tryGetInstance(String name, Configuration conf) {
if (name.length() != NAME_LEN) {
// we use it to fast discard the request without doing map lookup
return null;
}
FastWritable fw = register.get(name);
return fw == null ? null : fw.getFastWritableInstance(conf);
... | [
"public",
"static",
"FastWritable",
"tryGetInstance",
"(",
"String",
"name",
",",
"Configuration",
"conf",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"!=",
"NAME_LEN",
")",
"{",
"// we use it to fast discard the request without doing map lookup",
"return",
... | Tries to get an instance given the name of class. If the name is registered
as FastWritable, the instance is obtained using the registry. | [
"Tries",
"to",
"get",
"an",
"instance",
"given",
"the",
"name",
"of",
"class",
".",
"If",
"the",
"name",
"is",
"registered",
"as",
"FastWritable",
"the",
"instance",
"is",
"obtained",
"using",
"the",
"registry",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/FastWritableRegister.java#L98-L105 |
118,687 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/HadoopLocationWizard.java | HadoopLocationWizard.performFinish | public HadoopServer performFinish() {
try {
if (this.original == null) {
// New location
Display.getDefault().syncExec(new Runnable() {
public void run() {
ServerRegistry.getInstance().addServer(
HadoopLocationWizard.this.location);
}
});... | java | public HadoopServer performFinish() {
try {
if (this.original == null) {
// New location
Display.getDefault().syncExec(new Runnable() {
public void run() {
ServerRegistry.getInstance().addServer(
HadoopLocationWizard.this.location);
}
});... | [
"public",
"HadoopServer",
"performFinish",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"original",
"==",
"null",
")",
"{",
"// New location",
"Display",
".",
"getDefault",
"(",
")",
".",
"syncExec",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",... | Performs any actions appropriate in response to the user having pressed
the Finish button, or refuse if finishing now is not permitted.
@return the created or updated Hadoop location | [
"Performs",
"any",
"actions",
"appropriate",
"in",
"response",
"to",
"the",
"user",
"having",
"pressed",
"the",
"Finish",
"button",
"or",
"refuse",
"if",
"finishing",
"now",
"is",
"not",
"permitted",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/HadoopLocationWizard.java#L111-L142 |
118,688 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/HadoopLocationWizard.java | HadoopLocationWizard.createConfNameEditor | private Text createConfNameEditor(ModifyListener listener,
Composite parent, String propName, String labelText) {
{
ConfProp prop = ConfProp.getByName(propName);
if (prop != null)
return createConfLabelText(listener, parent, prop, labelText);
}
Label label = new Label(parent, SWT... | java | private Text createConfNameEditor(ModifyListener listener,
Composite parent, String propName, String labelText) {
{
ConfProp prop = ConfProp.getByName(propName);
if (prop != null)
return createConfLabelText(listener, parent, prop, labelText);
}
Label label = new Label(parent, SWT... | [
"private",
"Text",
"createConfNameEditor",
"(",
"ModifyListener",
"listener",
",",
"Composite",
"parent",
",",
"String",
"propName",
",",
"String",
"labelText",
")",
"{",
"{",
"ConfProp",
"prop",
"=",
"ConfProp",
".",
"getByName",
"(",
"propName",
")",
";",
"i... | Create an editor entry for the given configuration name
@param listener the listener to trigger on property change
@param parent the SWT parent container
@param propName the name of the property to create an editor for
@param labelText a label (null will defaults to the property name)
@return a SWT Text field | [
"Create",
"an",
"editor",
"entry",
"for",
"the",
"given",
"configuration",
"name"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/servers/HadoopLocationWizard.java#L562-L584 |
118,689 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/XMLUtils.java | XMLUtils.transform | public static void transform(
InputStream styleSheet, InputStream xml, Writer out
)
throws TransformerConfigurationException, TransformerException {
// Instantiate a TransformerFactory
TransformerFactory tFactory = TransformerFactory.newInstance... | java | public static void transform(
InputStream styleSheet, InputStream xml, Writer out
)
throws TransformerConfigurationException, TransformerException {
// Instantiate a TransformerFactory
TransformerFactory tFactory = TransformerFactory.newInstance... | [
"public",
"static",
"void",
"transform",
"(",
"InputStream",
"styleSheet",
",",
"InputStream",
"xml",
",",
"Writer",
"out",
")",
"throws",
"TransformerConfigurationException",
",",
"TransformerException",
"{",
"// Instantiate a TransformerFactory",
"TransformerFactory",
"tF... | Transform input xml given a stylesheet.
@param styleSheet the style-sheet
@param xml input xml data
@param out output
@throws TransformerConfigurationException
@throws TransformerException | [
"Transform",
"input",
"xml",
"given",
"a",
"stylesheet",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/XMLUtils.java#L39-L55 |
118,690 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/NLineInputFormat.java | NLineInputFormat.getSplits | public InputSplit[] getSplits(JobConf job, int numSplits)
throws IOException {
ArrayList<FileSplit> splits = new ArrayList<FileSplit>();
for (FileStatus status : listLocatedStatus(job)) {
Path fileName = status.getPath();
if (status.isDir()) {
throw new IOException("Not a file: " + fileNam... | java | public InputSplit[] getSplits(JobConf job, int numSplits)
throws IOException {
ArrayList<FileSplit> splits = new ArrayList<FileSplit>();
for (FileStatus status : listLocatedStatus(job)) {
Path fileName = status.getPath();
if (status.isDir()) {
throw new IOException("Not a file: " + fileNam... | [
"public",
"InputSplit",
"[",
"]",
"getSplits",
"(",
"JobConf",
"job",
",",
"int",
"numSplits",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"FileSplit",
">",
"splits",
"=",
"new",
"ArrayList",
"<",
"FileSplit",
">",
"(",
")",
";",
"for",
"(",
"Fi... | Logically splits the set of input files for the job, splits N lines
of the input as one split.
@see org.apache.hadoop.mapred.FileInputFormat#getSplits(JobConf, int) | [
"Logically",
"splits",
"the",
"set",
"of",
"input",
"files",
"for",
"the",
"job",
"splits",
"N",
"lines",
"of",
"the",
"input",
"as",
"one",
"split",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/NLineInputFormat.java#L78-L117 |
118,691 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java | FileInputFormat.getSplits | public List<InputSplit> getSplits(JobContext job
) throws IOException {
long minSize = Math.max(getFormatMinSplitSize(), getMinSplitSize(job));
long maxSize = getMaxSplitSize(job);
// generate splits
List<InputSplit> splits = new ArrayList<InputSplit>();
for (Loc... | java | public List<InputSplit> getSplits(JobContext job
) throws IOException {
long minSize = Math.max(getFormatMinSplitSize(), getMinSplitSize(job));
long maxSize = getMaxSplitSize(job);
// generate splits
List<InputSplit> splits = new ArrayList<InputSplit>();
for (Loc... | [
"public",
"List",
"<",
"InputSplit",
">",
"getSplits",
"(",
"JobContext",
"job",
")",
"throws",
"IOException",
"{",
"long",
"minSize",
"=",
"Math",
".",
"max",
"(",
"getFormatMinSplitSize",
"(",
")",
",",
"getMinSplitSize",
"(",
"job",
")",
")",
";",
"long... | Generate the list of files and make them into FileSplits. | [
"Generate",
"the",
"list",
"of",
"files",
"and",
"make",
"them",
"into",
"FileSplits",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/input/FileInputFormat.java#L292-L329 |
118,692 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/TrashPolicy.java | TrashPolicy.getInstance | public static TrashPolicy getInstance(Configuration conf, FileSystem fs, Path home)
throws IOException {
Class<? extends TrashPolicy> trashClass = conf.getClass("fs.trash.classname",
TrashPolicyDefault.class,
... | java | public static TrashPolicy getInstance(Configuration conf, FileSystem fs, Path home)
throws IOException {
Class<? extends TrashPolicy> trashClass = conf.getClass("fs.trash.classname",
TrashPolicyDefault.class,
... | [
"public",
"static",
"TrashPolicy",
"getInstance",
"(",
"Configuration",
"conf",
",",
"FileSystem",
"fs",
",",
"Path",
"home",
")",
"throws",
"IOException",
"{",
"Class",
"<",
"?",
"extends",
"TrashPolicy",
">",
"trashClass",
"=",
"conf",
".",
"getClass",
"(",
... | Get an instance of the configured TrashPolicy based on the value
of the configuration paramater fs.trash.classname.
@param conf the configuration to be used
@param fs the file system to be used
@param home the home directory
@return an instance of TrashPolicy | [
"Get",
"an",
"instance",
"of",
"the",
"configured",
"TrashPolicy",
"based",
"on",
"the",
"value",
"of",
"the",
"configuration",
"paramater",
"fs",
".",
"trash",
".",
"classname",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/TrashPolicy.java#L94-L102 |
118,693 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/compress/lz4/Lz4Compressor.java | Lz4Compressor.reset | @Override
public synchronized void reset() {
finish = false;
finished = false;
uncompressedDirectBuf.clear();
uncompressedDirectBufLen = 0;
compressedDirectBuf.clear();
compressedDirectBuf.limit(0);
userBufOff = userBufLen = 0;
bytesRead = bytesWritten = 0L;
} | java | @Override
public synchronized void reset() {
finish = false;
finished = false;
uncompressedDirectBuf.clear();
uncompressedDirectBufLen = 0;
compressedDirectBuf.clear();
compressedDirectBuf.limit(0);
userBufOff = userBufLen = 0;
bytesRead = bytesWritten = 0L;
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"reset",
"(",
")",
"{",
"finish",
"=",
"false",
";",
"finished",
"=",
"false",
";",
"uncompressedDirectBuf",
".",
"clear",
"(",
")",
";",
"uncompressedDirectBufLen",
"=",
"0",
";",
"compressedDirectBuf",
".",
... | Resets compressor so that a new set of input data can be processed. | [
"Resets",
"compressor",
"so",
"that",
"a",
"new",
"set",
"of",
"input",
"data",
"can",
"be",
"processed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/lz4/Lz4Compressor.java#L263-L273 |
118,694 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logSubmitted | public void logSubmitted(String jobConfPath, long submitTime, String jobTrackerId)
throws IOException {
if (disableHistory) {
return;
}
// create output stream for logging in hadoop.job.history.location
int defaultBufferSize =
logDirFs.getConf().getInt("io.file.buffer.size", 4096);
... | java | public void logSubmitted(String jobConfPath, long submitTime, String jobTrackerId)
throws IOException {
if (disableHistory) {
return;
}
// create output stream for logging in hadoop.job.history.location
int defaultBufferSize =
logDirFs.getConf().getInt("io.file.buffer.size", 4096);
... | [
"public",
"void",
"logSubmitted",
"(",
"String",
"jobConfPath",
",",
"long",
"submitTime",
",",
"String",
"jobTrackerId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"// create output stream for logging in hadoop.job.h... | Log job submitted event to history. Creates a new file in history
for the job. if history file creation fails, it disables history
for all other events.
@param jobConfPath path to job conf xml file in HDFS.
@param submitTime time when job tracker received the job
@throws IOException | [
"Log",
"job",
"submitted",
"event",
"to",
"history",
".",
"Creates",
"a",
"new",
"file",
"in",
"history",
"for",
"the",
"job",
".",
"if",
"history",
"file",
"creation",
"fails",
"it",
"disables",
"history",
"for",
"all",
"other",
"events",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L207-L294 |
118,695 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logInited | public void logInited(long startTime, int totalMaps, int totalReduces) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.LAUNCH_TIME, Keys.TOTAL_MAPS,
Keys.TOTAL_REDUCES, Keys.JOB_STATUS},
... | java | public void logInited(long startTime, int totalMaps, int totalReduces) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.LAUNCH_TIME, Keys.TOTAL_MAPS,
Keys.TOTAL_REDUCES, Keys.JOB_STATUS},
... | [
"public",
"void",
"logInited",
"(",
"long",
"startTime",
",",
"int",
"totalMaps",
",",
"int",
"totalReduces",
")",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"!=",
"writers",
")",
"{",
"log",
"(",
"writers",
",",... | Logs launch time of job.
@param startTime start time of job.
@param totalMaps total maps assigned by jobtracker.
@param totalReduces total reduces. | [
"Logs",
"launch",
"time",
"of",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L303-L317 |
118,696 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logStarted | public void logStarted() {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.JOB_STATUS},
new String[] {jobId.toString(),
Values.RUNNING.name()});
}
} | java | public void logStarted() {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.JOB_STATUS},
new String[] {jobId.toString(),
Values.RUNNING.name()});
}
} | [
"public",
"void",
"logStarted",
"(",
")",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"!=",
"writers",
")",
"{",
"log",
"(",
"writers",
",",
"RecordTypes",
".",
"Job",
",",
"new",
"Keys",
"[",
"]",
"{",
"Keys"... | Logs job as running | [
"Logs",
"job",
"as",
"running"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L322-L333 |
118,697 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logFinished | public void logFinished(long finishTime,
int finishedMaps, int finishedReduces,
int failedMaps, int failedReduces,
int killedMaps, int killedReduces,
Counters mapCounters,
Counters reduceCou... | java | public void logFinished(long finishTime,
int finishedMaps, int finishedReduces,
int failedMaps, int failedReduces,
int killedMaps, int killedReduces,
Counters mapCounters,
Counters reduceCou... | [
"public",
"void",
"logFinished",
"(",
"long",
"finishTime",
",",
"int",
"finishedMaps",
",",
"int",
"finishedReduces",
",",
"int",
"failedMaps",
",",
"int",
"failedReduces",
",",
"int",
"killedMaps",
",",
"int",
"killedReduces",
",",
"Counters",
"mapCounters",
"... | Log job finished. closes the job file in history.
@param finishTime finish time of job in ms.
@param finishedMaps no of maps successfully finished.
@param finishedReduces no of reduces finished sucessfully.
@param failedMaps no of failed map tasks. (includes killed)
@param failedReduces no of failed reduce tasks. (incl... | [
"Log",
"job",
"finished",
".",
"closes",
"the",
"job",
"file",
"in",
"history",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L346-L384 |
118,698 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logFailed | public void logFailed(long timestamp, int finishedMaps,
int finishedReduces, Counters counters) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.FINISH_TIME,
Keys.JOB_STATU... | java | public void logFailed(long timestamp, int finishedMaps,
int finishedReduces, Counters counters) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.FINISH_TIME,
Keys.JOB_STATU... | [
"public",
"void",
"logFailed",
"(",
"long",
"timestamp",
",",
"int",
"finishedMaps",
",",
"int",
"finishedReduces",
",",
"Counters",
"counters",
")",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"!=",
"writers",
")",
... | Logs job failed event. Closes the job history log file.
@param timestamp time when job failure was detected in ms.
@param finishedMaps no finished map tasks.
@param finishedReduces no of finished reduce tasks. | [
"Logs",
"job",
"failed",
"event",
".",
"Closes",
"the",
"job",
"history",
"log",
"file",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L392-L412 |
118,699 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java | CoronaJobHistory.logJobPriority | public void logJobPriority(JobID jobid, JobPriority priority) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.JOB_PRIORITY},
new String[] {jobId.toString(), priority.toString()});
}
} | java | public void logJobPriority(JobID jobid, JobPriority priority) {
if (disableHistory) {
return;
}
if (null != writers) {
log(writers, RecordTypes.Job,
new Keys[] {Keys.JOBID, Keys.JOB_PRIORITY},
new String[] {jobId.toString(), priority.toString()});
}
} | [
"public",
"void",
"logJobPriority",
"(",
"JobID",
"jobid",
",",
"JobPriority",
"priority",
")",
"{",
"if",
"(",
"disableHistory",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"!=",
"writers",
")",
"{",
"log",
"(",
"writers",
",",
"RecordTypes",
".",
... | Log job's priority.
@param priority Jobs priority | [
"Log",
"job",
"s",
"priority",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobHistory.java#L450-L460 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.