Package tachyon

Examples of tachyon.UnderFileSystem.list()


  private boolean isFormatted(String folder, String path) throws IOException {
    if (!folder.endsWith(TachyonURI.SEPARATOR)) {
      folder += TachyonURI.SEPARATOR;
    }
    UnderFileSystem ufs = UnderFileSystem.get(folder);
    String[] files = ufs.list(folder);
    if (files == null) {
      return false;
    }
    for (String file : files) {
      if (file.startsWith(path)) {
View Full Code Here


        } else {
          LOG.info("Create tachyon file " + tfsPath + " with file id " + fileId + " and "
              + "checkpoint location " + ufsPath);
        }
      } else { // ufsPath is a directory
        String[] files = ufs.list(ufsPath.toString()); // ufs.list() returns relative path
        if (files != null) {
          for (String filePath : files) {
            LOG.info("Get: " + filePath);
            String aPath = CommonUtils.concat(ufsPath, filePath);
            String checkPath = aPath.substring(ufsAddrRootPath.toString().length());
View Full Code Here

    }
    log.close();

    // Rename completed edit logs when loading them.
    ufs = UnderFileSystem.get(completedStr);
    int numOfCompleteFiles = ufs.list(completedStr).length;
    Assert.assertTrue(numOfCompleteFiles > 0);
    EditLog.setBackUpLogStartNum(numOfCompleteFiles / 2);
    log = new EditLog(journalPath, false, 0);
    int numOfCompleteFilesLeft = numOfCompleteFiles - numOfCompleteFiles / 2 + 1;
    Assert.assertEquals(numOfCompleteFilesLeft, ufs.list(completedStr).length);
View Full Code Here

    int numOfCompleteFiles = ufs.list(completedStr).length;
    Assert.assertTrue(numOfCompleteFiles > 0);
    EditLog.setBackUpLogStartNum(numOfCompleteFiles / 2);
    log = new EditLog(journalPath, false, 0);
    int numOfCompleteFilesLeft = numOfCompleteFiles - numOfCompleteFiles / 2 + 1;
    Assert.assertEquals(numOfCompleteFilesLeft, ufs.list(completedStr).length);
    for (int i = 0; i < numOfCompleteFilesLeft; i ++) {
      Assert.assertTrue(ufs.exists(completedStr + i + ".editLog"));
    }
    EditLog.setBackUpLogStartNum(-1);
    log.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.