本文整理匯總了Java中org.apache.hadoop.io.MapFile.DATA_FILE_NAME屬性的典型用法代碼示例。如果您正苦於以下問題:Java MapFile.DATA_FILE_NAME屬性的具體用法?Java MapFile.DATA_FILE_NAME怎麽用?Java MapFile.DATA_FILE_NAME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.hadoop.io.MapFile
的用法示例。
在下文中一共展示了MapFile.DATA_FILE_NAME屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listStatus
@Override
protected FileStatus[] listStatus(JobConf job) throws IOException {
FileStatus[] files = super.listStatus(job);
for (int i = 0; i < files.length; i++) {
FileStatus file = files[i];
if (file.isDirectory()) { // it's a MapFile
Path dataFile = new Path(file.getPath(), MapFile.DATA_FILE_NAME);
FileSystem fs = file.getPath().getFileSystem(job);
// use the data file
files[i] = fs.getFileStatus(dataFile);
}
}
return files;
}
示例2: listStatus
@Override
protected FileStatus[] listStatus(JobConf job) throws IOException {
FileStatus[] files = super.listStatus(job);
for (int i = 0; i < files.length; i++) {
FileStatus file = files[i];
if (file.isDir()) { // it's a MapFile
Path dataFile = new Path(file.getPath(), MapFile.DATA_FILE_NAME);
FileSystem fs = file.getPath().getFileSystem(job);
// use the data file
files[i] = fs.getFileStatus(dataFile);
}
}
return files;
}
示例3: listLocatedStatus
@Override
protected LocatedFileStatus[] listLocatedStatus(JobConf job) throws IOException {
LocatedFileStatus[] files = super.listLocatedStatus(job);
for (int i = 0; i < files.length; i++) {
FileStatus file = files[i];
if (file.isDir()) { // it's a MapFile
Path dataFile = new Path(file.getPath(), MapFile.DATA_FILE_NAME);
FileSystem fs = file.getPath().getFileSystem(job);
// use the data file
files[i] = fs.listLocatedStatus(dataFile).next();
}
}
return files;
}
示例4: MapFileSource
public MapFileSource(FileSystem fs, Path dir) throws IOException {
m_fs = fs;
m_config = m_fs.getConf();
Path root = new Path(fs.getUri());
m_dir = new Path(root, dir);
m_dirStr = m_dir.toUri().getPath();
m_dataPath = new Path(m_dir,MapFile.DATA_FILE_NAME);
m_indexPath = new Path(m_dir,MapFile.INDEX_FILE_NAME);
m_metaPath = new Path(m_dir,"metadata");
}