From 0fc074f88657c54ba12880fdd067a83bd1c88164 Mon Sep 17 00:00:00 2001 From: Jianjian Date: Tue, 17 Oct 2023 19:25:44 -0700 Subject: [PATCH] load ufs path directly --- .../java/alluxio/cli/fs/command/LoadCommand.java | 3 +-- .../fs/command/DoraLoadCommandIntegrationTest.java | 13 ++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dora/shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java b/dora/shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java index 44a1af58c91e..6539106d63e6 100644 --- a/dora/shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java +++ b/dora/shell/src/main/java/alluxio/cli/fs/command/LoadCommand.java @@ -150,8 +150,7 @@ public Options getOptions() { @Override public int run(CommandLine cl) throws AlluxioException, IOException { String[] args = cl.getArgs(); - AlluxioURI path = - new AlluxioURI(Configuration.getString(PropertyKey.DORA_CLIENT_UFS_ROOT)).join(args[0]); + AlluxioURI path = new AlluxioURI(args[0]); if (path.containsWildcard()) { throw new UnsupportedOperationException("Load does not support wildcard path"); } diff --git a/dora/tests/integration/src/test/java/alluxio/client/cli/fs/command/DoraLoadCommandIntegrationTest.java b/dora/tests/integration/src/test/java/alluxio/client/cli/fs/command/DoraLoadCommandIntegrationTest.java index 7a00707c8983..d554e4fefb42 100644 --- a/dora/tests/integration/src/test/java/alluxio/client/cli/fs/command/DoraLoadCommandIntegrationTest.java +++ b/dora/tests/integration/src/test/java/alluxio/client/cli/fs/command/DoraLoadCommandIntegrationTest.java @@ -56,10 +56,9 @@ public void testCommand() throws Exception { assertEquals(0, mFileSystem.getStatus(uriA).getInAlluxioPercentage()); assertEquals(0, mFileSystem.getStatus(uriB).getInAlluxioPercentage()); assertEquals(0, mFileSystem.getStatus(uriC).getInAlluxioPercentage()); - // Testing loading of a directory - assertEquals(0, mFsShell.run("load", "/testRoot", "--submit", "--verify")); - assertEquals(0, mFsShell.run("load", "/testRoot", "--progress")); + assertEquals(0, mFsShell.run("load", testRoot.getAbsolutePath(), "--submit", "--verify")); + assertEquals(0, mFsShell.run("load", testRoot.getAbsolutePath(), "--progress")); FileSystemUtils.waitForAlluxioPercentage(mFileSystem, uriA, 100); FileSystemUtils.waitForAlluxioPercentage(mFileSystem, uriB, 100); @@ -69,18 +68,18 @@ public void testCommand() throws Exception { fileInStream.positionedRead(0, buffer, 0, Constants.MB); assertTrue(BufferUtils.equalIncreasingByteArray(Constants.MB, buffer)); while (!mOutput.toString().contains("SUCCEEDED")) { - assertEquals(0, mFsShell.run("load", "/testRoot", "--progress")); + assertEquals(0, mFsShell.run("load", testRoot.getAbsolutePath(), "--progress")); Thread.sleep(1000); } assertTrue(mOutput.toString().contains("Inodes Processed: 4")); assertTrue(mOutput.toString().contains("Bytes Loaded: 3072.00KB out of 3072.00KB")); assertTrue(mOutput.toString().contains("Files Failed: 0")); - assertEquals(0, mFsShell.run("load", "/testRoot", "--stop")); + assertEquals(0, mFsShell.run("load", testRoot.getAbsolutePath(), "--stop")); assertEquals(-2, mFsShell.run("load", "/testRootNotExists", "--progress")); assertTrue(mOutput.toString().contains("cannot be found.")); - mFsShell.run("load", "/testRoot", "--progress", "--format", "JSON"); + mFsShell.run("load", testRoot.getAbsolutePath(), "--progress", "--format", "JSON"); assertTrue(mOutput.toString().contains("\"mJobState\":\"SUCCEEDED\"")); - mFsShell.run("load", "/testRoot", "--progress", "--format", "JSON", "--verbose"); + mFsShell.run("load", testRoot.getAbsolutePath(), "--progress", "--format", "JSON", "--verbose"); assertTrue(mOutput.toString().contains("\"mVerbose\":true")); } }