id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
119,600
facebookarchive/hadoop-20
src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java
SimulatorTaskTracker.handleSimulatorLaunchTaskAction
private List<SimulatorEvent> handleSimulatorLaunchTaskAction( SimulatorLaunchTaskAction action, long now) { if (LOG.isDebugEnabled()) { LOG.debug("Handling launch task action " + action); } // First, create statuses and update used slots for map and reduce // task separat...
java
private List<SimulatorEvent> handleSimulatorLaunchTaskAction( SimulatorLaunchTaskAction action, long now) { if (LOG.isDebugEnabled()) { LOG.debug("Handling launch task action " + action); } // First, create statuses and update used slots for map and reduce // task separat...
[ "private", "List", "<", "SimulatorEvent", ">", "handleSimulatorLaunchTaskAction", "(", "SimulatorLaunchTaskAction", "action", ",", "long", "now", ")", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ")", ")", "{", "LOG", ".", "debug", "(", "\"Handling launch ...
Launches a task on the simulated task tracker. @param action SimulatorLaunchTaskAction sent by the job tracker @param now current simulation time @return new events generated, a TaskAttemptCompletionEvent for map tasks, empty otherwise
[ "Launches", "a", "task", "on", "the", "simulated", "task", "tracker", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L301-L356
119,601
facebookarchive/hadoop-20
src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java
SimulatorTaskTracker.handleKillTaskAction
private List<SimulatorEvent> handleKillTaskAction(KillTaskAction action, long now) { TaskAttemptID taskId = action.getTaskID(); // we don't have a nice(r) toString() in Hadoop's TaskActions if (LOG.isDebugEnabled()) { LOG.debug("Handling kill task action, taskId=" + taskId + ", now=" + now); } ...
java
private List<SimulatorEvent> handleKillTaskAction(KillTaskAction action, long now) { TaskAttemptID taskId = action.getTaskID(); // we don't have a nice(r) toString() in Hadoop's TaskActions if (LOG.isDebugEnabled()) { LOG.debug("Handling kill task action, taskId=" + taskId + ", now=" + now); } ...
[ "private", "List", "<", "SimulatorEvent", ">", "handleKillTaskAction", "(", "KillTaskAction", "action", ",", "long", "now", ")", "{", "TaskAttemptID", "taskId", "=", "action", ".", "getTaskID", "(", ")", ";", "// we don't have a nice(r) toString() in Hadoop's TaskAction...
Kills a task attempt. @param action contains the task attempt to kill @param now current simulation time @return new events generated in response, empty
[ "Kills", "a", "task", "attempt", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L365-L391
119,602
facebookarchive/hadoop-20
src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java
SimulatorTaskTracker.progressTaskStatus
private void progressTaskStatus(SimulatorTaskInProgress tip, long now) { TaskStatus status = tip.getTaskStatus(); if (status.getRunState() != State.RUNNING) { return; // nothing to be done } boolean isMap = tip.isMapTask(); // Time when the user space code started long startTime = -1; ...
java
private void progressTaskStatus(SimulatorTaskInProgress tip, long now) { TaskStatus status = tip.getTaskStatus(); if (status.getRunState() != State.RUNNING) { return; // nothing to be done } boolean isMap = tip.isMapTask(); // Time when the user space code started long startTime = -1; ...
[ "private", "void", "progressTaskStatus", "(", "SimulatorTaskInProgress", "tip", ",", "long", "now", ")", "{", "TaskStatus", "status", "=", "tip", ".", "getTaskStatus", "(", ")", ";", "if", "(", "status", ".", "getRunState", "(", ")", "!=", "State", ".", "R...
Updates the progress indicator of a task if it is running. @param tip simulator task in progress whose progress is to be updated @param now current simulation time
[ "Updates", "the", "progress", "indicator", "of", "a", "task", "if", "it", "is", "running", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L440-L491
119,603
facebookarchive/hadoop-20
src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java
SimulatorTaskTracker.garbageCollectCompletedTasks
private void garbageCollectCompletedTasks() { for (Iterator<TaskAttemptID> iter = tasks.keySet().iterator(); iter.hasNext();) { TaskAttemptID taskId = iter.next(); SimulatorTaskInProgress tip = tasks.get(taskId); if (tip.getTaskStatus().getRunState() != State.RUNNING) { iter.remov...
java
private void garbageCollectCompletedTasks() { for (Iterator<TaskAttemptID> iter = tasks.keySet().iterator(); iter.hasNext();) { TaskAttemptID taskId = iter.next(); SimulatorTaskInProgress tip = tasks.get(taskId); if (tip.getTaskStatus().getRunState() != State.RUNNING) { iter.remov...
[ "private", "void", "garbageCollectCompletedTasks", "(", ")", "{", "for", "(", "Iterator", "<", "TaskAttemptID", ">", "iter", "=", "tasks", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "TaskAt...
Frees up bookkeping memory used by completed tasks. Has no effect on the events or logs produced by the SimulatorTaskTracker. We need this in order not to report completed task multiple times and to ensure that we do not run out of Java heap memory in larger simulations.
[ "Frees", "up", "bookkeping", "memory", "used", "by", "completed", "tasks", ".", "Has", "no", "effect", "on", "the", "events", "or", "logs", "produced", "by", "the", "SimulatorTaskTracker", ".", "We", "need", "this", "in", "order", "not", "to", "report", "c...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L511-L526
119,604
facebookarchive/hadoop-20
src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java
SimulatorTaskTracker.processHeartbeatEvent
private List<SimulatorEvent> processHeartbeatEvent(HeartbeatEvent event) { if (LOG.isDebugEnabled()) { LOG.debug("Processing heartbeat event " + event); } long now = event.getTimeStamp(); // Create the TaskTrackerStatus to report progressTaskStatuses(now); List<TaskStatus> taskSt...
java
private List<SimulatorEvent> processHeartbeatEvent(HeartbeatEvent event) { if (LOG.isDebugEnabled()) { LOG.debug("Processing heartbeat event " + event); } long now = event.getTimeStamp(); // Create the TaskTrackerStatus to report progressTaskStatuses(now); List<TaskStatus> taskSt...
[ "private", "List", "<", "SimulatorEvent", ">", "processHeartbeatEvent", "(", "HeartbeatEvent", "event", ")", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ")", ")", "{", "LOG", ".", "debug", "(", "\"Processing heartbeat event \"", "+", "event", ")", ";", ...
Transmits a heartbeat event to the jobtracker and processes the response. @param event HeartbeatEvent to process @return list of new events generated in response
[ "Transmits", "a", "heartbeat", "event", "to", "the", "jobtracker", "and", "processes", "the", "response", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L589-L640
119,605
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java
Decoder.retrieveStripe
public StripeInfo retrieveStripe(Block lostBlock, Path p, long lostBlockOffset, FileSystem fs, Context context, boolean online) throws IOException { StripeInfo si = null; if (stripeStore != null) { IOException caughtException = null; try { si = stripeStore.getStripe(co...
java
public StripeInfo retrieveStripe(Block lostBlock, Path p, long lostBlockOffset, FileSystem fs, Context context, boolean online) throws IOException { StripeInfo si = null; if (stripeStore != null) { IOException caughtException = null; try { si = stripeStore.getStripe(co...
[ "public", "StripeInfo", "retrieveStripe", "(", "Block", "lostBlock", ",", "Path", "p", ",", "long", "lostBlockOffset", ",", "FileSystem", "fs", ",", "Context", "context", ",", "boolean", "online", ")", "throws", "IOException", "{", "StripeInfo", "si", "=", "nu...
Retrieve stripes from stripe store
[ "Retrieve", "stripes", "from", "stripe", "store" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java#L166-L190
119,606
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java
Decoder.retrieveChecksum
public Long retrieveChecksum(Block lostBlock, Path p, long lostBlockOffset, FileSystem fs, Context context) throws IOException { Long oldCRC = null; if (checksumStore != null) { IOException caughtException = null; try { oldCRC = checksumStore.getChecksum(lostBlock); ...
java
public Long retrieveChecksum(Block lostBlock, Path p, long lostBlockOffset, FileSystem fs, Context context) throws IOException { Long oldCRC = null; if (checksumStore != null) { IOException caughtException = null; try { oldCRC = checksumStore.getChecksum(lostBlock); ...
[ "public", "Long", "retrieveChecksum", "(", "Block", "lostBlock", ",", "Path", "p", ",", "long", "lostBlockOffset", ",", "FileSystem", "fs", ",", "Context", "context", ")", "throws", "IOException", "{", "Long", "oldCRC", "=", "null", ";", "if", "(", "checksum...
Retrieve checksums from checksum store and record checksum lost if possible
[ "Retrieve", "checksums", "from", "checksum", "store", "and", "record", "checksum", "lost", "if", "possible" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java#L196-L217
119,607
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java
Decoder.recoverBlockToFileFromStripeInfo
public CRC32 recoverBlockToFileFromStripeInfo( FileSystem srcFs, Path srcPath, Block lostBlock, File localBlockFile, long blockSize, long lostBlockOffset, long limit, StripeInfo si, Context context) throws IOException { OutputStream out = null; try { out = new FileOutputStream(localBlo...
java
public CRC32 recoverBlockToFileFromStripeInfo( FileSystem srcFs, Path srcPath, Block lostBlock, File localBlockFile, long blockSize, long lostBlockOffset, long limit, StripeInfo si, Context context) throws IOException { OutputStream out = null; try { out = new FileOutputStream(localBlo...
[ "public", "CRC32", "recoverBlockToFileFromStripeInfo", "(", "FileSystem", "srcFs", ",", "Path", "srcPath", ",", "Block", "lostBlock", ",", "File", "localBlockFile", ",", "long", "blockSize", ",", "long", "lostBlockOffset", ",", "long", "limit", ",", "StripeInfo", ...
Recover a corrupt block to local file. Using the stripe information stored in the Stripe Store. @param srcFs The filesystem containing the source file. @param srcPath The damaged source file. @param lostBlock The missing/corrupted block @param localBlockFile The file to write the block to. @param blockSize The block s...
[ "Recover", "a", "corrupt", "block", "to", "local", "file", ".", "Using", "the", "stripe", "information", "stored", "in", "the", "Stripe", "Store", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java#L287-L307
119,608
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java
Decoder.getOldCodeId
private String getOldCodeId(FileStatus srcStat ) throws IOException { if (codec.id.equals("xor") || codec.id.equals("rs")) { return codec.id; } else { // Search for xor/rs parity files if (ParityFilePair.getParityFile( Codec.getCodec("xor"), srcStat, this.conf) != null) return ...
java
private String getOldCodeId(FileStatus srcStat ) throws IOException { if (codec.id.equals("xor") || codec.id.equals("rs")) { return codec.id; } else { // Search for xor/rs parity files if (ParityFilePair.getParityFile( Codec.getCodec("xor"), srcStat, this.conf) != null) return ...
[ "private", "String", "getOldCodeId", "(", "FileStatus", "srcStat", ")", "throws", "IOException", "{", "if", "(", "codec", ".", "id", ".", "equals", "(", "\"xor\"", ")", "||", "codec", ".", "id", ".", "equals", "(", "\"rs\"", ")", ")", "{", "return", "c...
Return the old code id to construct a old decoder
[ "Return", "the", "old", "code", "id", "to", "construct", "a", "old", "decoder" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/Decoder.java#L312-L325
119,609
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/HsftpFileSystem.java
HsftpFileSystem.setupSsl
private static void setupSsl(Configuration conf) { Configuration sslConf = new Configuration(false); sslConf.addResource(conf.get("dfs.https.client.keystore.resource", "ssl-client.xml")); System.setProperty("javax.net.ssl.trustStore", sslConf.get( "ssl.client.truststore.location", "")); ...
java
private static void setupSsl(Configuration conf) { Configuration sslConf = new Configuration(false); sslConf.addResource(conf.get("dfs.https.client.keystore.resource", "ssl-client.xml")); System.setProperty("javax.net.ssl.trustStore", sslConf.get( "ssl.client.truststore.location", "")); ...
[ "private", "static", "void", "setupSsl", "(", "Configuration", "conf", ")", "{", "Configuration", "sslConf", "=", "new", "Configuration", "(", "false", ")", ";", "sslConf", ".", "addResource", "(", "conf", ".", "get", "(", "\"dfs.https.client.keystore.resource\"",...
Set up SSL resources
[ "Set", "up", "SSL", "resources" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/HsftpFileSystem.java#L57-L75
119,610
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskController.java
TaskController.setup
void setup() { // Cannot set wait for confirmed kill mode if cannot check if task is alive if (supportsIsTaskAlive()) { waitForConfirmedKill = getConf().getBoolean(WAIT_FOR_CONFIRMED_KILL_KEY, WAIT_FOR_CONFIRMED_DEFAULT); confirmedKillRetries = getConf().getInt(CONFIRMED_KILL_RETRIES_KEY, ...
java
void setup() { // Cannot set wait for confirmed kill mode if cannot check if task is alive if (supportsIsTaskAlive()) { waitForConfirmedKill = getConf().getBoolean(WAIT_FOR_CONFIRMED_KILL_KEY, WAIT_FOR_CONFIRMED_DEFAULT); confirmedKillRetries = getConf().getInt(CONFIRMED_KILL_RETRIES_KEY, ...
[ "void", "setup", "(", ")", "{", "// Cannot set wait for confirmed kill mode if cannot check if task is alive", "if", "(", "supportsIsTaskAlive", "(", ")", ")", "{", "waitForConfirmedKill", "=", "getConf", "(", ")", ".", "getBoolean", "(", "WAIT_FOR_CONFIRMED_KILL_KEY", ",...
Setup task controller component. Will be called prior to use.
[ "Setup", "task", "controller", "component", ".", "Will", "be", "called", "prior", "to", "use", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskController.java#L85-L95
119,611
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/TaskController.java
TaskController.destroyTaskJVM
final void destroyTaskJVM(TaskControllerContext context) { Thread taskJVMDestroyer = new Thread(new DestroyJVMTaskRunnable(context)); taskJVMDestroyer.start(); if (waitForConfirmedKill) { try { taskJVMDestroyer.join(); } catch (InterruptedException e) { throw new IllegalStateExce...
java
final void destroyTaskJVM(TaskControllerContext context) { Thread taskJVMDestroyer = new Thread(new DestroyJVMTaskRunnable(context)); taskJVMDestroyer.start(); if (waitForConfirmedKill) { try { taskJVMDestroyer.join(); } catch (InterruptedException e) { throw new IllegalStateExce...
[ "final", "void", "destroyTaskJVM", "(", "TaskControllerContext", "context", ")", "{", "Thread", "taskJVMDestroyer", "=", "new", "Thread", "(", "new", "DestroyJVMTaskRunnable", "(", "context", ")", ")", ";", "taskJVMDestroyer", ".", "start", "(", ")", ";", "if", ...
Use DestroyJVMTaskRunnable to kill task JVM asynchronously. Wait for the confirmed kill if configured so. @param context Task context
[ "Use", "DestroyJVMTaskRunnable", "to", "kill", "task", "JVM", "asynchronously", ".", "Wait", "for", "the", "confirmed", "kill", "if", "configured", "so", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskController.java#L163-L174
119,612
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java
INodeRegularStorage.getPenultimateBlock
@Override public Block getPenultimateBlock() { if (blocks == null || blocks.length <= 1) { return null; } return blocks[blocks.length - 2]; }
java
@Override public Block getPenultimateBlock() { if (blocks == null || blocks.length <= 1) { return null; } return blocks[blocks.length - 2]; }
[ "@", "Override", "public", "Block", "getPenultimateBlock", "(", ")", "{", "if", "(", "blocks", "==", "null", "||", "blocks", ".", "length", "<=", "1", ")", "{", "return", "null", ";", "}", "return", "blocks", "[", "blocks", ".", "length", "-", "2", "...
Return the penultimate allocated block for this file.
[ "Return", "the", "penultimate", "allocated", "block", "for", "this", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java#L77-L83
119,613
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java
INodeRegularStorage.addBlock
@Override public void addBlock(BlockInfo newblock) { if (this.blocks == null) { this.blocks = new BlockInfo[1]; this.blocks[0] = newblock; } else { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + 1]; System.arraycopy(this.blocks, 0, newlist, 0, size); ...
java
@Override public void addBlock(BlockInfo newblock) { if (this.blocks == null) { this.blocks = new BlockInfo[1]; this.blocks[0] = newblock; } else { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + 1]; System.arraycopy(this.blocks, 0, newlist, 0, size); ...
[ "@", "Override", "public", "void", "addBlock", "(", "BlockInfo", "newblock", ")", "{", "if", "(", "this", ".", "blocks", "==", "null", ")", "{", "this", ".", "blocks", "=", "new", "BlockInfo", "[", "1", "]", ";", "this", ".", "blocks", "[", "0", "]...
add a block to the block list
[ "add", "a", "block", "to", "the", "block", "list" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java#L126-L138
119,614
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java
INodeRegularStorage.convertToRaidStorage
@Override public INodeRaidStorage convertToRaidStorage(BlockInfo[] parityBlocks, RaidCodec codec, int[] checksums, BlocksMap blocksMap, short replication, INodeFile inode) throws IOException { if (codec == null) { throw new IOException("Codec is null"); } else { return new INodeRaidSt...
java
@Override public INodeRaidStorage convertToRaidStorage(BlockInfo[] parityBlocks, RaidCodec codec, int[] checksums, BlocksMap blocksMap, short replication, INodeFile inode) throws IOException { if (codec == null) { throw new IOException("Codec is null"); } else { return new INodeRaidSt...
[ "@", "Override", "public", "INodeRaidStorage", "convertToRaidStorage", "(", "BlockInfo", "[", "]", "parityBlocks", ",", "RaidCodec", "codec", ",", "int", "[", "]", "checksums", ",", "BlocksMap", "blocksMap", ",", "short", "replication", ",", "INodeFile", "inode", ...
Only used by merge, it puts parity file's blocks and source file's blocks together into a block array to create an INodeRaidStorage
[ "Only", "used", "by", "merge", "it", "puts", "parity", "file", "s", "blocks", "and", "source", "file", "s", "blocks", "together", "into", "a", "block", "array", "to", "create", "an", "INodeRaidStorage" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeRegularStorage.java#L198-L208
119,615
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/compress/BlockCompressorStream.java
BlockCompressorStream.write
public void write(byte[] b, int off, int len) throws IOException { // Sanity checks if (compressor.finished()) { throw new IOException("write beyond end of stream"); } if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ...
java
public void write(byte[] b, int off, int len) throws IOException { // Sanity checks if (compressor.finished()) { throw new IOException("write beyond end of stream"); } if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ...
[ "public", "void", "write", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "// Sanity checks", "if", "(", "compressor", ".", "finished", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"wri...
Write the data provided to the compression codec, compressing no more than the buffer size less the compression overhead as specified during construction for each block. Each block contains the uncompressed length for the block, followed by one or more length-prefixed blocks of compressed data.
[ "Write", "the", "data", "provided", "to", "the", "compression", "codec", "compressing", "no", "more", "than", "the", "buffer", "size", "less", "the", "compression", "overhead", "as", "specified", "during", "construction", "for", "each", "block", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/compress/BlockCompressorStream.java#L76-L128
119,616
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DatanodeBlockInfo.java
DatanodeBlockInfo.detachBlock
boolean detachBlock(int namespaceId, Block block, int numLinks) throws IOException { if (isDetached()) { return false; } if (blockDataFile.getFile() == null || blockDataFile.volume == null) { throw new IOException("detachBlock:Block not found. " + block); } File meta = null; if (!in...
java
boolean detachBlock(int namespaceId, Block block, int numLinks) throws IOException { if (isDetached()) { return false; } if (blockDataFile.getFile() == null || blockDataFile.volume == null) { throw new IOException("detachBlock:Block not found. " + block); } File meta = null; if (!in...
[ "boolean", "detachBlock", "(", "int", "namespaceId", ",", "Block", "block", ",", "int", "numLinks", ")", "throws", "IOException", "{", "if", "(", "isDetached", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "blockDataFile", ".", "getFile", "...
Returns true if this block was copied, otherwise returns false.
[ "Returns", "true", "if", "this", "block", "was", "copied", "otherwise", "returns", "false", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DatanodeBlockInfo.java#L211-L238
119,617
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java
Job.addDependingJob
public synchronized boolean addDependingJob(Job dependingJob) { if (this.state == Job.WAITING) { //only allowed to add jobs when waiting if (this.dependingJobs == null) { this.dependingJobs = new ArrayList<Job>(); } return this.dependingJobs.add(dependingJob); } else { return fal...
java
public synchronized boolean addDependingJob(Job dependingJob) { if (this.state == Job.WAITING) { //only allowed to add jobs when waiting if (this.dependingJobs == null) { this.dependingJobs = new ArrayList<Job>(); } return this.dependingJobs.add(dependingJob); } else { return fal...
[ "public", "synchronized", "boolean", "addDependingJob", "(", "Job", "dependingJob", ")", "{", "if", "(", "this", ".", "state", "==", "Job", ".", "WAITING", ")", "{", "//only allowed to add jobs when waiting", "if", "(", "this", ".", "dependingJobs", "==", "null"...
Add a job to this jobs' dependency list. Dependent jobs can only be added while a Job is waiting to run, not during or afterwards. @param dependingJob Job that this Job depends on. @return <tt>true</tt> if the Job was added.
[ "Add", "a", "job", "to", "this", "jobs", "dependency", "list", ".", "Dependent", "jobs", "can", "only", "be", "added", "while", "a", "Job", "is", "waiting", "to", "run", "not", "during", "or", "afterwards", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java#L249-L258
119,618
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java
Job.checkRunningState
private void checkRunningState() { RunningJob running = null; try { running = jc.getJob(this.mapredJobID); if (running.isComplete()) { if (running.isSuccessful()) { this.state = Job.SUCCESS; } else { this.state = Job.FAILED; this.message = "Job failed!";...
java
private void checkRunningState() { RunningJob running = null; try { running = jc.getJob(this.mapredJobID); if (running.isComplete()) { if (running.isSuccessful()) { this.state = Job.SUCCESS; } else { this.state = Job.FAILED; this.message = "Job failed!";...
[ "private", "void", "checkRunningState", "(", ")", "{", "RunningJob", "running", "=", "null", ";", "try", "{", "running", "=", "jc", ".", "getJob", "(", "this", ".", "mapredJobID", ")", ";", "if", "(", "running", ".", "isComplete", "(", ")", ")", "{", ...
Check the state of this running job. The state may remain the same, become SUCCESS or FAILED.
[ "Check", "the", "state", "of", "this", "running", "job", ".", "The", "state", "may", "remain", "the", "same", "become", "SUCCESS", "or", "FAILED", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java#L280-L318
119,619
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java
Job.checkState
synchronized int checkState() { if (this.state == Job.RUNNING) { checkRunningState(); } if (this.state != Job.WAITING) { return this.state; } if (this.dependingJobs == null || this.dependingJobs.size() == 0) { this.state = Job.READY; return this.state; } Job pred = nu...
java
synchronized int checkState() { if (this.state == Job.RUNNING) { checkRunningState(); } if (this.state != Job.WAITING) { return this.state; } if (this.dependingJobs == null || this.dependingJobs.size() == 0) { this.state = Job.READY; return this.state; } Job pred = nu...
[ "synchronized", "int", "checkState", "(", ")", "{", "if", "(", "this", ".", "state", "==", "Job", ".", "RUNNING", ")", "{", "checkRunningState", "(", ")", ";", "}", "if", "(", "this", ".", "state", "!=", "Job", ".", "WAITING", ")", "{", "return", "...
Check and update the state of this job. The state changes depending on its current state and the states of the depending jobs.
[ "Check", "and", "update", "the", "state", "of", "this", "job", ".", "The", "state", "changes", "depending", "on", "its", "current", "state", "and", "the", "states", "of", "the", "depending", "jobs", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java#L324-L357
119,620
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java
Job.submit
protected synchronized void submit() { try { if (theJobConf.getBoolean("create.empty.dir.if.nonexist", false)) { FileSystem fs = FileSystem.get(theJobConf); Path inputPaths[] = FileInputFormat.getInputPaths(theJobConf); for (int i = 0; i < inputPaths.length; i++) { if (!fs.ex...
java
protected synchronized void submit() { try { if (theJobConf.getBoolean("create.empty.dir.if.nonexist", false)) { FileSystem fs = FileSystem.get(theJobConf); Path inputPaths[] = FileInputFormat.getInputPaths(theJobConf); for (int i = 0; i < inputPaths.length; i++) { if (!fs.ex...
[ "protected", "synchronized", "void", "submit", "(", ")", "{", "try", "{", "if", "(", "theJobConf", ".", "getBoolean", "(", "\"create.empty.dir.if.nonexist\"", ",", "false", ")", ")", "{", "FileSystem", "fs", "=", "FileSystem", ".", "get", "(", "theJobConf", ...
Submit this job to mapred. The state becomes RUNNING if submission is successful, FAILED otherwise.
[ "Submit", "this", "job", "to", "mapred", ".", "The", "state", "becomes", "RUNNING", "if", "submission", "is", "successful", "FAILED", "otherwise", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/jobcontrol/Job.java#L363-L385
119,621
facebookarchive/hadoop-20
src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/SimpleSeekableFormatOutputStream.java
SimpleSeekableFormatOutputStream.write
@Override public void write(byte[] b, int start, int length) throws IOException { currentDataSegmentBuffer.write(b, start, length); flushIfNeeded(); }
java
@Override public void write(byte[] b, int start, int length) throws IOException { currentDataSegmentBuffer.write(b, start, length); flushIfNeeded(); }
[ "@", "Override", "public", "void", "write", "(", "byte", "[", "]", "b", ",", "int", "start", ",", "int", "length", ")", "throws", "IOException", "{", "currentDataSegmentBuffer", ".", "write", "(", "b", ",", "start", ",", "length", ")", ";", "flushIfNeede...
This function makes sure the whole buffer is written into the same data segment.
[ "This", "function", "makes", "sure", "the", "whole", "buffer", "is", "written", "into", "the", "same", "data", "segment", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/SimpleSeekableFormatOutputStream.java#L111-L115
119,622
facebookarchive/hadoop-20
src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/SimpleSeekableFormatOutputStream.java
SimpleSeekableFormatOutputStream.flush
@Override public void flush() throws IOException { // Do not do anything if no data has been written if (currentDataSegmentBuffer.size() == 0) { return; } // Create the current DataSegment DataSegmentWriter currentDataSegment = new DataSegmentWriter(currentDataSegmentBuffer, codec,...
java
@Override public void flush() throws IOException { // Do not do anything if no data has been written if (currentDataSegmentBuffer.size() == 0) { return; } // Create the current DataSegment DataSegmentWriter currentDataSegment = new DataSegmentWriter(currentDataSegmentBuffer, codec,...
[ "@", "Override", "public", "void", "flush", "(", ")", "throws", "IOException", "{", "// Do not do anything if no data has been written", "if", "(", "currentDataSegmentBuffer", ".", "size", "(", ")", "==", "0", ")", "{", "return", ";", "}", "// Create the current Dat...
Take the current data segment, optionally compress it, calculate the crc32, and then write it out. The method sets the lastOffsets to the end of the file before it starts writing. That means the offsets in the MetaDataBlock will be after the end of the current data block.
[ "Take", "the", "current", "data", "segment", "optionally", "compress", "it", "calculate", "the", "crc32", "and", "then", "write", "it", "out", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/seekablecompression/src/java/org/apache/hadoop/io/simpleseekableformat/SimpleSeekableFormatOutputStream.java#L151-L176
119,623
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.checkPath
protected void checkPath(Path path) { URI thisUri = this.getUri(); URI thatUri = path.toUri(); String thatAuthority = thatUri.getAuthority(); if (thatUri.getScheme() != null && thatUri.getScheme().equalsIgnoreCase(thisUri.getScheme()) && thatUri.getPort() == NameNode.DEFAULT_PORT ...
java
protected void checkPath(Path path) { URI thisUri = this.getUri(); URI thatUri = path.toUri(); String thatAuthority = thatUri.getAuthority(); if (thatUri.getScheme() != null && thatUri.getScheme().equalsIgnoreCase(thisUri.getScheme()) && thatUri.getPort() == NameNode.DEFAULT_PORT ...
[ "protected", "void", "checkPath", "(", "Path", "path", ")", "{", "URI", "thisUri", "=", "this", ".", "getUri", "(", ")", ";", "URI", "thatUri", "=", "path", ".", "toUri", "(", ")", ";", "String", "thatAuthority", "=", "thatUri", ".", "getAuthority", "(...
Permit paths which explicitly specify the default port.
[ "Permit", "paths", "which", "explicitly", "specify", "the", "default", "port", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L114-L126
119,624
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.append
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException { DFSOutputStream op = (DFSOutputStream)dfs.append(getPathName(f), bufferSize, progress); return new FSDataOutputStream(op, statistics, op.getInitialLen()); }
java
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException { DFSOutputStream op = (DFSOutputStream)dfs.append(getPathName(f), bufferSize, progress); return new FSDataOutputStream(op, statistics, op.getInitialLen()); }
[ "public", "FSDataOutputStream", "append", "(", "Path", "f", ",", "int", "bufferSize", ",", "Progressable", "progress", ")", "throws", "IOException", "{", "DFSOutputStream", "op", "=", "(", "DFSOutputStream", ")", "dfs", ".", "append", "(", "getPathName", "(", ...
This optional operation is not yet supported.
[ "This", "optional", "operation", "is", "not", "yet", "supported", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L256-L261
119,625
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.concat
public void concat(Path trg, Path [] psrcs, boolean restricted) throws IOException { String [] srcs = new String [psrcs.length]; for(int i=0; i<psrcs.length; i++) { srcs[i] = getPathName(psrcs[i]); } dfs.concat(getPathName(trg), srcs, restricted); }
java
public void concat(Path trg, Path [] psrcs, boolean restricted) throws IOException { String [] srcs = new String [psrcs.length]; for(int i=0; i<psrcs.length; i++) { srcs[i] = getPathName(psrcs[i]); } dfs.concat(getPathName(trg), srcs, restricted); }
[ "public", "void", "concat", "(", "Path", "trg", ",", "Path", "[", "]", "psrcs", ",", "boolean", "restricted", ")", "throws", "IOException", "{", "String", "[", "]", "srcs", "=", "new", "String", "[", "psrcs", ".", "length", "]", ";", "for", "(", "int...
THIS IS DFS only operations, it is not part of FileSystem move blocks from srcs to trg and delete srcs afterwards @param trg existing file to append to @param psrcs list of files (same block size, same replication) @param restricted - should the equal block sizes be enforced @throws IOException
[ "THIS", "IS", "DFS", "only", "operations", "it", "is", "not", "part", "of", "FileSystem", "move", "blocks", "from", "srcs", "to", "trg", "and", "delete", "srcs", "afterwards" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L406-L412
119,626
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.concat
@Deprecated public void concat(Path trg, Path [] psrcs) throws IOException { concat(trg, psrcs, true); }
java
@Deprecated public void concat(Path trg, Path [] psrcs) throws IOException { concat(trg, psrcs, true); }
[ "@", "Deprecated", "public", "void", "concat", "(", "Path", "trg", ",", "Path", "[", "]", "psrcs", ")", "throws", "IOException", "{", "concat", "(", "trg", ",", "psrcs", ",", "true", ")", ";", "}" ]
THIS IS DFS only operations, it is not part of FileSystem move blocks from srcs to trg and delete srcs afterwards All blocks should be of the same size @param trg existing file to append to @param psrcs list of files (same block size, same replication) @throws IOException
[ "THIS", "IS", "DFS", "only", "operations", "it", "is", "not", "part", "of", "FileSystem", "move", "blocks", "from", "srcs", "to", "trg", "and", "delete", "srcs", "afterwards", "All", "blocks", "should", "be", "of", "the", "same", "size" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L423-L426
119,627
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.setQuota
public void setQuota(Path src, long namespaceQuota, long diskspaceQuota) throws IOException { dfs.setQuota(getPathName(src), namespaceQuota, diskspaceQuota); }
java
public void setQuota(Path src, long namespaceQuota, long diskspaceQuota) throws IOException { dfs.setQuota(getPathName(src), namespaceQuota, diskspaceQuota); }
[ "public", "void", "setQuota", "(", "Path", "src", ",", "long", "namespaceQuota", ",", "long", "diskspaceQuota", ")", "throws", "IOException", "{", "dfs", ".", "setQuota", "(", "getPathName", "(", "src", ")", ",", "namespaceQuota", ",", "diskspaceQuota", ")", ...
Set a directory's quotas @see org.apache.hadoop.hdfs.protocol.ClientProtocol#setQuota(String, long, long)
[ "Set", "a", "directory", "s", "quotas" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L501-L504
119,628
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
DistributedFileSystem.getFileStatus
public FileStatus getFileStatus(Path f) throws IOException { FileStatus fi = dfs.getFileInfo(getPathName(f)); if (fi != null) { fi.makeQualified(this); return fi; } else { throw new FileNotFoundException("File does not exist: " + f); } }
java
public FileStatus getFileStatus(Path f) throws IOException { FileStatus fi = dfs.getFileInfo(getPathName(f)); if (fi != null) { fi.makeQualified(this); return fi; } else { throw new FileNotFoundException("File does not exist: " + f); } }
[ "public", "FileStatus", "getFileStatus", "(", "Path", "f", ")", "throws", "IOException", "{", "FileStatus", "fi", "=", "dfs", ".", "getFileInfo", "(", "getPathName", "(", "f", ")", ")", ";", "if", "(", "fi", "!=", "null", ")", "{", "fi", ".", "makeQual...
Returns the stat information about the file. @throws FileNotFoundException if the file does not exist.
[ "Returns", "the", "stat", "information", "about", "the", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L822-L830
119,629
facebookarchive/hadoop-20
src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java
DataJoinReducerBase.joinAndCollect
private void joinAndCollect(Object[] tags, ResetableIterator[] values, Object key, OutputCollector output, Reporter reporter) throws IOException { if (values.length < 1) { return; } Object[] partialList = new Object[values.length]; joinAndCollect(tags, values, 0, ...
java
private void joinAndCollect(Object[] tags, ResetableIterator[] values, Object key, OutputCollector output, Reporter reporter) throws IOException { if (values.length < 1) { return; } Object[] partialList = new Object[values.length]; joinAndCollect(tags, values, 0, ...
[ "private", "void", "joinAndCollect", "(", "Object", "[", "]", "tags", ",", "ResetableIterator", "[", "]", "values", ",", "Object", "key", ",", "OutputCollector", "output", ",", "Reporter", "reporter", ")", "throws", "IOException", "{", "if", "(", "values", "...
join the list of the value lists, and collect the results. @param tags a list of input tags @param values a list of value lists, each corresponding to one input source @param key @param output @throws IOException
[ "join", "the", "list", "of", "the", "value", "lists", "and", "collect", "the", "results", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java#L174-L182
119,630
facebookarchive/hadoop-20
src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java
DataJoinReducerBase.joinAndCollect
private void joinAndCollect(Object[] tags, ResetableIterator[] values, int pos, Object[] partialList, Object key, OutputCollector output, Reporter reporter) throws IOException { if (values.length == pos) { // get a value from each source. Combine th...
java
private void joinAndCollect(Object[] tags, ResetableIterator[] values, int pos, Object[] partialList, Object key, OutputCollector output, Reporter reporter) throws IOException { if (values.length == pos) { // get a value from each source. Combine th...
[ "private", "void", "joinAndCollect", "(", "Object", "[", "]", "tags", ",", "ResetableIterator", "[", "]", "values", ",", "int", "pos", ",", "Object", "[", "]", "partialList", ",", "Object", "key", ",", "OutputCollector", "output", ",", "Reporter", "reporter"...
Perform the actual join recursively. @param tags a list of input tags @param values a list of value lists, each corresponding to one input source @param pos indicating the next value list to be joined @param partialList a list of values, each from one value list considered so far. @param key @param output @throws IOEx...
[ "Perform", "the", "actual", "join", "recursively", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.java#L199-L216
119,631
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java
HadoopServer.purgeJob
public void purgeJob(final HadoopJob job) { runningJobs.remove(job.getJobID()); Display.getDefault().asyncExec(new Runnable() { public void run() { fireJobRemoved(job); } }); }
java
public void purgeJob(final HadoopJob job) { runningJobs.remove(job.getJobID()); Display.getDefault().asyncExec(new Runnable() { public void run() { fireJobRemoved(job); } }); }
[ "public", "void", "purgeJob", "(", "final", "HadoopJob", "job", ")", "{", "runningJobs", ".", "remove", "(", "job", ".", "getJobID", "(", ")", ")", ";", "Display", ".", "getDefault", "(", ")", ".", "asyncExec", "(", "new", "Runnable", "(", ")", "{", ...
Remove the given job from the currently running jobs map @param job the job to remove
[ "Remove", "the", "given", "job", "from", "the", "currently", "running", "jobs", "map" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java#L276-L283
119,632
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java
HadoopServer.loadFromXML
public boolean loadFromXML(File file) throws ParserConfigurationException, SAXException, IOException { Configuration newConf = new Configuration(this.conf); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = builder.parse(file); Elem...
java
public boolean loadFromXML(File file) throws ParserConfigurationException, SAXException, IOException { Configuration newConf = new Configuration(this.conf); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = builder.parse(file); Elem...
[ "public", "boolean", "loadFromXML", "(", "File", "file", ")", "throws", "ParserConfigurationException", ",", "SAXException", ",", "IOException", "{", "Configuration", "newConf", "=", "new", "Configuration", "(", "this", ".", "conf", ")", ";", "DocumentBuilder", "b...
Overwrite this location with settings available in the given XML file. The existing configuration is preserved if the XML file is invalid. @param file the file path of the XML file @return validity of the XML file @throws ParserConfigurationException @throws IOException @throws SAXException
[ "Overwrite", "this", "location", "with", "settings", "available", "in", "the", "given", "XML", "file", ".", "The", "existing", "configuration", "is", "preserved", "if", "the", "XML", "file", "is", "invalid", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java#L350-L389
119,633
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java
HadoopServer.storeSettingsToFile
public void storeSettingsToFile(File file) throws IOException { FileOutputStream fos = new FileOutputStream(file); this.conf.writeXml(fos); fos.close(); }
java
public void storeSettingsToFile(File file) throws IOException { FileOutputStream fos = new FileOutputStream(file); this.conf.writeXml(fos); fos.close(); }
[ "public", "void", "storeSettingsToFile", "(", "File", "file", ")", "throws", "IOException", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "file", ")", ";", "this", ".", "conf", ".", "writeXml", "(", "fos", ")", ";", "fos", ".", "clos...
Write this location settings to the given output stream @param out the output stream @throws IOException
[ "Write", "this", "location", "settings", "to", "the", "given", "output", "stream" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java#L421-L425
119,634
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java
HadoopServer.addPluginConfigDefaultProperties
private void addPluginConfigDefaultProperties() { for (ConfProp prop : ConfProp.values()) { if (conf.get(prop.name) == null) conf.set(prop.name, prop.defVal); } }
java
private void addPluginConfigDefaultProperties() { for (ConfProp prop : ConfProp.values()) { if (conf.get(prop.name) == null) conf.set(prop.name, prop.defVal); } }
[ "private", "void", "addPluginConfigDefaultProperties", "(", ")", "{", "for", "(", "ConfProp", "prop", ":", "ConfProp", ".", "values", "(", ")", ")", "{", "if", "(", "conf", ".", "get", "(", "prop", ".", "name", ")", "==", "null", ")", "conf", ".", "s...
Fill the configuration with valid default values
[ "Fill", "the", "configuration", "with", "valid", "default", "values" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/server/HadoopServer.java#L436-L441
119,635
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobID.java
JobID.downgrade
public static JobID downgrade(org.apache.hadoop.mapreduce.JobID old) { if (old instanceof JobID) { return (JobID) old; } else { return new JobID(old.getJtIdentifier(), old.getId()); } }
java
public static JobID downgrade(org.apache.hadoop.mapreduce.JobID old) { if (old instanceof JobID) { return (JobID) old; } else { return new JobID(old.getJtIdentifier(), old.getId()); } }
[ "public", "static", "JobID", "downgrade", "(", "org", ".", "apache", ".", "hadoop", ".", "mapreduce", ".", "JobID", "old", ")", "{", "if", "(", "old", "instanceof", "JobID", ")", "{", "return", "(", "JobID", ")", "old", ";", "}", "else", "{", "return...
Downgrade a new JobID to an old one @param old a new or old JobID @return either old or a new JobID build to match old
[ "Downgrade", "a", "new", "JobID", "to", "an", "old", "one" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobID.java#L59-L65
119,636
facebookarchive/hadoop-20
src/core/org/apache/hadoop/metrics/APITrace.java
APITrace.logCall
public static void logCall(long entryTime, long returnTime, int callIndex, Object returnValue, Object argValues[], long streamId) { if (!API_TRACE_LOG.isInfoEnabled()) { ...
java
public static void logCall(long entryTime, long returnTime, int callIndex, Object returnValue, Object argValues[], long streamId) { if (!API_TRACE_LOG.isInfoEnabled()) { ...
[ "public", "static", "void", "logCall", "(", "long", "entryTime", ",", "long", "returnTime", ",", "int", "callIndex", ",", "Object", "returnValue", ",", "Object", "argValues", "[", "]", ",", "long", "streamId", ")", "{", "if", "(", "!", "API_TRACE_LOG", "."...
Record a method call and its return value in the log. @param entry the System.nanoTime timestamp for method entry @param callIndex index into callTable @param returnValue value returned by traced method @param argValues arguments passed to traced method @param streamId unique identifier for stream, or -1 if not applic...
[ "Record", "a", "method", "call", "and", "its", "return", "value", "in", "the", "log", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/APITrace.java#L114-L149
119,637
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/SleepJobRunner.java
SleepJobRunner.calcStats
private static Stats calcStats(List<Double> nums) { double sum = 0.0, mean = 0.0, variance = 0.0, stdDev = 0.0; for (Double d : nums) { sum += d.doubleValue(); } if (nums.size() > 0) { mean = sum / nums.size(); } sum = 0.0; for (Double d : nums) { sum += (d.doubleValue() -...
java
private static Stats calcStats(List<Double> nums) { double sum = 0.0, mean = 0.0, variance = 0.0, stdDev = 0.0; for (Double d : nums) { sum += d.doubleValue(); } if (nums.size() > 0) { mean = sum / nums.size(); } sum = 0.0; for (Double d : nums) { sum += (d.doubleValue() -...
[ "private", "static", "Stats", "calcStats", "(", "List", "<", "Double", ">", "nums", ")", "{", "double", "sum", "=", "0.0", ",", "mean", "=", "0.0", ",", "variance", "=", "0.0", ",", "stdDev", "=", "0.0", ";", "for", "(", "Double", "d", ":", "nums",...
Calculates mean, variance, standard deviation for a set of numbers @param nums the list of numbers to compute stats on @return aforementioned values in a Stats helper class
[ "Calculates", "mean", "variance", "standard", "deviation", "for", "a", "set", "of", "numbers" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/SleepJobRunner.java#L61-L80
119,638
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java
PoolInfo.write
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("poolGroupName", poolGroupName); jsonGenerator.writeStringField("poolName", poolName); jsonGenerator.writeEndObject(); }
java
public void write(JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("poolGroupName", poolGroupName); jsonGenerator.writeStringField("poolName", poolName); jsonGenerator.writeEndObject(); }
[ "public", "void", "write", "(", "JsonGenerator", "jsonGenerator", ")", "throws", "IOException", "{", "jsonGenerator", ".", "writeStartObject", "(", ")", ";", "jsonGenerator", ".", "writeStringField", "(", "\"poolGroupName\"", ",", "poolGroupName", ")", ";", "jsonGen...
Used to write the state of the PoolInfo instance to disk, when we are persisting the state of the ClusterManager @param jsonGenerator The JsonGenerator instance being used to write JSON to disk @throws IOException
[ "Used", "to", "write", "the", "state", "of", "the", "PoolInfo", "instance", "to", "disk", "when", "we", "are", "persisting", "the", "state", "of", "the", "ClusterManager" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java#L74-L79
119,639
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java
PoolInfo.createPoolInfoStrings
public static PoolInfoStrings createPoolInfoStrings(PoolInfo poolInfo) { if (poolInfo == null) { return null; } return new PoolInfoStrings(poolInfo.getPoolGroupName(), poolInfo.getPoolName()); }
java
public static PoolInfoStrings createPoolInfoStrings(PoolInfo poolInfo) { if (poolInfo == null) { return null; } return new PoolInfoStrings(poolInfo.getPoolGroupName(), poolInfo.getPoolName()); }
[ "public", "static", "PoolInfoStrings", "createPoolInfoStrings", "(", "PoolInfo", "poolInfo", ")", "{", "if", "(", "poolInfo", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "PoolInfoStrings", "(", "poolInfo", ".", "getPoolGroupName", "(", ...
Convert this object to PoolInfoStrings for Thrift @param poolInfo Pool info @return {@link PoolInfo} converted to a Thrift form
[ "Convert", "this", "object", "to", "PoolInfoStrings", "for", "Thrift" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java#L95-L102
119,640
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java
PoolInfo.createPoolInfo
public static PoolInfo createPoolInfo(PoolInfoStrings poolInfoStrings) { if (poolInfoStrings == null) { return null; } return new PoolInfo(poolInfoStrings.getPoolGroupName(), poolInfoStrings.getPoolName()); }
java
public static PoolInfo createPoolInfo(PoolInfoStrings poolInfoStrings) { if (poolInfoStrings == null) { return null; } return new PoolInfo(poolInfoStrings.getPoolGroupName(), poolInfoStrings.getPoolName()); }
[ "public", "static", "PoolInfo", "createPoolInfo", "(", "PoolInfoStrings", "poolInfoStrings", ")", "{", "if", "(", "poolInfoStrings", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "PoolInfo", "(", "poolInfoStrings", ".", "getPoolGroupName", ...
Convert this object from PoolInfoStrings for Thrift @param poolInfoStrings Thrift representation of a {@link PoolInfo} @return Converted {@link PoolInfo}
[ "Convert", "this", "object", "from", "PoolInfoStrings", "for", "Thrift" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java#L131-L138
119,641
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java
PoolInfo.isLegalPoolInfo
public static boolean isLegalPoolInfo(PoolInfo poolInfo) { if (poolInfo == null || poolInfo.getPoolGroupName() == null || poolInfo.getPoolName() == null) { return false; } if (INVALID_REGEX_PATTERN.matcher(poolInfo.getPoolGroupName()).matches() || poolInfo.getPoolGroupName().isEmpty())...
java
public static boolean isLegalPoolInfo(PoolInfo poolInfo) { if (poolInfo == null || poolInfo.getPoolGroupName() == null || poolInfo.getPoolName() == null) { return false; } if (INVALID_REGEX_PATTERN.matcher(poolInfo.getPoolGroupName()).matches() || poolInfo.getPoolGroupName().isEmpty())...
[ "public", "static", "boolean", "isLegalPoolInfo", "(", "PoolInfo", "poolInfo", ")", "{", "if", "(", "poolInfo", "==", "null", "||", "poolInfo", ".", "getPoolGroupName", "(", ")", "==", "null", "||", "poolInfo", ".", "getPoolName", "(", ")", "==", "null", "...
Returns whether or not the given pool name is legal. Legal pool names are of nonzero length and are formed only of alphanumeric characters, underscores (_), and hyphens (-). @param poolInfo the name of the pool to check @return true if the name is a valid pool name, false otherwise
[ "Returns", "whether", "or", "not", "the", "given", "pool", "name", "is", "legal", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolInfo.java#L167-L181
119,642
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/permission/FsPermission.java
FsPermission.applyUMask
public FsPermission applyUMask(FsPermission umask) { return new FsPermission(useraction.and(umask.useraction.not()), groupaction.and(umask.groupaction.not()), otheraction.and(umask.otheraction.not())); }
java
public FsPermission applyUMask(FsPermission umask) { return new FsPermission(useraction.and(umask.useraction.not()), groupaction.and(umask.groupaction.not()), otheraction.and(umask.otheraction.not())); }
[ "public", "FsPermission", "applyUMask", "(", "FsPermission", "umask", ")", "{", "return", "new", "FsPermission", "(", "useraction", ".", "and", "(", "umask", ".", "useraction", ".", "not", "(", ")", ")", ",", "groupaction", ".", "and", "(", "umask", ".", ...
Apply a umask to this permission and return a new one
[ "Apply", "a", "umask", "to", "this", "permission", "and", "return", "a", "new", "one" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/permission/FsPermission.java#L181-L185
119,643
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/permission/FsPermission.java
FsPermission.valueOf
public static FsPermission valueOf(String unixSymbolicPermission) { if (unixSymbolicPermission == null) { return null; } else if (unixSymbolicPermission.length() != 10) { throw new IllegalArgumentException("length != 10(unixSymbolicPermission=" + unixSymbolicPermission + ")"); } ...
java
public static FsPermission valueOf(String unixSymbolicPermission) { if (unixSymbolicPermission == null) { return null; } else if (unixSymbolicPermission.length() != 10) { throw new IllegalArgumentException("length != 10(unixSymbolicPermission=" + unixSymbolicPermission + ")"); } ...
[ "public", "static", "FsPermission", "valueOf", "(", "String", "unixSymbolicPermission", ")", "{", "if", "(", "unixSymbolicPermission", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "unixSymbolicPermission", ".", "length", "(", ")", "!=...
Create a FsPermission from a Unix symbolic permission string @param unixSymbolicPermission e.g. "-rw-rw-rw-"
[ "Create", "a", "FsPermission", "from", "a", "Unix", "symbolic", "permission", "string" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/permission/FsPermission.java#L234-L249
119,644
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
SecondaryNameNode.initialize
private void initialize(Configuration conf) throws IOException { // initiate Java VM metrics JvmMetrics.init("SecondaryNameNode", conf.get("session.id")); // Create connection to the namenode. shouldRun = true; nameNodeAddr = NameNode.getClientProtocolAddress(conf); this.conf = conf; t...
java
private void initialize(Configuration conf) throws IOException { // initiate Java VM metrics JvmMetrics.init("SecondaryNameNode", conf.get("session.id")); // Create connection to the namenode. shouldRun = true; nameNodeAddr = NameNode.getClientProtocolAddress(conf); this.conf = conf; t...
[ "private", "void", "initialize", "(", "Configuration", "conf", ")", "throws", "IOException", "{", "// initiate Java VM metrics", "JvmMetrics", ".", "init", "(", "\"SecondaryNameNode\"", ",", "conf", ".", "get", "(", "\"session.id\"", ")", ")", ";", "// Create connec...
Initialize SecondaryNameNode.
[ "Initialize", "SecondaryNameNode", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L116-L166
119,645
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
SecondaryNameNode.shutdown
public void shutdown() { shouldRun = false; try { if (infoServer != null) infoServer.stop(); } catch (Exception e) { LOG.warn("Exception shutting down SecondaryNameNode", e); } try { if (checkpointImage != null) checkpointImage.close(); } catch(IOException e) { LOG.warn(S...
java
public void shutdown() { shouldRun = false; try { if (infoServer != null) infoServer.stop(); } catch (Exception e) { LOG.warn("Exception shutting down SecondaryNameNode", e); } try { if (checkpointImage != null) checkpointImage.close(); } catch(IOException e) { LOG.warn(S...
[ "public", "void", "shutdown", "(", ")", "{", "shouldRun", "=", "false", ";", "try", "{", "if", "(", "infoServer", "!=", "null", ")", "infoServer", ".", "stop", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LOG", ".", "warn", "(", ...
Shut down this instance of the datanode. Returns only after shutdown is complete.
[ "Shut", "down", "this", "instance", "of", "the", "datanode", ".", "Returns", "only", "after", "shutdown", "is", "complete", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L172-L184
119,646
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
SecondaryNameNode.getInfoServer
private String getInfoServer() throws IOException { URI fsName = FileSystem.getDefaultUri(conf); if (!"hdfs".equals(fsName.getScheme())) { throw new IOException("This is not a DFS"); } return NetUtils.getServerAddress(conf, "dfs.info.bindAddress", "dfs.info.po...
java
private String getInfoServer() throws IOException { URI fsName = FileSystem.getDefaultUri(conf); if (!"hdfs".equals(fsName.getScheme())) { throw new IOException("This is not a DFS"); } return NetUtils.getServerAddress(conf, "dfs.info.bindAddress", "dfs.info.po...
[ "private", "String", "getInfoServer", "(", ")", "throws", "IOException", "{", "URI", "fsName", "=", "FileSystem", ".", "getDefaultUri", "(", "conf", ")", ";", "if", "(", "!", "\"hdfs\"", ".", "equals", "(", "fsName", ".", "getScheme", "(", ")", ")", ")",...
Returns the Jetty server that the Namenode is listening on.
[ "Returns", "the", "Jetty", "server", "that", "the", "Namenode", "is", "listening", "on", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L287-L294
119,647
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
SecondaryNameNode.doCheckpoint
boolean doCheckpoint() throws IOException { LOG.info("Checkpoint starting"); // Do the required initialization of the merge work area. startCheckpoint(); checkpointImage.ensureCurrentDirExists(); NNStorage dstStorage = checkpointImage.storage; // Tell the namenode to start logging transactio...
java
boolean doCheckpoint() throws IOException { LOG.info("Checkpoint starting"); // Do the required initialization of the merge work area. startCheckpoint(); checkpointImage.ensureCurrentDirExists(); NNStorage dstStorage = checkpointImage.storage; // Tell the namenode to start logging transactio...
[ "boolean", "doCheckpoint", "(", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"Checkpoint starting\"", ")", ";", "// Do the required initialization of the merge work area.", "startCheckpoint", "(", ")", ";", "checkpointImage", ".", "ensureCurrentDirExists", ...
Create a new checkpoint
[ "Create", "a", "new", "checkpoint" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L299-L355
119,648
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
SecondaryNameNode.doMerge
private void doMerge(CheckpointSignature sig, RemoteEditLogManifest manifest, boolean loadImage, FSImage dstImage) throws IOException { if (loadImage) { // create an empty namespace if new image namesystem = new FSNamesystem(checkpointImage, conf); checkpointImage.setFSNamesystem(namesystem); ...
java
private void doMerge(CheckpointSignature sig, RemoteEditLogManifest manifest, boolean loadImage, FSImage dstImage) throws IOException { if (loadImage) { // create an empty namespace if new image namesystem = new FSNamesystem(checkpointImage, conf); checkpointImage.setFSNamesystem(namesystem); ...
[ "private", "void", "doMerge", "(", "CheckpointSignature", "sig", ",", "RemoteEditLogManifest", "manifest", ",", "boolean", "loadImage", ",", "FSImage", "dstImage", ")", "throws", "IOException", "{", "if", "(", "loadImage", ")", "{", "// create an empty namespace if ne...
Merge downloaded image and edits and write the new image into current storage directory.
[ "Merge", "downloaded", "image", "and", "edits", "and", "write", "the", "new", "image", "into", "current", "storage", "directory", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L367-L375
119,649
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java
GenWriterThread.writeControlFile
private void writeControlFile(FileSystem fs, Path outputPath, Path checksumFile, String name) throws IOException { SequenceFile.Writer write = null; try { Path parentDir = new Path(rtc.input, "filelists"); if (!fs.exists(parentDir)) { fs.mkdirs(parentDir); } ...
java
private void writeControlFile(FileSystem fs, Path outputPath, Path checksumFile, String name) throws IOException { SequenceFile.Writer write = null; try { Path parentDir = new Path(rtc.input, "filelists"); if (!fs.exists(parentDir)) { fs.mkdirs(parentDir); } ...
[ "private", "void", "writeControlFile", "(", "FileSystem", "fs", ",", "Path", "outputPath", ",", "Path", "checksumFile", ",", "String", "name", ")", "throws", "IOException", "{", "SequenceFile", ".", "Writer", "write", "=", "null", ";", "try", "{", "Path", "p...
This is used for verification Each mapper writes one control file control file only contains the base directory written by this mapper and the checksum file path so that we could create a Read mapper which scanned the files under the base directory and verify the checksum of files with the information given in the chec...
[ "This", "is", "used", "for", "verification", "Each", "mapper", "writes", "one", "control", "file", "control", "file", "only", "contains", "the", "base", "directory", "written", "by", "this", "mapper", "and", "the", "checksum", "file", "path", "so", "that", "...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java#L270-L288
119,650
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java
GenWriterThread.prepare
@Override public GenThread[] prepare(JobConf conf, Text key, Text value) throws IOException { this.rtc = new GenWriterRunTimeConstants(); super.prepare(conf, key, value, rtc); rtc.task_name = key.toString() + rtc.taskID; rtc.roll_interval = conf.getLong(WRITER_ROLL_INTERVAL_KEY, ...
java
@Override public GenThread[] prepare(JobConf conf, Text key, Text value) throws IOException { this.rtc = new GenWriterRunTimeConstants(); super.prepare(conf, key, value, rtc); rtc.task_name = key.toString() + rtc.taskID; rtc.roll_interval = conf.getLong(WRITER_ROLL_INTERVAL_KEY, ...
[ "@", "Override", "public", "GenThread", "[", "]", "prepare", "(", "JobConf", "conf", ",", "Text", "key", ",", "Text", "value", ")", "throws", "IOException", "{", "this", ".", "rtc", "=", "new", "GenWriterRunTimeConstants", "(", ")", ";", "super", ".", "p...
Create a number of threads to generate write traffics @param conf @param key name of the mapper @param value location of data input @return @throws IOException
[ "Create", "a", "number", "of", "threads", "to", "generate", "write", "traffics" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/GenWriterThread.java#L298-L319
119,651
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java
Ingest.setCatchingUp
private void setCatchingUp() throws IOException { try { if (inputEditStream != null && inputEditStream.isInProgress()) { catchingUp = (inputEditStream.length() - inputEditStream.getPosition() > catchUpLag); } else { catchingUp = true; } } catch (Exception e) { catchingUp ...
java
private void setCatchingUp() throws IOException { try { if (inputEditStream != null && inputEditStream.isInProgress()) { catchingUp = (inputEditStream.length() - inputEditStream.getPosition() > catchUpLag); } else { catchingUp = true; } } catch (Exception e) { catchingUp ...
[ "private", "void", "setCatchingUp", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "inputEditStream", "!=", "null", "&&", "inputEditStream", ".", "isInProgress", "(", ")", ")", "{", "catchingUp", "=", "(", "inputEditStream", ".", "length", "(...
Checks if the ingest is catching up. If the ingest is consuming finalized segment, it's assumed to be behind. Otherwise, catching up is based on the position of the input stream. @throws IOException
[ "Checks", "if", "the", "ingest", "is", "catching", "up", ".", "If", "the", "ingest", "is", "consuming", "finalized", "segment", "it", "s", "assumed", "to", "be", "behind", ".", "Otherwise", "catching", "up", "is", "based", "on", "the", "position", "of", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L130-L140
119,652
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java
Ingest.getLagBytes
public long getLagBytes() { try { if (inputEditStream != null && inputEditStream.isInProgress()) { // for file journals it may happen that we read a segment finalized // by primary, but not refreshed by the standby, so length() returns 0 // hence we take max(-1,lag) return Math...
java
public long getLagBytes() { try { if (inputEditStream != null && inputEditStream.isInProgress()) { // for file journals it may happen that we read a segment finalized // by primary, but not refreshed by the standby, so length() returns 0 // hence we take max(-1,lag) return Math...
[ "public", "long", "getLagBytes", "(", ")", "{", "try", "{", "if", "(", "inputEditStream", "!=", "null", "&&", "inputEditStream", ".", "isInProgress", "(", ")", ")", "{", "// for file journals it may happen that we read a segment finalized", "// by primary, but not refresh...
Returns the distance in bytes between the current position inside of the edits log and the length of the edits log
[ "Returns", "the", "distance", "in", "bytes", "between", "the", "current", "position", "inside", "of", "the", "edits", "log", "and", "the", "length", "of", "the", "edits", "log" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L169-L183
119,653
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java
Ingest.loadFSEdits
private int loadFSEdits() throws IOException { FSDirectory fsDir = fsNamesys.dir; int numEdits = 0; long startTime = FSNamesystem.now(); LOG.info("Ingest: Consuming transactions: " + this.toString()); try { logVersion = inputEditStream.getVersion(); if (!LayoutVersion.supports(Feature.T...
java
private int loadFSEdits() throws IOException { FSDirectory fsDir = fsNamesys.dir; int numEdits = 0; long startTime = FSNamesystem.now(); LOG.info("Ingest: Consuming transactions: " + this.toString()); try { logVersion = inputEditStream.getVersion(); if (!LayoutVersion.supports(Feature.T...
[ "private", "int", "loadFSEdits", "(", ")", "throws", "IOException", "{", "FSDirectory", "fsDir", "=", "fsNamesys", ".", "dir", ";", "int", "numEdits", "=", "0", ";", "long", "startTime", "=", "FSNamesystem", ".", "now", "(", ")", ";", "LOG", ".", "info",...
Load an edit log, and continue applying the changes to the in-memory structure. This is where we ingest transactions into the standby.
[ "Load", "an", "edit", "log", "and", "continue", "applying", "the", "changes", "to", "the", "in", "-", "memory", "structure", ".", "This", "is", "where", "we", "ingest", "transactions", "into", "the", "standby", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L189-L220
119,654
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java
Ingest.ingestFSEdit
private FSEditLogOp ingestFSEdit(EditLogInputStream inputEditLog) throws IOException { FSEditLogOp op = null; try { op = inputEditLog.readOp(); InjectionHandler.processEventIO(InjectionEvent.INGEST_READ_OP); } catch (EOFException e) { return null; // No more transactions. } catch...
java
private FSEditLogOp ingestFSEdit(EditLogInputStream inputEditLog) throws IOException { FSEditLogOp op = null; try { op = inputEditLog.readOp(); InjectionHandler.processEventIO(InjectionEvent.INGEST_READ_OP); } catch (EOFException e) { return null; // No more transactions. } catch...
[ "private", "FSEditLogOp", "ingestFSEdit", "(", "EditLogInputStream", "inputEditLog", ")", "throws", "IOException", "{", "FSEditLogOp", "op", "=", "null", ";", "try", "{", "op", "=", "inputEditLog", ".", "readOp", "(", ")", ";", "InjectionHandler", ".", "processE...
Read a single transaction from the input edit log @param inputEditLog the log to read from @return a single edit log entry, null if EOF @throws IOException on error
[ "Read", "a", "single", "transaction", "from", "the", "input", "edit", "log" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L228-L244
119,655
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java
Ingest.shouldLoad
private boolean shouldLoad(long txid) { boolean shouldLoad = txid > standby.getLastCorrectTxId(); if (!shouldLoad) { LOG.info("Ingest: skip loading txId: " + txid + " to namesystem, but writing to edit log, last correct txid: " + standby.getLastCorrectTxId()); } return shouldL...
java
private boolean shouldLoad(long txid) { boolean shouldLoad = txid > standby.getLastCorrectTxId(); if (!shouldLoad) { LOG.info("Ingest: skip loading txId: " + txid + " to namesystem, but writing to edit log, last correct txid: " + standby.getLastCorrectTxId()); } return shouldL...
[ "private", "boolean", "shouldLoad", "(", "long", "txid", ")", "{", "boolean", "shouldLoad", "=", "txid", ">", "standby", ".", "getLastCorrectTxId", "(", ")", ";", "if", "(", "!", "shouldLoad", ")", "{", "LOG", ".", "info", "(", "\"Ingest: skip loading txId: ...
Used for ingest recovery, where we erase the local edit log, and transactions need to be populated to the local log, but they should be not loaded into the namespace.
[ "Used", "for", "ingest", "recovery", "where", "we", "erase", "the", "local", "edit", "log", "and", "transactions", "need", "to", "be", "populated", "to", "the", "local", "log", "but", "they", "should", "be", "not", "loaded", "into", "the", "namespace", "."...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L511-L519
119,656
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java
LookasideCacheFileSystem.mapCachePath
Path mapCachePath(Path hdfsPath) { assert hdfsPath.isAbsolute(); Path value = new Path(cacheDir + Path.SEPARATOR + hdfsPath); return value; }
java
Path mapCachePath(Path hdfsPath) { assert hdfsPath.isAbsolute(); Path value = new Path(cacheDir + Path.SEPARATOR + hdfsPath); return value; }
[ "Path", "mapCachePath", "(", "Path", "hdfsPath", ")", "{", "assert", "hdfsPath", ".", "isAbsolute", "(", ")", ";", "Path", "value", "=", "new", "Path", "(", "cacheDir", "+", "Path", ".", "SEPARATOR", "+", "hdfsPath", ")", ";", "return", "value", ";", "...
Maps a hdfs path into a pathname in the local cache. In the current implementation, the cachePath is the same as the hdfs pathname.
[ "Maps", "a", "hdfs", "path", "into", "a", "pathname", "in", "the", "local", "cache", ".", "In", "the", "current", "implementation", "the", "cachePath", "is", "the", "same", "as", "the", "hdfs", "pathname", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java#L175-L179
119,657
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java
LookasideCacheFileSystem.evictCache
public void evictCache(Path hdfsPath, Path localPath, long size) throws IOException { boolean done = cacheFs.delete(localPath, false); if (!done) { if (LOG.isDebugEnabled()) { LOG.debug("Evict for path: " + hdfsPath + " local path " + localPath + " unsuccessful."); } ...
java
public void evictCache(Path hdfsPath, Path localPath, long size) throws IOException { boolean done = cacheFs.delete(localPath, false); if (!done) { if (LOG.isDebugEnabled()) { LOG.debug("Evict for path: " + hdfsPath + " local path " + localPath + " unsuccessful."); } ...
[ "public", "void", "evictCache", "(", "Path", "hdfsPath", ",", "Path", "localPath", ",", "long", "size", ")", "throws", "IOException", "{", "boolean", "done", "=", "cacheFs", ".", "delete", "(", "localPath", ",", "false", ")", ";", "if", "(", "!", "done",...
Evicts a file from the cache. If the cache is exceeding capacity, then the cache calls this method to indicate that it is evicting a file from the cache. This is part of the Eviction Interface.
[ "Evicts", "a", "file", "from", "the", "cache", ".", "If", "the", "cache", "is", "exceeding", "capacity", "then", "the", "cache", "calls", "this", "method", "to", "indicate", "that", "it", "is", "evicting", "a", "file", "from", "the", "cache", ".", "This"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java#L203-L212
119,658
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java
LookasideCacheFileSystem.create
@Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { FSDataOutputStream fd = new FSDataOutputStream( new CacheOutputStream(conf, thi...
java
@Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { FSDataOutputStream fd = new FSDataOutputStream( new CacheOutputStream(conf, thi...
[ "@", "Override", "public", "FSDataOutputStream", "create", "(", "Path", "f", ",", "FsPermission", "permission", ",", "boolean", "overwrite", ",", "int", "bufferSize", ",", "short", "replication", ",", "long", "blockSize", ",", "Progressable", "progress", ")", "t...
Create new file. We start writing the data into underlying filessystem as well as the cacheFileSystem.
[ "Create", "new", "file", ".", "We", "start", "writing", "the", "data", "into", "underlying", "filessystem", "as", "well", "as", "the", "cacheFileSystem", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java#L279-L291
119,659
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/shell/Command.java
Command.runAll
public int runAll() { int exitCode = 0; if (args == null) { // no argument return run(); } for (String src : args) { try { Path srcPath = new Path(src); FileSystem fs = srcPath.getFileSystem(getConf()); FileStatus[] statuses = fs.globStatus(srcPath); if (...
java
public int runAll() { int exitCode = 0; if (args == null) { // no argument return run(); } for (String src : args) { try { Path srcPath = new Path(src); FileSystem fs = srcPath.getFileSystem(getConf()); FileStatus[] statuses = fs.globStatus(srcPath); if (...
[ "public", "int", "runAll", "(", ")", "{", "int", "exitCode", "=", "0", ";", "if", "(", "args", "==", "null", ")", "{", "// no argument", "return", "run", "(", ")", ";", "}", "for", "(", "String", "src", ":", "args", ")", "{", "try", "{", "Path", ...
For each source path, execute the command @return 0 if it runs successfully; -1 if it fails
[ "For", "each", "source", "path", "execute", "the", "command" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/shell/Command.java#L56-L90
119,660
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FreightStreamer.java
FreightStreamer.printToStdout
private void printToStdout(InputStream in) throws IOException { try { IOUtils.copyBytes(in, System.out, getConf(), false); } finally { in.close(); } }
java
private void printToStdout(InputStream in) throws IOException { try { IOUtils.copyBytes(in, System.out, getConf(), false); } finally { in.close(); } }
[ "private", "void", "printToStdout", "(", "InputStream", "in", ")", "throws", "IOException", "{", "try", "{", "IOUtils", ".", "copyBytes", "(", "in", ",", "System", ".", "out", ",", "getConf", "(", ")", ",", "false", ")", ";", "}", "finally", "{", "in",...
Print from src to stdout.
[ "Print", "from", "src", "to", "stdout", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FreightStreamer.java#L100-L106
119,661
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FreightStreamer.java
FreightStreamer.copyToLocal
private void copyToLocal(final FileSystem srcFS, final Path src, final File dst, final boolean copyCrc) throws IOException { /* Keep the structure similar to ChecksumFileSystem.copyToLocal(). * Ideal these two should just invoke FileUtil.copy() and not repeat * recursion he...
java
private void copyToLocal(final FileSystem srcFS, final Path src, final File dst, final boolean copyCrc) throws IOException { /* Keep the structure similar to ChecksumFileSystem.copyToLocal(). * Ideal these two should just invoke FileUtil.copy() and not repeat * recursion he...
[ "private", "void", "copyToLocal", "(", "final", "FileSystem", "srcFS", ",", "final", "Path", "src", ",", "final", "File", "dst", ",", "final", "boolean", "copyCrc", ")", "throws", "IOException", "{", "/* Keep the structure similar to ChecksumFileSystem.copyToLocal(). \n...
Copy a source file from a given file system to local destination. @param srcFS source file system @param src source path @param dst destination @param copyCrc copy CRC files? @exception IOException If some IO failed
[ "Copy", "a", "source", "file", "from", "a", "given", "file", "system", "to", "local", "destination", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FreightStreamer.java#L190-L236
119,662
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FreightStreamer.java
FreightStreamer.tail
private void tail(String[] cmd, int pos) throws IOException { CommandFormat c = new CommandFormat("tail", 1, 1, "f"); String src = null; Path path = null; try { List<String> parameters = c.parse(cmd, pos); src = parameters.get(0); } catch(IllegalArgumentException iae) { System.err...
java
private void tail(String[] cmd, int pos) throws IOException { CommandFormat c = new CommandFormat("tail", 1, 1, "f"); String src = null; Path path = null; try { List<String> parameters = c.parse(cmd, pos); src = parameters.get(0); } catch(IllegalArgumentException iae) { System.err...
[ "private", "void", "tail", "(", "String", "[", "]", "cmd", ",", "int", "pos", ")", "throws", "IOException", "{", "CommandFormat", "c", "=", "new", "CommandFormat", "(", "\"tail\"", ",", "1", ",", "1", ",", "\"f\"", ")", ";", "String", "src", "=", "nu...
Parse the incoming command string @param cmd @param pos ignore anything before this pos in cmd @throws IOException
[ "Parse", "the", "incoming", "command", "string" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FreightStreamer.java#L546-L585
119,663
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/protocol/LayoutVersion.java
LayoutVersion.supports
public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); }
java
public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); }
[ "public", "static", "boolean", "supports", "(", "final", "Feature", "f", ",", "final", "int", "lv", ")", "{", "final", "EnumSet", "<", "Feature", ">", "set", "=", "map", ".", "get", "(", "lv", ")", ";", "return", "set", "!=", "null", "&&", "set", "...
Returns true if a given feature is supported in the given layout version @param f Feature @param lv LayoutVersion @return true if {@code f} is supported in layout version {@code lv}
[ "Returns", "true", "if", "a", "given", "feature", "is", "supported", "in", "the", "given", "layout", "version" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/LayoutVersion.java#L181-L184
119,664
facebookarchive/hadoop-20
src/tools/org/apache/hadoop/tools/GetConf.java
GetConf.doWork
private int doWork(String[] args) { if (args.length == 1) { CommandHandler handler = Command.getHandler(args[0]); if (handler != null) { return handler.doWork(this); } } printUsage(); return -1; }
java
private int doWork(String[] args) { if (args.length == 1) { CommandHandler handler = Command.getHandler(args[0]); if (handler != null) { return handler.doWork(this); } } printUsage(); return -1; }
[ "private", "int", "doWork", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "==", "1", ")", "{", "CommandHandler", "handler", "=", "Command", ".", "getHandler", "(", "args", "[", "0", "]", ")", ";", "if", "(", "handler"...
Main method that runs the tool for given arguments. @param args arguments @return return status of the command
[ "Main", "method", "that", "runs", "the", "tool", "for", "given", "arguments", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/GetConf.java#L191-L200
119,665
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java
JobInProgressTraits.reportTasksInProgress
public Vector<TaskInProgress> reportTasksInProgress(boolean shouldBeMap, boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); TaskInProgress tips[] = null; if (shouldBeMap) { tips = maps; } else { tips = reduces; } for (int i = 0; i < tips.lengt...
java
public Vector<TaskInProgress> reportTasksInProgress(boolean shouldBeMap, boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); TaskInProgress tips[] = null; if (shouldBeMap) { tips = maps; } else { tips = reduces; } for (int i = 0; i < tips.lengt...
[ "public", "Vector", "<", "TaskInProgress", ">", "reportTasksInProgress", "(", "boolean", "shouldBeMap", ",", "boolean", "shouldBeComplete", ")", "{", "Vector", "<", "TaskInProgress", ">", "results", "=", "new", "Vector", "<", "TaskInProgress", ">", "(", ")", ";"...
Return a vector of completed TaskInProgress objects
[ "Return", "a", "vector", "of", "completed", "TaskInProgress", "objects" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java#L72-L87
119,666
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java
JobInProgressTraits.reportCleanupTIPs
public Vector<TaskInProgress> reportCleanupTIPs(boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); for (int i = 0; i < cleanup.length; i++) { if (cleanup[i].isComplete() == shouldBeComplete) { results.add(cleanup[i]); } } return results; }
java
public Vector<TaskInProgress> reportCleanupTIPs(boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); for (int i = 0; i < cleanup.length; i++) { if (cleanup[i].isComplete() == shouldBeComplete) { results.add(cleanup[i]); } } return results; }
[ "public", "Vector", "<", "TaskInProgress", ">", "reportCleanupTIPs", "(", "boolean", "shouldBeComplete", ")", "{", "Vector", "<", "TaskInProgress", ">", "results", "=", "new", "Vector", "<", "TaskInProgress", ">", "(", ")", ";", "for", "(", "int", "i", "=", ...
Return a vector of cleanup TaskInProgress objects
[ "Return", "a", "vector", "of", "cleanup", "TaskInProgress", "objects" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java#L92-L101
119,667
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java
JobInProgressTraits.reportSetupTIPs
public Vector<TaskInProgress> reportSetupTIPs(boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); for (int i = 0; i < setup.length; i++) { if (setup[i].isComplete() == shouldBeComplete) { results.add(setup[i]); } } return results; }
java
public Vector<TaskInProgress> reportSetupTIPs(boolean shouldBeComplete) { Vector<TaskInProgress> results = new Vector<TaskInProgress>(); for (int i = 0; i < setup.length; i++) { if (setup[i].isComplete() == shouldBeComplete) { results.add(setup[i]); } } return results; }
[ "public", "Vector", "<", "TaskInProgress", ">", "reportSetupTIPs", "(", "boolean", "shouldBeComplete", ")", "{", "Vector", "<", "TaskInProgress", ">", "results", "=", "new", "Vector", "<", "TaskInProgress", ">", "(", ")", ";", "for", "(", "int", "i", "=", ...
Return a vector of setup TaskInProgress objects
[ "Return", "a", "vector", "of", "setup", "TaskInProgress", "objects" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java#L106-L115
119,668
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java
JobInProgressTraits.getTaskInProgress
public TaskInProgress getTaskInProgress(TaskID tipid) { if (tipid.isMap()) { if (cleanup.length > 0 && tipid.equals(cleanup[0].getTIPId())) { // cleanup map tip return cleanup[0]; } if (setup.length > 0 && tipid.equals(setup[0].getTIPId())) { //setup map tip return setup[0]; ...
java
public TaskInProgress getTaskInProgress(TaskID tipid) { if (tipid.isMap()) { if (cleanup.length > 0 && tipid.equals(cleanup[0].getTIPId())) { // cleanup map tip return cleanup[0]; } if (setup.length > 0 && tipid.equals(setup[0].getTIPId())) { //setup map tip return setup[0]; ...
[ "public", "TaskInProgress", "getTaskInProgress", "(", "TaskID", "tipid", ")", "{", "if", "(", "tipid", ".", "isMap", "(", ")", ")", "{", "if", "(", "cleanup", ".", "length", ">", "0", "&&", "tipid", ".", "equals", "(", "cleanup", "[", "0", "]", ".", ...
Return the TaskInProgress that matches the tipid.
[ "Return", "the", "TaskInProgress", "that", "matches", "the", "tipid", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgressTraits.java#L120-L147
119,669
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/BinaryProtocol.java
BinaryProtocol.close
public void close() throws IOException, InterruptedException { LOG.debug("closing connection"); stream.close(); uplink.closeConnection(); uplink.interrupt(); uplink.join(); }
java
public void close() throws IOException, InterruptedException { LOG.debug("closing connection"); stream.close(); uplink.closeConnection(); uplink.interrupt(); uplink.join(); }
[ "public", "void", "close", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "LOG", ".", "debug", "(", "\"closing connection\"", ")", ";", "stream", ".", "close", "(", ")", ";", "uplink", ".", "closeConnection", "(", ")", ";", "uplink", ...
Close the connection and shutdown the handler thread. @throws IOException @throws InterruptedException
[ "Close", "the", "connection", "and", "shutdown", "the", "handler", "thread", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/BinaryProtocol.java#L240-L246
119,670
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/pipes/BinaryProtocol.java
BinaryProtocol.writeObject
private void writeObject(Writable obj) throws IOException { // For Text and BytesWritable, encode them directly, so that they end up // in C++ as the natural translations. if (obj instanceof Text) { Text t = (Text) obj; int len = t.getLength(); WritableUtils.writeVInt(stream, len); s...
java
private void writeObject(Writable obj) throws IOException { // For Text and BytesWritable, encode them directly, so that they end up // in C++ as the natural translations. if (obj instanceof Text) { Text t = (Text) obj; int len = t.getLength(); WritableUtils.writeVInt(stream, len); s...
[ "private", "void", "writeObject", "(", "Writable", "obj", ")", "throws", "IOException", "{", "// For Text and BytesWritable, encode them directly, so that they end up", "// in C++ as the natural translations.", "if", "(", "obj", "instanceof", "Text", ")", "{", "Text", "t", ...
Write the given object to the stream. If it is a Text or BytesWritable, write it directly. Otherwise, write it to a buffer and then write the length and data to the stream. @param obj the object to write @throws IOException
[ "Write", "the", "given", "object", "to", "the", "stream", ".", "If", "it", "is", "a", "Text", "or", "BytesWritable", "write", "it", "directly", ".", "Otherwise", "write", "it", "to", "a", "buffer", "and", "then", "write", "the", "length", "and", "data", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/pipes/BinaryProtocol.java#L326-L346
119,671
facebookarchive/hadoop-20
src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/HdfsProxy.java
HdfsProxy.stop
public void stop() { try { if (server != null) { server.stop(); server.join(); } } catch (Exception e) { LOG.warn("Got exception shutting down proxy", e); } }
java
public void stop() { try { if (server != null) { server.stop(); server.join(); } } catch (Exception e) { LOG.warn("Got exception shutting down proxy", e); } }
[ "public", "void", "stop", "(", ")", "{", "try", "{", "if", "(", "server", "!=", "null", ")", "{", "server", ".", "stop", "(", ")", ";", "server", ".", "join", "(", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "LOG", ".", "war...
Stop all server threads and wait for all to finish.
[ "Stop", "all", "server", "threads", "and", "wait", "for", "all", "to", "finish", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/HdfsProxy.java#L101-L110
119,672
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/Path.java
Path.getParent
public Path getParent() { String path = uri.getPath(); int lastSlash = path.lastIndexOf('/'); int start = hasWindowsDrive(path, true) ? 3 : 0; if ((path.length() == start) || // empty path (lastSlash == start && path.length() == start+1)) { // at root return null; } S...
java
public Path getParent() { String path = uri.getPath(); int lastSlash = path.lastIndexOf('/'); int start = hasWindowsDrive(path, true) ? 3 : 0; if ((path.length() == start) || // empty path (lastSlash == start && path.length() == start+1)) { // at root return null; } S...
[ "public", "Path", "getParent", "(", ")", "{", "String", "path", "=", "uri", ".", "getPath", "(", ")", ";", "int", "lastSlash", "=", "path", ".", "lastIndexOf", "(", "'", "'", ")", ";", "int", "start", "=", "hasWindowsDrive", "(", "path", ",", "true",...
Returns the parent of a path or null if at root.
[ "Returns", "the", "parent", "of", "a", "path", "or", "null", "if", "at", "root", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/Path.java#L192-L208
119,673
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/Path.java
Path.makeQualified
public Path makeQualified(FileSystem fs) { Path path = this; if (!isAbsolute()) { FileSystem.LogForCollect .info("make Qualify non absolute path: " + this.toString() + " working directory: " + fs.getWorkingDirectory()); path = new Path(fs.getWorkingDirectory(), this); } ...
java
public Path makeQualified(FileSystem fs) { Path path = this; if (!isAbsolute()) { FileSystem.LogForCollect .info("make Qualify non absolute path: " + this.toString() + " working directory: " + fs.getWorkingDirectory()); path = new Path(fs.getWorkingDirectory(), this); } ...
[ "public", "Path", "makeQualified", "(", "FileSystem", "fs", ")", "{", "Path", "path", "=", "this", ";", "if", "(", "!", "isAbsolute", "(", ")", ")", "{", "FileSystem", ".", "LogForCollect", ".", "info", "(", "\"make Qualify non absolute path: \"", "+", "this...
Returns a qualified path object.
[ "Returns", "a", "qualified", "path", "object", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/Path.java#L273-L304
119,674
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorBaseDescriptor.java
ValueAggregatorBaseDescriptor.configure
public void configure(JobConf job) { this.inputFile = job.get("map.input.file"); maxNumItems = job.getLong("aggregate.max.num.unique.values", Long.MAX_VALUE); }
java
public void configure(JobConf job) { this.inputFile = job.get("map.input.file"); maxNumItems = job.getLong("aggregate.max.num.unique.values", Long.MAX_VALUE); }
[ "public", "void", "configure", "(", "JobConf", "job", ")", "{", "this", ".", "inputFile", "=", "job", ".", "get", "(", "\"map.input.file\"", ")", ";", "maxNumItems", "=", "job", ".", "getLong", "(", "\"aggregate.max.num.unique.values\"", ",", "Long", ".", "M...
get the input file name. @param job a job configuration object
[ "get", "the", "input", "file", "name", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorBaseDescriptor.java#L155-L159
119,675
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeHardLinkFile.java
INodeHardLinkFile.loadHardLinkFileInfo
public static HardLinkFileInfo loadHardLinkFileInfo(long hardLinkID, FSImageLoadingContext context) { // update the latest hard link ID context.getFSDirectory().resetLastHardLinkIDIfLarge(hardLinkID); // create the hard link file info if necessary HardLinkFileInfo fileInfo = context.getHar...
java
public static HardLinkFileInfo loadHardLinkFileInfo(long hardLinkID, FSImageLoadingContext context) { // update the latest hard link ID context.getFSDirectory().resetLastHardLinkIDIfLarge(hardLinkID); // create the hard link file info if necessary HardLinkFileInfo fileInfo = context.getHar...
[ "public", "static", "HardLinkFileInfo", "loadHardLinkFileInfo", "(", "long", "hardLinkID", ",", "FSImageLoadingContext", "context", ")", "{", "// update the latest hard link ID ", "context", ".", "getFSDirectory", "(", ")", ".", "resetLastHardLinkIDIfLarge", "(", "hardLinkI...
Create a HardLink file info if necessary and register to the hardLinkINodeIDToFileInfoMap And return the hardLinkFileInfo which is registered in the hardLinkINodeIDToFileInfoMap This function is not thread safe. @param inodeID @param context The context when loading the fsImage @return hardLinkFileInfo registered in t...
[ "Create", "a", "HardLink", "file", "info", "if", "necessary", "and", "register", "to", "the", "hardLinkINodeIDToFileInfoMap", "And", "return", "the", "hardLinkFileInfo", "which", "is", "registered", "in", "the", "hardLinkINodeIDToFileInfoMap" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeHardLinkFile.java#L249-L261
119,676
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/DirectoryTraversal.java
DirectoryTraversal.getNextFile
public FileStatus getNextFile() throws IOException { // Check if traversal is done. while (!doneTraversal()) { // If traversal is not done, check if the stack is not empty. while (!stack.isEmpty()) { // If the stack is not empty, look at the top node. Node node = stack.peek(); ...
java
public FileStatus getNextFile() throws IOException { // Check if traversal is done. while (!doneTraversal()) { // If traversal is not done, check if the stack is not empty. while (!stack.isEmpty()) { // If the stack is not empty, look at the top node. Node node = stack.peek(); ...
[ "public", "FileStatus", "getNextFile", "(", ")", "throws", "IOException", "{", "// Check if traversal is done.", "while", "(", "!", "doneTraversal", "(", ")", ")", "{", "// If traversal is not done, check if the stack is not empty.", "while", "(", "!", "stack", ".", "is...
Return the next file. @throws IOException
[ "Return", "the", "next", "file", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/DirectoryTraversal.java#L90-L135
119,677
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java
TotalOrderPartitioner.getPartition
@SuppressWarnings("unchecked") // is memcmp-able and uses the trie public int getPartition(K key, V value, int numPartitions) { return partitions.findPartition(key); }
java
@SuppressWarnings("unchecked") // is memcmp-able and uses the trie public int getPartition(K key, V value, int numPartitions) { return partitions.findPartition(key); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// is memcmp-able and uses the trie", "public", "int", "getPartition", "(", "K", "key", ",", "V", "value", ",", "int", "numPartitions", ")", "{", "return", "partitions", ".", "findPartition", "(", "key", ")", ...
by construction, we know if our keytype
[ "by", "construction", "we", "know", "if", "our", "keytype" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java#L96-L99
119,678
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java
TotalOrderPartitioner.readPartitions
@SuppressWarnings("unchecked") // map output key class private K[] readPartitions(FileSystem fs, Path p, Class<K> keyClass, JobConf job) throws IOException { SequenceFile.Reader reader = new SequenceFile.Reader(fs, p, job); ArrayList<K> parts = new ArrayList<K>(); K key = (K) ReflectionUtils.newInst...
java
@SuppressWarnings("unchecked") // map output key class private K[] readPartitions(FileSystem fs, Path p, Class<K> keyClass, JobConf job) throws IOException { SequenceFile.Reader reader = new SequenceFile.Reader(fs, p, job); ArrayList<K> parts = new ArrayList<K>(); K key = (K) ReflectionUtils.newInst...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// map output key class", "private", "K", "[", "]", "readPartitions", "(", "FileSystem", "fs", ",", "Path", "p", ",", "Class", "<", "K", ">", "keyClass", ",", "JobConf", "job", ")", "throws", "IOException", ...
matching key types enforced by passing in
[ "matching", "key", "types", "enforced", "by", "passing", "in" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java#L210-L223
119,679
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java
TotalOrderPartitioner.buildTrie
private TrieNode buildTrie(BinaryComparable[] splits, int lower, int upper, byte[] prefix, int maxDepth) { final int depth = prefix.length; if (depth >= maxDepth || lower == upper) { return new LeafTrieNode(depth, splits, lower, upper); } InnerTrieNode result = new InnerTrieNode(depth); ...
java
private TrieNode buildTrie(BinaryComparable[] splits, int lower, int upper, byte[] prefix, int maxDepth) { final int depth = prefix.length; if (depth >= maxDepth || lower == upper) { return new LeafTrieNode(depth, splits, lower, upper); } InnerTrieNode result = new InnerTrieNode(depth); ...
[ "private", "TrieNode", "buildTrie", "(", "BinaryComparable", "[", "]", "splits", ",", "int", "lower", ",", "int", "upper", ",", "byte", "[", "]", "prefix", ",", "int", "maxDepth", ")", "{", "final", "int", "depth", "=", "prefix", ".", "length", ";", "i...
Given a sorted set of cut points, build a trie that will find the correct partition quickly. @param splits the list of cut points @param lower the lower bound of partitions 0..numPartitions-1 @param upper the upper bound of partitions 0..numPartitions-1 @param prefix the prefix that we have already checked against @par...
[ "Given", "a", "sorted", "set", "of", "cut", "points", "build", "a", "trie", "that", "will", "find", "the", "correct", "partition", "quickly", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java#L235-L263
119,680
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/actions/DFSActionImpl.java
DFSActionImpl.mkdir
private void mkdir(IStructuredSelection selection) { List<DFSFolder> folders = filterSelection(DFSFolder.class, selection); if (folders.size() >= 1) { DFSFolder folder = folders.get(0); InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), "Create subfol...
java
private void mkdir(IStructuredSelection selection) { List<DFSFolder> folders = filterSelection(DFSFolder.class, selection); if (folders.size() >= 1) { DFSFolder folder = folders.get(0); InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), "Create subfol...
[ "private", "void", "mkdir", "(", "IStructuredSelection", "selection", ")", "{", "List", "<", "DFSFolder", ">", "folders", "=", "filterSelection", "(", "DFSFolder", ".", "class", ",", "selection", ")", ";", "if", "(", "folders", ".", "size", "(", ")", ">=",...
Create a new sub-folder into an existing directory @param selection
[ "Create", "a", "new", "sub", "-", "folder", "into", "an", "existing", "directory" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/actions/DFSActionImpl.java#L144-L155
119,681
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/actions/DFSActionImpl.java
DFSActionImpl.open
private void open(IStructuredSelection selection) throws IOException, PartInitException, InvocationTargetException, InterruptedException { for (DFSFile file : filterSelection(DFSFile.class, selection)) { IStorageEditorInput editorInput = new DFSFileEditorInput(file); targetPart.getSite().getWork...
java
private void open(IStructuredSelection selection) throws IOException, PartInitException, InvocationTargetException, InterruptedException { for (DFSFile file : filterSelection(DFSFile.class, selection)) { IStorageEditorInput editorInput = new DFSFileEditorInput(file); targetPart.getSite().getWork...
[ "private", "void", "open", "(", "IStructuredSelection", "selection", ")", "throws", "IOException", ",", "PartInitException", ",", "InvocationTargetException", ",", "InterruptedException", "{", "for", "(", "DFSFile", "file", ":", "filterSelection", "(", "DFSFile", ".",...
Open the selected DfsPath in the editor window @param selection @throws JSchException @throws IOException @throws PartInitException @throws InvocationTargetException @throws InterruptedException
[ "Open", "the", "selected", "DfsPath", "in", "the", "editor", "window" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/actions/DFSActionImpl.java#L345-L354
119,682
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/JobInitializer.java
JobInitializer.getAverageWaitMsecsPerHardAdmissionJob
synchronized float getAverageWaitMsecsPerHardAdmissionJob() { float averageWaitMsecsPerHardAdmissionJob = -1f; if (!hardAdmissionMillisQueue.isEmpty()) { long totalWait = 0; for (Long waitMillis : hardAdmissionMillisQueue) { totalWait += waitMillis; } averageWaitMsecsPerHardAdmis...
java
synchronized float getAverageWaitMsecsPerHardAdmissionJob() { float averageWaitMsecsPerHardAdmissionJob = -1f; if (!hardAdmissionMillisQueue.isEmpty()) { long totalWait = 0; for (Long waitMillis : hardAdmissionMillisQueue) { totalWait += waitMillis; } averageWaitMsecsPerHardAdmis...
[ "synchronized", "float", "getAverageWaitMsecsPerHardAdmissionJob", "(", ")", "{", "float", "averageWaitMsecsPerHardAdmissionJob", "=", "-", "1f", ";", "if", "(", "!", "hardAdmissionMillisQueue", ".", "isEmpty", "(", ")", ")", "{", "long", "totalWait", "=", "0", ";...
Get the average waiting msecs per hard admission job entrance. @return Average waiting msecs per hard admission job entrance
[ "Get", "the", "average", "waiting", "msecs", "per", "hard", "admission", "job", "entrance", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/JobInitializer.java#L165-L176
119,683
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/JobInitializer.java
JobInitializer.getJobAdmissionWaitInfo
synchronized JobAdmissionWaitInfo getJobAdmissionWaitInfo(JobInProgress job) { Integer rank = jobToRank.get(job); int position = (rank == null) ? -1 : rank; float averageWaitMsecsPerHardAdmissionJob = getAverageWaitMsecsPerHardAdmissionJob(); return new JobAdmissionWaitInfo( exceedTaskLi...
java
synchronized JobAdmissionWaitInfo getJobAdmissionWaitInfo(JobInProgress job) { Integer rank = jobToRank.get(job); int position = (rank == null) ? -1 : rank; float averageWaitMsecsPerHardAdmissionJob = getAverageWaitMsecsPerHardAdmissionJob(); return new JobAdmissionWaitInfo( exceedTaskLi...
[ "synchronized", "JobAdmissionWaitInfo", "getJobAdmissionWaitInfo", "(", "JobInProgress", "job", ")", "{", "Integer", "rank", "=", "jobToRank", ".", "get", "(", "job", ")", ";", "int", "position", "=", "(", "rank", "==", "null", ")", "?", "-", "1", ":", "ra...
Get the job admission wait info for a particular job. @param job Job to look for in the waiting queue @return Admission wait info for the job
[ "Get", "the", "job", "admission", "wait", "info", "for", "a", "particular", "job", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/JobInitializer.java#L184-L192
119,684
facebookarchive/hadoop-20
src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerLogReaderAvatar.java
ServerLogReaderAvatar.detectJournalManager
protected void detectJournalManager() throws IOException { int failures = 0; do { try { Stat stat = new Stat(); String primaryAddr = zk.getPrimaryAvatarAddress(logicalName, stat, true, true); if (primaryAddr == null || primaryAd...
java
protected void detectJournalManager() throws IOException { int failures = 0; do { try { Stat stat = new Stat(); String primaryAddr = zk.getPrimaryAvatarAddress(logicalName, stat, true, true); if (primaryAddr == null || primaryAd...
[ "protected", "void", "detectJournalManager", "(", ")", "throws", "IOException", "{", "int", "failures", "=", "0", ";", "do", "{", "try", "{", "Stat", "stat", "=", "new", "Stat", "(", ")", ";", "String", "primaryAddr", "=", "zk", ".", "getPrimaryAvatarAddre...
Detect the primary node and the current Journal Manager; @throws IOException
[ "Detect", "the", "primary", "node", "and", "the", "current", "Journal", "Manager", ";" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerLogReaderAvatar.java#L183-L230
119,685
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/ArrayOutputStream.java
ArrayOutputStream.expandIfNecessary
private void expandIfNecessary(int size) { if (bytes.length >= size) { // no need to expand return; } // either double, or expand to fit size int newlength = Math.max(2 * bytes.length, size); bytes = Arrays.copyOf(bytes, newlength); }
java
private void expandIfNecessary(int size) { if (bytes.length >= size) { // no need to expand return; } // either double, or expand to fit size int newlength = Math.max(2 * bytes.length, size); bytes = Arrays.copyOf(bytes, newlength); }
[ "private", "void", "expandIfNecessary", "(", "int", "size", ")", "{", "if", "(", "bytes", ".", "length", ">=", "size", ")", "{", "// no need to expand", "return", ";", "}", "// either double, or expand to fit size", "int", "newlength", "=", "Math", ".", "max", ...
Expand the underlying byte array to fit size bytes.
[ "Expand", "the", "underlying", "byte", "array", "to", "fit", "size", "bytes", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/ArrayOutputStream.java#L51-L59
119,686
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/ArrayOutputStream.java
ArrayOutputStream.write
public void write(byte b[], int off, int len) { expandIfNecessary(count + len); System.arraycopy(b, off, bytes, count, len); count += len; }
java
public void write(byte b[], int off, int len) { expandIfNecessary(count + len); System.arraycopy(b, off, bytes, count, len); count += len; }
[ "public", "void", "write", "(", "byte", "b", "[", "]", ",", "int", "off", ",", "int", "len", ")", "{", "expandIfNecessary", "(", "count", "+", "len", ")", ";", "System", ".", "arraycopy", "(", "b", ",", "off", ",", "bytes", ",", "count", ",", "le...
Writes array of bytes into the output stream.
[ "Writes", "array", "of", "bytes", "into", "the", "output", "stream", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/ArrayOutputStream.java#L73-L77
119,687
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsImageVisitor.java
LsImageVisitor.newLine
private void newLine() { numBlocks = 0; perms = username = group = path = linkTarget = replication = hardlinkId = ""; filesize = 0l; type = INode.INodeType.REGULAR_INODE.toString(); inInode = true; }
java
private void newLine() { numBlocks = 0; perms = username = group = path = linkTarget = replication = hardlinkId = ""; filesize = 0l; type = INode.INodeType.REGULAR_INODE.toString(); inInode = true; }
[ "private", "void", "newLine", "(", ")", "{", "numBlocks", "=", "0", ";", "perms", "=", "username", "=", "group", "=", "path", "=", "linkTarget", "=", "replication", "=", "hardlinkId", "=", "\"\"", ";", "filesize", "=", "0l", ";", "type", "=", "INode", ...
Start a new line of output, reset values.
[ "Start", "a", "new", "line", "of", "output", "reset", "values", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/LsImageVisitor.java#L74-L80
119,688
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/ReduceTask.java
ReduceTask.getMapFiles
private Path[] getMapFiles(FileSystem fs, boolean isLocal) throws IOException { List<Path> fileList = new ArrayList<Path>(); if (isLocal) { // for local jobs for(int i = 0; i < numMaps; ++i) { fileList.add(mapOutputFile.getInputFile(i, getTaskID())); } } else { // for non l...
java
private Path[] getMapFiles(FileSystem fs, boolean isLocal) throws IOException { List<Path> fileList = new ArrayList<Path>(); if (isLocal) { // for local jobs for(int i = 0; i < numMaps; ++i) { fileList.add(mapOutputFile.getInputFile(i, getTaskID())); } } else { // for non l...
[ "private", "Path", "[", "]", "getMapFiles", "(", "FileSystem", "fs", ",", "boolean", "isLocal", ")", "throws", "IOException", "{", "List", "<", "Path", ">", "fileList", "=", "new", "ArrayList", "<", "Path", ">", "(", ")", ";", "if", "(", "isLocal", ")"...
Get the input files for the reducer.
[ "Get", "the", "input", "files", "for", "the", "reducer", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/ReduceTask.java#L223-L238
119,689
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/ReduceTask.java
ReduceTask.getClosestPowerOf2
private static int getClosestPowerOf2(int value) { if (value <= 0) throw new IllegalArgumentException("Undefined for " + value); final int hob = Integer.highestOneBit(value); return Integer.numberOfTrailingZeros(hob) + (((hob >>> 1) & value) == 0 ? 0 : 1); }
java
private static int getClosestPowerOf2(int value) { if (value <= 0) throw new IllegalArgumentException("Undefined for " + value); final int hob = Integer.highestOneBit(value); return Integer.numberOfTrailingZeros(hob) + (((hob >>> 1) & value) == 0 ? 0 : 1); }
[ "private", "static", "int", "getClosestPowerOf2", "(", "int", "value", ")", "{", "if", "(", "value", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Undefined for \"", "+", "value", ")", ";", "final", "int", "hob", "=", "Integer", ".", ...
Return the exponent of the power of two closest to the given positive value, or zero if value leq 0. This follows the observation that the msb of a given value is also the closest power of two, unless the bit following it is set.
[ "Return", "the", "exponent", "of", "the", "power", "of", "two", "closest", "to", "the", "given", "positive", "value", "or", "zero", "if", "value", "leq", "0", ".", "This", "follows", "the", "observation", "that", "the", "msb", "of", "a", "given", "value"...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/ReduceTask.java#L3346-L3352
119,690
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java
BookKeeperJournalMetadataManager.init
public void init() throws IOException { try { if (zooKeeper.exists(zooKeeperParentPath, false) == null) { zooKeeper.create(zooKeeperParentPath, new byte[] { '0' }, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); LOG.info("Created ZNode " + zooKeeperParentPath); } i...
java
public void init() throws IOException { try { if (zooKeeper.exists(zooKeeperParentPath, false) == null) { zooKeeper.create(zooKeeperParentPath, new byte[] { '0' }, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); LOG.info("Created ZNode " + zooKeeperParentPath); } i...
[ "public", "void", "init", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "zooKeeper", ".", "exists", "(", "zooKeeperParentPath", ",", "false", ")", "==", "null", ")", "{", "zooKeeper", ".", "create", "(", "zooKeeperParentPath", ",", "new", ...
Create znodes for storing ledger metadata if they have not been created before @throws IOException If there an unrecoverable error talking to ZooKeeper
[ "Create", "znodes", "for", "storing", "ledger", "metadata", "if", "they", "have", "not", "been", "created", "before" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L123-L144
119,691
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java
BookKeeperJournalMetadataManager.fullyQualifiedPathForLedger
public String fullyQualifiedPathForLedger(EditLogLedgerMetadata e) { String nameForLedger = nameForLedger(e); return fullyQualifiedPathForLedger(nameForLedger); }
java
public String fullyQualifiedPathForLedger(EditLogLedgerMetadata e) { String nameForLedger = nameForLedger(e); return fullyQualifiedPathForLedger(nameForLedger); }
[ "public", "String", "fullyQualifiedPathForLedger", "(", "EditLogLedgerMetadata", "e", ")", "{", "String", "nameForLedger", "=", "nameForLedger", "(", "e", ")", ";", "return", "fullyQualifiedPathForLedger", "(", "nameForLedger", ")", ";", "}" ]
Return the full ZNode path for a ZNode corresponding to a specific to a specific ledger's metadata. @param e Metadata object that we want to get the full path for @return Full path to the ledger's child ZNode
[ "Return", "the", "full", "ZNode", "path", "for", "a", "ZNode", "corresponding", "to", "a", "specific", "to", "a", "specific", "ledger", "s", "metadata", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L199-L202
119,692
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java
BookKeeperJournalMetadataManager.deleteLedgerMetadata
public boolean deleteLedgerMetadata(EditLogLedgerMetadata ledger, int version) throws IOException { String ledgerPath = fullyQualifiedPathForLedger(ledger); try { zooKeeper.delete(ledgerPath, version); return true; } catch (KeeperException.NoNodeException e) { LOG.warn(ledgerPath + "...
java
public boolean deleteLedgerMetadata(EditLogLedgerMetadata ledger, int version) throws IOException { String ledgerPath = fullyQualifiedPathForLedger(ledger); try { zooKeeper.delete(ledgerPath, version); return true; } catch (KeeperException.NoNodeException e) { LOG.warn(ledgerPath + "...
[ "public", "boolean", "deleteLedgerMetadata", "(", "EditLogLedgerMetadata", "ledger", ",", "int", "version", ")", "throws", "IOException", "{", "String", "ledgerPath", "=", "fullyQualifiedPathForLedger", "(", "ledger", ")", ";", "try", "{", "zooKeeper", ".", "delete"...
Removes ledger-related Metadata from BookKeeper. Does not delete the ledger itself. @param ledger The object for the ledger metadata that we want to delete from BookKeeper @param version The version of the ledger metadata (or -1 to delete any version). Used as a way to guard against deleting a ledger metadata that is b...
[ "Removes", "ledger", "-", "related", "Metadata", "from", "BookKeeper", ".", "Does", "not", "delete", "the", "ledger", "itself", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L218-L237
119,693
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java
BookKeeperJournalMetadataManager.verifyEditLogLedgerMetadata
public boolean verifyEditLogLedgerMetadata(EditLogLedgerMetadata metadata, String fullPathToVerify) { Preconditions.checkNotNull(metadata); try { EditLogLedgerMetadata otherMetadata = readEditLogLedgerMetadata(fullPathToVerify); if (otherMetadata == null) { LOG.warn("No metad...
java
public boolean verifyEditLogLedgerMetadata(EditLogLedgerMetadata metadata, String fullPathToVerify) { Preconditions.checkNotNull(metadata); try { EditLogLedgerMetadata otherMetadata = readEditLogLedgerMetadata(fullPathToVerify); if (otherMetadata == null) { LOG.warn("No metad...
[ "public", "boolean", "verifyEditLogLedgerMetadata", "(", "EditLogLedgerMetadata", "metadata", ",", "String", "fullPathToVerify", ")", "{", "Preconditions", ".", "checkNotNull", "(", "metadata", ")", ";", "try", "{", "EditLogLedgerMetadata", "otherMetadata", "=", "readEd...
Verify that the specified EditLogLedgerMetadata instance is the same as the EditLogLedgerMetadata object stored in the specified ZNode path. @param metadata The instance to compare against @param fullPathToVerify The path to verify @return True if we are able to successfully verify the metadata
[ "Verify", "that", "the", "specified", "EditLogLedgerMetadata", "instance", "is", "the", "same", "as", "the", "EditLogLedgerMetadata", "object", "stored", "in", "the", "specified", "ZNode", "path", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L358-L376
119,694
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java
BookKeeperJournalMetadataManager.listLedgers
public Collection<EditLogLedgerMetadata> listLedgers( boolean includeInProgressLedgers) throws IOException { // Use TreeSet to sort ledgers by firstTxId TreeSet<EditLogLedgerMetadata> ledgers = new TreeSet<EditLogLedgerMetadata>(); try { List<String> ledgerNames = zooKeeper.getChildren(...
java
public Collection<EditLogLedgerMetadata> listLedgers( boolean includeInProgressLedgers) throws IOException { // Use TreeSet to sort ledgers by firstTxId TreeSet<EditLogLedgerMetadata> ledgers = new TreeSet<EditLogLedgerMetadata>(); try { List<String> ledgerNames = zooKeeper.getChildren(...
[ "public", "Collection", "<", "EditLogLedgerMetadata", ">", "listLedgers", "(", "boolean", "includeInProgressLedgers", ")", "throws", "IOException", "{", "// Use TreeSet to sort ledgers by firstTxId", "TreeSet", "<", "EditLogLedgerMetadata", ">", "ledgers", "=", "new", "Tree...
List all ledgers in this instance's ZooKeeper namespace. @param includeInProgressLedgers If true, will include in-progress (non-finalized) ledgers @return A list of ledgers ordered (in increasing order) by the first transaction id, using {@link EditLogLedgerMetadata#compareTo(EditLogLedgerMetadata)} @throws IOException
[ "List", "all", "ledgers", "in", "this", "instance", "s", "ZooKeeper", "namespace", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L394-L432
119,695
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
DataStorage.doMerge
boolean doMerge(String[] srcDataDirs, Collection<File> dstDataDirs, int namespaceId, NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { HashMap<File, File> dirsToMerge = new HashMap<File, File>(); int i = 0; for (Iterator<File> it = dstDataDirs.iterator(); it.hasNext(); i++) { ...
java
boolean doMerge(String[] srcDataDirs, Collection<File> dstDataDirs, int namespaceId, NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { HashMap<File, File> dirsToMerge = new HashMap<File, File>(); int i = 0; for (Iterator<File> it = dstDataDirs.iterator(); it.hasNext(); i++) { ...
[ "boolean", "doMerge", "(", "String", "[", "]", "srcDataDirs", ",", "Collection", "<", "File", ">", "dstDataDirs", ",", "int", "namespaceId", ",", "NamespaceInfo", "nsInfo", ",", "StartupOption", "startOpt", ")", "throws", "IOException", "{", "HashMap", "<", "F...
merge the data directory from srcDataDirs to dstDataDirs @return true if merge succeeds; false if no merge happens
[ "merge", "the", "data", "directory", "from", "srcDataDirs", "to", "dstDataDirs" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L238-L289
119,696
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
DataStorage.recoverTransitionRead
void recoverTransitionRead(DataNode datanode, int namespaceId, NamespaceInfo nsInfo, Collection<File> dataDirs, StartupOption startOpt, String nameserviceId) throws IOException { // First ensure datanode level format/snapshot/rollback is completed // recoverTransitionRead(datanode, nsInfo, dataDirs, start...
java
void recoverTransitionRead(DataNode datanode, int namespaceId, NamespaceInfo nsInfo, Collection<File> dataDirs, StartupOption startOpt, String nameserviceId) throws IOException { // First ensure datanode level format/snapshot/rollback is completed // recoverTransitionRead(datanode, nsInfo, dataDirs, start...
[ "void", "recoverTransitionRead", "(", "DataNode", "datanode", ",", "int", "namespaceId", ",", "NamespaceInfo", "nsInfo", ",", "Collection", "<", "File", ">", "dataDirs", ",", "StartupOption", "startOpt", ",", "String", "nameserviceId", ")", "throws", "IOException", ...
recoverTransitionRead for a specific Name Space @param datanode DataNode @param namespaceId name space Id @param nsInfo Namespace info of namenode corresponding to the Name Space @param dataDirs Storage directories @param startOpt startup option @throws IOException on error
[ "recoverTransitionRead", "for", "a", "specific", "Name", "Space" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L301-L331
119,697
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
DataStorage.makeNameSpaceDataDir
public static void makeNameSpaceDataDir(Collection<File> dataDirs) throws IOException { for (File data : dataDirs) { try { DiskChecker.checkDir(data); } catch ( IOException e ) { LOG.warn("Invalid directory in: " + data.getCanonicalPath() + ": " + e.getMessage()); } ...
java
public static void makeNameSpaceDataDir(Collection<File> dataDirs) throws IOException { for (File data : dataDirs) { try { DiskChecker.checkDir(data); } catch ( IOException e ) { LOG.warn("Invalid directory in: " + data.getCanonicalPath() + ": " + e.getMessage()); } ...
[ "public", "static", "void", "makeNameSpaceDataDir", "(", "Collection", "<", "File", ">", "dataDirs", ")", "throws", "IOException", "{", "for", "(", "File", "data", ":", "dataDirs", ")", "{", "try", "{", "DiskChecker", ".", "checkDir", "(", "data", ")", ";"...
Create physical directory for Name Spaces on the data node @param dataDirs List of data directories @throws IOException on errors
[ "Create", "physical", "directory", "for", "Name", "Spaces", "on", "the", "data", "node" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L340-L349
119,698
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
DataStorage.doTransition
private void doTransition(List<StorageDirectory> sds, NamespaceInfo nsInfo, StartupOption startOpt ) throws IOException { if (startOpt == StartupOption.ROLLBACK) doRollback(nsInfo); // rollback if applicable int numOf...
java
private void doTransition(List<StorageDirectory> sds, NamespaceInfo nsInfo, StartupOption startOpt ) throws IOException { if (startOpt == StartupOption.ROLLBACK) doRollback(nsInfo); // rollback if applicable int numOf...
[ "private", "void", "doTransition", "(", "List", "<", "StorageDirectory", ">", "sds", ",", "NamespaceInfo", "nsInfo", ",", "StartupOption", "startOpt", ")", "throws", "IOException", "{", "if", "(", "startOpt", "==", "StartupOption", ".", "ROLLBACK", ")", "doRollb...
Analyze which and whether a transition of the fs state is required and perform it if necessary. Rollback if (previousLV >= LAYOUT_VERSION && previousLV > FEDERATION_VERSION) Upgrade if this.LV > LAYOUT_VERSION && this.LV > FEDERATION_VERSION Regular startup if this.LV = LAYOUT_VERSION && this.cTime = namenode.cTime @...
[ "Analyze", "which", "and", "whether", "a", "transition", "of", "the", "fs", "state", "is", "required", "and", "perform", "it", "if", "necessary", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L468-L529
119,699
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
DataStorage.addNameSpaceStorage
private void addNameSpaceStorage(int nsID, NameSpaceSliceStorage nsStorage) throws IOException { if (!this.nsStorageMap.containsKey(nsID)) { this.nsStorageMap.put(nsID, nsStorage); } }
java
private void addNameSpaceStorage(int nsID, NameSpaceSliceStorage nsStorage) throws IOException { if (!this.nsStorageMap.containsKey(nsID)) { this.nsStorageMap.put(nsID, nsStorage); } }
[ "private", "void", "addNameSpaceStorage", "(", "int", "nsID", ",", "NameSpaceSliceStorage", "nsStorage", ")", "throws", "IOException", "{", "if", "(", "!", "this", ".", "nsStorageMap", ".", "containsKey", "(", "nsID", ")", ")", "{", "this", ".", "nsStorageMap"...
Add nsStorage into nsStorageMap
[ "Add", "nsStorage", "into", "nsStorageMap" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L1050-L1055