@Test public void loadUnderFsTest() throws IOException { if (!UnderFileSystemCluster.isUFSHDFS()) { return; } String[] exclusions = { "/tachyon", "/exclusions" }; String[] inclusions = { "/inclusions/sub-1", "/inclusions/sub-2" }; for (String exclusion : exclusions) { if (!mUfs.exists(exclusion)) { mUfs.mkdirs(exclusion, true); } } for (String inclusion : inclusions) { if (!mUfs.exists(inclusion)) { mUfs.mkdirs(inclusion, true); } CommonUtils.touch(mUnderfsAddress + inclusion + "/1"); } UnderfsUtils.loadUnderFs(mTfs, Constants.PATH_SEPARATOR, mUnderfsAddress + Constants.PATH_SEPARATOR, new PrefixList("tachyon;exclusions", ";")); List<String> paths = null; for (String exclusion : exclusions) { try { paths = mTfs.ls(exclusion, true); fail("NO FileDoesNotExistException is expected here"); } catch (IOException ioe) { Assert.assertNotNull(ioe); } Assert.assertNull("Not exclude the target folder: " + exclusion, paths); } for (String inclusion : inclusions) { paths = mTfs.ls(inclusion, true); Assert.assertNotNull(paths); } }
public static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath, String excludePaths) throws IOException { Pair<String, String> tfsPair = UnderFileSystem.parse(tfsAddrRootPath); String tfsAddress = tfsPair.getFirst(); String tfsRootPath = tfsPair.getSecond(); TachyonFS tfs = TachyonFS.get(tfsAddress); PrefixList excludePathPrefix = new PrefixList(excludePaths, ";"); loadUnderFs(tfs, tfsRootPath, ufsAddrRootPath, excludePathPrefix); }
UnderfsUtils { public static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath, String excludePaths) throws IOException { Pair<String, String> tfsPair = UnderFileSystem.parse(tfsAddrRootPath); String tfsAddress = tfsPair.getFirst(); String tfsRootPath = tfsPair.getSecond(); TachyonFS tfs = TachyonFS.get(tfsAddress); PrefixList excludePathPrefix = new PrefixList(excludePaths, ";"); loadUnderFs(tfs, tfsRootPath, ufsAddrRootPath, excludePathPrefix); } }
UnderfsUtils { public static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath, String excludePaths) throws IOException { Pair<String, String> tfsPair = UnderFileSystem.parse(tfsAddrRootPath); String tfsAddress = tfsPair.getFirst(); String tfsRootPath = tfsPair.getSecond(); TachyonFS tfs = TachyonFS.get(tfsAddress); PrefixList excludePathPrefix = new PrefixList(excludePaths, ";"); loadUnderFs(tfs, tfsRootPath, ufsAddrRootPath, excludePathPrefix); }  }
UnderfsUtils { public static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath, String excludePaths) throws IOException { Pair<String, String> tfsPair = UnderFileSystem.parse(tfsAddrRootPath); String tfsAddress = tfsPair.getFirst(); String tfsRootPath = tfsPair.getSecond(); TachyonFS tfs = TachyonFS.get(tfsAddress); PrefixList excludePathPrefix = new PrefixList(excludePaths, ";"); loadUnderFs(tfs, tfsRootPath, ufsAddrRootPath, excludePathPrefix); }  static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath,
      String excludePaths); static void loadUnderFs(TachyonFS tfs, String tfsRootPath, String ufsAddrRootPath,
      PrefixList excludePathPrefix); static void main(String[] args); static void printUsage(); }
UnderfsUtils { public static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath, String excludePaths) throws IOException { Pair<String, String> tfsPair = UnderFileSystem.parse(tfsAddrRootPath); String tfsAddress = tfsPair.getFirst(); String tfsRootPath = tfsPair.getSecond(); TachyonFS tfs = TachyonFS.get(tfsAddress); PrefixList excludePathPrefix = new PrefixList(excludePaths, ";"); loadUnderFs(tfs, tfsRootPath, ufsAddrRootPath, excludePathPrefix); }  static void loadUnderFs(String tfsAddrRootPath, String ufsAddrRootPath,
      String excludePaths); static void loadUnderFs(TachyonFS tfs, String tfsRootPath, String ufsAddrRootPath,
      PrefixList excludePathPrefix); static void main(String[] args); static void printUsage();  }