Package tachyon

Examples of tachyon.TachyonURI


   * Validates the given uri, throwing an IOException if the uri is invalid.
   *
   * @param uri The uri to validate
   */
  private void validateUri(TachyonURI uri) throws IOException {
    TachyonURI thisFs = getUri();
    if (uri == null || (!uri.isPathAbsolute() && !TachyonURI.EMPTY_URI.equals(uri))
        || (uri.hasScheme() && !thisFs.getScheme().equals(uri.getScheme()))
        || (uri.hasAuthority() && !thisFs.getAuthority().equals(uri.getAuthority()))) {
      throw new IOException("Uri " + uri + " is invalid.");
    }
  }
View Full Code Here


  @Test
  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);
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);
View Full Code Here

          new ConcurrentCreator(DEPTH, CONCURRENCY_DEPTH, ROOT_PATH);
      concurrentCreator.call();
      Journal journal = new Journal(MasterConf.get().JOURNAL_FOLDER, "image.data", "log.data");
      MasterInfo info = new MasterInfo(new InetSocketAddress(9999), journal);
      info.init();
      for (TachyonURI path : mMasterInfo.ls(new TachyonURI("/"), true)) {
        Assert.assertEquals(mMasterInfo.getFileId(path), info.getFileId(path));
      }
      after();
      before();
    }
View Full Code Here

    ConcurrentDeleter concurrentDeleter =
        new ConcurrentDeleter(DEPTH, CONCURRENCY_DEPTH, ROOT_PATH);
    concurrentDeleter.call();

    Assert.assertEquals(1, mMasterInfo.ls(new TachyonURI("/"), true).size());
  }
View Full Code Here

  }

  @Test(expected = FileAlreadyExistException.class)
  public void createAlreadyExistFileTest() throws InvalidPathException, FileAlreadyExistException,
      BlockInfoException, TachyonException {
    mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    mMasterInfo.mkdirs(new TachyonURI("/testFile"), true);
  }
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

  }

  @Test(expected = InvalidPathException.class)
  public void createFileInvalidPathTest() throws InvalidPathException, FileAlreadyExistException,
      BlockInfoException, TachyonException {
    mMasterInfo.createFile(new TachyonURI("testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
  }
View Full Code Here

  }

  @Test(expected = FileAlreadyExistException.class)
  public void createFileInvalidPathTest2() throws InvalidPathException, FileAlreadyExistException,
      BlockInfoException, TachyonException {
    mMasterInfo.createFile(new TachyonURI("/"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
  }
View Full Code Here

TOP

Related Classes of tachyon.TachyonURI

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.