本文整理汇总了Java中org.apache.hadoop.fs.LocalDirAllocator.getAllLocalPathsToRead方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDirAllocator.getAllLocalPathsToRead方法的具体用法?Java LocalDirAllocator.getAllLocalPathsToRead怎么用?Java LocalDirAllocator.getAllLocalPathsToRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.fs.LocalDirAllocator
的用法示例。
在下文中一共展示了LocalDirAllocator.getAllLocalPathsToRead方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanupTemporalDirectories
import org.apache.hadoop.fs.LocalDirAllocator; //导入方法依赖的package包/类
public void cleanupTemporalDirectories() {
if (deletionService == null) return;
LocalDirAllocator lDirAllocator = new LocalDirAllocator(ConfVars.WORKER_TEMPORAL_DIR.varname);
try {
Iterable<Path> iter = lDirAllocator.getAllLocalPathsToRead(".", systemConf);
FileSystem localFS = FileSystem.getLocal(systemConf);
for (Path path : iter) {
PathData[] items = PathData.expandAsGlob(localFS.makeQualified(new Path(path, "*")).toString(), systemConf);
ArrayList<Path> paths = new ArrayList<>();
for (PathData pd : items) {
paths.add(pd.path);
}
if (paths.size() == 0) continue;
deletionService.delete(null, paths.toArray(new Path[paths.size()]));
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
示例2: HashShuffleAppenderManager
import org.apache.hadoop.fs.LocalDirAllocator; //导入方法依赖的package包/类
public HashShuffleAppenderManager(TajoConf systemConf) throws IOException {
this.systemConf = systemConf;
// initialize LocalDirAllocator
lDirAllocator = new LocalDirAllocator(ConfVars.WORKER_TEMPORAL_DIR.varname);
// initialize DFS and LocalFileSystems
defaultFS = TajoConf.getTajoRootDir(systemConf).getFileSystem(systemConf);
localFS = FileSystem.getLocal(systemConf);
pageSize = systemConf.getIntVar(ConfVars.SHUFFLE_HASH_APPENDER_PAGE_VOLUME) * StorageUnit.MB;
Iterable<Path> allLocalPath = lDirAllocator.getAllLocalPathsToRead(".", systemConf);
//add async hash shuffle writer
for (Path path : allLocalPath) {
temporalPaths.add(localFS.makeQualified(path).toString());
executors.put(temporalPaths.size() - 1, Executors.newSingleThreadExecutor());
}
}
示例3: cleanupTemporalDirectories
import org.apache.hadoop.fs.LocalDirAllocator; //导入方法依赖的package包/类
protected void cleanupTemporalDirectories() {
if(deletionService == null) return;
LocalDirAllocator lDirAllocator = new LocalDirAllocator(ConfVars.WORKER_TEMPORAL_DIR.varname);
try {
Iterable<Path> iter = lDirAllocator.getAllLocalPathsToRead(".", systemConf);
FileSystem localFS = FileSystem.getLocal(systemConf);
for (Path path : iter){
PathData[] items = PathData.expandAsGlob(localFS.makeQualified(new Path(path, "*")).toString(), systemConf);
ArrayList<Path> paths = new ArrayList<Path>();
for (PathData pd : items){
paths.add(pd.path);
}
if(paths.size() == 0) continue;
deletionService.delete(null, paths.toArray(new Path[paths.size()]));
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
示例4: cleanup
import org.apache.hadoop.fs.LocalDirAllocator; //导入方法依赖的package包/类
public void cleanup(String strPath) {
if (deletionService == null) return;
LocalDirAllocator lDirAllocator = new LocalDirAllocator(ConfVars.WORKER_TEMPORAL_DIR.varname);
try {
Iterable<Path> iter = lDirAllocator.getAllLocalPathsToRead(strPath, systemConf);
FileSystem localFS = FileSystem.getLocal(systemConf);
for (Path path : iter) {
deletionService.delete(localFS.makeQualified(path));
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
示例5: cleanup
import org.apache.hadoop.fs.LocalDirAllocator; //导入方法依赖的package包/类
protected void cleanup(String strPath) {
if(deletionService == null) return;
LocalDirAllocator lDirAllocator = new LocalDirAllocator(ConfVars.WORKER_TEMPORAL_DIR.varname);
try {
Iterable<Path> iter = lDirAllocator.getAllLocalPathsToRead(strPath, systemConf);
FileSystem localFS = FileSystem.getLocal(systemConf);
for (Path path : iter){
deletionService.delete(localFS.makeQualified(path));
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}