_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q162300 | ServerCore.getNewClientId | train | private long getNewClientId() {
while (true) {
long clientId = Math.abs(clientIdsGenerator.nextLong());
if (!clientsData.containsKey(clientId)) {
return clientId;
}
}
} | java | {
"resource": ""
} |
q162301 | ChecksumStore.putIfAbsentChecksum | train | public Long putIfAbsentChecksum(Block blk, Long newChecksum)
throws IOException {
Long oldChecksum = putIfAbsent(blk, newChecksum);
if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) {
throw new IOException("Block " + blk.toString()
+ " has different checksums " + oldChecksum + "(ol... | java | {
"resource": ""
} |
q162302 | OverrideRecordReader.fillJoinCollector | train | protected void fillJoinCollector(K iterkey) throws IOException {
final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
if (!q.isEmpty()) {
int highpos = -1;
ArrayList<ComposableRecordReader<K,?>> list =
new ArrayList<ComposableRecordReader<K,?>>(kids.length);
q.p... | java | {
"resource": ""
} |
q162303 | BlockWithChecksumFileReader.getGenerationStampFromSeperateChecksumFile | train | static long getGenerationStampFromSeperateChecksumFile(String[] listdir, String blockName) {
for (int j = 0; j < listdir.length; j++) {
String path = listdir[j];
if (!path.startsWith(blockName)) {
continue;
}
String[] vals = StringUtils.split(path, '_');
if (vals.length != 3) {... | java | {
"resource": ""
} |
q162304 | BlockWithChecksumFileReader.parseGenerationStampInMetaFile | train | static long parseGenerationStampInMetaFile(File blockFile, File metaFile
) throws IOException {
String metaname = metaFile.getName();
String gs = metaname.substring(blockFile.getName().length() + 1,
metaname.length() - FSDataset.METADATA_EXTENSION.length());
try {
return Long.parseLong(g... | java | {
"resource": ""
} |
q162305 | BlockWithChecksumFileReader.metaFileExists | train | static public boolean metaFileExists(FSDatasetInterface dataset, int namespaceId, Block b) throws IOException {
return getMetaFile(dataset, namespaceId, b).exists();
} | java | {
"resource": ""
} |
q162306 | BufferedByteInputStream.wrapInputStream | train | public static DataInputStream wrapInputStream(InputStream is, int bufferSize,
int readBufferSize) {
// wrapping BufferedByteInputStream in BufferedInputStream decreases
// pressure on BBIS internal locks, and we read from the BBIS in
// bigger chunks
return new DataInputStream(new BufferedInputStr... | java | {
"resource": ""
} |
q162307 | BufferedByteInputStream.close | train | public void close() throws IOException {
// multiple close should return with no errors
// readThread will close underlying buffer
readThread.close();
try {
readThread.join();
} catch (InterruptedException e) {
throw new IOException(e);
}
} | java | {
"resource": ""
} |
q162308 | BufferedByteInputStream.checkOutput | train | private int checkOutput(int readBytes) throws IOException {
if (readBytes > -1) {
return readBytes;
}
if (closed) {
throw new IOException("The stream has been closed");
}
if (readThread.error != null) {
throw new IOException(readThread.error.getMessage());
}
return readByte... | java | {
"resource": ""
} |
q162309 | ClusterStatus.initTrackersToTasksMap | train | private void initTrackersToTasksMap(Collection<JobInProgress> jobsInProgress) {
for (TaskTrackerStatus tracker : taskTrackersDetails) {
taskTrackerExtendedTasks.put(tracker.getTrackerName(),
new ArrayList<TaskStatus>());
}
for (JobInProgress job : jobsInProgress) {
total_map_tasks ... | java | {
"resource": ""
} |
q162310 | MapOutputFile.getOutputFile | train | public Path getOutputFile(TaskAttemptID mapTaskId)
throws IOException {
return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir(
jobId.toString(), mapTaskId.toString())
+ "/file.out", conf);
} | java | {
"resource": ""
} |
q162311 | MapOutputFile.getSpillFileForWrite | train | public Path getSpillFileForWrite(TaskAttemptID mapTaskId, int spillNumber,
long size) throws IOException {
return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir(
jobId.toString(), mapTaskId.toString())
+ "/spill" +
... | java | {
"resource": ""
} |
q162312 | MapOutputFile.getSpillIndexFile | train | public Path getSpillIndexFile(TaskAttemptID mapTaskId, int spillNumber)
throws IOException {
return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir(
jobId.toString(), mapTaskId.toString())
+ "/spill" +
spillNumber + ".out.in... | java | {
"resource": ""
} |
q162313 | MapOutputFile.getInputFile | train | public Path getInputFile(int mapId, TaskAttemptID reduceTaskId)
throws IOException {
// TODO *oom* should use a format here
return lDirAlloc.getLocalPathToRead(TaskTracker.getIntermediateOutputDir(
jobId.toString(), reduceTaskId.toString())
+ "/map_" + mapId + "... | java | {
"resource": ""
} |
q162314 | MapOutputFile.getInputFileForWrite | train | public Path getInputFileForWrite(TaskID mapId, TaskAttemptID reduceTaskId,
long size)
throws IOException {
// TODO *oom* should use a format here
return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir(
jobId.toString(), reduceTas... | java | {
"resource": ""
} |
q162315 | MapOutputFile.removeAll | train | public void removeAll(TaskAttemptID taskId) throws IOException {
String toBeDeleted =
TaskTracker.getIntermediateOutputDir(jobId.toString(), taskId.toString());
if (asyncDiskService != null) {
asyncDiskService.moveAndDeleteFromEachVolume(toBeDeleted);
LOG.info("Move and then delete map ouput "... | java | {
"resource": ""
} |
q162316 | LocatedBlocks.setLastBlockSize | train | public synchronized void setLastBlockSize(long blockId, long blockSize) {
assert blocks.size() > 0;
LocatedBlock last = blocks.get(blocks.size() - 1);
if (underConstruction && blockSize > last.getBlockSize()) {
assert blockId == last.getBlock().getBlockId();
this.setFileLength(this.getFileLengt... | java | {
"resource": ""
} |
q162317 | BlockReaderLocalWithChecksum.readAll | train | public ByteBuffer readAll() throws IOException {
MappedByteBuffer bb = dataFileChannel.map(FileChannel.MapMode.READ_ONLY,
startOffset, length);
return bb;
} | java | {
"resource": ""
} |
q162318 | TFactoryBasedThreadPoolServer.createNewServer | train | public static TFactoryBasedThreadPoolServer createNewServer(
TProcessor processor, ServerSocket serverSocket, int socketTimeOut)
throws IOException {
TServerSocket socket = new TServerSocket(serverSocket, socketTimeOut);
TFactoryBasedThreadPoolServer.Args args =
new TFactoryBasedThreadPoolServer.A... | java | {
"resource": ""
} |
q162319 | IsolationRunner.fillInMissingMapOutputs | train | private static void fillInMissingMapOutputs(FileSystem fs,
TaskAttemptID taskId,
int numMaps,
JobConf conf) throws IOException {
Class<? extends WritableComparable> keyClass
... | java | {
"resource": ""
} |
q162320 | IsolationRunner.main | train | public static void main(String[] args
) throws ClassNotFoundException, IOException,
InterruptedException {
if (args.length != 1) {
System.out.println("Usage: IsolationRunner <path>/job.xml");
System.exit(1);
}
File jobFilename = new F... | java | {
"resource": ""
} |
q162321 | DFSFolder.upload | train | public void upload(IProgressMonitor monitor, final File file)
throws IOException {
if (file.isDirectory()) {
Path filePath = new Path(this.path, file.getName());
getDFS().mkdirs(filePath);
DFSFolder newFolder = new DFSFolder(this, filePath);
monitor.worked(1);
for (File child : ... | java | {
"resource": ""
} |
q162322 | DFSFolder.mkdir | train | public void mkdir(String folderName) {
try {
getDFS().mkdirs(new Path(this.path, folderName));
} catch (IOException ioe) {
ioe.printStackTrace();
}
doRefresh();
} | java | {
"resource": ""
} |
q162323 | PendingReplication.add | train | boolean add(Path filename) {
synchronized (pendingReplications) {
PendingInfo found = pendingReplications.get(filename);
if (found == null) {
pendingReplications.put(filename, new PendingInfo(filename));
return true;
}
return false;
}
} | java | {
"resource": ""
} |
q162324 | TopologyCache.getNode | train | public Node getNode(String name) {
Node n = hostnameToNodeMap.get(name);
// it's ok if multiple threads try to resolve the same host at the same time
// the assumption is that resolve() will return a canonical node object and
// the put operation is therefore idempotent
if (n == null) {
n = r... | java | {
"resource": ""
} |
q162325 | SequenceFileOutputFormat.getReaders | train | public static SequenceFile.Reader[] getReaders(Configuration conf, Path dir)
throws IOException {
FileSystem fs = dir.getFileSystem(conf);
Path[] names = FileUtil.stat2Paths(fs.listStatus(dir));
// sort names, so that hash partitioning works
Arrays.sort(names);
SequenceFile.Reader[] pa... | java | {
"resource": ""
} |
q162326 | TrackerStats.isFaulty | train | public boolean isFaulty(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = usageReports.get(trackerName);
return isDeadTracker(trackerName) || (usageReport != null &&
(usageReport.getNumFailedConnections() > maxFailedConnections ||
usageReport.getNumFail... | java | {
"resource": ""
} |
q162327 | TrackerStats.getNumFaultyTrackers | train | public int getNumFaultyTrackers() {
int count = 0;
synchronized (this) {
for (String trackerName : usageReports.keySet()) {
if (isFaulty(trackerName)) {
count++;
}
}
}
return count;
} | java | {
"resource": ""
} |
q162328 | TrackerStats.recordTask | train | public void recordTask(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport.setNumTotalTasks(usageReport.getNumTotalTasks() + 1);
}
} | java | {
"resource": ""
} |
q162329 | TrackerStats.recordSucceededTask | train | public void recordSucceededTask(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport.setNumSucceeded(usageReport.getNumSucceeded() + 1);
}
} | java | {
"resource": ""
} |
q162330 | TrackerStats.recordKilledTask | train | public void recordKilledTask(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport.setNumKilled(usageReport.getNumKilled() + 1);
}
} | java | {
"resource": ""
} |
q162331 | TrackerStats.recordFailedTask | train | public void recordFailedTask(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport.setNumFailed(usageReport.getNumFailed() + 1);
}
} | java | {
"resource": ""
} |
q162332 | TrackerStats.recordSlowTask | train | public void recordSlowTask(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport.setNumSlow(usageReport.getNumSlow() + 1);
}
} | java | {
"resource": ""
} |
q162333 | TrackerStats.recordConnectionError | train | public void recordConnectionError(String trackerName) {
synchronized (this) {
NodeUsageReport usageReport = getReportUnprotected(trackerName);
usageReport
.setNumFailedConnections(usageReport.getNumFailedConnections() + 1);
}
} | java | {
"resource": ""
} |
q162334 | TrackerStats.getReportUnprotected | train | private NodeUsageReport getReportUnprotected(String trackerName) {
NodeUsageReport usageReport = usageReports.get(trackerName);
if (usageReport == null) {
usageReport = new NodeUsageReport(trackerName, 0, 0, 0, 0, 0, 0, 0);
usageReports.put(trackerName, usageReport);
}
return usageReport;
... | java | {
"resource": ""
} |
q162335 | MetricsTimeVaryingRate.inc | train | public void inc(final int numOps, final long time) {
lock.lock();
try {
currentData.numOperations += numOps;
currentData.time += time;
long timePerOps = time/numOps;
minMax.update(timePerOps);
} finally {
lock.unlock();
}
} | java | {
"resource": ""
} |
q162336 | TaskAttemptID.downgrade | train | public static
TaskAttemptID downgrade(org.apache.hadoop.mapreduce.TaskAttemptID old) {
if (old instanceof TaskAttemptID) {
return (TaskAttemptID) old;
} else {
return new TaskAttemptID(TaskID.downgrade(old.getTaskID()), old.getId());
}
} | java | {
"resource": ""
} |
q162337 | BlockInlineChecksumReader.getFileLengthFromBlockSize | train | public static long getFileLengthFromBlockSize(long blockSize,
int bytesPerChecksum, int checksumSize) {
long numChunks;
if (blockSize % bytesPerChecksum == 0) {
numChunks = blockSize / bytesPerChecksum;
} else {
numChunks = blockSize / bytesPerChecksum + 1;
}
return b... | java | {
"resource": ""
} |
q162338 | BlockInlineChecksumReader.getPosFromBlockOffset | train | public static long getPosFromBlockOffset(long offsetInBlock, int bytesPerChecksum,
int checksumSize) {
// We only support to read full chunks, so offsetInBlock must be the boundary
// of the chunks.
assert offsetInBlock % bytesPerChecksum == 0;
// The position in the file will be the same as the f... | java | {
"resource": ""
} |
q162339 | FSDatasetAsyncDiskService.execute | train | synchronized void execute(File root, Runnable task) {
if (executors == null) {
throw new RuntimeException("AsyncDiskService is already shutdown");
}
ThreadPoolExecutor executor = executors.get(root);
if (executor == null) {
throw new RuntimeException("Cannot find root " + root
+ " ... | java | {
"resource": ""
} |
q162340 | FSDatasetAsyncDiskService.shutdown | train | synchronized void shutdown() {
if (executors == null) {
LOG.warn("AsyncDiskService has already shut down.");
} else {
LOG.info("Shutting down all async disk service threads...");
for (Map.Entry<File, ThreadPoolExecutor> e
: executors.entrySet()) {
e.... | java | {
"resource": ""
} |
q162341 | FSDatasetAsyncDiskService.deleteAsync | train | void deleteAsync(FSDataset.FSVolume volume, File blockFile,
File metaFile, String blockName, int namespaceId) {
DataNode.LOG.info("Scheduling block " + blockName + " file " + blockFile
+ " for deletion");
ReplicaFileDeleteTask deletionTask = new ReplicaFileDeleteTask(volume,
blockFile, met... | java | {
"resource": ""
} |
q162342 | FSDatasetAsyncDiskService.deleteAsyncFile | train | void deleteAsyncFile(FSDataset.FSVolume volume, File file){
DataNode.LOG.info("Scheduling file " + file.toString() + " for deletion");
FileDeleteTask deletionTask =
new FileDeleteTask(volume, file);
execute(volume.getCurrentDir(), deletionTask);
} | java | {
"resource": ""
} |
q162343 | NativeS3FileSystem.createParent | train | private void createParent(Path path) throws IOException {
Path parent = path.getParent();
if (parent != null) {
String key = pathToKey(makeAbsolute(parent));
if (key.length() > 0) {
store.storeEmptyFile(key + FOLDER_SUFFIX);
}
}
} | java | {
"resource": ""
} |
q162344 | GenericOptionsParser.buildGeneralOptions | train | @SuppressWarnings("static-access")
private static Options buildGeneralOptions(Options opts) {
Option fs = OptionBuilder.withArgName("local|namenode:port")
.hasArg()
.withDescription("specify a namenode")
.create("fs");
Option jt = OptionBuilder.withArgName("local|jobtracker:port")
.hasArg()
... | java | {
"resource": ""
} |
q162345 | GenericOptionsParser.processGeneralOptions | train | private void processGeneralOptions(Configuration conf,
CommandLine line) {
if (line.hasOption("fs")) {
FileSystem.setDefaultUri(conf, line.getOptionValue("fs"));
}
if (line.hasOption("jt")) {
conf.set("mapred.job.tracker", line.getOptionValue("jt"));
}
if (line.hasOption("conf")) ... | java | {
"resource": ""
} |
q162346 | GenericOptionsParser.getLibJars | train | public static URL[] getLibJars(Configuration conf) throws IOException {
String jars = conf.get("tmpjars");
if(jars==null) {
return null;
}
String[] files = jars.split(",");
URL[] cp = new URL[files.length];
for (int i=0;i<cp.length;i++) {
Path tmp = new Path(files[i]);
cp[i] = ... | java | {
"resource": ""
} |
q162347 | GenericOptionsParser.parseGeneralOptions | train | private String[] parseGeneralOptions(Options opts, Configuration conf,
String[] args) {
opts = buildGeneralOptions(opts);
CommandLineParser parser = new GnuParser();
try {
commandLine = parser.parse(opts, args, true);
processGeneralOptions(conf, commandLine);
return commandLine.getA... | java | {
"resource": ""
} |
q162348 | GenericOptionsParser.printGenericCommandUsage | train | public static void printGenericCommandUsage(PrintStream out) {
out.println("Generic options supported are");
out.println("-conf <configuration file> specify an application configuration file");
out.println("-D <property=value> use value for given property");
out.println("-fs <local|n... | java | {
"resource": ""
} |
q162349 | FaultManager.addNode | train | public void addNode(String name, Set<ResourceType> resourceTypes) {
List<FaultStatsForType> faultStats = new ArrayList<FaultStatsForType>(
resourceTypes.size());
for (ResourceType type : resourceTypes) {
faultStats.add(new FaultStatsForType(type));
}
nodeToFaultStats.put(name, faultStats);... | java | {
"resource": ""
} |
q162350 | FaultManager.nodeFeedback | train | public void nodeFeedback(String nodeName, List<ResourceType> resourceTypes,
NodeUsageReport usageReport) {
List<FaultStatsForType> faultStats = nodeToFaultStats.get(nodeName);
if (faultStats == null) {
LOG.info("Received node feedback for deleted node " + nodeName);
return;
}
boolean s... | java | {
"resource": ""
} |
q162351 | FaultManager.isBlacklisted | train | public boolean isBlacklisted(String nodeName, ResourceType type) {
List<ResourceType> blacklistedResourceTypes =
blacklistedNodes.get(nodeName);
if (blacklistedResourceTypes != null) {
synchronized (blacklistedResourceTypes) {
return blacklistedResourceTypes.contains(type);
}
} els... | java | {
"resource": ""
} |
q162352 | FaultManager.getBlacklistedNodes | train | public List<String> getBlacklistedNodes() {
List<String> ret = new ArrayList<String>();
for (String nodeName : blacklistedNodes.keySet()) {
ret.add(nodeName);
}
return ret;
} | java | {
"resource": ""
} |
q162353 | FaultManager.blacklistIfNeeded | train | private void blacklistIfNeeded(
String nodeName, List<FaultStatsForType> faultStats) {
for (FaultStatsForType stat : faultStats) {
if (isBlacklisted(nodeName, stat.type)) {
continue;
}
if (tooManyFailuresOnNode(stat) ||
tooManyConnectionFailuresOnNode(stat)) {
nm.... | java | {
"resource": ""
} |
q162354 | FaultManager.blacklist | train | private void blacklist(String nodeName, ResourceType type) {
List<ResourceType> blacklistedResourceTypes =
blacklistedNodes.get(nodeName);
if (blacklistedResourceTypes == null) {
blacklistedResourceTypes = new ArrayList<ResourceType>();
blacklistedNodes.put(nodeName, blacklistedResourceTypes);... | java | {
"resource": ""
} |
q162355 | FSPermissionChecker.checkPermission | train | void checkPermission(String path, INode[] inodes, boolean doCheckOwner,
FsAction ancestorAccess, FsAction parentAccess, FsAction access,
FsAction subAccess) throws AccessControlException {
if (LOG.isDebugEnabled()) {
LOG.debug("ACCESS CHECK: " + this
+ ", doCheckOwner=" + doCheckOwner
... | java | {
"resource": ""
} |
q162356 | WebUtils.convertResourceTypesToStrings | train | public static Collection<String> convertResourceTypesToStrings(
Collection<ResourceType> resourceTypes) {
List<String> retList = new ArrayList<String>(resourceTypes.size());
for (ResourceType resourceType : resourceTypes) {
retList.add(resourceType.toString());
}
return retList;
} | java | {
"resource": ""
} |
q162357 | WebUtils.validateAttributeNames | train | public static String validateAttributeNames(
Enumeration<String> attributeNames) {
while (attributeNames.hasMoreElements()) {
String attribute = attributeNames.nextElement();
if (!attribute.equals("users") && !attribute.equals("poolGroups") &&
!attribute.equals("poolInfos") && !attribute... | java | {
"resource": ""
} |
q162358 | WebUtils.isValidKillSessionsToken | train | public static boolean isValidKillSessionsToken(String token) {
if (token == null || token.isEmpty()) {
return false;
}
for (String validToken:VALID_TOKENS) {
if (token.equals (validToken)) {
return true;
}
}
return false;
} | java | {
"resource": ""
} |
q162359 | WebUtils.getJspParameterFilters | train | public static JspParameterFilters getJspParameterFilters(
String userFilter,
String poolGroupFilter,
String poolInfoFilter) {
JspParameterFilters filters = new JspParameterFilters();
if (userFilter != null && !userFilter.equals("null")) {
filters.getUserFilterSet().addAll(Arrays.asList(u... | java | {
"resource": ""
} |
q162360 | ZlibCompressor.setInputFromSavedData | train | synchronized void setInputFromSavedData() {
int len = Math.min(userBufLen, uncompressedDirectBuf.remaining());
((ByteBuffer)uncompressedDirectBuf).put(userBuf, userBufOff, len);
userBufLen -= len;
userBufOff += len;
uncompressedDirectBufLen = uncompressedDirectBuf.position();
} | java | {
"resource": ""
} |
q162361 | AtomicFileOutputStream.abort | train | public void abort() {
try {
super.close();
} catch (IOException ioe) {
LOG.warn("Unable to abort file " + tmpFile, ioe);
}
if (!tmpFile.delete()) {
LOG.warn("Unable to delete tmp file during abort " + tmpFile);
}
} | java | {
"resource": ""
} |
q162362 | SimulatorJobTracker.startTracker | train | public static SimulatorJobTracker startTracker(JobConf conf, long startTime, SimulatorEngine engine)
throws IOException {
SimulatorJobTracker result = null;
try {
SimulatorClock simClock = new SimulatorClock(startTime);
result = new SimulatorJobTracker(conf, simClock, engine);
result.taskSch... | java | {
"resource": ""
} |
q162363 | SimulatorJobTracker.startTracker | train | public static SimulatorJobTracker startTracker(JobConf conf, long startTime)
throws IOException, InterruptedException {
return startTracker(conf, startTime, new SimulatorEngine());
} | java | {
"resource": ""
} |
q162364 | SimulatorJobTracker.getClock | train | static Clock getClock() {
assert(engine.getCurrentTime() == clock.getTime()):
" Engine time = " + engine.getCurrentTime() +
" JobTracker time = " + clock.getTime();
return clock;
} | java | {
"resource": ""
} |
q162365 | SimulatorJobTracker.cleanupJob | train | private void cleanupJob(JobInProgress job) {
cleanupQueue.add(job.getJobID());
while(cleanupQueue.size()> JOBS_IN_MUMAK_MEMORY) {
JobID removedJob = cleanupQueue.poll();
// retireJob(removedJob, "");
}
} | java | {
"resource": ""
} |
q162366 | SimulatorJobTracker.validateAndSetClock | train | private void validateAndSetClock(long newSimulationTime) {
// We do not use the getClock routine here as
// the Engine and JobTracker clocks are different at
// this point.
long currentSimulationTime = clock.getTime();
if (newSimulationTime < currentSimulationTime) {
// time has gone... | java | {
"resource": ""
} |
q162367 | SimulatorJobTracker.getMapCompletionTasks | train | private List<TaskTrackerAction> getMapCompletionTasks(
TaskTrackerStatus status,
List<TaskTrackerAction> tasksToKill) {
boolean loggingEnabled = LOG.isDebugEnabled();
// Build up the list of tasks about to be killed
Set<TaskAttemptID> killedTasks = new HashSet<TaskAttemptID>();
if (tas... | java | {
"resource": ""
} |
q162368 | BookKeeperJournalInputStream.nextEntryStream | train | private InputStream nextEntryStream() throws IOException {
long nextLedgerEntryId = currentStreamState.getNextLedgerEntryId();
if (nextLedgerEntryId > maxLedgerEntryIdSeen) {
updateMaxLedgerEntryIdSeen();
if (nextLedgerEntryId > maxLedgerEntryIdSeen) {
// Return null if we've reached the end... | java | {
"resource": ""
} |
q162369 | BookKeeperJournalInputStream.position | train | public void position(long position) throws IOException {
if (position == 0) {
currentStreamState.setNextLedgerEntryId(firstLedgerEntryId);
currentStreamState.setOffsetInEntry(0);
entryStream = null;
} else if (savedStreamState == null ||
position != savedStreamState.getReaderPosition()... | java | {
"resource": ""
} |
q162370 | RaidShell.verifyParity | train | private void verifyParity(String[] args, int startIndex) {
boolean restoreReplication = false;
int repl = -1;
Path root = null;
for (int i = startIndex; i < args.length; i++) {
String arg = args[i];
if (arg.equals("-restore")) {
restoreReplication = true;
} else if (arg.equals(... | java | {
"resource": ""
} |
q162371 | RaidShell.recover | train | public Path[] recover(String cmd, String argv[], int startindex)
throws IOException {
Path[] paths = new Path[(argv.length - startindex) / 2];
int j = 0;
for (int i = startindex; i < argv.length; i = i + 2) {
String path = argv[i];
long corruptOffset = Long.parseLong(argv[i+1]);
LOG.in... | java | {
"resource": ""
} |
q162372 | RaidShell.isFileCorrupt | train | protected boolean isFileCorrupt(final DistributedFileSystem dfs,
final FileStatus fileStat)
throws IOException {
return isFileCorrupt(dfs, fileStat, false, conf,
this.numNonRaidedMissingBlks, this.numStrpMissingBlksMap);
} | java | {
"resource": ""
} |
q162373 | FastProtocolRegister.tryGetMethod | train | public static Method tryGetMethod(String id) {
if (id.length() != NAME_LEN) {
// we use it to fast discard the request without doing map lookup
return null;
}
return idToMethod.get(id);
} | java | {
"resource": ""
} |
q162374 | Job.setCombinerClass | train | public void setCombinerClass(Class<? extends Reducer> cls
) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setClass(COMBINE_CLASS_ATTR, cls, Reducer.class);
} | java | {
"resource": ""
} |
q162375 | Job.setMapOutputKeyClass | train | public void setMapOutputKeyClass(Class<?> theClass
) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setMapOutputKeyClass(theClass);
} | java | {
"resource": ""
} |
q162376 | Job.setMapOutputValueClass | train | public void setMapOutputValueClass(Class<?> theClass
) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setMapOutputValueClass(theClass);
} | java | {
"resource": ""
} |
q162377 | Job.setOutputKeyClass | train | public void setOutputKeyClass(Class<?> theClass
) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setOutputKeyClass(theClass);
} | java | {
"resource": ""
} |
q162378 | Job.setOutputValueClass | train | public void setOutputValueClass(Class<?> theClass
) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setOutputValueClass(theClass);
} | java | {
"resource": ""
} |
q162379 | Job.setJobName | train | public void setJobName(String name) throws IllegalStateException {
ensureState(JobState.DEFINE);
conf.setJobName(name);
} | java | {
"resource": ""
} |
q162380 | Job.killTask | train | public void killTask(TaskAttemptID taskId) throws IOException {
ensureState(JobState.RUNNING);
info.killTask(org.apache.hadoop.mapred.TaskAttemptID.downgrade(taskId),
false);
} | java | {
"resource": ""
} |
q162381 | Job.getCounters | train | public Counters getCounters() throws IOException {
ensureState(JobState.RUNNING);
org.apache.hadoop.mapred.Counters ctrs = info.getCounters();
if (ctrs == null) {
return null;
} else {
return new Counters(ctrs);
}
} | java | {
"resource": ""
} |
q162382 | Job.setUseNewAPI | train | private void setUseNewAPI() throws IOException {
int numReduces = conf.getNumReduceTasks();
String oldMapperClass = "mapred.mapper.class";
String oldReduceClass = "mapred.reducer.class";
conf.setBooleanIfUnset("mapred.mapper.new-api",
conf.get(oldMapperClass) == null);
if ... | java | {
"resource": ""
} |
q162383 | Job.submit | train | public void submit() throws IOException, InterruptedException,
ClassNotFoundException {
ensureState(JobState.DEFINE);
setUseNewAPI();
info = jobClient.submitJobInternal(conf);
state = JobState.RUNNING;
} | java | {
"resource": ""
} |
q162384 | Job.waitForCompletion | train | public boolean waitForCompletion(boolean verbose
) throws IOException, InterruptedException,
ClassNotFoundException {
if (state == JobState.DEFINE) {
submit();
}
if (verbose) {
jobClient.monitorAndPrintJob(conf, info)... | java | {
"resource": ""
} |
q162385 | StreamJob.setUserJobConfProps | train | protected void setUserJobConfProps(boolean doEarlyProps) {
Iterator it = userJobConfProps_.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
String val = (String)userJobConfProps_.get(key);
boolean earlyName = key.equals("fs.default.name");
earlyName |= key.equ... | java | {
"resource": ""
} |
q162386 | JournalNodeHttpServer.getJournalStats | train | public static Map<String, Map<String, String>> getJournalStats(
Collection<Journal> journals) {
Map<String, Map<String, String>> stats = new HashMap<String, Map<String, String>>();
for (Journal j : journals) {
try {
Map<String, String> stat = new HashMap<String, String>();
stats.put(... | java | {
"resource": ""
} |
q162387 | JournalNodeHttpServer.sendResponse | train | static void sendResponse(String output, HttpServletResponse response)
throws IOException {
PrintWriter out = null;
try {
out = response.getWriter();
out.write(output);
} finally {
if (out != null) {
out.close();
}
}
} | java | {
"resource": ""
} |
q162388 | DFSAdmin.report | train | public void report() throws IOException {
DistributedFileSystem dfs = getDFS();
if (dfs != null) {
DiskStatus ds = dfs.getDiskStatus();
long capacity = ds.getCapacity();
long used = ds.getDfsUsed();
long remaining = ds.getRemaining();
long presentCapacity = used + remaining;
... | java | {
"resource": ""
} |
q162389 | DFSAdmin.upgradeProgress | train | public int upgradeProgress(String[] argv, int idx) throws IOException {
DistributedFileSystem dfs = getDFS();
if (dfs == null) {
System.out.println("FileSystem is " + getFS().getUri());
return -1;
}
if (idx != argv.length - 1) {
printUsage("-upgradeProgress");
return -1;
}
... | java | {
"resource": ""
} |
q162390 | DFSAdmin.getClientDatanodeProtocol | train | private ClientDatanodeProtocol getClientDatanodeProtocol(String dnAddr)
throws IOException {
String hostname = null;
int port;
int index;
Configuration conf = getConf();
if (dnAddr == null) {
// Defaulting the configured address for the port
dnAddr = conf.get(FSConsta... | java | {
"resource": ""
} |
q162391 | DFSAdmin.getBlockInfo | train | private int getBlockInfo(String[] argv, int i) throws IOException {
long blockId = Long.valueOf(argv[i++]);
LocatedBlockWithFileName locatedBlock =
getDFS().getClient().getBlockInfo(blockId);
if (null == locatedBlock) {
System.err.println("Could not find the block with id : " + blockId);
retur... | java | {
"resource": ""
} |
q162392 | HftpFileSystem.openConnection | train | protected HttpURLConnection openConnection(String path, String query)
throws IOException {
try {
final URL url = new URI("http", null, nnAddr.getAddress().getHostAddress(),
nnAddr.getPort(), path, query, null).toURL();
if (LOG.isTraceEnabled()) {
LOG.trace("url=" + url);
}
... | java | {
"resource": ""
} |
q162393 | HarIndex.getHarIndex | train | public static HarIndex getHarIndex(FileSystem fs, Path initializer)
throws IOException {
if (!initializer.getName().endsWith(HAR)) {
initializer = initializer.getParent();
}
InputStream in = null;
try {
Path indexFile = new Path(initializer, INDEX);
FileStatus indexStat = fs.getF... | java | {
"resource": ""
} |
q162394 | HarIndex.parseLine | train | void parseLine(String line) throws UnsupportedEncodingException {
String[] splits = line.split(" ");
boolean isDir = "dir".equals(splits[1]) ? true: false;
if (!isDir && splits.length >= 6) {
String name = URLDecoder.decode(splits[0], "UTF-8");
String partName = URLDecoder.decode(splits[2], "UT... | java | {
"resource": ""
} |
q162395 | HarIndex.findEntry | train | public IndexEntry findEntry(String partName, long partFileOffset) {
for (IndexEntry e: entries) {
boolean nameMatch = partName.equals(e.partFileName);
boolean inRange = (partFileOffset >= e.startOffset) &&
(partFileOffset < e.startOffset + e.length);
if (nameMatch && inRang... | java | {
"resource": ""
} |
q162396 | HarIndex.findEntryByFileName | train | public IndexEntry findEntryByFileName(String fileName) {
for (IndexEntry e: entries) {
if (fileName.equals(e.fileName)) {
return e;
}
}
return null;
} | java | {
"resource": ""
} |
q162397 | BookKeeperJournalManager.prepareBookKeeperEnv | train | @VisibleForTesting
public static void prepareBookKeeperEnv(final String availablePath,
ZooKeeper zooKeeper) throws IOException {
final CountDownLatch availablePathLatch = new CountDownLatch(1);
StringCallback cb = new StringCallback() {
@Override
public void processResult(int rc, String pat... | java | {
"resource": ""
} |
q162398 | BookKeeperJournalManager.createZkMetadataIfNotExists | train | private void createZkMetadataIfNotExists(StorageInfo si) throws IOException {
try {
if (!hasSomeJournalData()) {
try {
// First create the parent path
zk.create(zkParentPath, new byte[] { '0' },
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
// Write format/n... | java | {
"resource": ""
} |
q162399 | BookKeeperJournalManager.zkPathExists | train | private boolean zkPathExists(String path) throws IOException {
try {
return zk.exists(path, false) != null;
} catch (KeeperException e) {
keeperException("Unrecoverable ZooKeeper error checking if " +
path + " exists", e);
} catch (InterruptedException e) {
interruptedException("... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.