コード例 #1
0
 @Test
 public void lastModificationTimeCreateFileTest() throws Exception {
   mFsMaster.createDirectory(new AlluxioURI("/testFolder"), CreateDirectoryOptions.defaults());
   long opTimeMs = TEST_CURRENT_TIME;
   CreateFileOptions options = CreateFileOptions.defaults().setOperationTimeMs(opTimeMs);
   try (LockedInodePath inodePath =
       mInodeTree.lockInodePath(
           new AlluxioURI("/testFolder/testFile"), InodeTree.LockMode.WRITE)) {
     mFsMaster.createFileInternal(inodePath, options);
   }
   FileInfo folderInfo = mFsMaster.getFileInfo(mFsMaster.getFileId(new AlluxioURI("/testFolder")));
   Assert.assertEquals(opTimeMs, folderInfo.getLastModificationTimeMs());
 }
コード例 #2
0
 @Test
 public void ttlCreateFileTest() throws Exception {
   mFsMaster.createDirectory(new AlluxioURI("/testFolder"), CreateDirectoryOptions.defaults());
   long ttl = 100;
   CreateFileOptions options = CreateFileOptions.defaults().setTtl(ttl);
   try (LockedInodePath inodePath =
       mInodeTree.lockInodePath(
           new AlluxioURI("/testFolder/testFile"), InodeTree.LockMode.WRITE)) {
     mFsMaster.createFileInternal(inodePath, options);
   }
   FileInfo folderInfo =
       mFsMaster.getFileInfo(mFsMaster.getFileId(new AlluxioURI("/testFolder/testFile")));
   Assert.assertEquals(ttl, folderInfo.getTtl());
 }