From 97f325aba7477f9aa6469ad1857e16be6373b713 Mon Sep 17 00:00:00 2001 From: maobaolong Date: Fri, 19 Jan 2024 10:51:19 +0800 Subject: [PATCH] Fix negative size if specified filesize over Integer.MAX_VALUE for stressWorkerBench ### What changes are proposed in this pull request? Change to use long type store file size. ### Why are the changes needed? Without this PR, we cannot specified a filesize lagger than Integer.MAX_VALUE. ### Does this PR introduce any user facing changes? No pr-link: Alluxio/alluxio#18492 change-id: cid-2b816d1f2cbc9ebcf888b06802eb682fb76d55c2 --- .../java/alluxio/stress/cli/worker/StressWorkerBench.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dora/stress/shell/src/main/java/alluxio/stress/cli/worker/StressWorkerBench.java b/dora/stress/shell/src/main/java/alluxio/stress/cli/worker/StressWorkerBench.java index cc775ac6ef19..c0e225ff8c72 100644 --- a/dora/stress/shell/src/main/java/alluxio/stress/cli/worker/StressWorkerBench.java +++ b/dora/stress/shell/src/main/java/alluxio/stress/cli/worker/StressWorkerBench.java @@ -155,7 +155,7 @@ public void prepare() throws Exception { // initialize the base, for only the non-distributed task (the cluster launching task) Path basePath = new Path(mParameters.mBasePath); - int fileSize = (int) FormatUtils.parseSpaceSize(mParameters.mFileSize); + long fileSize = FormatUtils.parseSpaceSize(mParameters.mFileSize); int numFiles = getTotalFileNumber(); // Generate the file paths using the same heuristics so all nodes have the same set of paths @@ -266,7 +266,7 @@ public void generateTestFilePaths(Path basePath) throws IOException { LOG.info("{} file paths generated", mFilePaths.length); } - private void prepareTestFiles(Path basePath, int fileSize, FileSystem prepareFs) + private void prepareTestFiles(Path basePath, long fileSize, FileSystem prepareFs) throws IOException { int numFiles = mFilePaths.length; LOG.info("Preparing {} test files under {}", numFiles, basePath);