client = ((PersistTachyon) Persist.I[Value.TACHYON]).createClient(PersistTachyon.PREFIX+serverUri); String rootFolder = pathComponents[1]; List<ClientFileInfo> filesOnTFS= client.listStatus(rootFolder); // do a recursive descend Futures fs = new Futures(); for (ClientFileInfo f : filesOnTFS ) {
/** * Identifies the number of column partitions. * * TODO(hy): Creating file here should be based on id. * * @return the number of column partitions * @throws IOException when any of the partition paths is invalid or points to a non-existing * object */ public int partitions() throws IOException { TachyonURI tUri = new TachyonURI(PathUtils.concatPath(mRawTable.getPath(), Constants.MASTER_COLUMN_FILE_PREFIX + mColumnIndex)); return mTachyonFS.listStatus(tUri).size(); } }
@Override public FileStatus[] listStatus(Path path) throws IOException { TachyonURI tPath = new TachyonURI(Utils.getPathWithoutScheme(path)); Path hdfsPath = Utils.getHDFSPath(tPath, mUnderFSAddress); LOG.info("listStatus(" + path + "): HDFS Path: " + hdfsPath); if (mStatistics != null) { mStatistics.incrementReadOps(1); } if (!mTFS.exist(tPath)) { throw new FileNotFoundException("File does not exist: " + path); } List<FileInfo> files = mTFS.listStatus(tPath); FileStatus[] ret = new FileStatus[files.size()]; for (int k = 0; k < files.size(); k ++) { FileInfo info = files.get(k); // TODO(hy): Replicate 3 with the number of disk replications. ret[k] = new FileStatus(info.getLength(), info.isFolder, 3, info.getBlockSizeBytes(), info.getCreationTimeMs(), info.getCreationTimeMs(), null, null, null, new Path( mTachyonHeader + info.getPath())); } return ret; }