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,100 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrFilesFixed | protected synchronized void incrFilesFixed(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).filesFixed.inc(incr);
numFiles... | java | protected synchronized void incrFilesFixed(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).filesFixed.inc(incr);
numFiles... | [
"protected",
"synchronized",
"void",
"incrFilesFixed",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"RaidNodeMetrics",
... | Increments the number of corrupt files that have been fixed by this
integrity monitor. | [
"Increments",
"the",
"number",
"of",
"corrupt",
"files",
"that",
"have",
"been",
"fixed",
"by",
"this",
"integrity",
"monitor",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L280-L288 |
118,101 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrFileFixReadBytesRemoteRack | protected synchronized void incrFileFixReadBytesRemoteRack(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).numFileFixReadByte... | java | protected synchronized void incrFileFixReadBytesRemoteRack(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).numFileFixReadByte... | [
"protected",
"synchronized",
"void",
"incrFileFixReadBytesRemoteRack",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"Ra... | Increments the number of bytes read from remote racks during file fix
operations of the this integrity monitor | [
"Increments",
"the",
"number",
"of",
"bytes",
"read",
"from",
"remote",
"racks",
"during",
"file",
"fix",
"operations",
"of",
"the",
"this",
"integrity",
"monitor"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L294-L302 |
118,102 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrFileCopyFailures | protected synchronized void incrFileCopyFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).fileCopyFailures.inc(incr);
... | java | protected synchronized void incrFileCopyFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).fileCopyFailures.inc(incr);
... | [
"protected",
"synchronized",
"void",
"incrFileCopyFailures",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"RaidNodeMetr... | Increments the number of decommissioning file copy failures. | [
"Increments",
"the",
"number",
"of",
"decommissioning",
"file",
"copy",
"failures",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L313-L321 |
118,103 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrFilesCopied | protected synchronized void incrFilesCopied(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).filesCopied.inc(incr);
numFil... | java | protected synchronized void incrFilesCopied(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).filesCopied.inc(incr);
numFil... | [
"protected",
"synchronized",
"void",
"incrFilesCopied",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"RaidNodeMetrics",... | Increments the number of decommissioning files that have been copied by
this integrity monitor. | [
"Increments",
"the",
"number",
"of",
"decommissioning",
"files",
"that",
"have",
"been",
"copied",
"by",
"this",
"integrity",
"monitor",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L344-L352 |
118,104 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.open | synchronized void open() throws IOException {
if (syncer == null) {
syncer = new SyncThread();
syncThread = new Thread(syncer);
syncThread.start();
}
if (state != State.BETWEEN_LOG_SEGMENTS)
throw new IOException("Bad state: " + state);
startLogSegment(getLastWrittenTxId() + 1, ... | java | synchronized void open() throws IOException {
if (syncer == null) {
syncer = new SyncThread();
syncThread = new Thread(syncer);
syncThread.start();
}
if (state != State.BETWEEN_LOG_SEGMENTS)
throw new IOException("Bad state: " + state);
startLogSegment(getLastWrittenTxId() + 1, ... | [
"synchronized",
"void",
"open",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"syncer",
"==",
"null",
")",
"{",
"syncer",
"=",
"new",
"SyncThread",
"(",
")",
";",
"syncThread",
"=",
"new",
"Thread",
"(",
"syncer",
")",
";",
"syncThread",
".",
"sta... | Create empty edit log files.
Initialize the output stream for logging.
@throws IOException | [
"Create",
"empty",
"edit",
"log",
"files",
".",
"Initialize",
"the",
"output",
"stream",
"for",
"logging",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L279-L291 |
118,105 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSyncAll | public void logSyncAll() throws IOException {
// Record the most recent transaction ID as our own id
synchronized (this) {
TransactionId id = myTransactionId.get();
id.txid = txid;
}
// Then make sure we're synced up to this point
logSync();
} | java | public void logSyncAll() throws IOException {
// Record the most recent transaction ID as our own id
synchronized (this) {
TransactionId id = myTransactionId.get();
id.txid = txid;
}
// Then make sure we're synced up to this point
logSync();
} | [
"public",
"void",
"logSyncAll",
"(",
")",
"throws",
"IOException",
"{",
"// Record the most recent transaction ID as our own id",
"synchronized",
"(",
"this",
")",
"{",
"TransactionId",
"id",
"=",
"myTransactionId",
".",
"get",
"(",
")",
";",
"id",
".",
"txid",
"=... | Blocks until all ongoing edits have been synced to disk. This differs from
logSync in that it waits for edits that have been written by other threads,
not just edits from the calling thread.
NOTE: this should be done while holding the FSNamesystem lock, or else more
operations can start writing while this is in progre... | [
"Blocks",
"until",
"all",
"ongoing",
"edits",
"have",
"been",
"synced",
"to",
"disk",
".",
"This",
"differs",
"from",
"logSync",
"in",
"that",
"it",
"waits",
"for",
"edits",
"that",
"have",
"been",
"written",
"by",
"other",
"threads",
"not",
"just",
"edits... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L425-L433 |
118,106 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSyncIfNeeded | public void logSyncIfNeeded() {
boolean doSync = false;
synchronized (this) {
if (txid > synctxid + maxBufferedTransactions) {
FSNamesystem.LOG.info("Out of band log sync triggered " +
" because there are " +
(txid-synctxid) +
... | java | public void logSyncIfNeeded() {
boolean doSync = false;
synchronized (this) {
if (txid > synctxid + maxBufferedTransactions) {
FSNamesystem.LOG.info("Out of band log sync triggered " +
" because there are " +
(txid-synctxid) +
... | [
"public",
"void",
"logSyncIfNeeded",
"(",
")",
"{",
"boolean",
"doSync",
"=",
"false",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"txid",
">",
"synctxid",
"+",
"maxBufferedTransactions",
")",
"{",
"FSNamesystem",
".",
"LOG",
".",
"info",
"(",
... | if there are too many transactions that are yet to be synced,
then sync them. Otherwise, the in-memory buffer that keeps
the transactions would grow to be very very big. This can happen
when there are a large number of listStatus calls which update
the access time of files. | [
"if",
"there",
"are",
"too",
"many",
"transactions",
"that",
"are",
"yet",
"to",
"be",
"synced",
"then",
"sync",
"them",
".",
"Otherwise",
"the",
"in",
"-",
"memory",
"buffer",
"that",
"keeps",
"the",
"transactions",
"would",
"grow",
"to",
"be",
"very",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L442-L462 |
118,107 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSync | public void logSync(boolean doWait) {
long syncStart = 0;
boolean thisThreadSuccess = false;
boolean thisThreadSyncing = false;
EditLogOutputStream logStream = null;
try {
synchronized (this) {
long mytxid = myTransactionId.get().txid;
myTransactionId.get().txid = -1L;
... | java | public void logSync(boolean doWait) {
long syncStart = 0;
boolean thisThreadSuccess = false;
boolean thisThreadSyncing = false;
EditLogOutputStream logStream = null;
try {
synchronized (this) {
long mytxid = myTransactionId.get().txid;
myTransactionId.get().txid = -1L;
... | [
"public",
"void",
"logSync",
"(",
"boolean",
"doWait",
")",
"{",
"long",
"syncStart",
"=",
"0",
";",
"boolean",
"thisThreadSuccess",
"=",
"false",
";",
"boolean",
"thisThreadSyncing",
"=",
"false",
";",
"EditLogOutputStream",
"logStream",
"=",
"null",
";",
"tr... | Sync all modifications done by this thread.
The internal concurrency design of this class is as follows:
- Log items are written synchronized into an in-memory buffer,
and each assigned a transaction ID.
- When a thread (client) would like to sync all of its edits, logSync()
uses a ThreadLocal transaction ID to determ... | [
"Sync",
"all",
"modifications",
"done",
"by",
"this",
"thread",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L496-L585 |
118,108 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logOpenFile | public void logOpenFile(String path, INodeFileUnderConstruction newNode)
throws IOException {
AddOp op = AddOp.getInstance();
op.set(newNode.getId(),
path,
newNode.getReplication(),
newNode.getModificationTime(),
newNode.getAccessTime(),
newNode.ge... | java | public void logOpenFile(String path, INodeFileUnderConstruction newNode)
throws IOException {
AddOp op = AddOp.getInstance();
op.set(newNode.getId(),
path,
newNode.getReplication(),
newNode.getModificationTime(),
newNode.getAccessTime(),
newNode.ge... | [
"public",
"void",
"logOpenFile",
"(",
"String",
"path",
",",
"INodeFileUnderConstruction",
"newNode",
")",
"throws",
"IOException",
"{",
"AddOp",
"op",
"=",
"AddOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"newNode",
".",
"getId",
"(",
")... | Add open lease record to edit log.
Records the block locations of the last block. | [
"Add",
"open",
"lease",
"record",
"to",
"edit",
"log",
".",
"Records",
"the",
"block",
"locations",
"of",
"the",
"last",
"block",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L729-L743 |
118,109 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logCloseFile | public void logCloseFile(String path, INodeFile newNode) {
CloseOp op = CloseOp.getInstance();
op.set(newNode.getId(),
path,
newNode.getReplication(),
newNode.getModificationTime(),
newNode.getAccessTime(),
newNode.getPreferredBlockSize(),
newNode.getBlocks(),
... | java | public void logCloseFile(String path, INodeFile newNode) {
CloseOp op = CloseOp.getInstance();
op.set(newNode.getId(),
path,
newNode.getReplication(),
newNode.getModificationTime(),
newNode.getAccessTime(),
newNode.getPreferredBlockSize(),
newNode.getBlocks(),
... | [
"public",
"void",
"logCloseFile",
"(",
"String",
"path",
",",
"INodeFile",
"newNode",
")",
"{",
"CloseOp",
"op",
"=",
"CloseOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"newNode",
".",
"getId",
"(",
")",
",",
"path",
",",
"newNode",
... | Add close lease record to edit log. | [
"Add",
"close",
"lease",
"record",
"to",
"edit",
"log",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L748-L761 |
118,110 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logAppendFile | public void logAppendFile(String path, INodeFileUnderConstruction newNode)
throws IOException {
AppendOp op = AppendOp.getInstance();
op.set(path,
newNode.getBlocks(),
newNode.getClientName(),
newNode.getClientMachine());
logEdit(op);
} | java | public void logAppendFile(String path, INodeFileUnderConstruction newNode)
throws IOException {
AppendOp op = AppendOp.getInstance();
op.set(path,
newNode.getBlocks(),
newNode.getClientName(),
newNode.getClientMachine());
logEdit(op);
} | [
"public",
"void",
"logAppendFile",
"(",
"String",
"path",
",",
"INodeFileUnderConstruction",
"newNode",
")",
"throws",
"IOException",
"{",
"AppendOp",
"op",
"=",
"AppendOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"path",
",",
"newNode",
".... | Add append file record to the edit log. | [
"Add",
"append",
"file",
"record",
"to",
"the",
"edit",
"log",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L766-L774 |
118,111 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logMkDir | public void logMkDir(String path, INode newNode) {
MkdirOp op = MkdirOp.getInstance();
op.set(newNode.getId(), path, newNode.getModificationTime(),
newNode.getPermissionStatus());
logEdit(op);
} | java | public void logMkDir(String path, INode newNode) {
MkdirOp op = MkdirOp.getInstance();
op.set(newNode.getId(), path, newNode.getModificationTime(),
newNode.getPermissionStatus());
logEdit(op);
} | [
"public",
"void",
"logMkDir",
"(",
"String",
"path",
",",
"INode",
"newNode",
")",
"{",
"MkdirOp",
"op",
"=",
"MkdirOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"newNode",
".",
"getId",
"(",
")",
",",
"path",
",",
"newNode",
".",
... | Add create directory record to edit log | [
"Add",
"create",
"directory",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L779-L784 |
118,112 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logHardLink | public void logHardLink(String src, String dst, long timestamp) {
HardLinkOp op = HardLinkOp.getInstance();
op.set(src, dst, timestamp);
logEdit(op);
} | java | public void logHardLink(String src, String dst, long timestamp) {
HardLinkOp op = HardLinkOp.getInstance();
op.set(src, dst, timestamp);
logEdit(op);
} | [
"public",
"void",
"logHardLink",
"(",
"String",
"src",
",",
"String",
"dst",
",",
"long",
"timestamp",
")",
"{",
"HardLinkOp",
"op",
"=",
"HardLinkOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"dst",
",",
"timestamp",
")",
... | Add hardlink record to edit log | [
"Add",
"hardlink",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L789-L793 |
118,113 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logRename | public void logRename(String src, String dst, long timestamp) {
RenameOp op = RenameOp.getInstance();
op.set(src, dst, timestamp);
logEdit(op);
} | java | public void logRename(String src, String dst, long timestamp) {
RenameOp op = RenameOp.getInstance();
op.set(src, dst, timestamp);
logEdit(op);
} | [
"public",
"void",
"logRename",
"(",
"String",
"src",
",",
"String",
"dst",
",",
"long",
"timestamp",
")",
"{",
"RenameOp",
"op",
"=",
"RenameOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"dst",
",",
"timestamp",
")",
";",... | Add rename record to edit log | [
"Add",
"rename",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L798-L802 |
118,114 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSetReplication | public void logSetReplication(String src, short replication) {
SetReplicationOp op = SetReplicationOp.getInstance();
op.set(src, replication);
logEdit(op);
} | java | public void logSetReplication(String src, short replication) {
SetReplicationOp op = SetReplicationOp.getInstance();
op.set(src, replication);
logEdit(op);
} | [
"public",
"void",
"logSetReplication",
"(",
"String",
"src",
",",
"short",
"replication",
")",
"{",
"SetReplicationOp",
"op",
"=",
"SetReplicationOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"replication",
")",
";",
"logEdit",
... | Add set replication record to edit log | [
"Add",
"set",
"replication",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L815-L819 |
118,115 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSetQuota | public void logSetQuota(String src, long nsQuota, long dsQuota) {
SetQuotaOp op = SetQuotaOp.getInstance();
op.set(src, nsQuota, dsQuota);
logEdit(op);
} | java | public void logSetQuota(String src, long nsQuota, long dsQuota) {
SetQuotaOp op = SetQuotaOp.getInstance();
op.set(src, nsQuota, dsQuota);
logEdit(op);
} | [
"public",
"void",
"logSetQuota",
"(",
"String",
"src",
",",
"long",
"nsQuota",
",",
"long",
"dsQuota",
")",
"{",
"SetQuotaOp",
"op",
"=",
"SetQuotaOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"nsQuota",
",",
"dsQuota",
")"... | Add set namespace quota record to edit log
@param src the string representation of the path to a directory
@param quota the directory size limit | [
"Add",
"set",
"namespace",
"quota",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L826-L830 |
118,116 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSetPermissions | public void logSetPermissions(String src, FsPermission permissions) {
SetPermissionsOp op = SetPermissionsOp.getInstance();
op.set(src, permissions);
logEdit(op);
} | java | public void logSetPermissions(String src, FsPermission permissions) {
SetPermissionsOp op = SetPermissionsOp.getInstance();
op.set(src, permissions);
logEdit(op);
} | [
"public",
"void",
"logSetPermissions",
"(",
"String",
"src",
",",
"FsPermission",
"permissions",
")",
"{",
"SetPermissionsOp",
"op",
"=",
"SetPermissionsOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"permissions",
")",
";",
"logE... | Add set permissions record to edit log | [
"Add",
"set",
"permissions",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L833-L837 |
118,117 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logSetOwner | public void logSetOwner(String src, String username, String groupname) {
SetOwnerOp op = SetOwnerOp.getInstance();
op.set(src, username, groupname);
logEdit(op);
} | java | public void logSetOwner(String src, String username, String groupname) {
SetOwnerOp op = SetOwnerOp.getInstance();
op.set(src, username, groupname);
logEdit(op);
} | [
"public",
"void",
"logSetOwner",
"(",
"String",
"src",
",",
"String",
"username",
",",
"String",
"groupname",
")",
"{",
"SetOwnerOp",
"op",
"=",
"SetOwnerOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"username",
",",
"groupna... | Add set owner record to edit log | [
"Add",
"set",
"owner",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L840-L844 |
118,118 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logDelete | public void logDelete(String src, long timestamp) {
DeleteOp op = DeleteOp.getInstance();
op.set(src, timestamp);
logEdit(op);
} | java | public void logDelete(String src, long timestamp) {
DeleteOp op = DeleteOp.getInstance();
op.set(src, timestamp);
logEdit(op);
} | [
"public",
"void",
"logDelete",
"(",
"String",
"src",
",",
"long",
"timestamp",
")",
"{",
"DeleteOp",
"op",
"=",
"DeleteOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"timestamp",
")",
";",
"logEdit",
"(",
"op",
")",
";",
... | Add delete file record to edit log | [
"Add",
"delete",
"file",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L870-L874 |
118,119 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logGenerationStamp | public void logGenerationStamp(long genstamp) {
SetGenstampOp op = SetGenstampOp.getInstance();
op.set(genstamp);
logEdit(op);
} | java | public void logGenerationStamp(long genstamp) {
SetGenstampOp op = SetGenstampOp.getInstance();
op.set(genstamp);
logEdit(op);
} | [
"public",
"void",
"logGenerationStamp",
"(",
"long",
"genstamp",
")",
"{",
"SetGenstampOp",
"op",
"=",
"SetGenstampOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"genstamp",
")",
";",
"logEdit",
"(",
"op",
")",
";",
"}"
] | Add generation stamp record to edit log | [
"Add",
"generation",
"stamp",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L879-L883 |
118,120 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.logTimes | public void logTimes(String src, long mtime, long atime) {
TimesOp op = TimesOp.getInstance();
op.set(src, mtime, atime);
logEdit(op);
} | java | public void logTimes(String src, long mtime, long atime) {
TimesOp op = TimesOp.getInstance();
op.set(src, mtime, atime);
logEdit(op);
} | [
"public",
"void",
"logTimes",
"(",
"String",
"src",
",",
"long",
"mtime",
",",
"long",
"atime",
")",
"{",
"TimesOp",
"op",
"=",
"TimesOp",
".",
"getInstance",
"(",
")",
";",
"op",
".",
"set",
"(",
"src",
",",
"mtime",
",",
"atime",
")",
";",
"logEd... | Add access time record to edit log | [
"Add",
"access",
"time",
"record",
"to",
"edit",
"log"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L888-L892 |
118,121 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.rollEditLog | synchronized long rollEditLog() throws IOException {
LOG.info("Rolling edit logs.");
long start = System.nanoTime();
endCurrentLogSegment(true);
long nextTxId = getLastWrittenTxId() + 1;
startLogSegment(nextTxId, true);
assert curSegmentTxId == nextTxId;
long rollTime = DFSUtil.getElap... | java | synchronized long rollEditLog() throws IOException {
LOG.info("Rolling edit logs.");
long start = System.nanoTime();
endCurrentLogSegment(true);
long nextTxId = getLastWrittenTxId() + 1;
startLogSegment(nextTxId, true);
assert curSegmentTxId == nextTxId;
long rollTime = DFSUtil.getElap... | [
"synchronized",
"long",
"rollEditLog",
"(",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Rolling edit logs.\"",
")",
";",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"endCurrentLogSegment",
"(",
"true",
")",
";",
"long",... | Finalizes the current edit log and opens a new log segment.
@return the transaction id of the BEGIN_LOG_SEGMENT transaction
in the new log. | [
"Finalizes",
"the",
"current",
"edit",
"log",
"and",
"opens",
"a",
"new",
"log",
"segment",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L921-L936 |
118,122 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.startLogSegment | synchronized void startLogSegment(final long segmentTxId,
boolean writeHeaderTxn) throws IOException {
LOG.info("Starting log segment at " + segmentTxId);
if (segmentTxId < 0) {
throw new IOException("Bad txid: " + segmentTxId);
}
if (state != State.BETWEEN_LOG_SEGMENTS) {
throw new IO... | java | synchronized void startLogSegment(final long segmentTxId,
boolean writeHeaderTxn) throws IOException {
LOG.info("Starting log segment at " + segmentTxId);
if (segmentTxId < 0) {
throw new IOException("Bad txid: " + segmentTxId);
}
if (state != State.BETWEEN_LOG_SEGMENTS) {
throw new IO... | [
"synchronized",
"void",
"startLogSegment",
"(",
"final",
"long",
"segmentTxId",
",",
"boolean",
"writeHeaderTxn",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Starting log segment at \"",
"+",
"segmentTxId",
")",
";",
"if",
"(",
"segmentTxId",
"<... | Start writing to the log segment with the given txid.
Transitions from BETWEEN_LOG_SEGMENTS state to IN_LOG_SEGMENT state. | [
"Start",
"writing",
"to",
"the",
"log",
"segment",
"with",
"the",
"given",
"txid",
".",
"Transitions",
"from",
"BETWEEN_LOG_SEGMENTS",
"state",
"to",
"IN_LOG_SEGMENT",
"state",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L942-L998 |
118,123 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.endCurrentLogSegment | synchronized void endCurrentLogSegment(boolean writeEndTxn)
throws IOException {
LOG.info("Ending log segment " + curSegmentTxId);
if (state != State.IN_SEGMENT) {
throw new IllegalStateException("Bad state: " + state);
}
waitForSyncToFinish();
if (writeEndTxn) {
logEdit(LogSegment... | java | synchronized void endCurrentLogSegment(boolean writeEndTxn)
throws IOException {
LOG.info("Ending log segment " + curSegmentTxId);
if (state != State.IN_SEGMENT) {
throw new IllegalStateException("Bad state: " + state);
}
waitForSyncToFinish();
if (writeEndTxn) {
logEdit(LogSegment... | [
"synchronized",
"void",
"endCurrentLogSegment",
"(",
"boolean",
"writeEndTxn",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"info",
"(",
"\"Ending log segment \"",
"+",
"curSegmentTxId",
")",
";",
"if",
"(",
"state",
"!=",
"State",
".",
"IN_SEGMENT",
")",
"{",... | Finalize the current log segment. Transitions from IN_SEGMENT state to
BETWEEN_LOG_SEGMENTS state. | [
"Finalize",
"the",
"current",
"log",
"segment",
".",
"Transitions",
"from",
"IN_SEGMENT",
"state",
"to",
"BETWEEN_LOG_SEGMENTS",
"state",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1004-L1026 |
118,124 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.purgeLogsOlderThan | public void purgeLogsOlderThan(final long minTxIdToKeep) {
synchronized (this) {
// synchronized to prevent findbugs warning about inconsistent
// synchronization. This will be JIT-ed out if asserts are
// off.
assert curSegmentTxId == HdfsConstants.INVALID_TXID || // on format this
... | java | public void purgeLogsOlderThan(final long minTxIdToKeep) {
synchronized (this) {
// synchronized to prevent findbugs warning about inconsistent
// synchronization. This will be JIT-ed out if asserts are
// off.
assert curSegmentTxId == HdfsConstants.INVALID_TXID || // on format this
... | [
"public",
"void",
"purgeLogsOlderThan",
"(",
"final",
"long",
"minTxIdToKeep",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"// synchronized to prevent findbugs warning about inconsistent",
"// synchronization. This will be JIT-ed out if asserts are",
"// off.",
"assert",
"cu... | Archive any log files that are older than the given txid. | [
"Archive",
"any",
"log",
"files",
"that",
"are",
"older",
"than",
"the",
"given",
"txid",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1031-L1047 |
118,125 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.selectInputStreams | public synchronized boolean selectInputStreams(
Collection<EditLogInputStream> streams, long fromTxId,
long toAtLeastTxId, int minRedundancy) throws IOException {
// at this point we should not have any non-finalized segments
// this function is called at startup, and must be invoked after
... | java | public synchronized boolean selectInputStreams(
Collection<EditLogInputStream> streams, long fromTxId,
long toAtLeastTxId, int minRedundancy) throws IOException {
// at this point we should not have any non-finalized segments
// this function is called at startup, and must be invoked after
... | [
"public",
"synchronized",
"boolean",
"selectInputStreams",
"(",
"Collection",
"<",
"EditLogInputStream",
">",
"streams",
",",
"long",
"fromTxId",
",",
"long",
"toAtLeastTxId",
",",
"int",
"minRedundancy",
")",
"throws",
"IOException",
"{",
"// at this point we should no... | Select a list of input streams to load.
@param streams, streams to be returned
@param fromTxId first transaction in the selected streams
@param toAtLeast the selected streams must contain this transaction
@param inProgessOk set to true if in-progress streams are OK
@return true if there the redundancy in no met | [
"Select",
"a",
"list",
"of",
"input",
"streams",
"to",
"load",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1091-L1114 |
118,126 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.closeAllStreams | static void closeAllStreams(Iterable<EditLogInputStream> streams) {
for (EditLogInputStream s : streams) {
IOUtils.closeStream(s);
}
} | java | static void closeAllStreams(Iterable<EditLogInputStream> streams) {
for (EditLogInputStream s : streams) {
IOUtils.closeStream(s);
}
} | [
"static",
"void",
"closeAllStreams",
"(",
"Iterable",
"<",
"EditLogInputStream",
">",
"streams",
")",
"{",
"for",
"(",
"EditLogInputStream",
"s",
":",
"streams",
")",
"{",
"IOUtils",
".",
"closeStream",
"(",
"s",
")",
";",
"}",
"}"
] | Close all the streams in a collection
@param streams The list of streams to close | [
"Close",
"all",
"the",
"streams",
"in",
"a",
"collection"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1158-L1162 |
118,127 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.getJournalClass | static Class<? extends JournalManager> getJournalClass(Configuration conf,
String uriScheme) {
String key = "dfs.name.edits.journal-plugin" + "." + uriScheme;
Class<? extends JournalManager> clazz = null;
try {
clazz = conf.getClass(key, null, JournalManager.class);
} catch (RuntimeException... | java | static Class<? extends JournalManager> getJournalClass(Configuration conf,
String uriScheme) {
String key = "dfs.name.edits.journal-plugin" + "." + uriScheme;
Class<? extends JournalManager> clazz = null;
try {
clazz = conf.getClass(key, null, JournalManager.class);
} catch (RuntimeException... | [
"static",
"Class",
"<",
"?",
"extends",
"JournalManager",
">",
"getJournalClass",
"(",
"Configuration",
"conf",
",",
"String",
"uriScheme",
")",
"{",
"String",
"key",
"=",
"\"dfs.name.edits.journal-plugin\"",
"+",
"\".\"",
"+",
"uriScheme",
";",
"Class",
"<",
"?... | Retrieve the implementation class for a Journal scheme.
@param conf The configuration to retrieve the information from
@param uriScheme The uri scheme to look up.
@return the class of the journal implementation
@throws IllegalArgumentException if no class is configured for uri | [
"Retrieve",
"the",
"implementation",
"class",
"for",
"a",
"Journal",
"scheme",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1171-L1188 |
118,128 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | FSEditLog.createJournal | public static JournalManager createJournal(Configuration conf, URI uri,
NamespaceInfo nsInfo, NameNodeMetrics metrics) {
Class<? extends JournalManager> clazz = getJournalClass(conf,
uri.getScheme());
try {
Constructor<? extends JournalManager> cons = clazz.getConstructor(
Configu... | java | public static JournalManager createJournal(Configuration conf, URI uri,
NamespaceInfo nsInfo, NameNodeMetrics metrics) {
Class<? extends JournalManager> clazz = getJournalClass(conf,
uri.getScheme());
try {
Constructor<? extends JournalManager> cons = clazz.getConstructor(
Configu... | [
"public",
"static",
"JournalManager",
"createJournal",
"(",
"Configuration",
"conf",
",",
"URI",
"uri",
",",
"NamespaceInfo",
"nsInfo",
",",
"NameNodeMetrics",
"metrics",
")",
"{",
"Class",
"<",
"?",
"extends",
"JournalManager",
">",
"clazz",
"=",
"getJournalClass... | Construct a custom journal manager.
The class to construct is taken from the configuration.
@param uri Uri to construct
@return The constructed journal manager
@throws IllegalArgumentException if no class is configured for uri | [
"Construct",
"a",
"custom",
"journal",
"manager",
".",
"The",
"class",
"to",
"construct",
"is",
"taken",
"from",
"the",
"configuration",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1197-L1211 |
118,129 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileRecordReader.java | CombineFileRecordReader.getProgress | public float getProgress() throws IOException {
long subprogress = 0; // bytes processed in current split
if (null != curReader) {
// idx is always one past the current subsplit's true index.
subprogress = (long)(curReader.getProgress() * split.getLength(idx - 1));
}
return Math.min(1.0f,... | java | public float getProgress() throws IOException {
long subprogress = 0; // bytes processed in current split
if (null != curReader) {
// idx is always one past the current subsplit's true index.
subprogress = (long)(curReader.getProgress() * split.getLength(idx - 1));
}
return Math.min(1.0f,... | [
"public",
"float",
"getProgress",
"(",
")",
"throws",
"IOException",
"{",
"long",
"subprogress",
"=",
"0",
";",
"// bytes processed in current split",
"if",
"(",
"null",
"!=",
"curReader",
")",
"{",
"// idx is always one past the current subsplit's true index.",
"subprogr... | return progress based on the amount of data processed so far. | [
"return",
"progress",
"based",
"on",
"the",
"amount",
"of",
"data",
"processed",
"so",
"far",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileRecordReader.java#L94-L101 |
118,130 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileRecordReader.java | CombineFileRecordReader.initNextRecordReader | protected boolean initNextRecordReader() throws IOException {
if (curReader != null) {
curReader.close();
curReader = null;
if (idx > 0) {
progress += split.getLength(idx-1); // done processing so far
}
}
// if all chunks have been processed, nothing more to do.
if (... | java | protected boolean initNextRecordReader() throws IOException {
if (curReader != null) {
curReader.close();
curReader = null;
if (idx > 0) {
progress += split.getLength(idx-1); // done processing so far
}
}
// if all chunks have been processed, nothing more to do.
if (... | [
"protected",
"boolean",
"initNextRecordReader",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"curReader",
"!=",
"null",
")",
"{",
"curReader",
".",
"close",
"(",
")",
";",
"curReader",
"=",
"null",
";",
"if",
"(",
"idx",
">",
"0",
")",
"{",
"prog... | Get the record reader for the next chunk in this CombineFileSplit. | [
"Get",
"the",
"record",
"reader",
"for",
"the",
"next",
"chunk",
"in",
"this",
"CombineFileSplit",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileRecordReader.java#L132-L161 |
118,131 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.setupJob | public void setupJob(JobContext context) throws IOException {
if (outputPath != null) {
Path tmpDir = new Path(outputPath, FileOutputCommitter.TEMP_DIR_NAME);
FileSystem fileSys = tmpDir.getFileSystem(context.getConfiguration());
if (!fileSys.mkdirs(tmpDir)) {
LOG.error("Mkdirs failed to c... | java | public void setupJob(JobContext context) throws IOException {
if (outputPath != null) {
Path tmpDir = new Path(outputPath, FileOutputCommitter.TEMP_DIR_NAME);
FileSystem fileSys = tmpDir.getFileSystem(context.getConfiguration());
if (!fileSys.mkdirs(tmpDir)) {
LOG.error("Mkdirs failed to c... | [
"public",
"void",
"setupJob",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"if",
"(",
"outputPath",
"!=",
"null",
")",
"{",
"Path",
"tmpDir",
"=",
"new",
"Path",
"(",
"outputPath",
",",
"FileOutputCommitter",
".",
"TEMP_DIR_NAME",
")",
";... | Create the temporary directory that is the root of all of the task
work directories.
@param context the job's context | [
"Create",
"the",
"temporary",
"directory",
"that",
"is",
"the",
"root",
"of",
"all",
"of",
"the",
"task",
"work",
"directories",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L77-L85 |
118,132 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.commitJob | public void commitJob(JobContext context) throws IOException {
// delete the _temporary folder
cleanupJob(context);
// check if the o/p dir should be marked
if (shouldMarkOutputDir(context.getConfiguration())) {
// create a _success file in the o/p folder
markOutputDirSuccessful(context);
... | java | public void commitJob(JobContext context) throws IOException {
// delete the _temporary folder
cleanupJob(context);
// check if the o/p dir should be marked
if (shouldMarkOutputDir(context.getConfiguration())) {
// create a _success file in the o/p folder
markOutputDirSuccessful(context);
... | [
"public",
"void",
"commitJob",
"(",
"JobContext",
"context",
")",
"throws",
"IOException",
"{",
"// delete the _temporary folder",
"cleanupJob",
"(",
"context",
")",
";",
"// check if the o/p dir should be marked",
"if",
"(",
"shouldMarkOutputDir",
"(",
"context",
".",
... | Delete the temporary directory, including all of the work directories.
This is called for all jobs whose final run state is SUCCEEDED
@param context the job's context. | [
"Delete",
"the",
"temporary",
"directory",
"including",
"all",
"of",
"the",
"work",
"directories",
".",
"This",
"is",
"called",
"for",
"all",
"jobs",
"whose",
"final",
"run",
"state",
"is",
"SUCCEEDED"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L110-L118 |
118,133 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.abortJob | @Override
public void abortJob(JobContext context, JobStatus.State state)
throws IOException {
cleanupJob(context);
} | java | @Override
public void abortJob(JobContext context, JobStatus.State state)
throws IOException {
cleanupJob(context);
} | [
"@",
"Override",
"public",
"void",
"abortJob",
"(",
"JobContext",
"context",
",",
"JobStatus",
".",
"State",
"state",
")",
"throws",
"IOException",
"{",
"cleanupJob",
"(",
"context",
")",
";",
"}"
] | Delete the temporary directory, including all of the work directories.
@param context the job's context
@param state final run state of the job, should be FAILED or KILLED | [
"Delete",
"the",
"temporary",
"directory",
"including",
"all",
"of",
"the",
"work",
"directories",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L141-L145 |
118,134 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.commitTask | public void commitTask(TaskAttemptContext context)
throws IOException {
TaskAttemptID attemptId = context.getTaskAttemptID();
if (workPath != null) {
context.progress();
if (outputFileSystem.exists(workPath)) {
// Move the task outputs to their final place
moveTaskOutputs(context,... | java | public void commitTask(TaskAttemptContext context)
throws IOException {
TaskAttemptID attemptId = context.getTaskAttemptID();
if (workPath != null) {
context.progress();
if (outputFileSystem.exists(workPath)) {
// Move the task outputs to their final place
moveTaskOutputs(context,... | [
"public",
"void",
"commitTask",
"(",
"TaskAttemptContext",
"context",
")",
"throws",
"IOException",
"{",
"TaskAttemptID",
"attemptId",
"=",
"context",
".",
"getTaskAttemptID",
"(",
")",
";",
"if",
"(",
"workPath",
"!=",
"null",
")",
"{",
"context",
".",
"progr... | Move the files from the work directory to the job output directory
@param context the task context | [
"Move",
"the",
"files",
"from",
"the",
"work",
"directory",
"to",
"the",
"job",
"output",
"directory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L161-L178 |
118,135 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.moveTaskOutputs | private void moveTaskOutputs(TaskAttemptContext context,
FileSystem fs,
Path jobOutputDir,
Path taskOutput)
throws IOException {
TaskAttemptID attemptId = context.getTaskAttemptID();
context.progress();
if (fs.is... | java | private void moveTaskOutputs(TaskAttemptContext context,
FileSystem fs,
Path jobOutputDir,
Path taskOutput)
throws IOException {
TaskAttemptID attemptId = context.getTaskAttemptID();
context.progress();
if (fs.is... | [
"private",
"void",
"moveTaskOutputs",
"(",
"TaskAttemptContext",
"context",
",",
"FileSystem",
"fs",
",",
"Path",
"jobOutputDir",
",",
"Path",
"taskOutput",
")",
"throws",
"IOException",
"{",
"TaskAttemptID",
"attemptId",
"=",
"context",
".",
"getTaskAttemptID",
"("... | Move all of the files from the work directory to the final output
@param context the task context
@param fs the output file system
@param jobOutputDir the final output direcotry
@param taskOutput the work path
@throws IOException | [
"Move",
"all",
"of",
"the",
"files",
"from",
"the",
"work",
"directory",
"to",
"the",
"final",
"output"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L188-L219 |
118,136 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.abortTask | @Override
public void abortTask(TaskAttemptContext context) throws IOException {
try {
if (workPath != null) {
context.progress();
if (!outputFileSystem.delete(workPath, true)) {
LOG.warn("Deleting output in " + workPath + " returns false");
}
}
} catch (IOExcept... | java | @Override
public void abortTask(TaskAttemptContext context) throws IOException {
try {
if (workPath != null) {
context.progress();
if (!outputFileSystem.delete(workPath, true)) {
LOG.warn("Deleting output in " + workPath + " returns false");
}
}
} catch (IOExcept... | [
"@",
"Override",
"public",
"void",
"abortTask",
"(",
"TaskAttemptContext",
"context",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"workPath",
"!=",
"null",
")",
"{",
"context",
".",
"progress",
"(",
")",
";",
"if",
"(",
"!",
"outputFileSystem... | Delete the work directory | [
"Delete",
"the",
"work",
"directory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L224-L237 |
118,137 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.getFinalPath | private Path getFinalPath(Path jobOutputDir, Path taskOutput,
Path taskOutputPath) throws IOException {
URI taskOutputUri = taskOutput.toUri();
URI relativePath = taskOutputPath.toUri().relativize(taskOutputUri);
if (taskOutputUri == relativePath) {
throw new IOException("... | java | private Path getFinalPath(Path jobOutputDir, Path taskOutput,
Path taskOutputPath) throws IOException {
URI taskOutputUri = taskOutput.toUri();
URI relativePath = taskOutputPath.toUri().relativize(taskOutputUri);
if (taskOutputUri == relativePath) {
throw new IOException("... | [
"private",
"Path",
"getFinalPath",
"(",
"Path",
"jobOutputDir",
",",
"Path",
"taskOutput",
",",
"Path",
"taskOutputPath",
")",
"throws",
"IOException",
"{",
"URI",
"taskOutputUri",
"=",
"taskOutput",
".",
"toUri",
"(",
")",
";",
"URI",
"relativePath",
"=",
"ta... | Find the final name of a given output file, given the job output directory
and the work directory.
@param jobOutputDir the job's output directory
@param taskOutput the specific task output file
@param taskOutputPath the job's work directory
@return the final path for the specific output file
@throws IOException | [
"Find",
"the",
"final",
"name",
"of",
"a",
"given",
"output",
"file",
"given",
"the",
"job",
"output",
"directory",
"and",
"the",
"work",
"directory",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L248-L261 |
118,138 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java | FileOutputCommitter.needsTaskCommit | @Override
public boolean needsTaskCommit(TaskAttemptContext context
) throws IOException {
return workPath != null && outputFileSystem.exists(workPath);
} | java | @Override
public boolean needsTaskCommit(TaskAttemptContext context
) throws IOException {
return workPath != null && outputFileSystem.exists(workPath);
} | [
"@",
"Override",
"public",
"boolean",
"needsTaskCommit",
"(",
"TaskAttemptContext",
"context",
")",
"throws",
"IOException",
"{",
"return",
"workPath",
"!=",
"null",
"&&",
"outputFileSystem",
".",
"exists",
"(",
"workPath",
")",
";",
"}"
] | Did this task write any files in the work directory?
@param context the task's context | [
"Did",
"this",
"task",
"write",
"any",
"files",
"in",
"the",
"work",
"directory?"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java#L267-L271 |
118,139 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.readNameToNode | private void readNameToNode(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("nameToNode");
// Expecting the START_OBJECT token for nameToNode
coronaSerializer.readStartObjectToken("nameToNode");
JsonToken current = coronaSerializer.nextToken();
while (current !... | java | private void readNameToNode(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("nameToNode");
// Expecting the START_OBJECT token for nameToNode
coronaSerializer.readStartObjectToken("nameToNode");
JsonToken current = coronaSerializer.nextToken();
while (current !... | [
"private",
"void",
"readNameToNode",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"nameToNode\"",
")",
";",
"// Expecting the START_OBJECT token for nameToNode",
"coronaSerializer",
".",
"readStar... | Reads the nameToNode map from the JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"nameToNode",
"map",
"from",
"the",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L485-L501 |
118,140 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.readHostsToSessions | private void readHostsToSessions(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("hostsToSessions");
// Expecting the START_OBJECT token for hostsToSessions
coronaSerializer.readStartObjectToken("hostsToSessions");
JsonToken current = coronaSerializer.nextToken();
... | java | private void readHostsToSessions(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("hostsToSessions");
// Expecting the START_OBJECT token for hostsToSessions
coronaSerializer.readStartObjectToken("hostsToSessions");
JsonToken current = coronaSerializer.nextToken();
... | [
"private",
"void",
"readHostsToSessions",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"hostsToSessions\"",
")",
";",
"// Expecting the START_OBJECT token for hostsToSessions",
"coronaSerializer",
"... | Reads the hostsToSessions map from the JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws java.io.IOException | [
"Reads",
"the",
"hostsToSessions",
"map",
"from",
"the",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L509-L522 |
118,141 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.readNameToApps | private void readNameToApps(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("nameToApps");
// Expecting the START_OBJECT token for nameToApps
coronaSerializer.readStartObjectToken("nameToApps");
JsonToken current = coronaSerializer.nextToken();
while (current ... | java | private void readNameToApps(CoronaSerializer coronaSerializer)
throws IOException {
coronaSerializer.readField("nameToApps");
// Expecting the START_OBJECT token for nameToApps
coronaSerializer.readStartObjectToken("nameToApps");
JsonToken current = coronaSerializer.nextToken();
while (current ... | [
"private",
"void",
"readNameToApps",
"(",
"CoronaSerializer",
"coronaSerializer",
")",
"throws",
"IOException",
"{",
"coronaSerializer",
".",
"readField",
"(",
"\"nameToApps\"",
")",
";",
"// Expecting the START_OBJECT token for nameToApps",
"coronaSerializer",
".",
"readStar... | Reads the nameToApps map from the JSON stream
@param coronaSerializer The CoronaSerializer instance to be used to
read the JSON
@throws IOException | [
"Reads",
"the",
"nameToApps",
"map",
"from",
"the",
"JSON",
"stream"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L530-L553 |
118,142 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.existRunnableNodes | public boolean existRunnableNodes(ResourceType type) {
RunnableIndices r = typeToIndices.get(type);
return r.existRunnableNodes();
} | java | public boolean existRunnableNodes(ResourceType type) {
RunnableIndices r = typeToIndices.get(type);
return r.existRunnableNodes();
} | [
"public",
"boolean",
"existRunnableNodes",
"(",
"ResourceType",
"type",
")",
"{",
"RunnableIndices",
"r",
"=",
"typeToIndices",
".",
"get",
"(",
"type",
")",
";",
"return",
"r",
".",
"existRunnableNodes",
"(",
")",
";",
"}"
] | See if there are any runnable nodes of a given type
@param type the type to look for
@return true if there are runnable nodes for this type, false otherwise | [
"See",
"if",
"there",
"are",
"any",
"runnable",
"nodes",
"of",
"a",
"given",
"type"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L560-L563 |
118,143 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getRunnableNode | public ClusterNode getRunnableNode(String host, LocalityLevel maxLevel,
ResourceType type, Set<String> excluded) {
if (host == null) {
RunnableIndices r = typeToIndices.get(type);
return r.getRunnableNodeForAny(excluded);
}
RequestedNode node = resolve(host, type);
return getRunnableNo... | java | public ClusterNode getRunnableNode(String host, LocalityLevel maxLevel,
ResourceType type, Set<String> excluded) {
if (host == null) {
RunnableIndices r = typeToIndices.get(type);
return r.getRunnableNodeForAny(excluded);
}
RequestedNode node = resolve(host, type);
return getRunnableNo... | [
"public",
"ClusterNode",
"getRunnableNode",
"(",
"String",
"host",
",",
"LocalityLevel",
"maxLevel",
",",
"ResourceType",
"type",
",",
"Set",
"<",
"String",
">",
"excluded",
")",
"{",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"RunnableIndices",
"r",
"=",
... | Find the best matching node for this host subject to the maxLevel
constraint
@param host the host of the request
@param maxLevel the max locality level to consider
@param type the type of resource needed on the node
@param excluded the list of nodes to exclude from consideration
@return the runnable node satisfying the... | [
"Find",
"the",
"best",
"matching",
"node",
"for",
"this",
"host",
"subject",
"to",
"the",
"maxLevel",
"constraint"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L583-L591 |
118,144 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getRunnableNode | public ClusterNode getRunnableNode(RequestedNode requestedNode,
LocalityLevel maxLevel,
ResourceType type,
Set<String> excluded) {
ClusterNode node = null;
RunnableIndices r = typeToIndices.get(type);
... | java | public ClusterNode getRunnableNode(RequestedNode requestedNode,
LocalityLevel maxLevel,
ResourceType type,
Set<String> excluded) {
ClusterNode node = null;
RunnableIndices r = typeToIndices.get(type);
... | [
"public",
"ClusterNode",
"getRunnableNode",
"(",
"RequestedNode",
"requestedNode",
",",
"LocalityLevel",
"maxLevel",
",",
"ResourceType",
"type",
",",
"Set",
"<",
"String",
">",
"excluded",
")",
"{",
"ClusterNode",
"node",
"=",
"null",
";",
"RunnableIndices",
"r",... | Get a runnable node.
@param requestedNode The request information.
@param maxLevel The maximum locality level that we can go to.
@param type The type of resource.
@param excluded The excluded nodes.
@return The runnable node that can be used. | [
"Get",
"a",
"runnable",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L601-L624 |
118,145 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.addNode | protected void addNode(ClusterNode node,
Map<ResourceType, String> resourceInfos) {
synchronized (node) {
// 1: primary
nameToNode.put(node.getName(), node);
faultManager.addNode(node.getName(), resourceInfos.keySet());
nameToApps.put(node.getName(), resourceInfos);
... | java | protected void addNode(ClusterNode node,
Map<ResourceType, String> resourceInfos) {
synchronized (node) {
// 1: primary
nameToNode.put(node.getName(), node);
faultManager.addNode(node.getName(), resourceInfos.keySet());
nameToApps.put(node.getName(), resourceInfos);
... | [
"protected",
"void",
"addNode",
"(",
"ClusterNode",
"node",
",",
"Map",
"<",
"ResourceType",
",",
"String",
">",
"resourceInfos",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"// 1: primary",
"nameToNode",
".",
"put",
"(",
"node",
".",
"getName",
"(",
... | Add a node to be managed.
@param node Node to be managed
@param resourceInfos Mapping of the resource type to runnable indices | [
"Add",
"a",
"node",
"to",
"be",
"managed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L632-L656 |
118,146 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.updateRunnability | private void updateRunnability(ClusterNode node) {
synchronized (node) {
for (Map.Entry<ResourceType, RunnableIndices> entry :
typeToIndices.entrySet()) {
ResourceType type = entry.getKey();
RunnableIndices r = entry.getValue();
ResourceRequest unitReq = Utilities.getUnitResour... | java | private void updateRunnability(ClusterNode node) {
synchronized (node) {
for (Map.Entry<ResourceType, RunnableIndices> entry :
typeToIndices.entrySet()) {
ResourceType type = entry.getKey();
RunnableIndices r = entry.getValue();
ResourceRequest unitReq = Utilities.getUnitResour... | [
"private",
"void",
"updateRunnability",
"(",
"ClusterNode",
"node",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"ResourceType",
",",
"RunnableIndices",
">",
"entry",
":",
"typeToIndices",
".",
"entrySet",
"(",
")",
... | Update the runnable status of a node based on resources available.
This checks both resources and slot availability.
@param node The node | [
"Update",
"the",
"runnable",
"status",
"of",
"a",
"node",
"based",
"on",
"resources",
"available",
".",
"This",
"checks",
"both",
"resources",
"and",
"slot",
"availability",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L663-L682 |
118,147 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.addAppToNode | protected void addAppToNode(
ClusterNode node, ResourceType type, String appInfo) {
synchronized (node) {
// Update primary index.
Map<ResourceType, String> apps = nameToApps.get(node.getName());
apps.put(type, appInfo);
// Update runnable indices.
for (Map.Entry<ResourceType, R... | java | protected void addAppToNode(
ClusterNode node, ResourceType type, String appInfo) {
synchronized (node) {
// Update primary index.
Map<ResourceType, String> apps = nameToApps.get(node.getName());
apps.put(type, appInfo);
// Update runnable indices.
for (Map.Entry<ResourceType, R... | [
"protected",
"void",
"addAppToNode",
"(",
"ClusterNode",
"node",
",",
"ResourceType",
"type",
",",
"String",
"appInfo",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"// Update primary index.",
"Map",
"<",
"ResourceType",
",",
"String",
">",
"apps",
"=",
"n... | Register a new application on the node
@param node the node to register on
@param type the type of an application
@param appInfo the appInfo string for the application | [
"Register",
"a",
"new",
"application",
"on",
"the",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L690-L709 |
118,148 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getNodeSessions | public Set<String> getNodeSessions(String nodeName) {
ClusterNode node = nameToNode.get(nodeName);
if (node == null) {
LOG.warn("Trying to get the sessions for a non-existent node " +
nodeName);
return new HashSet<String>();
}
synchronized (node) {
return new HashSet<String>(ho... | java | public Set<String> getNodeSessions(String nodeName) {
ClusterNode node = nameToNode.get(nodeName);
if (node == null) {
LOG.warn("Trying to get the sessions for a non-existent node " +
nodeName);
return new HashSet<String>();
}
synchronized (node) {
return new HashSet<String>(ho... | [
"public",
"Set",
"<",
"String",
">",
"getNodeSessions",
"(",
"String",
"nodeName",
")",
"{",
"ClusterNode",
"node",
"=",
"nameToNode",
".",
"get",
"(",
"nodeName",
")",
";",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Trying ... | Get all the sessions that have grants on the node
@param nodeName the name of the node
@return the set of session ids that are running on the node | [
"Get",
"all",
"the",
"sessions",
"that",
"have",
"grants",
"on",
"the",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L716-L726 |
118,149 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.deleteSession | public void deleteSession(String session) {
for (Set<String> sessions : hostsToSessions.values()) {
sessions.remove(session);
}
} | java | public void deleteSession(String session) {
for (Set<String> sessions : hostsToSessions.values()) {
sessions.remove(session);
}
} | [
"public",
"void",
"deleteSession",
"(",
"String",
"session",
")",
"{",
"for",
"(",
"Set",
"<",
"String",
">",
"sessions",
":",
"hostsToSessions",
".",
"values",
"(",
")",
")",
"{",
"sessions",
".",
"remove",
"(",
"session",
")",
";",
"}",
"}"
] | Remove the references to the session
@param session the session to be deleted | [
"Remove",
"the",
"references",
"to",
"the",
"session"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L732-L736 |
118,150 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.cancelGrant | public void cancelGrant(String nodeName, String sessionId, int requestId) {
ClusterNode node = nameToNode.get(nodeName);
if (node == null) {
LOG.warn("Canceling grant for non-existent node: " + nodeName);
return;
}
synchronized (node) {
if (node.deleted) {
LOG.warn("Canceling g... | java | public void cancelGrant(String nodeName, String sessionId, int requestId) {
ClusterNode node = nameToNode.get(nodeName);
if (node == null) {
LOG.warn("Canceling grant for non-existent node: " + nodeName);
return;
}
synchronized (node) {
if (node.deleted) {
LOG.warn("Canceling g... | [
"public",
"void",
"cancelGrant",
"(",
"String",
"nodeName",
",",
"String",
"sessionId",
",",
"int",
"requestId",
")",
"{",
"ClusterNode",
"node",
"=",
"nameToNode",
".",
"get",
"(",
"nodeName",
")",
";",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"LOG",
... | Cancel grant on a node
@param nodeName the node the grant is on
@param sessionId the session the grant was given to
@param requestId the request this grant satisfied | [
"Cancel",
"grant",
"on",
"a",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L826-L857 |
118,151 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.addGrant | public boolean addGrant(
ClusterNode node, String sessionId, ResourceRequestInfo req) {
synchronized (node) {
if (node.deleted) {
return false;
}
if (!node.checkForGrant(Utilities.getUnitResourceRequest(
req.getType()), resourceLimit)) {
return false;
}
n... | java | public boolean addGrant(
ClusterNode node, String sessionId, ResourceRequestInfo req) {
synchronized (node) {
if (node.deleted) {
return false;
}
if (!node.checkForGrant(Utilities.getUnitResourceRequest(
req.getType()), resourceLimit)) {
return false;
}
n... | [
"public",
"boolean",
"addGrant",
"(",
"ClusterNode",
"node",
",",
"String",
"sessionId",
",",
"ResourceRequestInfo",
"req",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"deleted",
")",
"{",
"return",
"false",
";",
"}",
"if",
"... | Add a grant to a node
@param node the node the grant is on
@param sessionId the session the grant is given to
@param req the request this grant satisfies
@return true if the grant can be added to the node, false otherwise | [
"Add",
"a",
"grant",
"to",
"a",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L866-L887 |
118,152 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.restoreAfterSafeModeRestart | public void restoreAfterSafeModeRestart() throws IOException {
if (!clusterManager.safeMode) {
throw new IOException("restoreAfterSafeModeRestart() called while the " +
"Cluster Manager was not in Safe Mode");
}
// Restoring all the ClusterNode(s)
for (ClusterNode clusterNode : nameToNode.... | java | public void restoreAfterSafeModeRestart() throws IOException {
if (!clusterManager.safeMode) {
throw new IOException("restoreAfterSafeModeRestart() called while the " +
"Cluster Manager was not in Safe Mode");
}
// Restoring all the ClusterNode(s)
for (ClusterNode clusterNode : nameToNode.... | [
"public",
"void",
"restoreAfterSafeModeRestart",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"clusterManager",
".",
"safeMode",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"restoreAfterSafeModeRestart() called while the \"",
"+",
"\"Cluster Manager was not... | This method rebuilds members related to the NodeManager instance, which
were not directly persisted themselves.
@throws IOException | [
"This",
"method",
"rebuilds",
"members",
"related",
"to",
"the",
"NodeManager",
"instance",
"which",
"were",
"not",
"directly",
"persisted",
"themselves",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L919-L938 |
118,153 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.restoreResourceRequestInfo | public void restoreResourceRequestInfo(ResourceRequestInfo
resourceRequestInfo) {
List<RequestedNode> requestedNodes = null;
List<String> hosts = resourceRequestInfo.getHosts();
if (hosts != null && hosts.size() > 0) {
requestedNodes = new ArrayList<Requested... | java | public void restoreResourceRequestInfo(ResourceRequestInfo
resourceRequestInfo) {
List<RequestedNode> requestedNodes = null;
List<String> hosts = resourceRequestInfo.getHosts();
if (hosts != null && hosts.size() > 0) {
requestedNodes = new ArrayList<Requested... | [
"public",
"void",
"restoreResourceRequestInfo",
"(",
"ResourceRequestInfo",
"resourceRequestInfo",
")",
"{",
"List",
"<",
"RequestedNode",
">",
"requestedNodes",
"=",
"null",
";",
"List",
"<",
"String",
">",
"hosts",
"=",
"resourceRequestInfo",
".",
"getHosts",
"(",... | This method rebuilds members related to a ResourceRequestInfo instance,
which were not directly persisted themselves.
@param resourceRequestInfo The ResourceRequestInfo instance to be restored | [
"This",
"method",
"rebuilds",
"members",
"related",
"to",
"a",
"ResourceRequestInfo",
"instance",
"which",
"were",
"not",
"directly",
"persisted",
"themselves",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L945-L956 |
118,154 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.heartbeat | public boolean heartbeat(ClusterNodeInfo clusterNodeInfo)
throws DisallowedNode {
ClusterNode node = nameToNode.get(clusterNodeInfo.name);
if (!canAllowNode(clusterNodeInfo.getAddress().getHost())) {
if (node != null) {
node.heartbeat(clusterNodeInfo);
} else {
throw new Disallow... | java | public boolean heartbeat(ClusterNodeInfo clusterNodeInfo)
throws DisallowedNode {
ClusterNode node = nameToNode.get(clusterNodeInfo.name);
if (!canAllowNode(clusterNodeInfo.getAddress().getHost())) {
if (node != null) {
node.heartbeat(clusterNodeInfo);
} else {
throw new Disallow... | [
"public",
"boolean",
"heartbeat",
"(",
"ClusterNodeInfo",
"clusterNodeInfo",
")",
"throws",
"DisallowedNode",
"{",
"ClusterNode",
"node",
"=",
"nameToNode",
".",
"get",
"(",
"clusterNodeInfo",
".",
"name",
")",
";",
"if",
"(",
"!",
"canAllowNode",
"(",
"clusterN... | return true if a new node has been added - else return false
@param clusterNodeInfo the node that is heartbeating
@return true if this is a new node that has been added, false otherwise | [
"return",
"true",
"if",
"a",
"new",
"node",
"has",
"been",
"added",
"-",
"else",
"return",
"false"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L976-L1045 |
118,155 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getAppInfo | public String getAppInfo(ClusterNode node, ResourceType type) {
Map<ResourceType, String> resourceInfos = nameToApps.get(node.getName());
if (resourceInfos == null) {
return null;
} else {
return resourceInfos.get(type);
}
} | java | public String getAppInfo(ClusterNode node, ResourceType type) {
Map<ResourceType, String> resourceInfos = nameToApps.get(node.getName());
if (resourceInfos == null) {
return null;
} else {
return resourceInfos.get(type);
}
} | [
"public",
"String",
"getAppInfo",
"(",
"ClusterNode",
"node",
",",
"ResourceType",
"type",
")",
"{",
"Map",
"<",
"ResourceType",
",",
"String",
">",
"resourceInfos",
"=",
"nameToApps",
".",
"get",
"(",
"node",
".",
"getName",
"(",
")",
")",
";",
"if",
"(... | Get information about applications running on a node.
@param node The node.
@param type The type of resources.
@return The application-specific information | [
"Get",
"information",
"about",
"applications",
"running",
"on",
"a",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1053-L1060 |
118,156 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getAllocatedCpuForType | public int getAllocatedCpuForType(ResourceType type) {
int total = 0;
for (ClusterNode node: nameToNode.values()) {
synchronized (node) {
if (node.deleted) {
continue;
}
total += node.getAllocatedCpuForType(type);
}
}
return total;
} | java | public int getAllocatedCpuForType(ResourceType type) {
int total = 0;
for (ClusterNode node: nameToNode.values()) {
synchronized (node) {
if (node.deleted) {
continue;
}
total += node.getAllocatedCpuForType(type);
}
}
return total;
} | [
"public",
"int",
"getAllocatedCpuForType",
"(",
"ResourceType",
"type",
")",
"{",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"ClusterNode",
"node",
":",
"nameToNode",
".",
"values",
"(",
")",
")",
"{",
"synchronized",
"(",
"node",
")",
"{",
"if",
"(",
... | Find allocation for a resource type.
@param type The resource type.
@return The allocation. | [
"Find",
"allocation",
"for",
"a",
"resource",
"type",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1137-L1149 |
118,157 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.getFreeNodesForType | public List<String> getFreeNodesForType(ResourceType type) {
ArrayList<String> freeNodes = new ArrayList<String>();
for (Map.Entry<String, ClusterNode> entry: nameToNode.entrySet()) {
ClusterNode node = entry.getValue();
synchronized (node) {
if (!node.deleted &&
node.getMaxCpuFo... | java | public List<String> getFreeNodesForType(ResourceType type) {
ArrayList<String> freeNodes = new ArrayList<String>();
for (Map.Entry<String, ClusterNode> entry: nameToNode.entrySet()) {
ClusterNode node = entry.getValue();
synchronized (node) {
if (!node.deleted &&
node.getMaxCpuFo... | [
"public",
"List",
"<",
"String",
">",
"getFreeNodesForType",
"(",
"ResourceType",
"type",
")",
"{",
"ArrayList",
"<",
"String",
">",
"freeNodes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
... | Get a list nodes with free Cpu for a resource type | [
"Get",
"a",
"list",
"nodes",
"with",
"free",
"Cpu",
"for",
"a",
"resource",
"type"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1154-L1166 |
118,158 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.nodeFeedback | public void nodeFeedback(
String handle,
List<ResourceType> resourceTypes,
List<NodeUsageReport> reportList) {
// Iterate over each report.
for (NodeUsageReport usageReport : reportList) {
faultManager.nodeFeedback(usageReport.getNodeName(), resourceTypes,
usageReport);
}
... | java | public void nodeFeedback(
String handle,
List<ResourceType> resourceTypes,
List<NodeUsageReport> reportList) {
// Iterate over each report.
for (NodeUsageReport usageReport : reportList) {
faultManager.nodeFeedback(usageReport.getNodeName(), resourceTypes,
usageReport);
}
... | [
"public",
"void",
"nodeFeedback",
"(",
"String",
"handle",
",",
"List",
"<",
"ResourceType",
">",
"resourceTypes",
",",
"List",
"<",
"NodeUsageReport",
">",
"reportList",
")",
"{",
"// Iterate over each report.",
"for",
"(",
"NodeUsageReport",
"usageReport",
":",
... | Process feedback about nodes.
@param handle The session handle.
@param resourceTypes The types of resource this feedback is about.
@param reportList The list of reports. | [
"Process",
"feedback",
"about",
"nodes",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1266-L1275 |
118,159 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.blacklistNode | void blacklistNode(String nodeName, ResourceType resourceType) {
LOG.info("Node " + nodeName + " has been blacklisted for resource " +
resourceType);
clusterManager.getMetrics().setBlacklistedNodes(
faultManager.getBlacklistedNodeCount());
deleteAppFromNode(nodeName, resourceType);
} | java | void blacklistNode(String nodeName, ResourceType resourceType) {
LOG.info("Node " + nodeName + " has been blacklisted for resource " +
resourceType);
clusterManager.getMetrics().setBlacklistedNodes(
faultManager.getBlacklistedNodeCount());
deleteAppFromNode(nodeName, resourceType);
} | [
"void",
"blacklistNode",
"(",
"String",
"nodeName",
",",
"ResourceType",
"resourceType",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Node \"",
"+",
"nodeName",
"+",
"\" has been blacklisted for resource \"",
"+",
"resourceType",
")",
";",
"clusterManager",
".",
"getMetric... | Blacklist a resource on a node.
@param nodeName The node name
@param resourceType The resource type. | [
"Blacklist",
"a",
"resource",
"on",
"a",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1282-L1288 |
118,160 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.resolve | public RequestedNode resolve(String host, ResourceType type) {
RunnableIndices indices = typeToIndices.get(type);
return indices.getOrCreateRequestedNode(host);
} | java | public RequestedNode resolve(String host, ResourceType type) {
RunnableIndices indices = typeToIndices.get(type);
return indices.getOrCreateRequestedNode(host);
} | [
"public",
"RequestedNode",
"resolve",
"(",
"String",
"host",
",",
"ResourceType",
"type",
")",
"{",
"RunnableIndices",
"indices",
"=",
"typeToIndices",
".",
"get",
"(",
"type",
")",
";",
"return",
"indices",
".",
"getOrCreateRequestedNode",
"(",
"host",
")",
"... | Resolve a host name.
@param host The host.
@param type The resource type.
@return The resolved form. | [
"Resolve",
"a",
"host",
"name",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1319-L1322 |
118,161 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.resetNodesLastHeartbeatTime | public void resetNodesLastHeartbeatTime() {
long now = ClusterManager.clock.getTime();
for (ClusterNode node : nameToNode.values()) {
node.lastHeartbeatTime = now;
}
} | java | public void resetNodesLastHeartbeatTime() {
long now = ClusterManager.clock.getTime();
for (ClusterNode node : nameToNode.values()) {
node.lastHeartbeatTime = now;
}
} | [
"public",
"void",
"resetNodesLastHeartbeatTime",
"(",
")",
"{",
"long",
"now",
"=",
"ClusterManager",
".",
"clock",
".",
"getTime",
"(",
")",
";",
"for",
"(",
"ClusterNode",
"node",
":",
"nameToNode",
".",
"values",
"(",
")",
")",
"{",
"node",
".",
"last... | This is required when we come out of safe mode, and we need to reset
the lastHeartbeatTime for each node | [
"This",
"is",
"required",
"when",
"we",
"come",
"out",
"of",
"safe",
"mode",
"and",
"we",
"need",
"to",
"reset",
"the",
"lastHeartbeatTime",
"for",
"each",
"node"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1332-L1337 |
118,162 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java | NodeManager.write | public void write(JsonGenerator jsonGenerator) throws IOException {
jsonGenerator.writeStartObject();
// nameToNode begins
jsonGenerator.writeFieldName("nameToNode");
jsonGenerator.writeStartObject();
for (Map.Entry<String, ClusterNode> entry : nameToNode.entrySet()) {
jsonGenerator.writeFiel... | java | public void write(JsonGenerator jsonGenerator) throws IOException {
jsonGenerator.writeStartObject();
// nameToNode begins
jsonGenerator.writeFieldName("nameToNode");
jsonGenerator.writeStartObject();
for (Map.Entry<String, ClusterNode> entry : nameToNode.entrySet()) {
jsonGenerator.writeFiel... | [
"public",
"void",
"write",
"(",
"JsonGenerator",
"jsonGenerator",
")",
"throws",
"IOException",
"{",
"jsonGenerator",
".",
"writeStartObject",
"(",
")",
";",
"// nameToNode begins",
"jsonGenerator",
".",
"writeFieldName",
"(",
"\"nameToNode\"",
")",
";",
"jsonGenerato... | This method writes the state of the NodeManager to disk
@param jsonGenerator The instance of JsonGenerator, which will be used to
write JSON to disk
@throws IOException | [
"This",
"method",
"writes",
"the",
"state",
"of",
"the",
"NodeManager",
"to",
"disk"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/NodeManager.java#L1345-L1379 |
118,163 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/protocol/ReceivedBlockInfo.java | ReceivedBlockInfo.setDelHints | public void setDelHints(String delHints) {
if (delHints == null || delHints.isEmpty()) {
throw new IllegalArgumentException("DelHints is empty");
}
this.delHints = delHints;
} | java | public void setDelHints(String delHints) {
if (delHints == null || delHints.isEmpty()) {
throw new IllegalArgumentException("DelHints is empty");
}
this.delHints = delHints;
} | [
"public",
"void",
"setDelHints",
"(",
"String",
"delHints",
")",
"{",
"if",
"(",
"delHints",
"==",
"null",
"||",
"delHints",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"DelHints is empty\"",
")",
";",
"}",
"this",
... | Set this block's delHints
@param delHints | [
"Set",
"this",
"block",
"s",
"delHints"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/protocol/ReceivedBlockInfo.java#L56-L61 |
118,164 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/pipes/PipesMapRunner.java | PipesMapRunner.run | @SuppressWarnings("unchecked")
public void run(RecordReader<K1, V1> input, OutputCollector<K2, V2> output,
Reporter reporter) throws IOException {
Application<K1, V1, K2, V2> application = null;
try {
RecordReader<FloatWritable, NullWritable> fakeInput =
(!Submitter.getIsJavaR... | java | @SuppressWarnings("unchecked")
public void run(RecordReader<K1, V1> input, OutputCollector<K2, V2> output,
Reporter reporter) throws IOException {
Application<K1, V1, K2, V2> application = null;
try {
RecordReader<FloatWritable, NullWritable> fakeInput =
(!Submitter.getIsJavaR... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"run",
"(",
"RecordReader",
"<",
"K1",
",",
"V1",
">",
"input",
",",
"OutputCollector",
"<",
"K2",
",",
"V2",
">",
"output",
",",
"Reporter",
"reporter",
")",
"throws",
"IOException",
"{... | Run the map task.
@param input the set of inputs
@param output the object to collect the outputs of the map
@param reporter the object to update with status | [
"Run",
"the",
"map",
"task",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/PipesMapRunner.java#L59-L105 |
118,165 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java | DFSck.printUsage | static void printUsage() {
System.err.println("Usage: DFSck <path> [-list-corruptfileblocks | " +
"[-move | -delete | -openforwrite ] " +
"[-files [-blocks [-locations | -racks]]]] " +
"[-limit <limit>] [-service serviceName]" +
... | java | static void printUsage() {
System.err.println("Usage: DFSck <path> [-list-corruptfileblocks | " +
"[-move | -delete | -openforwrite ] " +
"[-files [-blocks [-locations | -racks]]]] " +
"[-limit <limit>] [-service serviceName]" +
... | [
"static",
"void",
"printUsage",
"(",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Usage: DFSck <path> [-list-corruptfileblocks | \"",
"+",
"\"[-move | -delete | -openforwrite ] \"",
"+",
"\"[-files [-blocks [-locations | -racks]]]] \"",
"+",
"\"[-limit <limit>] [-servi... | Print fsck usage information | [
"Print",
"fsck",
"usage",
"information"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java#L94-L117 |
118,166 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java | DFSck.listCorruptFileBlocks | private Integer listCorruptFileBlocks(String dir, int limit, String baseUrl)
throws IOException {
int errCode = -1;
int numCorrupt = 0;
int cookie = 0;
String lastBlock = null;
final String noCorruptLine = "has no CORRUPT files";
final String noMoreCorruptLine = "has no more CORRUPT files";
... | java | private Integer listCorruptFileBlocks(String dir, int limit, String baseUrl)
throws IOException {
int errCode = -1;
int numCorrupt = 0;
int cookie = 0;
String lastBlock = null;
final String noCorruptLine = "has no CORRUPT files";
final String noMoreCorruptLine = "has no more CORRUPT files";
... | [
"private",
"Integer",
"listCorruptFileBlocks",
"(",
"String",
"dir",
",",
"int",
"limit",
",",
"String",
"baseUrl",
")",
"throws",
"IOException",
"{",
"int",
"errCode",
"=",
"-",
"1",
";",
"int",
"numCorrupt",
"=",
"0",
";",
"int",
"cookie",
"=",
"0",
";... | To get the list, we need to call iteratively until the server says
there is no more left. | [
"To",
"get",
"the",
"list",
"we",
"need",
"to",
"call",
"iteratively",
"until",
"the",
"server",
"says",
"there",
"is",
"no",
"more",
"left",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java#L123-L194 |
118,167 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java | DFSck.updateConfKeys | private static void updateConfKeys(Configuration conf, String suffix,
String nameserviceId) {
String value = conf.get(FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY + suffix
+ (nameserviceId.isEmpty() ? "" : ("." + nameserviceId)));
if (value != null) {
conf.set(FSConstants.DFS_NAMENODE_HTTP_ADDR... | java | private static void updateConfKeys(Configuration conf, String suffix,
String nameserviceId) {
String value = conf.get(FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY + suffix
+ (nameserviceId.isEmpty() ? "" : ("." + nameserviceId)));
if (value != null) {
conf.set(FSConstants.DFS_NAMENODE_HTTP_ADDR... | [
"private",
"static",
"void",
"updateConfKeys",
"(",
"Configuration",
"conf",
",",
"String",
"suffix",
",",
"String",
"nameserviceId",
")",
"{",
"String",
"value",
"=",
"conf",
".",
"get",
"(",
"FSConstants",
".",
"DFS_NAMENODE_HTTP_ADDRESS_KEY",
"+",
"suffix",
"... | For federated and avatar clusters, we need update the http key. | [
"For",
"federated",
"and",
"avatar",
"clusters",
"we",
"need",
"update",
"the",
"http",
"key",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java#L334-L341 |
118,168 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java | DFSck.optionExist | private static boolean optionExist(String args[], String opt) {
for (String arg : args) {
if (arg.equalsIgnoreCase(opt)) {
return true;
}
}
return false;
} | java | private static boolean optionExist(String args[], String opt) {
for (String arg : args) {
if (arg.equalsIgnoreCase(opt)) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"optionExist",
"(",
"String",
"args",
"[",
"]",
",",
"String",
"opt",
")",
"{",
"for",
"(",
"String",
"arg",
":",
"args",
")",
"{",
"if",
"(",
"arg",
".",
"equalsIgnoreCase",
"(",
"opt",
")",
")",
"{",
"return",
"true"... | Check if the option exist in the given arguments. | [
"Check",
"if",
"the",
"option",
"exist",
"in",
"the",
"given",
"arguments",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSck.java#L346-L353 |
118,169 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/hash/Hash.java | Hash.parseHashType | public static int parseHashType(String name) {
if ("jenkins".equalsIgnoreCase(name)) {
return JENKINS_HASH;
} else if ("murmur".equalsIgnoreCase(name)) {
return MURMUR_HASH;
} else {
return INVALID_HASH;
}
} | java | public static int parseHashType(String name) {
if ("jenkins".equalsIgnoreCase(name)) {
return JENKINS_HASH;
} else if ("murmur".equalsIgnoreCase(name)) {
return MURMUR_HASH;
} else {
return INVALID_HASH;
}
} | [
"public",
"static",
"int",
"parseHashType",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"\"jenkins\"",
".",
"equalsIgnoreCase",
"(",
"name",
")",
")",
"{",
"return",
"JENKINS_HASH",
";",
"}",
"else",
"if",
"(",
"\"murmur\"",
".",
"equalsIgnoreCase",
"(",
"... | This utility method converts String representation of hash function name
to a symbolic constant. Currently two function types are supported,
"jenkins" and "murmur".
@param name hash function name
@return one of the predefined constants | [
"This",
"utility",
"method",
"converts",
"String",
"representation",
"of",
"hash",
"function",
"name",
"to",
"a",
"symbolic",
"constant",
".",
"Currently",
"two",
"function",
"types",
"are",
"supported",
"jenkins",
"and",
"murmur",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/hash/Hash.java#L41-L49 |
118,170 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/hash/Hash.java | Hash.getInstance | public static Hash getInstance(int type) {
switch(type) {
case JENKINS_HASH:
return JenkinsHash.getInstance();
case MURMUR_HASH:
return MurmurHash.getInstance();
default:
return null;
}
} | java | public static Hash getInstance(int type) {
switch(type) {
case JENKINS_HASH:
return JenkinsHash.getInstance();
case MURMUR_HASH:
return MurmurHash.getInstance();
default:
return null;
}
} | [
"public",
"static",
"Hash",
"getInstance",
"(",
"int",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"JENKINS_HASH",
":",
"return",
"JenkinsHash",
".",
"getInstance",
"(",
")",
";",
"case",
"MURMUR_HASH",
":",
"return",
"MurmurHash",
".",
"get... | Get a singleton instance of hash function of a given type.
@param type predefined hash type
@return hash function instance, or null if type is invalid | [
"Get",
"a",
"singleton",
"instance",
"of",
"hash",
"function",
"of",
"a",
"given",
"type",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/hash/Hash.java#L67-L76 |
118,171 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java | NotifierUtils.getVersion | public static int getVersion(URI editsURI) throws IOException {
if (editsURI.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) {
StorageDirectory sd = new NNStorage(new StorageInfo()).new StorageDirectory(
new File(editsURI.getPath()));
File versionFile = sd.getVersionFile();
if (!versionF... | java | public static int getVersion(URI editsURI) throws IOException {
if (editsURI.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) {
StorageDirectory sd = new NNStorage(new StorageInfo()).new StorageDirectory(
new File(editsURI.getPath()));
File versionFile = sd.getVersionFile();
if (!versionF... | [
"public",
"static",
"int",
"getVersion",
"(",
"URI",
"editsURI",
")",
"throws",
"IOException",
"{",
"if",
"(",
"editsURI",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"NNStorage",
".",
"LOCAL_URI_SCHEME",
")",
")",
"{",
"StorageDirectory",
"sd",
"=",
"... | Read version file from the given directory and return
the layout stored therein. | [
"Read",
"version",
"file",
"from",
"the",
"given",
"directory",
"and",
"return",
"the",
"layout",
"stored",
"therein",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java#L41-L58 |
118,172 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java | NotifierUtils.uriToFile | public static File uriToFile(URI u) throws IOException {
if (!u.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) {
throw new IOException("URI does not represent a file");
}
return new File(u.getPath());
} | java | public static File uriToFile(URI u) throws IOException {
if (!u.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) {
throw new IOException("URI does not represent a file");
}
return new File(u.getPath());
} | [
"public",
"static",
"File",
"uriToFile",
"(",
"URI",
"u",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"u",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"NNStorage",
".",
"LOCAL_URI_SCHEME",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"... | Get file associated with the given URI | [
"Get",
"file",
"associated",
"with",
"the",
"given",
"URI"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java#L63-L68 |
118,173 | facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java | NotifierUtils.getAllAncestors | public static List<String> getAllAncestors(String eventPath) {
// check if the path is valid.
if (eventPath == null || !eventPath.startsWith(Path.SEPARATOR)) {
return null;
}
if (eventPath.equals(Path.SEPARATOR)) {
return Arrays.asList(Path.SEPARATOR);
}
List<String> ancest... | java | public static List<String> getAllAncestors(String eventPath) {
// check if the path is valid.
if (eventPath == null || !eventPath.startsWith(Path.SEPARATOR)) {
return null;
}
if (eventPath.equals(Path.SEPARATOR)) {
return Arrays.asList(Path.SEPARATOR);
}
List<String> ancest... | [
"public",
"static",
"List",
"<",
"String",
">",
"getAllAncestors",
"(",
"String",
"eventPath",
")",
"{",
"// check if the path is valid.",
"if",
"(",
"eventPath",
"==",
"null",
"||",
"!",
"eventPath",
".",
"startsWith",
"(",
"Path",
".",
"SEPARATOR",
")",
")",... | return all the ancestors of the given path, include itself.
@param eventPath
@return | [
"return",
"all",
"the",
"ancestors",
"of",
"the",
"given",
"path",
"include",
"itself",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/NotifierUtils.java#L110-L129 |
118,174 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/jobcontrol/JobControl.java | JobControl.addJob | synchronized public String addJob(Job aJob) {
String id = this.getNextJobID();
aJob.setJobID(id);
aJob.setState(Job.WAITING);
this.addToQueue(aJob);
return id;
} | java | synchronized public String addJob(Job aJob) {
String id = this.getNextJobID();
aJob.setJobID(id);
aJob.setState(Job.WAITING);
this.addToQueue(aJob);
return id;
} | [
"synchronized",
"public",
"String",
"addJob",
"(",
"Job",
"aJob",
")",
"{",
"String",
"id",
"=",
"this",
".",
"getNextJobID",
"(",
")",
";",
"aJob",
".",
"setJobID",
"(",
"id",
")",
";",
"aJob",
".",
"setState",
"(",
"Job",
".",
"WAITING",
")",
";",
... | Add a new job.
@param aJob the new job | [
"Add",
"a",
"new",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/jobcontrol/JobControl.java#L153-L159 |
118,175 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java | DataBlockScanner.updateBlockInfo | private synchronized void updateBlockInfo(LogEntry e) {
BlockScanInfo info = blockMap.get(new Block(e.blockId, 0, e.genStamp));
if(info != null && e.verificationTime > 0 &&
info.lastScanTime < e.verificationTime) {
delBlockInfo(info);
info.lastScanTime = e.verificationTime;
info.... | java | private synchronized void updateBlockInfo(LogEntry e) {
BlockScanInfo info = blockMap.get(new Block(e.blockId, 0, e.genStamp));
if(info != null && e.verificationTime > 0 &&
info.lastScanTime < e.verificationTime) {
delBlockInfo(info);
info.lastScanTime = e.verificationTime;
info.... | [
"private",
"synchronized",
"void",
"updateBlockInfo",
"(",
"LogEntry",
"e",
")",
"{",
"BlockScanInfo",
"info",
"=",
"blockMap",
".",
"get",
"(",
"new",
"Block",
"(",
"e",
".",
"blockId",
",",
"0",
",",
"e",
".",
"genStamp",
")",
")",
";",
"if",
"(",
... | Update blockMap by the given LogEntry | [
"Update",
"blockMap",
"by",
"the",
"given",
"LogEntry"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java#L212-L222 |
118,176 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java | DataBlockScanner.addBlock | synchronized void addBlock(Block block) {
if (!isInitialized()) {
return;
}
BlockScanInfo info = blockMap.get(block);
if ( info != null ) {
LOG.warn("Adding an already existing block " + block);
delBlockInfo(info);
}
info = new BlockScanInfo(block);
info.lastS... | java | synchronized void addBlock(Block block) {
if (!isInitialized()) {
return;
}
BlockScanInfo info = blockMap.get(block);
if ( info != null ) {
LOG.warn("Adding an already existing block " + block);
delBlockInfo(info);
}
info = new BlockScanInfo(block);
info.lastS... | [
"synchronized",
"void",
"addBlock",
"(",
"Block",
"block",
")",
"{",
"if",
"(",
"!",
"isInitialized",
"(",
")",
")",
"{",
"return",
";",
"}",
"BlockScanInfo",
"info",
"=",
"blockMap",
".",
"get",
"(",
"block",
")",
";",
"if",
"(",
"info",
"!=",
"null... | Adds block to list of blocks | [
"Adds",
"block",
"to",
"list",
"of",
"blocks"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java#L282-L298 |
118,177 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java | DataBlockScanner.deleteBlock | synchronized void deleteBlock(Block block) {
if (!isInitialized()) {
return;
}
BlockScanInfo info = blockMap.get(block);
if ( info != null ) {
delBlockInfo(info);
}
} | java | synchronized void deleteBlock(Block block) {
if (!isInitialized()) {
return;
}
BlockScanInfo info = blockMap.get(block);
if ( info != null ) {
delBlockInfo(info);
}
} | [
"synchronized",
"void",
"deleteBlock",
"(",
"Block",
"block",
")",
"{",
"if",
"(",
"!",
"isInitialized",
"(",
")",
")",
"{",
"return",
";",
"}",
"BlockScanInfo",
"info",
"=",
"blockMap",
".",
"get",
"(",
"block",
")",
";",
"if",
"(",
"info",
"!=",
"n... | Deletes the block from internal structures | [
"Deletes",
"the",
"block",
"from",
"internal",
"structures"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java#L301-L309 |
118,178 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java | DataBlockScanner.verifyFirstBlock | private void verifyFirstBlock() {
BlockScanInfo block = null;
synchronized (this) {
if ( blockInfoSet.size() > 0 ) {
block = blockInfoSet.first();
}
}
if ( block != null ) {
verifyBlock(block);
processedBlocks.add(block.block.getBlockId());
}
} | java | private void verifyFirstBlock() {
BlockScanInfo block = null;
synchronized (this) {
if ( blockInfoSet.size() > 0 ) {
block = blockInfoSet.first();
}
}
if ( block != null ) {
verifyBlock(block);
processedBlocks.add(block.block.getBlockId());
}
} | [
"private",
"void",
"verifyFirstBlock",
"(",
")",
"{",
"BlockScanInfo",
"block",
"=",
"null",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"blockInfoSet",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"block",
"=",
"blockInfoSet",
".",
"first",
"... | Picks one block and verifies it | [
"Picks",
"one",
"block",
"and",
"verifies",
"it"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java#L555-L567 |
118,179 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.checkSrcPath | private static void checkSrcPath(Configuration conf, List<Path> srcPaths
) throws IOException {
List<IOException> rslt = new ArrayList<IOException>();
List<Path> unglobbed = new LinkedList<Path>();
for (Path p : srcPaths) {
FileSystem fs = p.getFileSystem(conf);
FileStatus[] inputs = fs.gl... | java | private static void checkSrcPath(Configuration conf, List<Path> srcPaths
) throws IOException {
List<IOException> rslt = new ArrayList<IOException>();
List<Path> unglobbed = new LinkedList<Path>();
for (Path p : srcPaths) {
FileSystem fs = p.getFileSystem(conf);
FileStatus[] inputs = fs.gl... | [
"private",
"static",
"void",
"checkSrcPath",
"(",
"Configuration",
"conf",
",",
"List",
"<",
"Path",
">",
"srcPaths",
")",
"throws",
"IOException",
"{",
"List",
"<",
"IOException",
">",
"rslt",
"=",
"new",
"ArrayList",
"<",
"IOException",
">",
"(",
")",
";... | Sanity check for srcPath | [
"Sanity",
"check",
"for",
"srcPath"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L1289-L1310 |
118,180 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.getCopier | public static DistCopier getCopier(final Configuration conf,
final Arguments args) throws IOException {
DistCopier dc = new DistCopier(conf, args);
dc.setupJob();
if (dc.getJobConf() != null) {
return dc;
} else {
return null;
}
} | java | public static DistCopier getCopier(final Configuration conf,
final Arguments args) throws IOException {
DistCopier dc = new DistCopier(conf, args);
dc.setupJob();
if (dc.getJobConf() != null) {
return dc;
} else {
return null;
}
} | [
"public",
"static",
"DistCopier",
"getCopier",
"(",
"final",
"Configuration",
"conf",
",",
"final",
"Arguments",
"args",
")",
"throws",
"IOException",
"{",
"DistCopier",
"dc",
"=",
"new",
"DistCopier",
"(",
"conf",
",",
"args",
")",
";",
"dc",
".",
"setupJob... | Return a DistCopier object for copying the files.
If a MapReduce job is needed, a DistCopier instance will be
initialized and returned.
If no MapReduce job is needed (for empty directories), all the
other work will be done in this function, and NULL will be
returned. If caller sees NULL returned, the copying has
succe... | [
"Return",
"a",
"DistCopier",
"object",
"for",
"copying",
"the",
"files",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L1525-L1534 |
118,181 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.copy | static void copy(final Configuration conf, final Arguments args
) throws IOException {
DistCopier copier = getCopier(conf, args);
if (copier != null) {
try {
JobClient client = copier.getJobClient();
RunningJob job = client.submitJob(copier.getJobConf());
try {
... | java | static void copy(final Configuration conf, final Arguments args
) throws IOException {
DistCopier copier = getCopier(conf, args);
if (copier != null) {
try {
JobClient client = copier.getJobClient();
RunningJob job = client.submitJob(copier.getJobConf());
try {
... | [
"static",
"void",
"copy",
"(",
"final",
"Configuration",
"conf",
",",
"final",
"Arguments",
"args",
")",
"throws",
"IOException",
"{",
"DistCopier",
"copier",
"=",
"getCopier",
"(",
"conf",
",",
"args",
")",
";",
"if",
"(",
"copier",
"!=",
"null",
")",
"... | Driver to copy srcPath to destPath depending on required protocol.
@param args arguments | [
"Driver",
"to",
"copy",
"srcPath",
"to",
"destPath",
"depending",
"on",
"required",
"protocol",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L1540-L1560 |
118,182 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.run | public int run(String[] args) {
try {
copy(conf, Arguments.valueOf(args, conf));
return 0;
} catch (IllegalArgumentException e) {
System.err.println(StringUtils.stringifyException(e) + "\n" + usage);
ToolRunner.printGenericCommandUsage(System.err);
return -1;
} catch (InvalidIn... | java | public int run(String[] args) {
try {
copy(conf, Arguments.valueOf(args, conf));
return 0;
} catch (IllegalArgumentException e) {
System.err.println(StringUtils.stringifyException(e) + "\n" + usage);
ToolRunner.printGenericCommandUsage(System.err);
return -1;
} catch (InvalidIn... | [
"public",
"int",
"run",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"copy",
"(",
"conf",
",",
"Arguments",
".",
"valueOf",
"(",
"args",
",",
"conf",
")",
")",
";",
"return",
"0",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
"... | This is the main driver for recursively copying directories
across file systems. It takes at least two cmdline parameters. A source
URL and a destination URL. It then essentially does an "ls -lR" on the
source URL, and writes the output in a round-robin manner to all the map
input files. The mapper actually copies the ... | [
"This",
"is",
"the",
"main",
"driver",
"for",
"recursively",
"copying",
"directories",
"across",
"file",
"systems",
".",
"It",
"takes",
"at",
"least",
"two",
"cmdline",
"parameters",
".",
"A",
"source",
"URL",
"and",
"a",
"destination",
"URL",
".",
"It",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L2042-L2069 |
118,183 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.makeRelative | static String makeRelative(Path root, Path absPath) {
if (!absPath.isAbsolute()) {
throw new IllegalArgumentException("!absPath.isAbsolute(), absPath="
+ absPath);
}
String p = absPath.toUri().getPath();
StringTokenizer pathTokens = new StringTokenizer(p, "/");
for(StringTokenizer r... | java | static String makeRelative(Path root, Path absPath) {
if (!absPath.isAbsolute()) {
throw new IllegalArgumentException("!absPath.isAbsolute(), absPath="
+ absPath);
}
String p = absPath.toUri().getPath();
StringTokenizer pathTokens = new StringTokenizer(p, "/");
for(StringTokenizer r... | [
"static",
"String",
"makeRelative",
"(",
"Path",
"root",
",",
"Path",
"absPath",
")",
"{",
"if",
"(",
"!",
"absPath",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"!absPath.isAbsolute(), absPath=\"",
"+",
"absPath",
... | Make a path relative with respect to a root path.
absPath is always assumed to descend from root.
Otherwise returned path is null. | [
"Make",
"a",
"path",
"relative",
"with",
"respect",
"to",
"a",
"root",
"path",
".",
"absPath",
"is",
"always",
"assumed",
"to",
"descend",
"from",
"root",
".",
"Otherwise",
"returned",
"path",
"is",
"null",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L2083-L2103 |
118,184 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.fullyDelete | static void fullyDelete(String dir, Configuration conf) throws IOException {
if (dir != null) {
Path tmp = new Path(dir);
tmp.getFileSystem(conf).delete(tmp, true);
}
} | java | static void fullyDelete(String dir, Configuration conf) throws IOException {
if (dir != null) {
Path tmp = new Path(dir);
tmp.getFileSystem(conf).delete(tmp, true);
}
} | [
"static",
"void",
"fullyDelete",
"(",
"String",
"dir",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dir",
"!=",
"null",
")",
"{",
"Path",
"tmp",
"=",
"new",
"Path",
"(",
"dir",
")",
";",
"tmp",
".",
"getFileSystem",
"(",... | Fully delete dir | [
"Fully",
"delete",
"dir"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L2139-L2144 |
118,185 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.setReducerCount | private static int setReducerCount(long fileCount, JobConf job,
JobClient client) {
// calculate the max number of reducers.
int numReducers = Math.max(job.getInt(MAX_REDUCE_LABEL, MAX_REDUCERS_DEFAULT),
(int) (fileCount / job.getInt(MAX_FILES_PER_REDUCER_LABEL,
MAX_FILES_PER_REDUCER... | java | private static int setReducerCount(long fileCount, JobConf job,
JobClient client) {
// calculate the max number of reducers.
int numReducers = Math.max(job.getInt(MAX_REDUCE_LABEL, MAX_REDUCERS_DEFAULT),
(int) (fileCount / job.getInt(MAX_FILES_PER_REDUCER_LABEL,
MAX_FILES_PER_REDUCER... | [
"private",
"static",
"int",
"setReducerCount",
"(",
"long",
"fileCount",
",",
"JobConf",
"job",
",",
"JobClient",
"client",
")",
"{",
"// calculate the max number of reducers.",
"int",
"numReducers",
"=",
"Math",
".",
"max",
"(",
"job",
".",
"getInt",
"(",
"MAX_... | Calculate how many reducers to run.
@param fileCount
@param job
@param client
@return | [
"Calculate",
"how",
"many",
"reducers",
"to",
"run",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L2153-L2164 |
118,186 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.sameFile | static private boolean sameFile(FileSystem srcfs, FileStatus srcstatus,
FileSystem dstfs, Path dstpath, boolean skipCRCCheck) throws IOException {
FileStatus dststatus;
try {
dststatus = dstfs.getFileStatus(dstpath);
} catch(FileNotFoundException fnfe) {
return false;
}
//same len... | java | static private boolean sameFile(FileSystem srcfs, FileStatus srcstatus,
FileSystem dstfs, Path dstpath, boolean skipCRCCheck) throws IOException {
FileStatus dststatus;
try {
dststatus = dstfs.getFileStatus(dstpath);
} catch(FileNotFoundException fnfe) {
return false;
}
//same len... | [
"static",
"private",
"boolean",
"sameFile",
"(",
"FileSystem",
"srcfs",
",",
"FileStatus",
"srcstatus",
",",
"FileSystem",
"dstfs",
",",
"Path",
"dstpath",
",",
"boolean",
"skipCRCCheck",
")",
"throws",
"IOException",
"{",
"FileStatus",
"dststatus",
";",
"try",
... | Check whether the contents of src and dst are the same.
Return false if dstpath does not exist
If the files have different sizes, return false.
If the files have the same sizes, the file checksums will be compared.
When file checksum is not supported in any of file systems,
two files are considered as the same if t... | [
"Check",
"whether",
"the",
"contents",
"of",
"src",
"and",
"dst",
"are",
"the",
"same",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L2924-L2969 |
118,187 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.isAncestorPath | static private boolean isAncestorPath(String x, String y) {
if (!y.startsWith(x)) {
return false;
}
final int len = x.length();
return y.length() == len || y.charAt(len) == Path.SEPARATOR_CHAR;
} | java | static private boolean isAncestorPath(String x, String y) {
if (!y.startsWith(x)) {
return false;
}
final int len = x.length();
return y.length() == len || y.charAt(len) == Path.SEPARATOR_CHAR;
} | [
"static",
"private",
"boolean",
"isAncestorPath",
"(",
"String",
"x",
",",
"String",
"y",
")",
"{",
"if",
"(",
"!",
"y",
".",
"startsWith",
"(",
"x",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"int",
"len",
"=",
"x",
".",
"length",
"(",
... | is x an ancestor path of y? | [
"is",
"x",
"an",
"ancestor",
"path",
"of",
"y?"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L3062-L3068 |
118,188 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCp.java | DistCp.checkDuplication | static private void checkDuplication(FileSystem fs, Path file, Path sorted,
Configuration conf) throws IOException {
SequenceFile.Reader in = null;
try {
SequenceFile.Sorter sorter = new SequenceFile.Sorter(fs,
new Text.Comparator(), Text.class, Text.class, conf);
sorter.sort(file, sorte... | java | static private void checkDuplication(FileSystem fs, Path file, Path sorted,
Configuration conf) throws IOException {
SequenceFile.Reader in = null;
try {
SequenceFile.Sorter sorter = new SequenceFile.Sorter(fs,
new Text.Comparator(), Text.class, Text.class, conf);
sorter.sort(file, sorte... | [
"static",
"private",
"void",
"checkDuplication",
"(",
"FileSystem",
"fs",
",",
"Path",
"file",
",",
"Path",
"sorted",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"SequenceFile",
".",
"Reader",
"in",
"=",
"null",
";",
"try",
"{",
"Sequenc... | Check whether the file list have duplication. | [
"Check",
"whether",
"the",
"file",
"list",
"have",
"duplication",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCp.java#L3071-L3097 |
118,189 | facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobMonitor.java | JobMonitor.getRemainingJobs | List<Job> getRemainingJobs() {
if (mThread.isAlive()) {
LOG.warn("Internal error: Polling running monitor for jobs");
}
synchronized (mJobs) {
return new ArrayList<Job>(mJobs);
}
} | java | List<Job> getRemainingJobs() {
if (mThread.isAlive()) {
LOG.warn("Internal error: Polling running monitor for jobs");
}
synchronized (mJobs) {
return new ArrayList<Job>(mJobs);
}
} | [
"List",
"<",
"Job",
">",
"getRemainingJobs",
"(",
")",
"{",
"if",
"(",
"mThread",
".",
"isAlive",
"(",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Internal error: Polling running monitor for jobs\"",
")",
";",
"}",
"synchronized",
"(",
"mJobs",
")",
"{",
"r... | If shutdown before all jobs have completed, any still-running jobs
may be extracted from the component.
@throws IllegalStateException If monitoring thread is still running.
@return Any jobs submitted and not known to have completed. | [
"If",
"shutdown",
"before",
"all",
"jobs",
"have",
"completed",
"any",
"still",
"-",
"running",
"jobs",
"may",
"be",
"extracted",
"from",
"the",
"component",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobMonitor.java#L100-L107 |
118,190 | facebookarchive/hadoop-20 | src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java | HadoopThriftServer.convertLocatedBlock | private static LocatedBlock convertLocatedBlock(TLocatedBlock tblk) {
TBlock one = tblk.block;
Block hblock = new Block(one.getBlockId(),
one.getNumBytes(),
one.getGenerationStamp());
List<TDatanodeID> locs = tblk.location;
DatanodeInfo[] dn = n... | java | private static LocatedBlock convertLocatedBlock(TLocatedBlock tblk) {
TBlock one = tblk.block;
Block hblock = new Block(one.getBlockId(),
one.getNumBytes(),
one.getGenerationStamp());
List<TDatanodeID> locs = tblk.location;
DatanodeInfo[] dn = n... | [
"private",
"static",
"LocatedBlock",
"convertLocatedBlock",
"(",
"TLocatedBlock",
"tblk",
")",
"{",
"TBlock",
"one",
"=",
"tblk",
".",
"block",
";",
"Block",
"hblock",
"=",
"new",
"Block",
"(",
"one",
".",
"getBlockId",
"(",
")",
",",
"one",
".",
"getNumBy... | Converts a TLocatedBlock to a LocatedBlock | [
"Converts",
"a",
"TLocatedBlock",
"to",
"a",
"LocatedBlock"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java#L811-L823 |
118,191 | facebookarchive/hadoop-20 | src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java | HadoopThriftServer.convertBlock | private static Block convertBlock(TBlock tblk) {
return new Block(tblk.getBlockId(),
tblk.getNumBytes(),
tblk.getGenerationStamp());
} | java | private static Block convertBlock(TBlock tblk) {
return new Block(tblk.getBlockId(),
tblk.getNumBytes(),
tblk.getGenerationStamp());
} | [
"private",
"static",
"Block",
"convertBlock",
"(",
"TBlock",
"tblk",
")",
"{",
"return",
"new",
"Block",
"(",
"tblk",
".",
"getBlockId",
"(",
")",
",",
"tblk",
".",
"getNumBytes",
"(",
")",
",",
"tblk",
".",
"getGenerationStamp",
"(",
")",
")",
";",
"}... | Converts a TBlock to a Block | [
"Converts",
"a",
"TBlock",
"to",
"a",
"Block"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java#L827-L831 |
118,192 | facebookarchive/hadoop-20 | src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java | HadoopThriftServer.createServerSocket | private ServerSocket createServerSocket(int port) throws IOException {
try {
ServerSocket sock = new ServerSocket();
// Prevent 2MSL delay problem on server restarts
sock.setReuseAddress(true);
// Bind to listening port
if (port == 0) {
sock.bind(null);
serverPort = soc... | java | private ServerSocket createServerSocket(int port) throws IOException {
try {
ServerSocket sock = new ServerSocket();
// Prevent 2MSL delay problem on server restarts
sock.setReuseAddress(true);
// Bind to listening port
if (port == 0) {
sock.bind(null);
serverPort = soc... | [
"private",
"ServerSocket",
"createServerSocket",
"(",
"int",
"port",
")",
"throws",
"IOException",
"{",
"try",
"{",
"ServerSocket",
"sock",
"=",
"new",
"ServerSocket",
"(",
")",
";",
"// Prevent 2MSL delay problem on server restarts",
"sock",
".",
"setReuseAddress",
"... | Bind to port. If the specified port is 0, then bind to random port. | [
"Bind",
"to",
"port",
".",
"If",
"the",
"specified",
"port",
"is",
"0",
"then",
"bind",
"to",
"random",
"port",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/thriftfs/src/java/org/apache/hadoop/thriftfs/HadoopThriftServer.java#L845-L862 |
118,193 | facebookarchive/hadoop-20 | src/ant/org/apache/hadoop/ant/DfsTask.java | DfsTask.setArgs | public void setArgs(String args) {
for (String s : args.trim().split("\\s*,\\s*"))
argv.add(s);
} | java | public void setArgs(String args) {
for (String s : args.trim().split("\\s*,\\s*"))
argv.add(s);
} | [
"public",
"void",
"setArgs",
"(",
"String",
"args",
")",
"{",
"for",
"(",
"String",
"s",
":",
"args",
".",
"trim",
"(",
")",
".",
"split",
"(",
"\"\\\\s*,\\\\s*\"",
")",
")",
"argv",
".",
"(",
"s",
")",
";",
"}"
] | Sets the argument list from a String of comma-separated values.
@param args A String of comma-separated arguments to FsShell. | [
"Sets",
"the",
"argument",
"list",
"from",
"a",
"String",
"of",
"comma",
"-",
"separated",
"values",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/ant/org/apache/hadoop/ant/DfsTask.java#L79-L82 |
118,194 | facebookarchive/hadoop-20 | src/ant/org/apache/hadoop/ant/DfsTask.java | DfsTask.setOut | public void setOut(String outprop) {
this.outprop = outprop;
out = new ByteArrayOutputStream();
if (outprop.equals(errprop))
err = out;
} | java | public void setOut(String outprop) {
this.outprop = outprop;
out = new ByteArrayOutputStream();
if (outprop.equals(errprop))
err = out;
} | [
"public",
"void",
"setOut",
"(",
"String",
"outprop",
")",
"{",
"this",
".",
"outprop",
"=",
"outprop",
";",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"if",
"(",
"outprop",
".",
"equals",
"(",
"errprop",
")",
")",
"err",
"=",
"out",
... | Sets the property into which System.out will be written.
@param outprop The name of the property into which System.out is written.
If the property is defined before this task is executed, it will not be updated. | [
"Sets",
"the",
"property",
"into",
"which",
"System",
".",
"out",
"will",
"be",
"written",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/ant/org/apache/hadoop/ant/DfsTask.java#L89-L94 |
118,195 | facebookarchive/hadoop-20 | src/ant/org/apache/hadoop/ant/DfsTask.java | DfsTask.setErr | public void setErr(String errprop) {
this.errprop = errprop;
err = (errprop.equals(outprop)) ? err = out : new ByteArrayOutputStream();
} | java | public void setErr(String errprop) {
this.errprop = errprop;
err = (errprop.equals(outprop)) ? err = out : new ByteArrayOutputStream();
} | [
"public",
"void",
"setErr",
"(",
"String",
"errprop",
")",
"{",
"this",
".",
"errprop",
"=",
"errprop",
";",
"err",
"=",
"(",
"errprop",
".",
"equals",
"(",
"outprop",
")",
")",
"?",
"err",
"=",
"out",
":",
"new",
"ByteArrayOutputStream",
"(",
")",
"... | Sets the property into which System.err will be written. If this property
has the same name as the property for System.out, the two will be interlaced.
@param errprop The name of the property into which System.err is written.
If the property is defined before this task is executed, it will not be updated. | [
"Sets",
"the",
"property",
"into",
"which",
"System",
".",
"err",
"will",
"be",
"written",
".",
"If",
"this",
"property",
"has",
"the",
"same",
"name",
"as",
"the",
"property",
"for",
"System",
".",
"out",
"the",
"two",
"will",
"be",
"interlaced",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/ant/org/apache/hadoop/ant/DfsTask.java#L102-L105 |
118,196 | facebookarchive/hadoop-20 | src/ant/org/apache/hadoop/ant/DfsTask.java | DfsTask.pushContext | protected void pushContext() {
antOut = System.out;
antErr = System.err;
System.setOut(new PrintStream(out));
System.setErr(out == err ? System.out : new PrintStream(err));
} | java | protected void pushContext() {
antOut = System.out;
antErr = System.err;
System.setOut(new PrintStream(out));
System.setErr(out == err ? System.out : new PrintStream(err));
} | [
"protected",
"void",
"pushContext",
"(",
")",
"{",
"antOut",
"=",
"System",
".",
"out",
";",
"antErr",
"=",
"System",
".",
"err",
";",
"System",
".",
"setOut",
"(",
"new",
"PrintStream",
"(",
"out",
")",
")",
";",
"System",
".",
"setErr",
"(",
"out",... | Save the current values of System.out, System.err and configure output
streams for FsShell. | [
"Save",
"the",
"current",
"values",
"of",
"System",
".",
"out",
"System",
".",
"err",
"and",
"configure",
"output",
"streams",
"for",
"FsShell",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/ant/org/apache/hadoop/ant/DfsTask.java#L134-L139 |
118,197 | facebookarchive/hadoop-20 | src/ant/org/apache/hadoop/ant/DfsTask.java | DfsTask.popContext | protected void popContext() {
// write output to property, if applicable
if (outprop != null && !System.out.checkError())
getProject().setNewProperty(outprop, out.toString());
if (out != err && errprop != null && !System.err.checkError())
getProject().setNewProperty(errprop, err.toString());
... | java | protected void popContext() {
// write output to property, if applicable
if (outprop != null && !System.out.checkError())
getProject().setNewProperty(outprop, out.toString());
if (out != err && errprop != null && !System.err.checkError())
getProject().setNewProperty(errprop, err.toString());
... | [
"protected",
"void",
"popContext",
"(",
")",
"{",
"// write output to property, if applicable",
"if",
"(",
"outprop",
"!=",
"null",
"&&",
"!",
"System",
".",
"out",
".",
"checkError",
"(",
")",
")",
"getProject",
"(",
")",
".",
"setNewProperty",
"(",
"outprop"... | Create the appropriate output properties with their respective output,
restore System.out, System.err and release any resources from created
ClassLoaders to aid garbage collection. | [
"Create",
"the",
"appropriate",
"output",
"properties",
"with",
"their",
"respective",
"output",
"restore",
"System",
".",
"out",
"System",
".",
"err",
"and",
"release",
"any",
"resources",
"from",
"created",
"ClassLoaders",
"to",
"aid",
"garbage",
"collection",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/ant/org/apache/hadoop/ant/DfsTask.java#L146-L157 |
118,198 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ReconfigurationServlet.java | ReconfigurationServlet.printConf | private void printConf(PrintWriter out, Reconfigurable reconf) {
Configuration oldConf = reconf.getConf();
Configuration newConf = new Configuration();
if (reconf instanceof ReconfigurableBase)
((ReconfigurableBase) reconf).preProcessConfiguration(newConf);
Collection<ReconfigurationUtil.Propert... | java | private void printConf(PrintWriter out, Reconfigurable reconf) {
Configuration oldConf = reconf.getConf();
Configuration newConf = new Configuration();
if (reconf instanceof ReconfigurableBase)
((ReconfigurableBase) reconf).preProcessConfiguration(newConf);
Collection<ReconfigurationUtil.Propert... | [
"private",
"void",
"printConf",
"(",
"PrintWriter",
"out",
",",
"Reconfigurable",
"reconf",
")",
"{",
"Configuration",
"oldConf",
"=",
"reconf",
".",
"getConf",
"(",
")",
";",
"Configuration",
"newConf",
"=",
"new",
"Configuration",
"(",
")",
";",
"if",
"(",... | Print configuration options that can be changed. | [
"Print",
"configuration",
"options",
"that",
"can",
"be",
"changed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ReconfigurationServlet.java#L91-L138 |
118,199 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/ReconfigurationServlet.java | ReconfigurationServlet.applyChanges | private void applyChanges(PrintWriter out, Reconfigurable reconf,
HttpServletRequest req)
throws IOException, ReconfigurationException {
Configuration oldConf = reconf.getConf();
Configuration newConf = new Configuration();
if (reconf instanceof ReconfigurableBase)
((R... | java | private void applyChanges(PrintWriter out, Reconfigurable reconf,
HttpServletRequest req)
throws IOException, ReconfigurationException {
Configuration oldConf = reconf.getConf();
Configuration newConf = new Configuration();
if (reconf instanceof ReconfigurableBase)
((R... | [
"private",
"void",
"applyChanges",
"(",
"PrintWriter",
"out",
",",
"Reconfigurable",
"reconf",
",",
"HttpServletRequest",
"req",
")",
"throws",
"IOException",
",",
"ReconfigurationException",
"{",
"Configuration",
"oldConf",
"=",
"reconf",
".",
"getConf",
"(",
")",
... | Apply configuration changes after admin has approved them. | [
"Apply",
"configuration",
"changes",
"after",
"admin",
"has",
"approved",
"them",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/ReconfigurationServlet.java#L148-L212 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.