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,000 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.divide | public int divide(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y > 0 && y < getFieldSize());
return divTable[x][y];
} | java | public int divide(int x, int y) {
assert(x >= 0 && x < getFieldSize() && y > 0 && y < getFieldSize());
return divTable[x][y];
} | [
"public",
"int",
"divide",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"getFieldSize",
"(",
")",
"&&",
"y",
">",
"0",
"&&",
"y",
"<",
"getFieldSize",
"(",
")",
")",
";",
"return",
"divTable",
"[",
... | Compute the division of two fields
@param x input field
@param y input field
@return x/y | [
"Compute",
"the",
"division",
"of",
"two",
"fields"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L161-L164 |
118,001 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.power | public int power(int x, int n) {
assert(x >= 0 && x < getFieldSize());
if (n == 0) {
return 1;
}
if (x == 0) {
return 0;
}
x = logTable[x] * n;
if (x < primitivePeriod) {
return powTable[x];
}
x = x % primitivePeriod;
return powTable[x];
} | java | public int power(int x, int n) {
assert(x >= 0 && x < getFieldSize());
if (n == 0) {
return 1;
}
if (x == 0) {
return 0;
}
x = logTable[x] * n;
if (x < primitivePeriod) {
return powTable[x];
}
x = x % primitivePeriod;
return powTable[x];
} | [
"public",
"int",
"power",
"(",
"int",
"x",
",",
"int",
"n",
")",
"{",
"assert",
"(",
"x",
">=",
"0",
"&&",
"x",
"<",
"getFieldSize",
"(",
")",
")",
";",
"if",
"(",
"n",
"==",
"0",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"x",
"==",
"... | Compute power n of a field
@param x input field
@param n power
@return x^n | [
"Compute",
"power",
"n",
"of",
"a",
"field"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L172-L186 |
118,002 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.solveVandermondeSystem | public void solveVandermondeSystem(int[] x, byte[][] y,
int len, int dataStart, int dataLen) {
assert(x.length <= len && y.length <= len);
int dataEnd = dataStart + dataLen;
for (int i = 0; i < len - 1; i++) {
for (int j = len - 1; j > i; j--) {
for (int k... | java | public void solveVandermondeSystem(int[] x, byte[][] y,
int len, int dataStart, int dataLen) {
assert(x.length <= len && y.length <= len);
int dataEnd = dataStart + dataLen;
for (int i = 0; i < len - 1; i++) {
for (int j = len - 1; j > i; j--) {
for (int k... | [
"public",
"void",
"solveVandermondeSystem",
"(",
"int",
"[",
"]",
"x",
",",
"byte",
"[",
"]",
"[",
"]",
"y",
",",
"int",
"len",
",",
"int",
"dataStart",
",",
"int",
"dataLen",
")",
"{",
"assert",
"(",
"x",
".",
"length",
"<=",
"len",
"&&",
"y",
"... | A "bulk" version of the solveVandermondeSystem | [
"A",
"bulk",
"version",
"of",
"the",
"solveVandermondeSystem"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L227-L250 |
118,003 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.substitute | public void substitute(byte[][] p, byte[] q, int x) {
substitute(p, q, x, 0, p[0].length);
} | java | public void substitute(byte[][] p, byte[] q, int x) {
substitute(p, q, x, 0, p[0].length);
} | [
"public",
"void",
"substitute",
"(",
"byte",
"[",
"]",
"[",
"]",
"p",
",",
"byte",
"[",
"]",
"q",
",",
"int",
"x",
")",
"{",
"substitute",
"(",
"p",
",",
"q",
",",
"x",
",",
"0",
",",
"p",
"[",
"0",
"]",
".",
"length",
")",
";",
"}"
] | A "bulk" version of the substitute.
Tends to be 2X faster than the "int" substitute in a loop.
@param p input polynomial
@param q store the return result
@param x input field | [
"A",
"bulk",
"version",
"of",
"the",
"substitute",
".",
"Tends",
"to",
"be",
"2X",
"faster",
"than",
"the",
"int",
"substitute",
"in",
"a",
"loop",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L368-L370 |
118,004 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.snapshotConfig | private void snapshotConfig() {
synchronized (configManager) {
maximum = configManager.getPoolMaximum(poolInfo, getType());
minimum = configManager.getPoolMinimum(poolInfo, getType());
weight = configManager.getWeight(poolInfo);
priority = configManager.getPriority(poolInfo);
preemptab... | java | private void snapshotConfig() {
synchronized (configManager) {
maximum = configManager.getPoolMaximum(poolInfo, getType());
minimum = configManager.getPoolMinimum(poolInfo, getType());
weight = configManager.getWeight(poolInfo);
priority = configManager.getPriority(poolInfo);
preemptab... | [
"private",
"void",
"snapshotConfig",
"(",
")",
"{",
"synchronized",
"(",
"configManager",
")",
"{",
"maximum",
"=",
"configManager",
".",
"getPoolMaximum",
"(",
"poolInfo",
",",
"getType",
"(",
")",
")",
";",
"minimum",
"=",
"configManager",
".",
"getPoolMinim... | Get the snapshot of the configuration from the configuration manager.
Synchronized on config manager to ensure that config is atomically updated
per pool. | [
"Get",
"the",
"snapshot",
"of",
"the",
"configuration",
"from",
"the",
"configuration",
"manager",
".",
"Synchronized",
"on",
"config",
"manager",
"to",
"ensure",
"that",
"config",
"is",
"atomically",
"updated",
"per",
"pool",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L149-L161 |
118,005 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.addSession | public void addSession(String id, Session session) {
synchronized (session) {
SessionSchedulable schedulable =
new SessionSchedulable(session, getType());
idToSession.put(id, schedulable);
}
} | java | public void addSession(String id, Session session) {
synchronized (session) {
SessionSchedulable schedulable =
new SessionSchedulable(session, getType());
idToSession.put(id, schedulable);
}
} | [
"public",
"void",
"addSession",
"(",
"String",
"id",
",",
"Session",
"session",
")",
"{",
"synchronized",
"(",
"session",
")",
"{",
"SessionSchedulable",
"schedulable",
"=",
"new",
"SessionSchedulable",
"(",
"session",
",",
"getType",
"(",
")",
")",
";",
"id... | Add a session to the pool
@param id the id of the session
@param session the session to add to the pool | [
"Add",
"a",
"session",
"to",
"the",
"pool"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L203-L209 |
118,006 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.getScheduleQueue | public Queue<SessionSchedulable> getScheduleQueue() {
if (scheduleQueue == null) {
scheduleQueue =
createSessionQueue(configManager.getPoolComparator(poolInfo));
}
return scheduleQueue;
} | java | public Queue<SessionSchedulable> getScheduleQueue() {
if (scheduleQueue == null) {
scheduleQueue =
createSessionQueue(configManager.getPoolComparator(poolInfo));
}
return scheduleQueue;
} | [
"public",
"Queue",
"<",
"SessionSchedulable",
">",
"getScheduleQueue",
"(",
")",
"{",
"if",
"(",
"scheduleQueue",
"==",
"null",
")",
"{",
"scheduleQueue",
"=",
"createSessionQueue",
"(",
"configManager",
".",
"getPoolComparator",
"(",
"poolInfo",
")",
")",
";",
... | Get the queue of sessions sorted for scheduling
@return the queue of sessions sorted for scheduling | [
"Get",
"the",
"queue",
"of",
"sessions",
"sorted",
"for",
"scheduling"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L215-L221 |
118,007 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.getPreemptQueue | public Queue<SessionSchedulable> getPreemptQueue() {
if (preemptQueue == null) {
ScheduleComparator comparator = null;
switch (configManager.getPoolComparator(poolInfo)) {
case FIFO:
comparator = ScheduleComparator.FIFO_PREEMPT;
break;
case FAIR:
comparator = Schedul... | java | public Queue<SessionSchedulable> getPreemptQueue() {
if (preemptQueue == null) {
ScheduleComparator comparator = null;
switch (configManager.getPoolComparator(poolInfo)) {
case FIFO:
comparator = ScheduleComparator.FIFO_PREEMPT;
break;
case FAIR:
comparator = Schedul... | [
"public",
"Queue",
"<",
"SessionSchedulable",
">",
"getPreemptQueue",
"(",
")",
"{",
"if",
"(",
"preemptQueue",
"==",
"null",
")",
"{",
"ScheduleComparator",
"comparator",
"=",
"null",
";",
"switch",
"(",
"configManager",
".",
"getPoolComparator",
"(",
"poolInfo... | Get the queue of sessions sorted for preemption
@return the queue of sessions sorted for preemption | [
"Get",
"the",
"queue",
"of",
"sessions",
"sorted",
"for",
"preemption"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L227-L248 |
118,008 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.createSessionQueue | public Queue<SessionSchedulable> createSessionQueue(
ScheduleComparator comparator) {
int initCapacity = snapshotSessions.size() == 0 ?
1 : snapshotSessions.size();
Queue<SessionSchedulable> sessionQueue =
new PriorityQueue<SessionSchedulable>(initCapacity, comparator);
sessionQueue.addA... | java | public Queue<SessionSchedulable> createSessionQueue(
ScheduleComparator comparator) {
int initCapacity = snapshotSessions.size() == 0 ?
1 : snapshotSessions.size();
Queue<SessionSchedulable> sessionQueue =
new PriorityQueue<SessionSchedulable>(initCapacity, comparator);
sessionQueue.addA... | [
"public",
"Queue",
"<",
"SessionSchedulable",
">",
"createSessionQueue",
"(",
"ScheduleComparator",
"comparator",
")",
"{",
"int",
"initCapacity",
"=",
"snapshotSessions",
".",
"size",
"(",
")",
"==",
"0",
"?",
"1",
":",
"snapshotSessions",
".",
"size",
"(",
"... | Get the queue of sessions in the pool sorted by comparator
@param comparator the comparator to use when sorting sessions
@return the queue of the sessions sorted by a given comparator | [
"Get",
"the",
"queue",
"of",
"sessions",
"in",
"the",
"pool",
"sorted",
"by",
"comparator"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L255-L263 |
118,009 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.isStarving | public boolean isStarving(long now) {
double starvingShare = getShare() * shareStarvingRatio;
if (getGranted() >= Math.ceil(starvingShare)) {
lastTimeAboveStarvingShare = now;
}
if (getGranted() >= Math.min(getShare(), getMinimum())) {
lastTimeAboveMinimum = now;
}
if (now - lastPre... | java | public boolean isStarving(long now) {
double starvingShare = getShare() * shareStarvingRatio;
if (getGranted() >= Math.ceil(starvingShare)) {
lastTimeAboveStarvingShare = now;
}
if (getGranted() >= Math.min(getShare(), getMinimum())) {
lastTimeAboveMinimum = now;
}
if (now - lastPre... | [
"public",
"boolean",
"isStarving",
"(",
"long",
"now",
")",
"{",
"double",
"starvingShare",
"=",
"getShare",
"(",
")",
"*",
"shareStarvingRatio",
";",
"if",
"(",
"getGranted",
"(",
")",
">=",
"Math",
".",
"ceil",
"(",
"starvingShare",
")",
")",
"{",
"las... | Check if the pool is starving now or not
@param now current timestampe
@return true if the pool is starving now, false otherwise | [
"Check",
"if",
"the",
"pool",
"is",
"starving",
"now",
"or",
"not"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L282-L320 |
118,010 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java | PoolSchedulable.getStarvingTime | public long getStarvingTime(long now) {
long starvingTime = Math.max(
getMinimumStarvingTime(now), getShareStarvingTime(now));
return starvingTime;
} | java | public long getStarvingTime(long now) {
long starvingTime = Math.max(
getMinimumStarvingTime(now), getShareStarvingTime(now));
return starvingTime;
} | [
"public",
"long",
"getStarvingTime",
"(",
"long",
"now",
")",
"{",
"long",
"starvingTime",
"=",
"Math",
".",
"max",
"(",
"getMinimumStarvingTime",
"(",
"now",
")",
",",
"getShareStarvingTime",
"(",
"now",
")",
")",
";",
"return",
"starvingTime",
";",
"}"
] | Get the amount of time the pool was starving for either its min share
or its share
@param now the current timestamp
@return the amount of time the pool was starving | [
"Get",
"the",
"amount",
"of",
"time",
"the",
"pool",
"was",
"starving",
"for",
"either",
"its",
"min",
"share",
"or",
"its",
"share"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolSchedulable.java#L328-L332 |
118,011 | facebookarchive/hadoop-20 | src/tools/org/apache/hadoop/tools/DistCh.java | DistCh.getMapCount | private static int getMapCount(int srcCount, int numNodes) {
int numMaps = (int)(srcCount / OP_PER_MAP);
numMaps = Math.min(numMaps, numNodes * MAX_MAPS_PER_NODE);
return Math.max(numMaps, 1);
} | java | private static int getMapCount(int srcCount, int numNodes) {
int numMaps = (int)(srcCount / OP_PER_MAP);
numMaps = Math.min(numMaps, numNodes * MAX_MAPS_PER_NODE);
return Math.max(numMaps, 1);
} | [
"private",
"static",
"int",
"getMapCount",
"(",
"int",
"srcCount",
",",
"int",
"numNodes",
")",
"{",
"int",
"numMaps",
"=",
"(",
"int",
")",
"(",
"srcCount",
"/",
"OP_PER_MAP",
")",
";",
"numMaps",
"=",
"Math",
".",
"min",
"(",
"numMaps",
",",
"numNode... | Calculate how many maps to run. | [
"Calculate",
"how",
"many",
"maps",
"to",
"run",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/DistCh.java#L417-L421 |
118,012 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.registerPrimarySsId | public synchronized void registerPrimarySsId(String address, Long ssid)
throws IOException {
String node = getSsIdNode(address);
zkCreateRecursively(node, SerializableUtils.toBytes(ssid), true,
ssid.toString());
} | java | public synchronized void registerPrimarySsId(String address, Long ssid)
throws IOException {
String node = getSsIdNode(address);
zkCreateRecursively(node, SerializableUtils.toBytes(ssid), true,
ssid.toString());
} | [
"public",
"synchronized",
"void",
"registerPrimarySsId",
"(",
"String",
"address",
",",
"Long",
"ssid",
")",
"throws",
"IOException",
"{",
"String",
"node",
"=",
"getSsIdNode",
"(",
"address",
")",
";",
"zkCreateRecursively",
"(",
"node",
",",
"SerializableUtils",... | Creates a node in zookeeper denoting the current session id of the primary
avatarnode of the cluster. The primary avatarnode always syncs this
information to zookeeper when it starts.
@param address
the address of the cluster, used to create the path name for the
znode
@param ssid
the session id of the primary avatarn... | [
"Creates",
"a",
"node",
"in",
"zookeeper",
"denoting",
"the",
"current",
"session",
"id",
"of",
"the",
"primary",
"avatarnode",
"of",
"the",
"cluster",
".",
"The",
"primary",
"avatarnode",
"always",
"syncs",
"this",
"information",
"to",
"zookeeper",
"when",
"i... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L112-L117 |
118,013 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.registerLastTxId | public synchronized void registerLastTxId(String address,
ZookeeperTxId lastTxid)
throws IOException {
String node = getLastTxIdNode(address);
zkCreateRecursively(node, lastTxid.toBytes(), true, lastTxid.toString());
} | java | public synchronized void registerLastTxId(String address,
ZookeeperTxId lastTxid)
throws IOException {
String node = getLastTxIdNode(address);
zkCreateRecursively(node, lastTxid.toBytes(), true, lastTxid.toString());
} | [
"public",
"synchronized",
"void",
"registerLastTxId",
"(",
"String",
"address",
",",
"ZookeeperTxId",
"lastTxid",
")",
"throws",
"IOException",
"{",
"String",
"node",
"=",
"getLastTxIdNode",
"(",
"address",
")",
";",
"zkCreateRecursively",
"(",
"node",
",",
"lastT... | Creates a node in zookeeper denoting the current session id and the last
transaction id processed by the primary avatarnode. This is used by the
primary avatarnode when it shuts down cleanly.
@param address
the address of the cluster, used to create the path name for the
znode
@param lastTxid
the last transaction id i... | [
"Creates",
"a",
"node",
"in",
"zookeeper",
"denoting",
"the",
"current",
"session",
"id",
"and",
"the",
"last",
"transaction",
"id",
"processed",
"by",
"the",
"primary",
"avatarnode",
".",
"This",
"is",
"used",
"by",
"the",
"primary",
"avatarnode",
"when",
"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L131-L136 |
118,014 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.getPrimarySsId | public Long getPrimarySsId(String address, boolean sync) throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
Stat stat = new Stat();
String node = getSsIdNode(address);
byte[] data = getNodeData(node, stat, false, sync);
if (data == null) {
return null;
}
... | java | public Long getPrimarySsId(String address, boolean sync) throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
Stat stat = new Stat();
String node = getSsIdNode(address);
byte[] data = getNodeData(node, stat, false, sync);
if (data == null) {
return null;
}
... | [
"public",
"Long",
"getPrimarySsId",
"(",
"String",
"address",
",",
"boolean",
"sync",
")",
"throws",
"IOException",
",",
"KeeperException",
",",
"InterruptedException",
",",
"ClassNotFoundException",
"{",
"Stat",
"stat",
"=",
"new",
"Stat",
"(",
")",
";",
"Strin... | Retrieves the current session id for the cluster from zookeeper.
@param address
the address of the cluster
@param sync
whether or not to perform a sync before read
@throws IOException
@throws KeeperException
@throws InterruptedException | [
"Retrieves",
"the",
"current",
"session",
"id",
"for",
"the",
"cluster",
"from",
"zookeeper",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L329-L338 |
118,015 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.getPrimaryLastTxId | public ZookeeperTxId getPrimaryLastTxId(String address, boolean sync)
throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
Stat stat = new Stat();
String node = getLastTxIdNode(address);
byte[] data = getNodeData(node, stat, false, sync);
if (data == null) {
... | java | public ZookeeperTxId getPrimaryLastTxId(String address, boolean sync)
throws IOException,
KeeperException, InterruptedException, ClassNotFoundException {
Stat stat = new Stat();
String node = getLastTxIdNode(address);
byte[] data = getNodeData(node, stat, false, sync);
if (data == null) {
... | [
"public",
"ZookeeperTxId",
"getPrimaryLastTxId",
"(",
"String",
"address",
",",
"boolean",
"sync",
")",
"throws",
"IOException",
",",
"KeeperException",
",",
"InterruptedException",
",",
"ClassNotFoundException",
"{",
"Stat",
"stat",
"=",
"new",
"Stat",
"(",
")",
... | Retrieves the last transaction id of the primary from zookeeper.
@param address
the address of the cluster
@param sync
whether or not to perform a sync before read
@throws IOException
@throws KeeperException
@throws InterruptedException | [
"Retrieves",
"the",
"last",
"transaction",
"id",
"of",
"the",
"primary",
"from",
"zookeeper",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L351-L361 |
118,016 | facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.getPrimaryAvatarAddress | public String getPrimaryAvatarAddress(String address, Stat stat, boolean retry)
throws IOException, KeeperException, InterruptedException {
return getPrimaryAvatarAddress(address, stat, retry, false);
} | java | public String getPrimaryAvatarAddress(String address, Stat stat, boolean retry)
throws IOException, KeeperException, InterruptedException {
return getPrimaryAvatarAddress(address, stat, retry, false);
} | [
"public",
"String",
"getPrimaryAvatarAddress",
"(",
"String",
"address",
",",
"Stat",
"stat",
",",
"boolean",
"retry",
")",
"throws",
"IOException",
",",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"getPrimaryAvatarAddress",
"(",
"address",
",",
"... | Retrieves the primary address for the cluster, this does not perform a
sync before it reads the znode. | [
"Retrieves",
"the",
"primary",
"address",
"for",
"the",
"cluster",
"this",
"does",
"not",
"perform",
"a",
"sync",
"before",
"it",
"reads",
"the",
"znode",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L367-L370 |
118,017 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskRunner.java | TaskRunner.addJobJarToClassPath | private void addJobJarToClassPath(String localJarFile, StringBuffer classPath) {
File jobCacheDir = new File
(new Path(localJarFile).getParent().toString());
File[] libs = new File(jobCacheDir, "lib").listFiles();
String sep = System.getProperty("path.separator");
if (libs != null) {
for (i... | java | private void addJobJarToClassPath(String localJarFile, StringBuffer classPath) {
File jobCacheDir = new File
(new Path(localJarFile).getParent().toString());
File[] libs = new File(jobCacheDir, "lib").listFiles();
String sep = System.getProperty("path.separator");
if (libs != null) {
for (i... | [
"private",
"void",
"addJobJarToClassPath",
"(",
"String",
"localJarFile",
",",
"StringBuffer",
"classPath",
")",
"{",
"File",
"jobCacheDir",
"=",
"new",
"File",
"(",
"new",
"Path",
"(",
"localJarFile",
")",
".",
"getParent",
"(",
")",
".",
"toString",
"(",
"... | Given the path to the localized job jar file, add it's constituents to
the classpath | [
"Given",
"the",
"path",
"to",
"the",
"localized",
"job",
"jar",
"file",
"add",
"it",
"s",
"constituents",
"to",
"the",
"classpath"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskRunner.java#L223-L239 |
118,018 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskRunner.java | TaskRunner.appendSystemClasspath | private static void appendSystemClasspath(JobConf conf,
String pathSeparator,
StringBuffer classPath) {
// The alternate runtime can be used to debug tasks by putting a
// custom version of the mapred libraries. This will ge... | java | private static void appendSystemClasspath(JobConf conf,
String pathSeparator,
StringBuffer classPath) {
// The alternate runtime can be used to debug tasks by putting a
// custom version of the mapred libraries. This will ge... | [
"private",
"static",
"void",
"appendSystemClasspath",
"(",
"JobConf",
"conf",
",",
"String",
"pathSeparator",
",",
"StringBuffer",
"classPath",
")",
"{",
"// The alternate runtime can be used to debug tasks by putting a",
"// custom version of the mapred libraries. This will get load... | Add the system class path to a class path
@param conf JobConf
@param pathSeparator Path separator
@param classPath Where to add the system class path | [
"Add",
"the",
"system",
"class",
"path",
"to",
"a",
"class",
"path"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskRunner.java#L247-L270 |
118,019 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidHistogram.java | RaidHistogram.setNewWindows | public synchronized void setNewWindows(ArrayList<Long> newWindows)
throws IOException {
if (newWindows.size() != windows.size()) {
throw new IOException(
"Number of new windows need to be the same as that of old ones");
}
Collections.sort(newWindows);
for (int i = 0; i < newWindows... | java | public synchronized void setNewWindows(ArrayList<Long> newWindows)
throws IOException {
if (newWindows.size() != windows.size()) {
throw new IOException(
"Number of new windows need to be the same as that of old ones");
}
Collections.sort(newWindows);
for (int i = 0; i < newWindows... | [
"public",
"synchronized",
"void",
"setNewWindows",
"(",
"ArrayList",
"<",
"Long",
">",
"newWindows",
")",
"throws",
"IOException",
"{",
"if",
"(",
"newWindows",
".",
"size",
"(",
")",
"!=",
"windows",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IOE... | Only for testing | [
"Only",
"for",
"testing"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidHistogram.java#L151-L165 |
118,020 | facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java | JobQueuesManager.reorderJobs | private void reorderJobs(JobInProgress job, JobSchedulingInfo oldInfo,
QueueInfo qi) {
if(qi.removeWaitingJob(oldInfo) != null) {
qi.addWaitingJob(job);
}
if(qi.removeRunningJob(oldInfo) != null) {
qi.addRunningJob(job);
}
} | java | private void reorderJobs(JobInProgress job, JobSchedulingInfo oldInfo,
QueueInfo qi) {
if(qi.removeWaitingJob(oldInfo) != null) {
qi.addWaitingJob(job);
}
if(qi.removeRunningJob(oldInfo) != null) {
qi.addRunningJob(job);
}
} | [
"private",
"void",
"reorderJobs",
"(",
"JobInProgress",
"job",
",",
"JobSchedulingInfo",
"oldInfo",
",",
"QueueInfo",
"qi",
")",
"{",
"if",
"(",
"qi",
".",
"removeWaitingJob",
"(",
"oldInfo",
")",
"!=",
"null",
")",
"{",
"qi",
".",
"addWaitingJob",
"(",
"j... | because of the change in the job priority or job start-time. | [
"because",
"of",
"the",
"change",
"in",
"the",
"job",
"priority",
"or",
"job",
"start",
"-",
"time",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java#L208-L217 |
118,021 | facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java | JobQueuesManager.makeJobRunning | private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo,
QueueInfo qi) {
// Removing of the job from job list is responsibility of the
//initialization poller.
// Add the job to the running queue
qi.addRunningJob(job);
} | java | private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo,
QueueInfo qi) {
// Removing of the job from job list is responsibility of the
//initialization poller.
// Add the job to the running queue
qi.addRunningJob(job);
} | [
"private",
"void",
"makeJobRunning",
"(",
"JobInProgress",
"job",
",",
"JobSchedulingInfo",
"oldInfo",
",",
"QueueInfo",
"qi",
")",
"{",
"// Removing of the job from job list is responsibility of the",
"//initialization poller.",
"// Add the job to the running queue",
"qi",
".",
... | This is used to move a job from the waiting queue to the running queue. | [
"This",
"is",
"used",
"to",
"move",
"a",
"job",
"from",
"the",
"waiting",
"queue",
"to",
"the",
"running",
"queue",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java#L220-L226 |
118,022 | facebookarchive/hadoop-20 | src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java | JobQueuesManager.jobStateChanged | private void jobStateChanged(JobStatusChangeEvent event, QueueInfo qi) {
JobInProgress job = event.getJobInProgress();
JobSchedulingInfo oldJobStateInfo =
new JobSchedulingInfo(event.getOldStatus());
// Check if the ordering of the job has changed
// For now priority and start-time can change the... | java | private void jobStateChanged(JobStatusChangeEvent event, QueueInfo qi) {
JobInProgress job = event.getJobInProgress();
JobSchedulingInfo oldJobStateInfo =
new JobSchedulingInfo(event.getOldStatus());
// Check if the ordering of the job has changed
// For now priority and start-time can change the... | [
"private",
"void",
"jobStateChanged",
"(",
"JobStatusChangeEvent",
"event",
",",
"QueueInfo",
"qi",
")",
"{",
"JobInProgress",
"job",
"=",
"event",
".",
"getJobInProgress",
"(",
")",
";",
"JobSchedulingInfo",
"oldJobStateInfo",
"=",
"new",
"JobSchedulingInfo",
"(",
... | Update the scheduler as job's state has changed | [
"Update",
"the",
"scheduler",
"as",
"job",
"s",
"state",
"has",
"changed"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/JobQueuesManager.java#L229-L250 |
118,023 | facebookarchive/hadoop-20 | src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java | PipeMapRed.splitKeyVal | void splitKeyVal(byte[] line, int length, Text key, Text val)
throws IOException {
int numKeyFields = getNumOfKeyFields();
byte[] separator = getFieldSeparator();
// Need to find numKeyFields separators
int pos = UTF8ByteArrayUtils.findBytes(line, 0, length, separator);
for(int k=1; k<numKeyF... | java | void splitKeyVal(byte[] line, int length, Text key, Text val)
throws IOException {
int numKeyFields = getNumOfKeyFields();
byte[] separator = getFieldSeparator();
// Need to find numKeyFields separators
int pos = UTF8ByteArrayUtils.findBytes(line, 0, length, separator);
for(int k=1; k<numKeyF... | [
"void",
"splitKeyVal",
"(",
"byte",
"[",
"]",
"line",
",",
"int",
"length",
",",
"Text",
"key",
",",
"Text",
"val",
")",
"throws",
"IOException",
"{",
"int",
"numKeyFields",
"=",
"getNumOfKeyFields",
"(",
")",
";",
"byte",
"[",
"]",
"separator",
"=",
"... | Split a line into key and value.
@param line: a byte array of line containing UTF-8 bytes
@param key: key of a record
@param val: value of a record
@throws IOException | [
"Split",
"a",
"line",
"into",
"key",
"and",
"value",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java#L375-L396 |
118,024 | facebookarchive/hadoop-20 | src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java | PipeMapRed.write | void write(Object value) throws IOException {
if (clientInputSerializer != null) {
clientInputSerializer.serialize(value);
return;
}
byte[] bval;
int valSize;
if (value instanceof BytesWritable) {
BytesWritable val = (BytesWritable) value;
bval = val.getBytes();
valSiz... | java | void write(Object value) throws IOException {
if (clientInputSerializer != null) {
clientInputSerializer.serialize(value);
return;
}
byte[] bval;
int valSize;
if (value instanceof BytesWritable) {
BytesWritable val = (BytesWritable) value;
bval = val.getBytes();
valSiz... | [
"void",
"write",
"(",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"clientInputSerializer",
"!=",
"null",
")",
"{",
"clientInputSerializer",
".",
"serialize",
"(",
"value",
")",
";",
"return",
";",
"}",
"byte",
"[",
"]",
"bval",
";",
... | Write a value to the output stream using UTF-8 encoding
@param value output value
@throws IOException | [
"Write",
"a",
"value",
"to",
"the",
"output",
"stream",
"using",
"UTF",
"-",
"8",
"encoding"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java#L680-L702 |
118,025 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java | XmlEditsVisitor.writeTag | private void writeTag(String tag, String value) throws IOException {
printIndents();
if(value.length() > 0) {
write("<" + tag + ">" + value + "</" + tag + ">\n");
} else {
write("<" + tag + "/>\n");
}
} | java | private void writeTag(String tag, String value) throws IOException {
printIndents();
if(value.length() > 0) {
write("<" + tag + ">" + value + "</" + tag + ">\n");
} else {
write("<" + tag + "/>\n");
}
} | [
"private",
"void",
"writeTag",
"(",
"String",
"tag",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"printIndents",
"(",
")",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"write",
"(",
"\"<\"",
"+",
"tag",
"+",
... | Write an XML tag
@param tag a tag name
@param value a tag value | [
"Write",
"an",
"XML",
"tag"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java#L136-L143 |
118,026 | facebookarchive/hadoop-20 | src/contrib/snapshot/src/java/org/apache/hadoop/hdfs/server/namenode/SnapshotNode.java | SnapshotNode.updateLeasedFiles | void updateLeasedFiles(SnapshotStorage ssStore) throws IOException {
FSNamesystem fsNamesys = ssStore.getFSNamesystem();
List<Block> blocksForNN = new ArrayList<Block>();
leaseUpdateThreadPool = new ThreadPoolExecutor(1, maxLeaseUpdateThreads, 60,
TimeUnit.S... | java | void updateLeasedFiles(SnapshotStorage ssStore) throws IOException {
FSNamesystem fsNamesys = ssStore.getFSNamesystem();
List<Block> blocksForNN = new ArrayList<Block>();
leaseUpdateThreadPool = new ThreadPoolExecutor(1, maxLeaseUpdateThreads, 60,
TimeUnit.S... | [
"void",
"updateLeasedFiles",
"(",
"SnapshotStorage",
"ssStore",
")",
"throws",
"IOException",
"{",
"FSNamesystem",
"fsNamesys",
"=",
"ssStore",
".",
"getFSNamesystem",
"(",
")",
";",
"List",
"<",
"Block",
">",
"blocksForNN",
"=",
"new",
"ArrayList",
"<",
"Block"... | Tries to get the most up to date lengths of files under construction. | [
"Tries",
"to",
"get",
"the",
"most",
"up",
"to",
"date",
"lengths",
"of",
"files",
"under",
"construction",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/snapshot/src/java/org/apache/hadoop/hdfs/server/namenode/SnapshotNode.java#L367-L415 |
118,027 | facebookarchive/hadoop-20 | src/contrib/snapshot/src/java/org/apache/hadoop/hdfs/server/namenode/SnapshotNode.java | SnapshotNode.downloadSnapshotFiles | void downloadSnapshotFiles(SnapshotStorage ssStore) throws IOException {
CheckpointSignature start = namenode.getCheckpointSignature();
ssStore.storage.setStorageInfo(start);
CheckpointSignature end = null;
boolean success;
do {
// Clear temp files
prepareDownloadDirs();
// get f... | java | void downloadSnapshotFiles(SnapshotStorage ssStore) throws IOException {
CheckpointSignature start = namenode.getCheckpointSignature();
ssStore.storage.setStorageInfo(start);
CheckpointSignature end = null;
boolean success;
do {
// Clear temp files
prepareDownloadDirs();
// get f... | [
"void",
"downloadSnapshotFiles",
"(",
"SnapshotStorage",
"ssStore",
")",
"throws",
"IOException",
"{",
"CheckpointSignature",
"start",
"=",
"namenode",
".",
"getCheckpointSignature",
"(",
")",
";",
"ssStore",
".",
"storage",
".",
"setStorageInfo",
"(",
"start",
")",... | Download fsimage, edits and edits.new files from the name-node.
Files will be downloaded in CURRENT_DIR
@throws IOException | [
"Download",
"fsimage",
"edits",
"and",
"edits",
".",
"new",
"files",
"from",
"the",
"name",
"-",
"node",
".",
"Files",
"will",
"be",
"downloaded",
"in",
"CURRENT_DIR"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/snapshot/src/java/org/apache/hadoop/hdfs/server/namenode/SnapshotNode.java#L422-L465 |
118,028 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.reassignLease | synchronized Lease reassignLease(Lease lease, String src, String newHolder) {
assert newHolder != null : "new lease holder is null";
LeaseOpenTime leaseOpenTime = null;
if (lease != null) {
leaseOpenTime = removeLease(lease, src);
}
return addLease(newHolder, src,
le... | java | synchronized Lease reassignLease(Lease lease, String src, String newHolder) {
assert newHolder != null : "new lease holder is null";
LeaseOpenTime leaseOpenTime = null;
if (lease != null) {
leaseOpenTime = removeLease(lease, src);
}
return addLease(newHolder, src,
le... | [
"synchronized",
"Lease",
"reassignLease",
"(",
"Lease",
"lease",
",",
"String",
"src",
",",
"String",
"newHolder",
")",
"{",
"assert",
"newHolder",
"!=",
"null",
":",
"\"new lease holder is null\"",
";",
"LeaseOpenTime",
"leaseOpenTime",
"=",
"null",
";",
"if",
... | Reassign lease for file src to the new holder. | [
"Reassign",
"lease",
"for",
"file",
"src",
"to",
"the",
"new",
"holder",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L172-L182 |
118,029 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.findPath | synchronized String findPath(INodeFileUnderConstruction pendingFile)
throws IOException {
Lease lease = getLease(pendingFile.getClientName());
if (lease != null) {
String src = lease.findPath(pendingFile);
if (src != null) {
return src;
}
}
throw new IOExcepti... | java | synchronized String findPath(INodeFileUnderConstruction pendingFile)
throws IOException {
Lease lease = getLease(pendingFile.getClientName());
if (lease != null) {
String src = lease.findPath(pendingFile);
if (src != null) {
return src;
}
}
throw new IOExcepti... | [
"synchronized",
"String",
"findPath",
"(",
"INodeFileUnderConstruction",
"pendingFile",
")",
"throws",
"IOException",
"{",
"Lease",
"lease",
"=",
"getLease",
"(",
"pendingFile",
".",
"getClientName",
"(",
")",
")",
";",
"if",
"(",
"lease",
"!=",
"null",
")",
"... | Find the pathname for the specified pendingFile | [
"Find",
"the",
"pathname",
"for",
"the",
"specified",
"pendingFile"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L187-L198 |
118,030 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.removeLease | synchronized LeaseOpenTime removeLease(Lease lease, String src) {
LeaseOpenTime leaseOpenTime = sortedLeasesByPath.remove(src);
if (!lease.removePath(src)) {
LOG.error(src + " not found in lease.paths (=" + lease.paths + ")");
}
if (!lease.hasPath()) {
leases.remove(lease.holder);
if ... | java | synchronized LeaseOpenTime removeLease(Lease lease, String src) {
LeaseOpenTime leaseOpenTime = sortedLeasesByPath.remove(src);
if (!lease.removePath(src)) {
LOG.error(src + " not found in lease.paths (=" + lease.paths + ")");
}
if (!lease.hasPath()) {
leases.remove(lease.holder);
if ... | [
"synchronized",
"LeaseOpenTime",
"removeLease",
"(",
"Lease",
"lease",
",",
"String",
"src",
")",
"{",
"LeaseOpenTime",
"leaseOpenTime",
"=",
"sortedLeasesByPath",
".",
"remove",
"(",
"src",
")",
";",
"if",
"(",
"!",
"lease",
".",
"removePath",
"(",
"src",
"... | Remove the specified lease and src. | [
"Remove",
"the",
"specified",
"lease",
"and",
"src",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L203-L216 |
118,031 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.removeLease | synchronized void removeLease(String holder, String src) {
Lease lease = getLease(holder);
if (lease != null) {
removeLease(lease, src);
}
} | java | synchronized void removeLease(String holder, String src) {
Lease lease = getLease(holder);
if (lease != null) {
removeLease(lease, src);
}
} | [
"synchronized",
"void",
"removeLease",
"(",
"String",
"holder",
",",
"String",
"src",
")",
"{",
"Lease",
"lease",
"=",
"getLease",
"(",
"holder",
")",
";",
"if",
"(",
"lease",
"!=",
"null",
")",
"{",
"removeLease",
"(",
"lease",
",",
"src",
")",
";",
... | Remove the lease for the specified holder and src | [
"Remove",
"the",
"lease",
"for",
"the",
"specified",
"holder",
"and",
"src"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L221-L226 |
118,032 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java | LeaseManager.checkLeases | synchronized void checkLeases() {
int numPathsChecked = 0;
for(; sortedLeases.size() > 0; ) {
final Lease oldest = sortedLeases.first();
if (!oldest.expiredHardLimit()) {
return;
}
// internalReleaseLease() removes paths corresponding to empty files,
// i.e. it needs... | java | synchronized void checkLeases() {
int numPathsChecked = 0;
for(; sortedLeases.size() > 0; ) {
final Lease oldest = sortedLeases.first();
if (!oldest.expiredHardLimit()) {
return;
}
// internalReleaseLease() removes paths corresponding to empty files,
// i.e. it needs... | [
"synchronized",
"void",
"checkLeases",
"(",
")",
"{",
"int",
"numPathsChecked",
"=",
"0",
";",
"for",
"(",
";",
"sortedLeases",
".",
"size",
"(",
")",
">",
"0",
";",
")",
"{",
"final",
"Lease",
"oldest",
"=",
"sortedLeases",
".",
"first",
"(",
")",
"... | Check the leases beginning from the oldest. | [
"Check",
"the",
"leases",
"beginning",
"from",
"the",
"oldest",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java#L533-L564 |
118,033 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/Progress.java | Progress.addPhase | public Progress addPhase(String status) {
Progress phase = addPhase();
phase.setStatus(status);
return phase;
} | java | public Progress addPhase(String status) {
Progress phase = addPhase();
phase.setStatus(status);
return phase;
} | [
"public",
"Progress",
"addPhase",
"(",
"String",
"status",
")",
"{",
"Progress",
"phase",
"=",
"addPhase",
"(",
")",
";",
"phase",
".",
"setStatus",
"(",
"status",
")",
";",
"return",
"phase",
";",
"}"
] | Adds a named node to the tree. | [
"Adds",
"a",
"named",
"node",
"to",
"the",
"tree",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/Progress.java#L40-L44 |
118,034 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/Progress.java | Progress.complete | public void complete() {
// we have to traverse up to our parent, so be careful about locking.
Progress myParent;
synchronized(this) {
progress = 1.0f;
myParent = parent;
}
if (myParent != null) {
// this will synchronize on the parent, so we make sure we release
// our lock ... | java | public void complete() {
// we have to traverse up to our parent, so be careful about locking.
Progress myParent;
synchronized(this) {
progress = 1.0f;
myParent = parent;
}
if (myParent != null) {
// this will synchronize on the parent, so we make sure we release
// our lock ... | [
"public",
"void",
"complete",
"(",
")",
"{",
"// we have to traverse up to our parent, so be careful about locking.",
"Progress",
"myParent",
";",
"synchronized",
"(",
"this",
")",
"{",
"progress",
"=",
"1.0f",
";",
"myParent",
"=",
"parent",
";",
"}",
"if",
"(",
... | Completes this node, moving the parent node to its next child. | [
"Completes",
"this",
"node",
"moving",
"the",
"parent",
"node",
"to",
"its",
"next",
"child",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/Progress.java#L67-L81 |
118,035 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/Progress.java | Progress.get | public synchronized float get() {
Progress node = this;
while (node.parent != null) { // find the root
node = parent;
}
return node.getInternal();
} | java | public synchronized float get() {
Progress node = this;
while (node.parent != null) { // find the root
node = parent;
}
return node.getInternal();
} | [
"public",
"synchronized",
"float",
"get",
"(",
")",
"{",
"Progress",
"node",
"=",
"this",
";",
"while",
"(",
"node",
".",
"parent",
"!=",
"null",
")",
"{",
"// find the root",
"node",
"=",
"parent",
";",
"}",
"return",
"node",
".",
"getInternal",
"(",
... | and the node's parent never changes. Still, it doesn't hurt. | [
"and",
"the",
"node",
"s",
"parent",
"never",
"changes",
".",
"Still",
"it",
"doesn",
"t",
"hurt",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/Progress.java#L91-L97 |
118,036 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/Progress.java | Progress.getInternal | private synchronized float getInternal() {
int phaseCount = phases.size();
if (phaseCount != 0) {
float subProgress =
currentPhase < phaseCount ? phase().getInternal() : 0.0f;
return progressPerPhase*(currentPhase + subProgress);
} else {
return progress;
}
} | java | private synchronized float getInternal() {
int phaseCount = phases.size();
if (phaseCount != 0) {
float subProgress =
currentPhase < phaseCount ? phase().getInternal() : 0.0f;
return progressPerPhase*(currentPhase + subProgress);
} else {
return progress;
}
} | [
"private",
"synchronized",
"float",
"getInternal",
"(",
")",
"{",
"int",
"phaseCount",
"=",
"phases",
".",
"size",
"(",
")",
";",
"if",
"(",
"phaseCount",
"!=",
"0",
")",
"{",
"float",
"subProgress",
"=",
"currentPhase",
"<",
"phaseCount",
"?",
"phase",
... | Computes progress in this node. | [
"Computes",
"progress",
"in",
"this",
"node",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/Progress.java#L100-L109 |
118,037 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSLocationsRoot.java | DFSLocationsRoot.reloadLocations | private synchronized void reloadLocations() {
map.clear();
for (HadoopServer location : ServerRegistry.getInstance().getServers())
map.put(location, new DFSLocation(provider, location));
} | java | private synchronized void reloadLocations() {
map.clear();
for (HadoopServer location : ServerRegistry.getInstance().getServers())
map.put(location, new DFSLocation(provider, location));
} | [
"private",
"synchronized",
"void",
"reloadLocations",
"(",
")",
"{",
"map",
".",
"clear",
"(",
")",
";",
"for",
"(",
"HadoopServer",
"location",
":",
"ServerRegistry",
".",
"getInstance",
"(",
")",
".",
"getServers",
"(",
")",
")",
"map",
".",
"put",
"("... | Recompute the map of Hadoop locations | [
"Recompute",
"the",
"map",
"of",
"Hadoop",
"locations"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSLocationsRoot.java#L88-L92 |
118,038 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/LogUtils.java | LogUtils.incrLogMetrics | public static void incrLogMetrics(Map<String, Long> incrMetrics) {
if (incrMetrics == null || incrMetrics.size() == 0) {
return;
}
MetricsRegistry registry = RaidNodeMetrics.getInstance(
RaidNodeMetrics.DEFAULT_NAMESPACE_ID).getMetricsRegistry();
Map<String, MetricsTimeVaryingLong> logMetr... | java | public static void incrLogMetrics(Map<String, Long> incrMetrics) {
if (incrMetrics == null || incrMetrics.size() == 0) {
return;
}
MetricsRegistry registry = RaidNodeMetrics.getInstance(
RaidNodeMetrics.DEFAULT_NAMESPACE_ID).getMetricsRegistry();
Map<String, MetricsTimeVaryingLong> logMetr... | [
"public",
"static",
"void",
"incrLogMetrics",
"(",
"Map",
"<",
"String",
",",
"Long",
">",
"incrMetrics",
")",
"{",
"if",
"(",
"incrMetrics",
"==",
"null",
"||",
"incrMetrics",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"MetricsReg... | Increase logMetrics in the Raidnode metrics | [
"Increase",
"logMetrics",
"in",
"the",
"Raidnode",
"metrics"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/LogUtils.java#L152-L168 |
118,039 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.getLocalAddress | static java.net.InetAddress getLocalAddress() throws IOException {
try {
return java.net.InetAddress.getLocalHost();
} catch (java.net.UnknownHostException e) {
throw new IOException(e);
}
} | java | static java.net.InetAddress getLocalAddress() throws IOException {
try {
return java.net.InetAddress.getLocalHost();
} catch (java.net.UnknownHostException e) {
throw new IOException(e);
}
} | [
"static",
"java",
".",
"net",
".",
"InetAddress",
"getLocalAddress",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"java",
".",
"net",
".",
"InetAddress",
".",
"getLocalHost",
"(",
")",
";",
"}",
"catch",
"(",
"java",
".",
"net",
".",
"... | A helper function to get the local address of the machine
@return the local address of the current machine
@throws IOException | [
"A",
"helper",
"function",
"to",
"get",
"the",
"local",
"address",
"of",
"the",
"machine"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L212-L218 |
118,040 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.initializeServer | private ServerSocket initializeServer(CoronaConf conf) throws IOException {
// Choose any free port.
ServerSocket sessionServerSocket =
new ServerSocket(0, 0, getLocalAddress());
TServerSocket tServerSocket = new TServerSocket(sessionServerSocket,
co... | java | private ServerSocket initializeServer(CoronaConf conf) throws IOException {
// Choose any free port.
ServerSocket sessionServerSocket =
new ServerSocket(0, 0, getLocalAddress());
TServerSocket tServerSocket = new TServerSocket(sessionServerSocket,
co... | [
"private",
"ServerSocket",
"initializeServer",
"(",
"CoronaConf",
"conf",
")",
"throws",
"IOException",
"{",
"// Choose any free port.",
"ServerSocket",
"sessionServerSocket",
"=",
"new",
"ServerSocket",
"(",
"0",
",",
"0",
",",
"getLocalAddress",
"(",
")",
")",
";"... | Start the SessionDriver callback server
@param conf the corona configuration for this session
@return the server socket of the callback server
@throws IOException | [
"Start",
"the",
"SessionDriver",
"callback",
"server"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L226-L242 |
118,041 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.setName | public void setName(String name) throws IOException {
if (failException != null) {
throw failException;
}
if (name == null || name.length() == 0) {
return;
}
sessionInfo.name = name;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManag... | java | public void setName(String name) throws IOException {
if (failException != null) {
throw failException;
}
if (name == null || name.length() == 0) {
return;
}
sessionInfo.name = name;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManag... | [
"public",
"void",
"setName",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",... | Set the name for this session in the ClusterManager
@param name the name of this session
@throws IOException | [
"Set",
"the",
"name",
"for",
"this",
"session",
"in",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L303-L317 |
118,042 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.setPriority | public void setPriority(SessionPriority prio) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.priority = prio;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sessionId, newI... | java | public void setPriority(SessionPriority prio) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.priority = prio;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sessionId, newI... | [
"public",
"void",
"setPriority",
"(",
"SessionPriority",
"prio",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"sessionInfo",
".",
"priority",
"=",
"prio",
";",
"SessionInfo",
"newInf... | Set the priority for this session in the ClusterManager
@param prio the priority of this session
@throws IOException | [
"Set",
"the",
"priority",
"for",
"this",
"session",
"in",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L324-L334 |
118,043 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.setDeadline | public void setDeadline(long sessionDeadline) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.deadline = sessionDeadline;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sess... | java | public void setDeadline(long sessionDeadline) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.deadline = sessionDeadline;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sess... | [
"public",
"void",
"setDeadline",
"(",
"long",
"sessionDeadline",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"sessionInfo",
".",
"deadline",
"=",
"sessionDeadline",
";",
"SessionInfo"... | Set the deadline for this session in the ClusterManager
@param sessionDeadline the deadline for the session
@throws IOException | [
"Set",
"the",
"deadline",
"for",
"this",
"session",
"in",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L341-L351 |
118,044 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.setUrl | public void setUrl(String url) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.url = url;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sessionId, newInfo));
} | java | public void setUrl(String url) throws IOException {
if (failException != null) {
throw failException;
}
sessionInfo.url = url;
SessionInfo newInfo = new SessionInfo(sessionInfo);
cmNotifier.addCall(
new ClusterManagerService.sessionUpdateInfo_args(sessionId, newInfo));
} | [
"public",
"void",
"setUrl",
"(",
"String",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"sessionInfo",
".",
"url",
"=",
"url",
";",
"SessionInfo",
"newInfo",
"=",
"new",
... | Set the URL for this session in the ClusterManager
@param url the url of this session
@throws IOException | [
"Set",
"the",
"URL",
"for",
"this",
"session",
"in",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L358-L368 |
118,045 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.stopRemoteSession | public void stopRemoteSession(String remoteId) {
cmNotifier.addCall(new ClusterManagerService.sessionEnd_args(remoteId,
SessionStatus.TIMED_OUT));
} | java | public void stopRemoteSession(String remoteId) {
cmNotifier.addCall(new ClusterManagerService.sessionEnd_args(remoteId,
SessionStatus.TIMED_OUT));
} | [
"public",
"void",
"stopRemoteSession",
"(",
"String",
"remoteId",
")",
"{",
"cmNotifier",
".",
"addCall",
"(",
"new",
"ClusterManagerService",
".",
"sessionEnd_args",
"(",
"remoteId",
",",
"SessionStatus",
".",
"TIMED_OUT",
")",
")",
";",
"}"
] | Stops session acquired by remote JT
@param remoteId id of remote JT session | [
"Stops",
"session",
"acquired",
"by",
"remote",
"JT"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L375-L378 |
118,046 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.stop | public void stop(SessionStatus status,
List<ResourceType> resourceTypes,
List<NodeUsageReport> reportList) {
LOG.info("Stopping session driver");
running = false;
// clear all calls from the notifier and append the feedback and session
// end.
cmNotifier.clearC... | java | public void stop(SessionStatus status,
List<ResourceType> resourceTypes,
List<NodeUsageReport> reportList) {
LOG.info("Stopping session driver");
running = false;
// clear all calls from the notifier and append the feedback and session
// end.
cmNotifier.clearC... | [
"public",
"void",
"stop",
"(",
"SessionStatus",
"status",
",",
"List",
"<",
"ResourceType",
">",
"resourceTypes",
",",
"List",
"<",
"NodeUsageReport",
">",
"reportList",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Stopping session driver\"",
")",
";",
"running",
"="... | Stop the SessionDriver.
This sends the message to the ClusterManager indicating that the session
has ended.
If reportList is not null or empty it will send the report prior to
closing the session.
@param status the terminating status of the session
@param resourceTypes the types of the resources to send the report for... | [
"Stop",
"the",
"SessionDriver",
".",
"This",
"sends",
"the",
"message",
"to",
"the",
"ClusterManager",
"indicating",
"that",
"the",
"session",
"has",
"ended",
".",
"If",
"reportList",
"is",
"not",
"null",
"or",
"empty",
"it",
"will",
"send",
"the",
"report",... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L412-L432 |
118,047 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.join | public void join() throws InterruptedException {
serverThread.join();
long start = System.currentTimeMillis();
cmNotifier.join(SESSION_DRIVER_WAIT_INTERVAL);
long end = System.currentTimeMillis();
if (end - start >= SESSION_DRIVER_WAIT_INTERVAL) {
LOG.warn("Taking more than " + SESSION_DRIVER_... | java | public void join() throws InterruptedException {
serverThread.join();
long start = System.currentTimeMillis();
cmNotifier.join(SESSION_DRIVER_WAIT_INTERVAL);
long end = System.currentTimeMillis();
if (end - start >= SESSION_DRIVER_WAIT_INTERVAL) {
LOG.warn("Taking more than " + SESSION_DRIVER_... | [
"public",
"void",
"join",
"(",
")",
"throws",
"InterruptedException",
"{",
"serverThread",
".",
"join",
"(",
")",
";",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"cmNotifier",
".",
"join",
"(",
"SESSION_DRIVER_WAIT_INTERVAL",
")",... | Join the underlying threads of SessionDriver
@throws InterruptedException | [
"Join",
"the",
"underlying",
"threads",
"of",
"SessionDriver"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L438-L448 |
118,048 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.requestResources | public void requestResources(List<ResourceRequest> wanted)
throws IOException {
if (failException != null) {
throw failException;
}
cmNotifier.addCall(
new ClusterManagerService.requestResource_args(sessionId, wanted));
} | java | public void requestResources(List<ResourceRequest> wanted)
throws IOException {
if (failException != null) {
throw failException;
}
cmNotifier.addCall(
new ClusterManagerService.requestResource_args(sessionId, wanted));
} | [
"public",
"void",
"requestResources",
"(",
"List",
"<",
"ResourceRequest",
">",
"wanted",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"cmNotifier",
".",
"addCall",
"(",
"new",
"Cl... | Request needed resources from the ClusterManager
@param wanted the list of resources requested
@throws IOException | [
"Request",
"needed",
"resources",
"from",
"the",
"ClusterManager"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L455-L463 |
118,049 | facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.releaseResources | public void releaseResources(List<ResourceRequest> released)
throws IOException {
if (failException != null) {
throw failException;
}
List<Integer> releasedIds = new ArrayList<Integer>();
for (ResourceRequest req : released) {
releasedIds.add(req.getId());
}
cmNotifier.addCall(
... | java | public void releaseResources(List<ResourceRequest> released)
throws IOException {
if (failException != null) {
throw failException;
}
List<Integer> releasedIds = new ArrayList<Integer>();
for (ResourceRequest req : released) {
releasedIds.add(req.getId());
}
cmNotifier.addCall(
... | [
"public",
"void",
"releaseResources",
"(",
"List",
"<",
"ResourceRequest",
">",
"released",
")",
"throws",
"IOException",
"{",
"if",
"(",
"failException",
"!=",
"null",
")",
"{",
"throw",
"failException",
";",
"}",
"List",
"<",
"Integer",
">",
"releasedIds",
... | Release the resources that are no longer used
@param released resources to be released
@throws IOException | [
"Release",
"the",
"resources",
"that",
"are",
"no",
"longer",
"used"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L470-L482 |
118,050 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/aggregate/UserDefinedValueAggregatorDescriptor.java | UserDefinedValueAggregatorDescriptor.createInstance | public static Object createInstance(String className) {
Object retv = null;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Class<?> theFilterClass = Class.forName(className, true, classLoader);
Constructor meth = theFilterClass.getDeclaredConstructor(argArray);... | java | public static Object createInstance(String className) {
Object retv = null;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Class<?> theFilterClass = Class.forName(className, true, classLoader);
Constructor meth = theFilterClass.getDeclaredConstructor(argArray);... | [
"public",
"static",
"Object",
"createInstance",
"(",
"String",
"className",
")",
"{",
"Object",
"retv",
"=",
"null",
";",
"try",
"{",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"C... | Create an instance of the given class
@param className the name of the class
@return a dynamically created instance of the given class | [
"Create",
"an",
"instance",
"of",
"the",
"given",
"class"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/aggregate/UserDefinedValueAggregatorDescriptor.java#L48-L60 |
118,051 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java | LightWeightBitSet.set | public static void set(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
throw new IndexOutOfBoundsException();
bits[offset] |= 1L << pos;
} | java | public static void set(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
throw new IndexOutOfBoundsException();
bits[offset] |= 1L << pos;
} | [
"public",
"static",
"void",
"set",
"(",
"long",
"[",
"]",
"bits",
",",
"int",
"pos",
")",
"{",
"int",
"offset",
"=",
"pos",
">>",
"LONG_SHIFT",
";",
"if",
"(",
"offset",
">=",
"bits",
".",
"length",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"("... | Set the bit for the given position to true.
@param bits - bitset
@param pos - position to be set to true | [
"Set",
"the",
"bit",
"for",
"the",
"given",
"position",
"to",
"true",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java#L62-L67 |
118,052 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java | LightWeightBitSet.clear | public static void clear(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
throw new IndexOutOfBoundsException();
bits[offset] &= ~(1L << pos);
} | java | public static void clear(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
throw new IndexOutOfBoundsException();
bits[offset] &= ~(1L << pos);
} | [
"public",
"static",
"void",
"clear",
"(",
"long",
"[",
"]",
"bits",
",",
"int",
"pos",
")",
"{",
"int",
"offset",
"=",
"pos",
">>",
"LONG_SHIFT",
";",
"if",
"(",
"offset",
">=",
"bits",
".",
"length",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"... | Set the bit for the given position to false.
@param bits - bitset
@param pos - position to be set to false | [
"Set",
"the",
"bit",
"for",
"the",
"given",
"position",
"to",
"false",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java#L75-L80 |
118,053 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java | LightWeightBitSet.get | public static boolean get(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
return false;
return (bits[offset] & (1L << pos)) != 0;
} | java | public static boolean get(long[] bits, int pos) {
int offset = pos >> LONG_SHIFT;
if (offset >= bits.length)
return false;
return (bits[offset] & (1L << pos)) != 0;
} | [
"public",
"static",
"boolean",
"get",
"(",
"long",
"[",
"]",
"bits",
",",
"int",
"pos",
")",
"{",
"int",
"offset",
"=",
"pos",
">>",
"LONG_SHIFT",
";",
"if",
"(",
"offset",
">=",
"bits",
".",
"length",
")",
"return",
"false",
";",
"return",
"(",
"b... | Gets the bit for the given position.
@param bits
- bitset
@param pos
- position to retrieve. | [
"Gets",
"the",
"bit",
"for",
"the",
"given",
"position",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java#L90-L95 |
118,054 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java | LightWeightBitSet.cardinality | public static int cardinality(long[] bits) {
int card = 0;
for (int i = bits.length - 1; i >= 0; i--) {
long a = bits[i];
if (a == 0)
continue;
if (a == -1) {
card += 64;
continue;
}
// Successively collapse alternating bit groups into a sum.
a = ((a >... | java | public static int cardinality(long[] bits) {
int card = 0;
for (int i = bits.length - 1; i >= 0; i--) {
long a = bits[i];
if (a == 0)
continue;
if (a == -1) {
card += 64;
continue;
}
// Successively collapse alternating bit groups into a sum.
a = ((a >... | [
"public",
"static",
"int",
"cardinality",
"(",
"long",
"[",
"]",
"bits",
")",
"{",
"int",
"card",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"bits",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"long",
"a",
"=",
... | Checks the number of bits set to 1.
@param bits - bitset
@return the number of bits set to 1 | [
"Checks",
"the",
"number",
"of",
"bits",
"set",
"to",
"1",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/LightWeightBitSet.java#L103-L122 |
118,055 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/client/HttpImageUploadStream.java | HttpImageUploadStream.checkState | void checkState() throws IOException {
int majority = getMajoritySize();
int numDisabled = 0;
for (HttpImageUploadChannel ch : uploadChannels) {
numDisabled += ch.isDisabled() ? 1 : 0;
}
if (numDisabled >= majority) {
Map<HttpImageUploadChannel, Void> successes
= new HashMap<Htt... | java | void checkState() throws IOException {
int majority = getMajoritySize();
int numDisabled = 0;
for (HttpImageUploadChannel ch : uploadChannels) {
numDisabled += ch.isDisabled() ? 1 : 0;
}
if (numDisabled >= majority) {
Map<HttpImageUploadChannel, Void> successes
= new HashMap<Htt... | [
"void",
"checkState",
"(",
")",
"throws",
"IOException",
"{",
"int",
"majority",
"=",
"getMajoritySize",
"(",
")",
";",
"int",
"numDisabled",
"=",
"0",
";",
"for",
"(",
"HttpImageUploadChannel",
"ch",
":",
"uploadChannels",
")",
"{",
"numDisabled",
"+=",
"ch... | At each operation, this function is used to ensure that we still have a
majority of successful channels to which we can write. | [
"At",
"each",
"operation",
"this",
"function",
"is",
"used",
"to",
"ensure",
"that",
"we",
"still",
"have",
"a",
"majority",
"of",
"successful",
"channels",
"to",
"which",
"we",
"can",
"write",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/HttpImageUploadStream.java#L89-L110 |
118,056 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/client/HttpImageUploadStream.java | HttpImageUploadStream.flushBuffer | private void flushBuffer(boolean close) {
for (HttpImageUploadChannel ch : uploadChannels) {
ch.send(buffer);
}
if (!close) {
// allocate new buffer, since the old one is used by the channels for
// reading
buffer = new ByteArrayOutputStream((int) (1.2 * flushSize));
}
} | java | private void flushBuffer(boolean close) {
for (HttpImageUploadChannel ch : uploadChannels) {
ch.send(buffer);
}
if (!close) {
// allocate new buffer, since the old one is used by the channels for
// reading
buffer = new ByteArrayOutputStream((int) (1.2 * flushSize));
}
} | [
"private",
"void",
"flushBuffer",
"(",
"boolean",
"close",
")",
"{",
"for",
"(",
"HttpImageUploadChannel",
"ch",
":",
"uploadChannels",
")",
"{",
"ch",
".",
"send",
"(",
"buffer",
")",
";",
"}",
"if",
"(",
"!",
"close",
")",
"{",
"// allocate new buffer, s... | Flushes the buffer to the upload channels and allocates a new buffer. | [
"Flushes",
"the",
"buffer",
"to",
"the",
"upload",
"channels",
"and",
"allocates",
"a",
"new",
"buffer",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/HttpImageUploadStream.java#L128-L137 |
118,057 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.getFs | public synchronized FileSystem getFs() throws IOException {
if (this.fs == null) {
Path sysDir = getSystemDir();
this.fs = sysDir.getFileSystem(getConf());
}
return fs;
} | java | public synchronized FileSystem getFs() throws IOException {
if (this.fs == null) {
Path sysDir = getSystemDir();
this.fs = sysDir.getFileSystem(getConf());
}
return fs;
} | [
"public",
"synchronized",
"FileSystem",
"getFs",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"fs",
"==",
"null",
")",
"{",
"Path",
"sysDir",
"=",
"getSystemDir",
"(",
")",
";",
"this",
".",
"fs",
"=",
"sysDir",
".",
"getFileSystem",
... | Get a filesystem handle. We need this to prepare jobs
for submission to the MapReduce system.
@return the filesystem handle. | [
"Get",
"a",
"filesystem",
"handle",
".",
"We",
"need",
"this",
"to",
"prepare",
"jobs",
"for",
"submission",
"to",
"the",
"MapReduce",
"system",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L552-L558 |
118,058 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.copyRemoteFiles | private Path copyRemoteFiles(FileSystem jtFs, Path parentDir,
Path originalPath, JobConf job,
short replication, String md5)
throws IOException {
//check if we do not need to copy the files
// is jt using the same file system.
// just checkin... | java | private Path copyRemoteFiles(FileSystem jtFs, Path parentDir,
Path originalPath, JobConf job,
short replication, String md5)
throws IOException {
//check if we do not need to copy the files
// is jt using the same file system.
// just checkin... | [
"private",
"Path",
"copyRemoteFiles",
"(",
"FileSystem",
"jtFs",
",",
"Path",
"parentDir",
",",
"Path",
"originalPath",
",",
"JobConf",
"job",
",",
"short",
"replication",
",",
"String",
"md5",
")",
"throws",
"IOException",
"{",
"//check if we do not need to copy th... | was copied to | [
"was",
"copied",
"to"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L608-L679 |
118,059 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.symLinkAndConfigureFiles | private void symLinkAndConfigureFiles(JobConf job) throws IOException {
if (!(job.getBoolean("mapred.used.genericoptionsparser", false))) {
LOG.warn("Use GenericOptionsParser for parsing the arguments. " +
"Applications should implement Tool for the same.");
}
// get all the command li... | java | private void symLinkAndConfigureFiles(JobConf job) throws IOException {
if (!(job.getBoolean("mapred.used.genericoptionsparser", false))) {
LOG.warn("Use GenericOptionsParser for parsing the arguments. " +
"Applications should implement Tool for the same.");
}
// get all the command li... | [
"private",
"void",
"symLinkAndConfigureFiles",
"(",
"JobConf",
"job",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"job",
".",
"getBoolean",
"(",
"\"mapred.used.genericoptionsparser\"",
",",
"false",
")",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\... | Create symlinks for the files needed for the jobs in current directory
@param job
@throws IOException | [
"Create",
"symlinks",
"for",
"the",
"files",
"needed",
"for",
"the",
"jobs",
"in",
"current",
"directory"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L700-L739 |
118,060 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.configureUserName | private void configureUserName(JobConf job) throws IOException {
UnixUserGroupInformation ugi = getUGI(job);
// Set the user's name, group and working directory
job.setUser(ugi.getUserName());
if (ugi.getGroupNames() != null && ugi.getGroupNames().length > 0) {
job.set("group.name", ugi.getGroupNam... | java | private void configureUserName(JobConf job) throws IOException {
UnixUserGroupInformation ugi = getUGI(job);
// Set the user's name, group and working directory
job.setUser(ugi.getUserName());
if (ugi.getGroupNames() != null && ugi.getGroupNames().length > 0) {
job.set("group.name", ugi.getGroupNam... | [
"private",
"void",
"configureUserName",
"(",
"JobConf",
"job",
")",
"throws",
"IOException",
"{",
"UnixUserGroupInformation",
"ugi",
"=",
"getUGI",
"(",
"job",
")",
";",
"// Set the user's name, group and working directory",
"job",
".",
"setUser",
"(",
"ugi",
".",
"... | set this user's id in job configuration, so later job files can be
accessed using this user's id
@param job
@throws IOException | [
"set",
"this",
"user",
"s",
"id",
"in",
"job",
"configuration",
"so",
"later",
"job",
"files",
"can",
"be",
"accessed",
"using",
"this",
"user",
"s",
"id"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1092-L1102 |
118,061 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.submitJob | public RunningJob submitJob(String jobFile) throws FileNotFoundException,
InvalidJobConfException,
IOException {
// Load in the submitted job details
JobConf job = new JobConf(jobFile);
return submitJob... | java | public RunningJob submitJob(String jobFile) throws FileNotFoundException,
InvalidJobConfException,
IOException {
// Load in the submitted job details
JobConf job = new JobConf(jobFile);
return submitJob... | [
"public",
"RunningJob",
"submitJob",
"(",
"String",
"jobFile",
")",
"throws",
"FileNotFoundException",
",",
"InvalidJobConfException",
",",
"IOException",
"{",
"// Load in the submitted job details",
"JobConf",
"job",
"=",
"new",
"JobConf",
"(",
"jobFile",
")",
";",
"... | Submit a job to the MR system.
This returns a handle to the {@link RunningJob} which can be used to track
the running-job.
@param jobFile the job configuration.
@return a handle to the {@link RunningJob} which can be used to track the
running-job.
@throws FileNotFoundException
@throws InvalidJobConfException
@throws ... | [
"Submit",
"a",
"job",
"to",
"the",
"MR",
"system",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1128-L1134 |
118,062 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.submitJobInternal | public
RunningJob submitJobInternal(JobConf job
) throws FileNotFoundException,
ClassNotFoundException,
InterruptedException,
IOException {
/*
* configure the... | java | public
RunningJob submitJobInternal(JobConf job
) throws FileNotFoundException,
ClassNotFoundException,
InterruptedException,
IOException {
/*
* configure the... | [
"public",
"RunningJob",
"submitJobInternal",
"(",
"JobConf",
"job",
")",
"throws",
"FileNotFoundException",
",",
"ClassNotFoundException",
",",
"InterruptedException",
",",
"IOException",
"{",
"/*\n * configure the command line options correctly on the submitting dfs\n */",
... | Internal method for submitting jobs to the system.
@param job the configuration to submit
@return a proxy object for the running job
@throws FileNotFoundException
@throws ClassNotFoundException
@throws InterruptedException
@throws IOException | [
"Internal",
"method",
"for",
"submitting",
"jobs",
"to",
"the",
"system",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1175-L1265 |
118,063 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.validateNumberOfTasks | private void validateNumberOfTasks(int splits, int reduceTasks, JobConf conf)
throws IOException {
int maxTasks = conf.getInt("mapred.jobtracker.maxtasks.per.job", -1);
int totalTasks = splits + reduceTasks;
if ((maxTasks!= -1) && (totalTasks > maxTasks)) {
throw new IOException(
... | java | private void validateNumberOfTasks(int splits, int reduceTasks, JobConf conf)
throws IOException {
int maxTasks = conf.getInt("mapred.jobtracker.maxtasks.per.job", -1);
int totalTasks = splits + reduceTasks;
if ((maxTasks!= -1) && (totalTasks > maxTasks)) {
throw new IOException(
... | [
"private",
"void",
"validateNumberOfTasks",
"(",
"int",
"splits",
",",
"int",
"reduceTasks",
",",
"JobConf",
"conf",
")",
"throws",
"IOException",
"{",
"int",
"maxTasks",
"=",
"conf",
".",
"getInt",
"(",
"\"mapred.jobtracker.maxtasks.per.job\"",
",",
"-",
"1",
"... | JobTrcker applies this limit against the sum of mappers and reducers. | [
"JobTrcker",
"applies",
"this",
"limit",
"against",
"the",
"sum",
"of",
"mappers",
"and",
"reducers",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1353-L1364 |
118,064 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.readSplitFile | static RawSplit[] readSplitFile(DataInput in) throws IOException {
byte[] header = new byte[SPLIT_FILE_HEADER.length];
in.readFully(header);
if (!Arrays.equals(SPLIT_FILE_HEADER, header)) {
throw new IOException("Invalid header on split file");
}
int vers = WritableUtils.readVInt(in);
if (... | java | static RawSplit[] readSplitFile(DataInput in) throws IOException {
byte[] header = new byte[SPLIT_FILE_HEADER.length];
in.readFully(header);
if (!Arrays.equals(SPLIT_FILE_HEADER, header)) {
throw new IOException("Invalid header on split file");
}
int vers = WritableUtils.readVInt(in);
if (... | [
"static",
"RawSplit",
"[",
"]",
"readSplitFile",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"header",
"=",
"new",
"byte",
"[",
"SPLIT_FILE_HEADER",
".",
"length",
"]",
";",
"in",
".",
"readFully",
"(",
"header",
")",
";"... | Read a splits file into a list of raw splits
@param in the stream to read from
@return the complete list of splits
@throws IOException | [
"Read",
"a",
"splits",
"file",
"into",
"a",
"list",
"of",
"raw",
"splits"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1529-L1546 |
118,065 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.displayTasks | public void displayTasks(JobID jobId, String type, String state)
throws IOException {
TaskReport[] reports = new TaskReport[0];
if (type.equals("map")) {
reports = getMapTaskReports(jobId);
} else if (type.equals("reduce")) {
reports = getReduceTaskReports(jobId);
} else if (type.equals("s... | java | public void displayTasks(JobID jobId, String type, String state)
throws IOException {
TaskReport[] reports = new TaskReport[0];
if (type.equals("map")) {
reports = getMapTaskReports(jobId);
} else if (type.equals("reduce")) {
reports = getReduceTaskReports(jobId);
} else if (type.equals("s... | [
"public",
"void",
"displayTasks",
"(",
"JobID",
"jobId",
",",
"String",
"type",
",",
"String",
"state",
")",
"throws",
"IOException",
"{",
"TaskReport",
"[",
"]",
"reports",
"=",
"new",
"TaskReport",
"[",
"0",
"]",
";",
"if",
"(",
"type",
".",
"equals",
... | Display the information about a job's tasks, of a particular type and
in a particular state
@param jobId the ID of the job
@param type the type of the task (map/reduce/setup/cleanup)
@param state the state of the task
(pending/running/completed/failed/killed) | [
"Display",
"the",
"information",
"about",
"a",
"job",
"s",
"tasks",
"of",
"a",
"particular",
"type",
"and",
"in",
"a",
"particular",
"state"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1658-L1680 |
118,066 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.runJob | public static RunningJob runJob(JobConf job) throws IOException {
JobClient jc = new JobClient(job);
RunningJob rj = jc.submitJob(job);
try {
if (!jc.monitorAndPrintJob(job, rj)) {
throw new IOException("Job failed!");
}
} catch (InterruptedException ie) {
Thread.currentThread(... | java | public static RunningJob runJob(JobConf job) throws IOException {
JobClient jc = new JobClient(job);
RunningJob rj = jc.submitJob(job);
try {
if (!jc.monitorAndPrintJob(job, rj)) {
throw new IOException("Job failed!");
}
} catch (InterruptedException ie) {
Thread.currentThread(... | [
"public",
"static",
"RunningJob",
"runJob",
"(",
"JobConf",
"job",
")",
"throws",
"IOException",
"{",
"JobClient",
"jc",
"=",
"new",
"JobClient",
"(",
"job",
")",
";",
"RunningJob",
"rj",
"=",
"jc",
".",
"submitJob",
"(",
"job",
")",
";",
"try",
"{",
"... | Utility that submits a job, then polls for progress until the job is
complete.
@param job the job configuration.
@throws IOException if the job fails | [
"Utility",
"that",
"submits",
"a",
"job",
"then",
"polls",
"for",
"progress",
"until",
"the",
"job",
"is",
"complete",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1753-L1764 |
118,067 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.monitorAndPrintJob | public boolean monitorAndPrintJob(JobConf conf,
RunningJob job
) throws IOException, InterruptedException {
String lastReport = null;
TaskStatusFilter filter;
filter = getTaskOutputFilter(conf);
JobID jobId = job.getID();
LOG.info("Running job: " + jobId);
i... | java | public boolean monitorAndPrintJob(JobConf conf,
RunningJob job
) throws IOException, InterruptedException {
String lastReport = null;
TaskStatusFilter filter;
filter = getTaskOutputFilter(conf);
JobID jobId = job.getID();
LOG.info("Running job: " + jobId);
i... | [
"public",
"boolean",
"monitorAndPrintJob",
"(",
"JobConf",
"conf",
",",
"RunningJob",
"job",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"String",
"lastReport",
"=",
"null",
";",
"TaskStatusFilter",
"filter",
";",
"filter",
"=",
"getTaskOutputFil... | Monitor a job and print status in real-time as progress is made and tasks
fail.
@param conf the job's configuration
@param job the job to track
@return true if the job succeeded
@throws IOException if communication to the JobTracker fails | [
"Monitor",
"a",
"job",
"and",
"print",
"status",
"in",
"real",
"-",
"time",
"as",
"progress",
"is",
"made",
"and",
"tasks",
"fail",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1774-L1855 |
118,068 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listEvents | private void listEvents(JobID jobId, int fromEventId, int numEvents)
throws IOException {
TaskCompletionEvent[] events =
jobSubmitClient.getTaskCompletionEvents(jobId, fromEventId, numEvents);
System.out.println("Task completion events for " + jobId);
System.out.println("Number of events (from " +... | java | private void listEvents(JobID jobId, int fromEventId, int numEvents)
throws IOException {
TaskCompletionEvent[] events =
jobSubmitClient.getTaskCompletionEvents(jobId, fromEventId, numEvents);
System.out.println("Task completion events for " + jobId);
System.out.println("Number of events (from " +... | [
"private",
"void",
"listEvents",
"(",
"JobID",
"jobId",
",",
"int",
"fromEventId",
",",
"int",
"numEvents",
")",
"throws",
"IOException",
"{",
"TaskCompletionEvent",
"[",
"]",
"events",
"=",
"jobSubmitClient",
".",
"getTaskCompletionEvents",
"(",
"jobId",
",",
"... | List the events for the given job
@param jobId the job id for the job's events to list
@throws IOException | [
"List",
"the",
"events",
"for",
"the",
"given",
"job"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2335-L2347 |
118,069 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listJobs | private void listJobs() throws IOException {
JobStatus[] jobs = jobsToComplete();
if (jobs == null)
jobs = new JobStatus[0];
System.out.printf("%d jobs currently running\n", jobs.length);
displayJobList(jobs);
} | java | private void listJobs() throws IOException {
JobStatus[] jobs = jobsToComplete();
if (jobs == null)
jobs = new JobStatus[0];
System.out.printf("%d jobs currently running\n", jobs.length);
displayJobList(jobs);
} | [
"private",
"void",
"listJobs",
"(",
")",
"throws",
"IOException",
"{",
"JobStatus",
"[",
"]",
"jobs",
"=",
"jobsToComplete",
"(",
")",
";",
"if",
"(",
"jobs",
"==",
"null",
")",
"jobs",
"=",
"new",
"JobStatus",
"[",
"0",
"]",
";",
"System",
".",
"out... | Dump a list of currently running jobs
@throws IOException | [
"Dump",
"a",
"list",
"of",
"currently",
"running",
"jobs"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2353-L2360 |
118,070 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listAllJobs | private void listAllJobs() throws IOException {
JobStatus[] jobs = getAllJobs();
if (jobs == null)
jobs = new JobStatus[0];
System.out.printf("%d jobs submitted\n", jobs.length);
System.out.printf("States are:\n\tRunning : 1\tSucceded : 2" +
"\tFailed : 3\tPrep : 4\n");
displayJobList(jobs... | java | private void listAllJobs() throws IOException {
JobStatus[] jobs = getAllJobs();
if (jobs == null)
jobs = new JobStatus[0];
System.out.printf("%d jobs submitted\n", jobs.length);
System.out.printf("States are:\n\tRunning : 1\tSucceded : 2" +
"\tFailed : 3\tPrep : 4\n");
displayJobList(jobs... | [
"private",
"void",
"listAllJobs",
"(",
")",
"throws",
"IOException",
"{",
"JobStatus",
"[",
"]",
"jobs",
"=",
"getAllJobs",
"(",
")",
";",
"if",
"(",
"jobs",
"==",
"null",
")",
"jobs",
"=",
"new",
"JobStatus",
"[",
"0",
"]",
";",
"System",
".",
"out"... | Dump a list of all jobs submitted.
@throws IOException | [
"Dump",
"a",
"list",
"of",
"all",
"jobs",
"submitted",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2366-L2374 |
118,071 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listActiveTrackers | private void listActiveTrackers() throws IOException {
ClusterStatus c = jobSubmitClient.getClusterStatus(true);
Collection<String> trackers = c.getActiveTrackerNames();
for (String trackerName : trackers) {
System.out.println(trackerName);
}
} | java | private void listActiveTrackers() throws IOException {
ClusterStatus c = jobSubmitClient.getClusterStatus(true);
Collection<String> trackers = c.getActiveTrackerNames();
for (String trackerName : trackers) {
System.out.println(trackerName);
}
} | [
"private",
"void",
"listActiveTrackers",
"(",
")",
"throws",
"IOException",
"{",
"ClusterStatus",
"c",
"=",
"jobSubmitClient",
".",
"getClusterStatus",
"(",
"true",
")",
";",
"Collection",
"<",
"String",
">",
"trackers",
"=",
"c",
".",
"getActiveTrackerNames",
"... | Display the list of active trackers | [
"Display",
"the",
"list",
"of",
"active",
"trackers"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2379-L2385 |
118,072 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listBlacklistedTrackers | private void listBlacklistedTrackers() throws IOException {
ClusterStatus c = jobSubmitClient.getClusterStatus(true);
Collection<String> trackers = c.getBlacklistedTrackerNames();
for (String trackerName : trackers) {
System.out.println(trackerName);
}
} | java | private void listBlacklistedTrackers() throws IOException {
ClusterStatus c = jobSubmitClient.getClusterStatus(true);
Collection<String> trackers = c.getBlacklistedTrackerNames();
for (String trackerName : trackers) {
System.out.println(trackerName);
}
} | [
"private",
"void",
"listBlacklistedTrackers",
"(",
")",
"throws",
"IOException",
"{",
"ClusterStatus",
"c",
"=",
"jobSubmitClient",
".",
"getClusterStatus",
"(",
"true",
")",
";",
"Collection",
"<",
"String",
">",
"trackers",
"=",
"c",
".",
"getBlacklistedTrackerN... | Display the list of blacklisted trackers | [
"Display",
"the",
"list",
"of",
"blacklisted",
"trackers"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2390-L2396 |
118,073 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.listTrackers | private void listTrackers() throws IOException {
ClusterStatus fullStatus = jobSubmitClient.getClusterStatus(true);
Collection<TaskTrackerStatus> trackers =
fullStatus.getTaskTrackersDetails();
Set<String> activeTrackers =
new HashSet<String>(fullStatus.getActiveTrackerNames());
... | java | private void listTrackers() throws IOException {
ClusterStatus fullStatus = jobSubmitClient.getClusterStatus(true);
Collection<TaskTrackerStatus> trackers =
fullStatus.getTaskTrackersDetails();
Set<String> activeTrackers =
new HashSet<String>(fullStatus.getActiveTrackerNames());
... | [
"private",
"void",
"listTrackers",
"(",
")",
"throws",
"IOException",
"{",
"ClusterStatus",
"fullStatus",
"=",
"jobSubmitClient",
".",
"getClusterStatus",
"(",
"true",
")",
";",
"Collection",
"<",
"TaskTrackerStatus",
">",
"trackers",
"=",
"fullStatus",
".",
"getT... | Display the stats of the cluster with per tracker details
@throws IOException | [
"Display",
"the",
"stats",
"of",
"the",
"cluster",
"with",
"per",
"tracker",
"details"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L2402-L2463 |
118,074 | facebookarchive/hadoop-20 | src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PathFinder.java | PathFinder.getAbsolutePath | public File getAbsolutePath(String filename)
{
if (pathenv == null || pathSep == null || fileSep == null)
{
return null;
}
int val = -1;
String classvalue = pathenv + pathSep;
while (((val = classvalue.indexOf(pathSep)) >= 0) &&
classvalue.length() > 0) {
... | java | public File getAbsolutePath(String filename)
{
if (pathenv == null || pathSep == null || fileSep == null)
{
return null;
}
int val = -1;
String classvalue = pathenv + pathSep;
while (((val = classvalue.indexOf(pathSep)) >= 0) &&
classvalue.length() > 0) {
... | [
"public",
"File",
"getAbsolutePath",
"(",
"String",
"filename",
")",
"{",
"if",
"(",
"pathenv",
"==",
"null",
"||",
"pathSep",
"==",
"null",
"||",
"fileSep",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"val",
"=",
"-",
"1",
";",
"Strin... | Returns the full path name of this file if it is listed in the
path | [
"Returns",
"the",
"full",
"path",
"name",
"of",
"this",
"file",
"if",
"it",
"is",
"listed",
"in",
"the",
"path"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PathFinder.java#L68-L103 |
118,075 | facebookarchive/hadoop-20 | src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PathFinder.java | PathFinder.printSystemProperties | private static void printSystemProperties() {
System.out.println("System properties: ");
java.util.Properties p = System.getProperties();
java.util.Enumeration keys = p.keys();
while(keys.hasMoreElements()) {
String thiskey = (String)keys.nextElement();
String value = p.getProperty(thiskey);... | java | private static void printSystemProperties() {
System.out.println("System properties: ");
java.util.Properties p = System.getProperties();
java.util.Enumeration keys = p.keys();
while(keys.hasMoreElements()) {
String thiskey = (String)keys.nextElement();
String value = p.getProperty(thiskey);... | [
"private",
"static",
"void",
"printSystemProperties",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"System properties: \"",
")",
";",
"java",
".",
"util",
".",
"Properties",
"p",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"java",
".... | prints all system properties for this process | [
"prints",
"all",
"system",
"properties",
"for",
"this",
"process"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/PathFinder.java#L123-L132 |
118,076 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java | DFSFile.downloadToLocalFile | public void downloadToLocalFile(final File file)
throws InvocationTargetException, InterruptedException {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(
new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException {
... | java | public void downloadToLocalFile(final File file)
throws InvocationTargetException, InterruptedException {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(
new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException {
... | [
"public",
"void",
"downloadToLocalFile",
"(",
"final",
"File",
"file",
")",
"throws",
"InvocationTargetException",
",",
"InterruptedException",
"{",
"PlatformUI",
".",
"getWorkbench",
"(",
")",
".",
"getProgressService",
"(",
")",
".",
"busyCursorWhile",
"(",
"new",... | Download this file to the local file system. This creates a download
status monitor.
@param file
@throws JSchException
@throws IOException
@throws InvocationTargetException
@throws InterruptedException
@deprecated | [
"Download",
"this",
"file",
"to",
"the",
"local",
"file",
"system",
".",
"This",
"creates",
"a",
"download",
"status",
"monitor",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java#L104-L115 |
118,077 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java | DFSFile.toDetailedString | public String toDetailedString() {
final String[] units = { "b", "Kb", "Mb", "Gb", "Tb" };
int unit = 0;
double l = this.length;
while ((l >= 1024.0) && (unit < units.length)) {
unit += 1;
l /= 1024.0;
}
return String.format("%s (%.1f %s, r%d)", super.toString(), l,
units[un... | java | public String toDetailedString() {
final String[] units = { "b", "Kb", "Mb", "Gb", "Tb" };
int unit = 0;
double l = this.length;
while ((l >= 1024.0) && (unit < units.length)) {
unit += 1;
l /= 1024.0;
}
return String.format("%s (%.1f %s, r%d)", super.toString(), l,
units[un... | [
"public",
"String",
"toDetailedString",
"(",
")",
"{",
"final",
"String",
"[",
"]",
"units",
"=",
"{",
"\"b\"",
",",
"\"Kb\"",
",",
"\"Mb\"",
",",
"\"Gb\"",
",",
"\"Tb\"",
"}",
";",
"int",
"unit",
"=",
"0",
";",
"double",
"l",
"=",
"this",
".",
"le... | Provides a detailed string for this file
@return the string formatted as
<tt><filename> (<size>, r<replication>)</tt> | [
"Provides",
"a",
"detailed",
"string",
"for",
"this",
"file"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java#L152-L163 |
118,078 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java | DFSFile.downloadToLocalFile | public void downloadToLocalFile(IProgressMonitor monitor, File file)
throws InvocationTargetException {
final int taskSize = 1024;
monitor.setTaskName("Download file " + this.path);
BufferedOutputStream ostream = null;
DataInputStream istream = null;
try {
istream = getDFS().open(thi... | java | public void downloadToLocalFile(IProgressMonitor monitor, File file)
throws InvocationTargetException {
final int taskSize = 1024;
monitor.setTaskName("Download file " + this.path);
BufferedOutputStream ostream = null;
DataInputStream istream = null;
try {
istream = getDFS().open(thi... | [
"public",
"void",
"downloadToLocalFile",
"(",
"IProgressMonitor",
"monitor",
",",
"File",
"file",
")",
"throws",
"InvocationTargetException",
"{",
"final",
"int",
"taskSize",
"=",
"1024",
";",
"monitor",
".",
"setTaskName",
"(",
"\"Download file \"",
"+",
"this",
... | Download the DfsFile to a local file. Use the given monitor to report
status of operation.
@param monitor the status monitor
@param file the local file where to put the downloaded file
@throws InvocationTargetException | [
"Download",
"the",
"DfsFile",
"to",
"a",
"local",
"file",
".",
"Use",
"the",
"given",
"monitor",
"to",
"report",
"status",
"of",
"operation",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java#L183-L227 |
118,079 | facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java | DFSFile.upload | public void upload(IProgressMonitor monitor, File file) {
final int taskSize = 1024;
monitor.setTaskName("Upload file " + this.path);
BufferedInputStream istream = null;
DataOutputStream ostream = null;
try {
istream = new BufferedInputStream(new FileInputStream(file));
ostream = get... | java | public void upload(IProgressMonitor monitor, File file) {
final int taskSize = 1024;
monitor.setTaskName("Upload file " + this.path);
BufferedInputStream istream = null;
DataOutputStream ostream = null;
try {
istream = new BufferedInputStream(new FileInputStream(file));
ostream = get... | [
"public",
"void",
"upload",
"(",
"IProgressMonitor",
"monitor",
",",
"File",
"file",
")",
"{",
"final",
"int",
"taskSize",
"=",
"1024",
";",
"monitor",
".",
"setTaskName",
"(",
"\"Upload file \"",
"+",
"this",
".",
"path",
")",
";",
"BufferedInputStream",
"i... | Upload a local file to this file on the distributed file system
@param monitor
@param file | [
"Upload",
"a",
"local",
"file",
"to",
"this",
"file",
"on",
"the",
"distributed",
"file",
"system"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFile.java#L235-L279 |
118,080 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystemDatanodeHelper.java | FSNamesystemDatanodeHelper.getDatanodeStats | public static DatanodeStatus getDatanodeStats(FSNamesystem ns,
ArrayList<DatanodeDescriptor> live, ArrayList<DatanodeDescriptor> dead) {
ns.DFSNodesStatus(live, dead);
ArrayList<DatanodeDescriptor> decommissioning = ns
.getDecommissioningNodesList(live);
// live nodes
int numLive = live.s... | java | public static DatanodeStatus getDatanodeStats(FSNamesystem ns,
ArrayList<DatanodeDescriptor> live, ArrayList<DatanodeDescriptor> dead) {
ns.DFSNodesStatus(live, dead);
ArrayList<DatanodeDescriptor> decommissioning = ns
.getDecommissioningNodesList(live);
// live nodes
int numLive = live.s... | [
"public",
"static",
"DatanodeStatus",
"getDatanodeStats",
"(",
"FSNamesystem",
"ns",
",",
"ArrayList",
"<",
"DatanodeDescriptor",
">",
"live",
",",
"ArrayList",
"<",
"DatanodeDescriptor",
">",
"dead",
")",
"{",
"ns",
".",
"DFSNodesStatus",
"(",
"live",
",",
"dea... | Get status of the datanodes in the system. | [
"Get",
"status",
"of",
"the",
"datanodes",
"in",
"the",
"system",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystemDatanodeHelper.java#L32-L70 |
118,081 | facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/IFileOutputStream.java | IFileOutputStream.finish | public void finish() throws IOException {
if (finished) {
return;
}
finished = true;
sum.writeValue(barray, 0, false);
out.write (barray, 0, sum.getChecksumSize());
out.flush();
} | java | public void finish() throws IOException {
if (finished) {
return;
}
finished = true;
sum.writeValue(barray, 0, false);
out.write (barray, 0, sum.getChecksumSize());
out.flush();
} | [
"public",
"void",
"finish",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"finished",
")",
"{",
"return",
";",
"}",
"finished",
"=",
"true",
";",
"sum",
".",
"writeValue",
"(",
"barray",
",",
"0",
",",
"false",
")",
";",
"out",
".",
"write",
"... | Finishes writing data to the output stream, by writing
the checksum bytes to the end. The underlying stream is not closed.
@throws IOException | [
"Finishes",
"writing",
"data",
"to",
"the",
"output",
"stream",
"by",
"writing",
"the",
"checksum",
"bytes",
"to",
"the",
"end",
".",
"The",
"underlying",
"stream",
"is",
"not",
"closed",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/IFileOutputStream.java#L69-L77 |
118,082 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.hardLink | public boolean hardLink(Path src, Path dst) throws IOException {
return fs.hardLink(src, dst);
} | java | public boolean hardLink(Path src, Path dst) throws IOException {
return fs.hardLink(src, dst);
} | [
"public",
"boolean",
"hardLink",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"return",
"fs",
".",
"hardLink",
"(",
"src",
",",
"dst",
")",
";",
"}"
] | hard link Path dst to Path src. Can take place on DFS. | [
"hard",
"link",
"Path",
"dst",
"to",
"Path",
"src",
".",
"Can",
"take",
"place",
"on",
"DFS",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L188-L190 |
118,083 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.rename | public boolean rename(Path src, Path dst) throws IOException {
return fs.rename(src, dst);
} | java | public boolean rename(Path src, Path dst) throws IOException {
return fs.rename(src, dst);
} | [
"public",
"boolean",
"rename",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"return",
"fs",
".",
"rename",
"(",
"src",
",",
"dst",
")",
";",
"}"
] | Renames Path src to Path dst. Can take place on local fs
or remote DFS. | [
"Renames",
"Path",
"src",
"to",
"Path",
"dst",
".",
"Can",
"take",
"place",
"on",
"local",
"fs",
"or",
"remote",
"DFS",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L200-L202 |
118,084 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.copyFromLocalFile | public void copyFromLocalFile(boolean delSrc, boolean overwrite,
Path[] srcs, Path dst)
throws IOException {
fs.copyFromLocalFile(delSrc, overwrite, srcs, dst);
} | java | public void copyFromLocalFile(boolean delSrc, boolean overwrite,
Path[] srcs, Path dst)
throws IOException {
fs.copyFromLocalFile(delSrc, overwrite, srcs, dst);
} | [
"public",
"void",
"copyFromLocalFile",
"(",
"boolean",
"delSrc",
",",
"boolean",
"overwrite",
",",
"Path",
"[",
"]",
"srcs",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"fs",
".",
"copyFromLocalFile",
"(",
"delSrc",
",",
"overwrite",
",",
"srcs",
... | The src files are on the local disk. Add it to FS at
the given dst name.
delSrc indicates if the source should be removed | [
"The",
"src",
"files",
"are",
"on",
"the",
"local",
"disk",
".",
"Add",
"it",
"to",
"FS",
"at",
"the",
"given",
"dst",
"name",
".",
"delSrc",
"indicates",
"if",
"the",
"source",
"should",
"be",
"removed"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L321-L325 |
118,085 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.copyToLocalFile | public void copyToLocalFile(boolean delSrc, Path src, Path dst)
throws IOException {
fs.copyToLocalFile(delSrc, src, dst);
} | java | public void copyToLocalFile(boolean delSrc, Path src, Path dst)
throws IOException {
fs.copyToLocalFile(delSrc, src, dst);
} | [
"public",
"void",
"copyToLocalFile",
"(",
"boolean",
"delSrc",
",",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"fs",
".",
"copyToLocalFile",
"(",
"delSrc",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
delSrc indicates if the src will be removed or not. | [
"The",
"src",
"file",
"is",
"under",
"FS",
"and",
"the",
"dst",
"is",
"on",
"the",
"local",
"disk",
".",
"Copy",
"it",
"from",
"FS",
"control",
"to",
"the",
"local",
"dst",
"name",
".",
"delSrc",
"indicates",
"if",
"the",
"src",
"will",
"be",
"remove... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L343-L346 |
118,086 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.startLocalOutput | public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
return fs.startLocalOutput(fsOutputFile, tmpLocalFile);
} | java | public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
return fs.startLocalOutput(fsOutputFile, tmpLocalFile);
} | [
"public",
"Path",
"startLocalOutput",
"(",
"Path",
"fsOutputFile",
",",
"Path",
"tmpLocalFile",
")",
"throws",
"IOException",
"{",
"return",
"fs",
".",
"startLocalOutput",
"(",
"fsOutputFile",
",",
"tmpLocalFile",
")",
";",
"}"
] | Returns a local File that the user can write output to. The caller
provides both the eventual FS target name and the local working
file. If the FS is local, we write directly into the target. If
the FS is remote, we write into the tmp local area. | [
"Returns",
"a",
"local",
"File",
"that",
"the",
"user",
"can",
"write",
"output",
"to",
".",
"The",
"caller",
"provides",
"both",
"the",
"eventual",
"FS",
"target",
"name",
"and",
"the",
"local",
"working",
"file",
".",
"If",
"the",
"FS",
"is",
"local",
... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L354-L357 |
118,087 | facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.completeLocalOutput | public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
fs.completeLocalOutput(fsOutputFile, tmpLocalFile);
} | java | public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
throws IOException {
fs.completeLocalOutput(fsOutputFile, tmpLocalFile);
} | [
"public",
"void",
"completeLocalOutput",
"(",
"Path",
"fsOutputFile",
",",
"Path",
"tmpLocalFile",
")",
"throws",
"IOException",
"{",
"fs",
".",
"completeLocalOutput",
"(",
"fsOutputFile",
",",
"tmpLocalFile",
")",
";",
"}"
] | Called when we're all done writing to the target. A local FS will
do nothing, because we've written to exactly the right place. A remote
FS will copy the contents of tmpLocalFile to the correct target at
fsOutputFile. | [
"Called",
"when",
"we",
"re",
"all",
"done",
"writing",
"to",
"the",
"target",
".",
"A",
"local",
"FS",
"will",
"do",
"nothing",
"because",
"we",
"ve",
"written",
"to",
"exactly",
"the",
"right",
"place",
".",
"A",
"remote",
"FS",
"will",
"copy",
"the"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L365-L368 |
118,088 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java | LocalStore.insert | public void insert(EventRecord er) {
SerializedRecord sr = new SerializedRecord(er);
try {
Anonymizer.anonymize(sr);
} catch (Exception e) {
e.printStackTrace();
}
append(sr);
} | java | public void insert(EventRecord er) {
SerializedRecord sr = new SerializedRecord(er);
try {
Anonymizer.anonymize(sr);
} catch (Exception e) {
e.printStackTrace();
}
append(sr);
} | [
"public",
"void",
"insert",
"(",
"EventRecord",
"er",
")",
"{",
"SerializedRecord",
"sr",
"=",
"new",
"SerializedRecord",
"(",
"er",
")",
";",
"try",
"{",
"Anonymizer",
".",
"anonymize",
"(",
"sr",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{... | Insert an EventRecord to the local storage, after it
gets serialized and anonymized.
@param er the EventRecord to be inserted | [
"Insert",
"an",
"EventRecord",
"to",
"the",
"local",
"storage",
"after",
"it",
"gets",
"serialized",
"and",
"anonymized",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java#L114-L122 |
118,089 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java | LocalStore.pack | public static StringBuffer pack(SerializedRecord sr) {
StringBuffer sb = new StringBuffer();
ArrayList<String> keys = new ArrayList<String>(sr.fields.keySet());
if (sr.isValid())
SerializedRecord.arrangeKeys(keys);
for (int i = 0; i < keys.size(); i++) {
String value = sr.fields.get(keys.... | java | public static StringBuffer pack(SerializedRecord sr) {
StringBuffer sb = new StringBuffer();
ArrayList<String> keys = new ArrayList<String>(sr.fields.keySet());
if (sr.isValid())
SerializedRecord.arrangeKeys(keys);
for (int i = 0; i < keys.size(); i++) {
String value = sr.fields.get(keys.... | [
"public",
"static",
"StringBuffer",
"pack",
"(",
"SerializedRecord",
"sr",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"keys",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"sr",
".",
"f... | Pack a SerializedRecord into an array of bytes
@param sr the SerializedRecord to be packed | [
"Pack",
"a",
"SerializedRecord",
"into",
"an",
"array",
"of",
"bytes"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java#L150-L164 |
118,090 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java | LocalStore.upload | public void upload() {
try {
writer.flush();
if (compress)
zipCompress(filename);
String remoteName = "failmon-";
if ("true".equalsIgnoreCase(Environment.getProperty("anonymizer.hash.hostnames")))
remoteName += Anonymizer.getMD5Hash(InetAddress.getLocalHost().getCanonicalHost... | java | public void upload() {
try {
writer.flush();
if (compress)
zipCompress(filename);
String remoteName = "failmon-";
if ("true".equalsIgnoreCase(Environment.getProperty("anonymizer.hash.hostnames")))
remoteName += Anonymizer.getMD5Hash(InetAddress.getLocalHost().getCanonicalHost... | [
"public",
"void",
"upload",
"(",
")",
"{",
"try",
"{",
"writer",
".",
"flush",
"(",
")",
";",
"if",
"(",
"compress",
")",
"zipCompress",
"(",
"filename",
")",
";",
"String",
"remoteName",
"=",
"\"failmon-\"",
";",
"if",
"(",
"\"true\"",
".",
"equalsIgn... | Upload the local file store into HDFS, after it
compressing it. Then a new local file is created
as a temporary record store. | [
"Upload",
"the",
"local",
"file",
"store",
"into",
"HDFS",
"after",
"it",
"compressing",
"it",
".",
"Then",
"a",
"new",
"local",
"file",
"is",
"created",
"as",
"a",
"temporary",
"record",
"store",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java#L172-L199 |
118,091 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java | LocalStore.zipCompress | public static void zipCompress(String filename) throws IOException {
FileOutputStream fos = new FileOutputStream(filename + COMPRESSION_SUFFIX);
CheckedOutputStream csum = new CheckedOutputStream(fos, new CRC32());
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(csum));
out.setComment... | java | public static void zipCompress(String filename) throws IOException {
FileOutputStream fos = new FileOutputStream(filename + COMPRESSION_SUFFIX);
CheckedOutputStream csum = new CheckedOutputStream(fos, new CRC32());
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(csum));
out.setComment... | [
"public",
"static",
"void",
"zipCompress",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"filename",
"+",
"COMPRESSION_SUFFIX",
")",
";",
"CheckedOutputStream",
"csum",
"=",
"new",
"Ch... | Compress a text file using the ZIP compressing algorithm.
@param filename the path to the file to be compressed | [
"Compress",
"a",
"text",
"file",
"using",
"the",
"ZIP",
"compressing",
"algorithm",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java#L206-L221 |
118,092 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java | LocalStore.copyToHDFS | public static void copyToHDFS(String localFile, String hdfsFile) throws IOException {
String hadoopConfPath;
if (Environment.getProperty("hadoop.conf.path") == null)
hadoopConfPath = "../../../conf";
else
hadoopConfPath = Environment.getProperty("hadoop.conf.path");
// Read the configura... | java | public static void copyToHDFS(String localFile, String hdfsFile) throws IOException {
String hadoopConfPath;
if (Environment.getProperty("hadoop.conf.path") == null)
hadoopConfPath = "../../../conf";
else
hadoopConfPath = Environment.getProperty("hadoop.conf.path");
// Read the configura... | [
"public",
"static",
"void",
"copyToHDFS",
"(",
"String",
"localFile",
",",
"String",
"hdfsFile",
")",
"throws",
"IOException",
"{",
"String",
"hadoopConfPath",
";",
"if",
"(",
"Environment",
".",
"getProperty",
"(",
"\"hadoop.conf.path\"",
")",
"==",
"null",
")"... | Copy a local file to HDFS
@param localFile the filename of the local file
@param hdfsFile the HDFS filename to copy to | [
"Copy",
"a",
"local",
"file",
"to",
"HDFS"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/LocalStore.java#L229-L254 |
118,093 | facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Anonymizer.java | Anonymizer.getMD5Hash | public static String getMD5Hash(String text) {
MessageDigest md;
byte[] md5hash = new byte[32];
try {
md = MessageDigest.getInstance("MD5");
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace()... | java | public static String getMD5Hash(String text) {
MessageDigest md;
byte[] md5hash = new byte[32];
try {
md = MessageDigest.getInstance("MD5");
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace()... | [
"public",
"static",
"String",
"getMD5Hash",
"(",
"String",
"text",
")",
"{",
"MessageDigest",
"md",
";",
"byte",
"[",
"]",
"md5hash",
"=",
"new",
"byte",
"[",
"32",
"]",
";",
"try",
"{",
"md",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
"... | Create the MD5 digest of an input text.
@param text the input text
@return the hexadecimal representation of the MD5 digest | [
"Create",
"the",
"MD5",
"digest",
"of",
"an",
"input",
"text",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/Anonymizer.java#L123-L136 |
118,094 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ListPathsServlet.java | ListPathsServlet.writeInfo | static void writeInfo(String parent, HdfsFileStatus i, XMLOutputter doc) throws IOException {
final SimpleDateFormat ldf = df.get();
doc.startTag(i.isDir() ? "directory" : "file");
doc.attribute("path", i.getFullPath(new Path(parent)).toUri().getPath());
doc.attribute("modified", ldf.format(new Date(i.g... | java | static void writeInfo(String parent, HdfsFileStatus i, XMLOutputter doc) throws IOException {
final SimpleDateFormat ldf = df.get();
doc.startTag(i.isDir() ? "directory" : "file");
doc.attribute("path", i.getFullPath(new Path(parent)).toUri().getPath());
doc.attribute("modified", ldf.format(new Date(i.g... | [
"static",
"void",
"writeInfo",
"(",
"String",
"parent",
",",
"HdfsFileStatus",
"i",
",",
"XMLOutputter",
"doc",
")",
"throws",
"IOException",
"{",
"final",
"SimpleDateFormat",
"ldf",
"=",
"df",
".",
"get",
"(",
")",
";",
"doc",
".",
"startTag",
"(",
"i",
... | Write a node to output.
Node information includes path, modification, permission, owner and group.
For files, it also includes size, replication and block-size. | [
"Write",
"a",
"node",
"to",
"output",
".",
"Node",
"information",
"includes",
"path",
"modification",
"permission",
"owner",
"and",
"group",
".",
"For",
"files",
"it",
"also",
"includes",
"size",
"replication",
"and",
"block",
"-",
"size",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ListPathsServlet.java#L64-L79 |
118,095 | facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/ListPathsServlet.java | ListPathsServlet.buildRoot | protected Map<String,String> buildRoot(HttpServletRequest request,
XMLOutputter doc) {
final String path = request.getPathInfo() != null
? request.getPathInfo() : "/";
final String exclude = request.getParameter("exclude") != null
? request.getParameter("exclude") : "\\..*\\.crc";
final St... | java | protected Map<String,String> buildRoot(HttpServletRequest request,
XMLOutputter doc) {
final String path = request.getPathInfo() != null
? request.getPathInfo() : "/";
final String exclude = request.getParameter("exclude") != null
? request.getParameter("exclude") : "\\..*\\.crc";
final St... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"buildRoot",
"(",
"HttpServletRequest",
"request",
",",
"XMLOutputter",
"doc",
")",
"{",
"final",
"String",
"path",
"=",
"request",
".",
"getPathInfo",
"(",
")",
"!=",
"null",
"?",
"request",
".",
"get... | Build a map from the query string, setting values and defaults. | [
"Build",
"a",
"map",
"from",
"the",
"query",
"string",
"setting",
"values",
"and",
"defaults",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/ListPathsServlet.java#L84-L103 |
118,096 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/PlacementMonitor.java | PlacementMonitor.shouldSubmitMove | private boolean shouldSubmitMove(PolicyInfo policy,
Map<String, Integer> nodeToNumBlocks,
List<BlockInfo> stripeBlocks) {
if (policy == null) {
return true;
}
int targetRepl = Integer.parseInt(policy.getProperty("targetReplication"));
int parityRepl = Integer.parseInt(policy.getPr... | java | private boolean shouldSubmitMove(PolicyInfo policy,
Map<String, Integer> nodeToNumBlocks,
List<BlockInfo> stripeBlocks) {
if (policy == null) {
return true;
}
int targetRepl = Integer.parseInt(policy.getProperty("targetReplication"));
int parityRepl = Integer.parseInt(policy.getPr... | [
"private",
"boolean",
"shouldSubmitMove",
"(",
"PolicyInfo",
"policy",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"nodeToNumBlocks",
",",
"List",
"<",
"BlockInfo",
">",
"stripeBlocks",
")",
"{",
"if",
"(",
"policy",
"==",
"null",
")",
"{",
"return",
"... | We will not submit more block move if the namenode hasn't deleted the
over replicated blocks yet. | [
"We",
"will",
"not",
"submit",
"more",
"block",
"move",
"if",
"the",
"namenode",
"hasn",
"t",
"deleted",
"the",
"over",
"replicated",
"blocks",
"yet",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/PlacementMonitor.java#L566-L595 |
118,097 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrNumBlockFixSimulationSuccess | protected synchronized void incrNumBlockFixSimulationSuccess(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).
blockFixS... | java | protected synchronized void incrNumBlockFixSimulationSuccess(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).
blockFixS... | [
"protected",
"synchronized",
"void",
"incrNumBlockFixSimulationSuccess",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"... | Increments the number of new code file fixing verification success | [
"Increments",
"the",
"number",
"of",
"new",
"code",
"file",
"fixing",
"verification",
"success"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L189-L198 |
118,098 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrNumBlockFixSimulationFailures | protected synchronized void incrNumBlockFixSimulationFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).
blockFix... | java | protected synchronized void incrNumBlockFixSimulationFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).
blockFix... | [
"protected",
"synchronized",
"void",
"incrNumBlockFixSimulationFailures",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
... | Increments the number of new code file fixing verification failures | [
"Increments",
"the",
"number",
"of",
"new",
"code",
"file",
"fixing",
"verification",
"failures"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L210-L219 |
118,099 | facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java | BlockIntegrityMonitor.incrFileFixFailures | protected synchronized void incrFileFixFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).fileFixFailures.inc(incr);
... | java | protected synchronized void incrFileFixFailures(long incr) {
if (incr < 0) {
throw new IllegalArgumentException("Cannot increment by negative value " +
incr);
}
RaidNodeMetrics.getInstance(RaidNodeMetrics.DEFAULT_NAMESPACE_ID).fileFixFailures.inc(incr);
... | [
"protected",
"synchronized",
"void",
"incrFileFixFailures",
"(",
"long",
"incr",
")",
"{",
"if",
"(",
"incr",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot increment by negative value \"",
"+",
"incr",
")",
";",
"}",
"RaidNodeMetri... | Increments the number of corrupt file fixing failures. | [
"Increments",
"the",
"number",
"of",
"corrupt",
"file",
"fixing",
"failures",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/BlockIntegrityMonitor.java#L239-L247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.