Package tachyon

Examples of tachyon.TachyonURI


  }

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


  @Test
  public void createFilePerfTest() throws FileAlreadyExistException, InvalidPathException,
      FileDoesNotExistException, TachyonException {
    // long sMs = System.currentTimeMillis();
    for (int k = 0; k < 200; k ++) {
      mMasterInfo.mkdirs(new TachyonURI("/testFile").join(MasterInfo.COL + k).join("0"), true);
    }
    // System.out.println(System.currentTimeMillis() - sMs);
    // sMs = System.currentTimeMillis();
    for (int k = 0; k < 200; k ++) {
      mMasterInfo.getClientFileInfo(new TachyonURI("/testFile").join(MasterInfo.COL + k).join("0"));
    }
    // System.out.println(System.currentTimeMillis() - sMs);
  }
View Full Code Here

  }

  @Test
  public void createFileTest() throws InvalidPathException, FileAlreadyExistException,
      FileDoesNotExistException, BlockInfoException, TachyonException {
    mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertFalse(mMasterInfo.getClientFileInfo(new TachyonURI("/testFile")).isFolder);
  }
View Full Code Here

  }

  @Test
  public void createRawTableTest() throws InvalidPathException, FileAlreadyExistException,
      TableColumnException, FileDoesNotExistException, TachyonException {
    mMasterInfo.createRawTable(new TachyonURI("/testTable"), 1, (ByteBuffer) null);
    Assert.assertTrue(mMasterInfo.getClientFileInfo(new TachyonURI("/testTable")).isFolder);
  }
View Full Code Here

  }

  @Test
  public void deleteDirectoryWithDirectoriesTest() throws InvalidPathException,
      FileAlreadyExistException, TachyonException, BlockInfoException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder/testFolder2"), true));
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFile"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    int fileId2 =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFolder2/testFile2"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(3, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertEquals(fileId2,
        mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2/testFile2")));
    Assert.assertTrue(mMasterInfo.delete(2, true));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2")));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertEquals(-1,
        mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2/testFile2")));
  }
View Full Code Here

  }

  @Test
  public void deleteDirectoryWithDirectoriesTest2() throws InvalidPathException,
      FileAlreadyExistException, TachyonException, BlockInfoException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder/testFolder2"), true));
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFile"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    int fileId2 =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFolder2/testFile2"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(3, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertEquals(fileId2,
        mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2/testFile2")));
    Assert.assertFalse(mMasterInfo.delete(2, false));
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(3, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertEquals(fileId2,
        mMasterInfo.getFileId(new TachyonURI("/testFolder/testFolder2/testFile2")));
  }
View Full Code Here

  }

  @Test
  public void deleteDirectoryWithFilesTest() throws InvalidPathException,
      FileAlreadyExistException, TachyonException, BlockInfoException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFile"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertTrue(mMasterInfo.delete(2, true));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
  }
View Full Code Here

  }

  @Test
  public void deleteDirectoryWithFilesTest2() throws InvalidPathException,
      FileAlreadyExistException, TachyonException, BlockInfoException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFolder/testFile"),
            Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
    Assert.assertFalse(mMasterInfo.delete(2, false));
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFolder/testFile")));
  }
View Full Code Here

  }

  @Test
  public void deleteEmptyDirectoryTest() throws InvalidPathException, FileAlreadyExistException,
      TachyonException {
    Assert.assertTrue(mMasterInfo.mkdirs(new TachyonURI("/testFolder"), true));
    Assert.assertEquals(2, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
    Assert.assertTrue(mMasterInfo.delete(new TachyonURI("/testFolder"), true));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFolder")));
  }
View Full Code Here

  @Test
  public void deleteFileTest() throws InvalidPathException, FileAlreadyExistException,
      TachyonException, BlockInfoException {
    int fileId =
        mMasterInfo.createFile(new TachyonURI("/testFile"), Constants.DEFAULT_BLOCK_SIZE_BYTE);
    Assert.assertEquals(fileId, mMasterInfo.getFileId(new TachyonURI("/testFile")));
    Assert.assertTrue(mMasterInfo.delete(fileId, true));
    Assert.assertEquals(-1, mMasterInfo.getFileId(new TachyonURI("/testFile")));
  }
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.