Package tachyon.thrift

Examples of tachyon.thrift.ClientFileInfo$ClientFileInfoStandardSchemeFactory


   * @throws Exception
   */
  @Test
  public void FolderTest() throws Exception {
    mTfs.mkdir(new TachyonURI("/xyz"));
    ClientFileInfo fInfo = mLocalTachyonCluster.getMasterInfo().getClientFileInfo(new TachyonURI("/xyz"));
    mLocalTachyonCluster.stopTFS();
    FolderTest(fInfo);
    String editLogPath = mLocalTachyonCluster.getEditLogPath();
    UnderFileSystem.get(editLogPath).delete(editLogPath, true);
    FolderTest(fInfo);
View Full Code Here


   * @throws Exception
   */
  @Test
  public void TableTest() throws Exception {
    mTfs.createRawTable(new TachyonURI("/xyz"), 10);
    ClientFileInfo fInfo = mLocalTachyonCluster.getMasterInfo().getClientFileInfo(new TachyonURI("/xyz"));
    mLocalTachyonCluster.stopTFS();
    TableTest(fInfo);
    String editLogPath = mLocalTachyonCluster.getEditLogPath();
    UnderFileSystem.get(editLogPath).delete(editLogPath, true);
    TableTest(fInfo);
View Full Code Here

          if (mCheckpointUfs == null) {
            mCheckpointUfs = UnderFileSystem.get(midPath);
          }

          final long startCopyTimeMs = System.currentTimeMillis();
          ClientFileInfo fileInfo = mMasterClient.getFileStatus(fileId, "");
          if (!fileInfo.isComplete) {
            LOG.error("File " + fileInfo + " is not complete!");
            continue;
          }
          for (int k = 0; k < fileInfo.blockIds.size(); k ++) {
            lockBlock(fileInfo.blockIds.get(k), Users.CHECKPOINT_USER_ID);
          }
          Closer closer = Closer.create();
          long fileSizeByte = 0;
          try {
            OutputStream os =
                closer.register(mCheckpointUfs.create(midPath, (int) fileInfo.getBlockSizeByte()));
            for (int k = 0; k < fileInfo.blockIds.size(); k ++) {
              File tempFile =
                  new File(CommonUtils.concat(mLocalDataFolder.toString(),
                      fileInfo.blockIds.get(k)));
              fileSizeByte += tempFile.length();
View Full Code Here

  public void addCheckpointTest() throws FileDoesNotExistException, SuspectedFileSizeException,
      FileAlreadyExistException, InvalidPathException, BlockInfoException, FileNotFoundException,
      TachyonException {
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals("", fileInfo.getUfsPath());
    mMasterInfo.addCheckpoint(-1, fileId, 1, new TachyonURI("/testPath"));
    fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals("/testPath", fileInfo.getUfsPath());
    mMasterInfo.addCheckpoint(-1, fileId, 1, new TachyonURI("/testPath"));
    fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals("/testPath", fileInfo.getUfsPath());
  }
View Full Code Here

  @Test
  public void clientFileInfoDirectoryTest() throws InvalidPathException, FileDoesNotExistException,
      FileAlreadyExistException, TachyonException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFolder"));
    Assert.assertEquals("testFolder", fileInfo.getName());
    Assert.assertEquals(2, fileInfo.getId());
    Assert.assertEquals(0, fileInfo.getLength());
    Assert.assertEquals("", fileInfo.getUfsPath());
    Assert.assertTrue(fileInfo.isFolder);
    Assert.assertFalse(fileInfo.isPinned);
    Assert.assertFalse(fileInfo.isCache);
    Assert.assertTrue(fileInfo.isComplete);
  }
View Full Code Here

  @Test
  public void clientFileInfoEmptyFileTest() throws InvalidPathException, FileDoesNotExistException,
      FileAlreadyExistException, BlockInfoException, TachyonException {
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals("testFile", fileInfo.getName());
    Assert.assertEquals(fileId, fileInfo.getId());
    Assert.assertEquals(0, fileInfo.getLength());
    Assert.assertEquals("", fileInfo.getUfsPath());
    Assert.assertFalse(fileInfo.isFolder);
    Assert.assertFalse(fileInfo.isPinned);
    Assert.assertTrue(fileInfo.isCache);
    Assert.assertFalse(fileInfo.isComplete);
  }
View Full Code Here

  @Test
  public void createDirectoryTest() throws InvalidPathException, FileAlreadyExistException,
      FileDoesNotExistException, TachyonException {
    mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true);
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFolder"));
    Assert.assertTrue(fileInfo.isFolder);
  }
View Full Code Here

      BlockInfoException, FileNotFoundException, TachyonException {
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    long opTimeMs = System.currentTimeMillis();
    mMasterInfo._addCheckpoint(-1, fileId, 1, new TachyonURI("/testPath"), opTimeMs);
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals(opTimeMs, fileInfo.lastModificationTimeMs);
  }
View Full Code Here

      BlockInfoException, FileNotFoundException, TachyonException {
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    long opTimeMs = System.currentTimeMillis();
    mMasterInfo._completeFile(fileId, opTimeMs);
    ClientFileInfo fileInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFile"));
    Assert.assertEquals(opTimeMs, fileInfo.lastModificationTimeMs);
  }
View Full Code Here

      FileAlreadyExistException, FileDoesNotExistException, TachyonException, BlockInfoException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    long opTimeMs = System.currentTimeMillis();
    mMasterInfo._createFile(false, new TachyonURI("/testFolder/testFile"), false,
        Constants.DEFAULT_BLOCK_SIZE_BYTE, opTimeMs);
    ClientFileInfo folderInfo = mMasterInfo.getClientFileInfo(new TachyonURI("/testFolder"));
    Assert.assertEquals(opTimeMs, folderInfo.lastModificationTimeMs);
  }
View Full Code Here

TOP

Related Classes of tachyon.thrift.ClientFileInfo$ClientFileInfoStandardSchemeFactory

Copyright © 2018 www.massapicom. 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.