You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/03/17 05:41:45 UTC
[GitHub] [incubator-pinot] snleee opened a new pull request #5160: Add a
simple PinotFS benchmark driver
snleee opened a new pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160
This benchmark tests the performance of pinotFS operations.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r393817397
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
Review comment:
Good to include the names of the directories that have been cleaned up
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-io commented on issue #5160: Add a simple
PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#issuecomment-599897785
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=h1) Report
> Merging [#5160](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/c81a656aea57ff5ba1abd856ca0f0026d8b5e0ee&el=desc) will **decrease** coverage by `9.40%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5160 +/- ##
============================================
- Coverage 66.02% 56.61% -9.41%
Complexity 12 12
============================================
Files 1050 1050
Lines 54117 54117
Branches 8071 8071
============================================
- Hits 35729 30638 -5091
- Misses 15734 21045 +5311
+ Partials 2654 2434 -220
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...he/pinot/core/query/reduce/ComparisonFunction.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvQ29tcGFyaXNvbkZ1bmN0aW9uLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...pinot/minion/exception/TaskCancelledException.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXhjZXB0aW9uL1Rhc2tDYW5jZWxsZWRFeGNlcHRpb24uamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...ot/minion/events/EventObserverFactoryRegistry.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXZlbnRzL0V2ZW50T2JzZXJ2ZXJGYWN0b3J5UmVnaXN0cnkuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...t/minion/executor/TaskExecutorFactoryRegistry.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXhlY3V0b3IvVGFza0V4ZWN1dG9yRmFjdG9yeVJlZ2lzdHJ5LmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...minion/executor/ConvertToRawIndexTaskExecutor.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXhlY3V0b3IvQ29udmVydFRvUmF3SW5kZXhUYXNrRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...nion/events/DefaultMinionEventObserverFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXZlbnRzL0RlZmF1bHRNaW5pb25FdmVudE9ic2VydmVyRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...startree/executor/StarTreeAggregationExecutor.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9zdGFydHJlZS9leGVjdXRvci9TdGFyVHJlZUFnZ3JlZ2F0aW9uRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| ... and [317 more](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=footer). Last update [c81a656...2262a00](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r394776920
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
Review comment:
added the directory names to the log.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on issue #5160: Add a simple
PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee commented on issue #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#issuecomment-599888304
```
2020/03/16 22:38:35.399 INFO [PinotFSBenchmarkDriver] [main] PinotFS has been initialized sucessfully. (mode = ALL, pinotFSClass = LocalPinotFS, configFile = /Users/snlee/workspace/pinot/pinot-tools/target/pinot-tools-pkg/config/sample2.conf, baseDirectoryUri = file:///Users/snlee/benchmark/base, localTempDir = /Users/snlee/benchmark/temp, numSegmentsForListFilesTest = 10, dataSizeInMBsForCopyTest = 100)
2020/03/16 22:38:35.409 INFO [PinotFSBenchmarkDriver] [main] ========= List Files in Multiple Directories ==========
2020/03/16 22:38:35.409 INFO [PinotFSBenchmarkDriver] [main] Created file:/Users/snlee/benchmark/base/listTestMultipleFile for list test...
2020/03/16 22:38:35.418 INFO [PinotFSBenchmarkDriver] [main] Took 9 ms to create 1 segments for directory_0
2020/03/16 22:38:35.438 INFO [PinotFSBenchmarkDriver] [main] Took 29 ms to create 10 segments for directory_1
2020/03/16 22:38:35.540 INFO [PinotFSBenchmarkDriver] [main] Took 131 ms to create 100 segments for directory_2
2020/03/16 22:38:36.552 INFO [PinotFSBenchmarkDriver] [main] Took 1143 ms to create 1000 segments for directory_3
2020/03/16 22:38:41.756 INFO [PinotFSBenchmarkDriver] [main] Took 6347 ms to create 10000 segments for directory_4
2020/03/16 22:38:41.822 INFO [PinotFSBenchmarkDriver] [main] 0: took 66 ms to listFiles. directory_0 (1 segments)
2020/03/16 22:38:41.822 INFO [PinotFSBenchmarkDriver] [main] 1: took 0 ms to listFiles. directory_0 (1 segments)
2020/03/16 22:38:41.823 INFO [PinotFSBenchmarkDriver] [main] 2: took 0 ms to listFiles. directory_0 (1 segments)
2020/03/16 22:38:41.823 INFO [PinotFSBenchmarkDriver] [main] 3: took 0 ms to listFiles. directory_0 (1 segments)
2020/03/16 22:38:41.823 INFO [PinotFSBenchmarkDriver] [main] 4: took 0 ms to listFiles. directory_0 (1 segments)
2020/03/16 22:38:41.823 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:41.824 INFO [PinotFSBenchmarkDriver] [main] 0: took 1 ms to listFiles. directory_1 (10 segments)
2020/03/16 22:38:41.825 INFO [PinotFSBenchmarkDriver] [main] 1: took 1 ms to listFiles. directory_1 (10 segments)
2020/03/16 22:38:41.826 INFO [PinotFSBenchmarkDriver] [main] 2: took 1 ms to listFiles. directory_1 (10 segments)
2020/03/16 22:38:41.826 INFO [PinotFSBenchmarkDriver] [main] 3: took 0 ms to listFiles. directory_1 (10 segments)
2020/03/16 22:38:41.827 INFO [PinotFSBenchmarkDriver] [main] 4: took 0 ms to listFiles. directory_1 (10 segments)
2020/03/16 22:38:41.827 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:41.833 INFO [PinotFSBenchmarkDriver] [main] 0: took 6 ms to listFiles. directory_2 (100 segments)
2020/03/16 22:38:41.837 INFO [PinotFSBenchmarkDriver] [main] 1: took 4 ms to listFiles. directory_2 (100 segments)
2020/03/16 22:38:41.843 INFO [PinotFSBenchmarkDriver] [main] 2: took 6 ms to listFiles. directory_2 (100 segments)
2020/03/16 22:38:41.847 INFO [PinotFSBenchmarkDriver] [main] 3: took 4 ms to listFiles. directory_2 (100 segments)
2020/03/16 22:38:41.851 INFO [PinotFSBenchmarkDriver] [main] 4: took 4 ms to listFiles. directory_2 (100 segments)
2020/03/16 22:38:41.851 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:41.872 INFO [PinotFSBenchmarkDriver] [main] 0: took 21 ms to listFiles. directory_3 (1000 segments)
2020/03/16 22:38:41.890 INFO [PinotFSBenchmarkDriver] [main] 1: took 18 ms to listFiles. directory_3 (1000 segments)
2020/03/16 22:38:41.906 INFO [PinotFSBenchmarkDriver] [main] 2: took 16 ms to listFiles. directory_3 (1000 segments)
2020/03/16 22:38:41.925 INFO [PinotFSBenchmarkDriver] [main] 3: took 19 ms to listFiles. directory_3 (1000 segments)
2020/03/16 22:38:41.942 INFO [PinotFSBenchmarkDriver] [main] 4: took 15 ms to listFiles. directory_3 (1000 segments)
2020/03/16 22:38:41.942 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:42.089 INFO [PinotFSBenchmarkDriver] [main] 0: took 147 ms to listFiles. directory_4 (10000 segments)
2020/03/16 22:38:42.191 INFO [PinotFSBenchmarkDriver] [main] 1: took 102 ms to listFiles. directory_4 (10000 segments)
2020/03/16 22:38:42.361 INFO [PinotFSBenchmarkDriver] [main] 2: took 169 ms to listFiles. directory_4 (10000 segments)
2020/03/16 22:38:42.461 INFO [PinotFSBenchmarkDriver] [main] 3: took 99 ms to listFiles. directory_4 (10000 segments)
2020/03/16 22:38:42.566 INFO [PinotFSBenchmarkDriver] [main] 4: took 105 ms to listFiles. directory_4 (10000 segments)
2020/03/16 22:38:42.566 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:42.566 INFO [PinotFSBenchmarkDriver] [main] ========= List Files ==========
2020/03/16 22:38:42.567 INFO [PinotFSBenchmarkDriver] [main] Created file:/Users/snlee/benchmark/base/listTest for list test...
2020/03/16 22:38:42.571 INFO [PinotFSBenchmarkDriver] [main] Took 5 ms to create 10 segments.
2020/03/16 22:38:42.571 INFO [PinotFSBenchmarkDriver] [main] 0: took 0 ms to listFiles.
2020/03/16 22:38:42.572 INFO [PinotFSBenchmarkDriver] [main] 1: took 1 ms to listFiles.
2020/03/16 22:38:42.572 INFO [PinotFSBenchmarkDriver] [main] 2: took 0 ms to listFiles.
2020/03/16 22:38:42.572 INFO [PinotFSBenchmarkDriver] [main] 3: took 0 ms to listFiles.
2020/03/16 22:38:42.573 INFO [PinotFSBenchmarkDriver] [main] 4: took 1 ms to listFiles.
2020/03/16 22:38:42.573 INFO [PinotFSBenchmarkDriver] [main]
========= Uploads and Downloads ==========
2020/03/16 22:38:42.573 INFO [PinotFSBenchmarkDriver] [main] Created file:/Users/snlee/benchmark/base/copyFiles for copy test...
2020/03/16 22:38:42.713 INFO [PinotFSBenchmarkDriver] [main] 0: took 138 ms to copyFromLocal, fileSize: 100 MB.
2020/03/16 22:38:42.850 INFO [PinotFSBenchmarkDriver] [main] 1: took 137 ms to copyFromLocal, fileSize: 100 MB.
2020/03/16 22:38:42.979 INFO [PinotFSBenchmarkDriver] [main] 2: took 129 ms to copyFromLocal, fileSize: 100 MB.
2020/03/16 22:38:43.096 INFO [PinotFSBenchmarkDriver] [main] 3: took 116 ms to copyFromLocal, fileSize: 100 MB.
2020/03/16 22:38:43.206 INFO [PinotFSBenchmarkDriver] [main] 4: took 110 ms to copyFromLocal, fileSize: 100 MB.
2020/03/16 22:38:43.206 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:43.329 INFO [PinotFSBenchmarkDriver] [main] 0: took 123 ms to copyToLocal, fileSize: 100 MB.
2020/03/16 22:38:43.440 INFO [PinotFSBenchmarkDriver] [main] 1: took 110 ms to copyToLocal, fileSize: 100 MB.
2020/03/16 22:38:43.553 INFO [PinotFSBenchmarkDriver] [main] 2: took 112 ms to copyToLocal, fileSize: 100 MB.
2020/03/16 22:38:43.668 INFO [PinotFSBenchmarkDriver] [main] 3: took 115 ms to copyToLocal, fileSize: 100 MB.
2020/03/16 22:38:43.782 INFO [PinotFSBenchmarkDriver] [main] 4: took 114 ms to copyToLocal, fileSize: 100 MB.
2020/03/16 22:38:43.783 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:43.890 INFO [PinotFSBenchmarkDriver] [main] 0: took 107 ms to copy, fileSize: 100 MB.
2020/03/16 22:38:43.993 INFO [PinotFSBenchmarkDriver] [main] 1: took 102 ms to copy, fileSize: 100 MB.
2020/03/16 22:38:44.103 INFO [PinotFSBenchmarkDriver] [main] 2: took 109 ms to copy, fileSize: 100 MB.
2020/03/16 22:38:44.212 INFO [PinotFSBenchmarkDriver] [main] 3: took 108 ms to copy, fileSize: 100 MB.
2020/03/16 22:38:44.320 INFO [PinotFSBenchmarkDriver] [main] 4: took 108 ms to copy, fileSize: 100 MB.
2020/03/16 22:38:44.321 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:44.321 INFO [PinotFSBenchmarkDriver] [main] 0: took 0 ms to rename, fileSize: 100 MB.
2020/03/16 22:38:44.321 INFO [PinotFSBenchmarkDriver] [main] 1: took 0 ms to rename, fileSize: 100 MB.
2020/03/16 22:38:44.322 INFO [PinotFSBenchmarkDriver] [main] 2: took 1 ms to rename, fileSize: 100 MB.
2020/03/16 22:38:44.322 INFO [PinotFSBenchmarkDriver] [main] 3: took 0 ms to rename, fileSize: 100 MB.
2020/03/16 22:38:44.322 INFO [PinotFSBenchmarkDriver] [main] 4: took 0 ms to rename, fileSize: 100 MB.
2020/03/16 22:38:44.322 INFO [PinotFSBenchmarkDriver] [main]
2020/03/16 22:38:44.334 INFO [PinotFSBenchmarkDriver] [main] 0: took 12 ms to delete, fileSize: 100 MB.
2020/03/16 22:38:44.345 INFO [PinotFSBenchmarkDriver] [main] 1: took 10 ms to delete, fileSize: 100 MB.
2020/03/16 22:38:44.358 INFO [PinotFSBenchmarkDriver] [main] 2: took 13 ms to delete, fileSize: 100 MB.
2020/03/16 22:38:44.370 INFO [PinotFSBenchmarkDriver] [main] 3: took 12 ms to delete, fileSize: 100 MB.
2020/03/16 22:38:44.383 INFO [PinotFSBenchmarkDriver] [main] 4: took 12 ms to delete, fileSize: 100 MB.
2020/03/16 22:38:46.620 INFO [PinotFSBenchmarkDriver] [main] Working directories have been cleaned up successfully.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee merged pull request #5160: Add a simple
PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee merged pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r393824601
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
Review comment:
This does not seem to be retry count (I was associating the term retry with failures). DEFAULT_NUM_OPS?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r394776973
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
Review comment:
changed to static final
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r393827104
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
Review comment:
I suppose eventually we want to take these as an argument or config? Otherwise maybe a static final int
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r393822902
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
+ int numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ String directoryPath = "directory_" + i;
+ File tmpDirectory = new File(_localTempDir.getPath(), directoryPath);
+ URI directoryUri = combinePath(listTestUri, directoryPath);
+ tmpDirectory.mkdir();
+
+ for (int j = 0; j < numSegments; j++) {
+ String relativePath = "segment_" + j;
+ File tmpFile = new File(tmpDirectory, relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(directoryUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments for directory_{}",
+ System.currentTimeMillis() - prepareTime, numSegments, i);
+ numSegments *= 10;
+ }
+
+ // reset numSegments
+ numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ for (int j = 0; j < DEFAULT_RETRY; j++) {
+ URI directoryUri = combinePath(listTestUri, "directory_" + i);
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(directoryUri, true);
+ LOGGER.info("{}: took {} ms to listFiles. directory_{} ({} segments)", j,
+ System.currentTimeMillis() - listFilesStart, i, lists.length);
+ Preconditions.checkState(lists.length == numSegments);
+ }
+ numSegments *= 10;
+ LOGGER.info("");
+ }
+ }
+
+ private void testListFiles() throws Exception {
+ LOGGER.info("========= List Files ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTest");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ for (int i = 0; i < _numSegmentsForListFilesTest; i++) {
+ String relativePath = "segment_" + i;
+ File tmpFile = new File(_localTempDir.getPath(), relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(listTestUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments.",
+ System.currentTimeMillis() - prepareTime, _numSegmentsForListFilesTest);
+
+ for (int i = 0; i < DEFAULT_RETRY; i++) {
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(listTestUri, true);
+ LOGGER.info("{}: took {} ms to listFiles.", i, System.currentTimeMillis() - listFilesStart);
+ Preconditions.checkState(lists.length == _numSegmentsForListFilesTest);
+ }
+ }
+
+ private void testCopies() throws Exception {
+ LOGGER.info("\n========= Uploads and Downloads ==========");
+ URI copyTestUri = combinePath(_baseDirectoryUri, "copyFiles");
+ _pinotFS.mkdir(copyTestUri);
+ LOGGER.info("Created {} for copy test...", copyTestUri);
+
+ long fileSizeInBytes = _dataSizeInMBsForCopyTest * 1024 * 1024;
+ File largeTmpFile = createFileWithSize("largeFile", fileSizeInBytes);
+ for (int i = 0; i < DEFAULT_RETRY; i++) {
+ URI largeFileDstUri = combinePath(copyTestUri, largeTmpFile.getName() + "_" + i);
+ long copyStart = System.currentTimeMillis();
+ _pinotFS.copyFromLocalFile(largeTmpFile, largeFileDstUri);
+ LOGGER.info("{}: took {} ms to copyFromLocal, fileSize: {} MB.", i, System.currentTimeMillis() - copyStart,
+ _dataSizeInMBsForCopyTest);
+ }
+
+ LOGGER.info("");
Review comment:
why do we have these empty log messages?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r394776943
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
+ int numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ String directoryPath = "directory_" + i;
+ File tmpDirectory = new File(_localTempDir.getPath(), directoryPath);
+ URI directoryUri = combinePath(listTestUri, directoryPath);
+ tmpDirectory.mkdir();
+
+ for (int j = 0; j < numSegments; j++) {
+ String relativePath = "segment_" + j;
+ File tmpFile = new File(tmpDirectory, relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(directoryUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments for directory_{}",
+ System.currentTimeMillis() - prepareTime, numSegments, i);
+ numSegments *= 10;
+ }
+
+ // reset numSegments
+ numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ for (int j = 0; j < DEFAULT_RETRY; j++) {
+ URI directoryUri = combinePath(listTestUri, "directory_" + i);
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(directoryUri, true);
+ LOGGER.info("{}: took {} ms to listFiles. directory_{} ({} segments)", j,
+ System.currentTimeMillis() - listFilesStart, i, lists.length);
+ Preconditions.checkState(lists.length == numSegments);
+ }
+ numSegments *= 10;
+ LOGGER.info("");
+ }
+ }
+
+ private void testListFiles() throws Exception {
+ LOGGER.info("========= List Files ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTest");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ for (int i = 0; i < _numSegmentsForListFilesTest; i++) {
+ String relativePath = "segment_" + i;
+ File tmpFile = new File(_localTempDir.getPath(), relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(listTestUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments.",
+ System.currentTimeMillis() - prepareTime, _numSegmentsForListFilesTest);
+
+ for (int i = 0; i < DEFAULT_RETRY; i++) {
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(listTestUri, true);
+ LOGGER.info("{}: took {} ms to listFiles.", i, System.currentTimeMillis() - listFilesStart);
+ Preconditions.checkState(lists.length == _numSegmentsForListFilesTest);
+ }
+ }
+
+ private void testCopies() throws Exception {
+ LOGGER.info("\n========= Uploads and Downloads ==========");
+ URI copyTestUri = combinePath(_baseDirectoryUri, "copyFiles");
+ _pinotFS.mkdir(copyTestUri);
+ LOGGER.info("Created {} for copy test...", copyTestUri);
+
+ long fileSizeInBytes = _dataSizeInMBsForCopyTest * 1024 * 1024;
+ File largeTmpFile = createFileWithSize("largeFile", fileSizeInBytes);
+ for (int i = 0; i < DEFAULT_RETRY; i++) {
+ URI largeFileDstUri = combinePath(copyTestUri, largeTmpFile.getName() + "_" + i);
+ long copyStart = System.currentTimeMillis();
+ _pinotFS.copyFromLocalFile(largeTmpFile, largeFileDstUri);
+ LOGGER.info("{}: took {} ms to copyFromLocal, fileSize: {} MB.", i, System.currentTimeMillis() - copyStart,
+ _dataSizeInMBsForCopyTest);
+ }
+
+ LOGGER.info("");
Review comment:
removed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-io edited a comment on issue #5160: Add a
simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#issuecomment-599897785
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=h1) Report
> Merging [#5160](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/c81a656aea57ff5ba1abd856ca0f0026d8b5e0ee&el=desc) will **decrease** coverage by `0.07%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5160 +/- ##
============================================
- Coverage 66.02% 65.94% -0.08%
Complexity 12 12
============================================
Files 1050 1050
Lines 54117 54112 -5
Branches 8071 8067 -4
============================================
- Hits 35729 35686 -43
- Misses 15734 15782 +48
+ Partials 2654 2644 -10
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ot/core/io/reader/impl/ConstantMVForwardIndex.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9pby9yZWFkZXIvaW1wbC9Db25zdGFudE1WRm9yd2FyZEluZGV4LmphdmE=) | `28.57% <0.00%> (-28.58%)` | `0.00% <0.00%> (ø%)` | |
| [...a/manager/realtime/RealtimeSegmentDataManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvUmVhbHRpbWVTZWdtZW50RGF0YU1hbmFnZXIuamF2YQ==) | `50.00% <0.00%> (-25.00%)` | `0.00% <0.00%> (ø%)` | |
| [...elix/core/relocation/RealtimeSegmentRelocator.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlbG9jYXRpb24vUmVhbHRpbWVTZWdtZW50UmVsb2NhdG9yLmphdmE=) | `23.68% <0.00%> (-21.06%)` | `0.00% <0.00%> (ø%)` | |
| [.../impl/dictionary/LongOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvTG9uZ09mZkhlYXBNdXRhYmxlRGljdGlvbmFyeS5qYXZh) | `58.06% <0.00%> (-9.68%)` | `0.00% <0.00%> (ø%)` | |
| [...impl/dictionary/FloatOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRmxvYXRPZmZIZWFwTXV0YWJsZURpY3Rpb25hcnkuamF2YQ==) | `59.13% <0.00%> (-8.61%)` | `0.00% <0.00%> (ø%)` | |
| [...impl/dictionary/DoubleOnHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRG91YmxlT25IZWFwTXV0YWJsZURpY3Rpb25hcnkuamF2YQ==) | `45.12% <0.00%> (-7.32%)` | `0.00% <0.00%> (ø%)` | |
| [...nt/index/readers/ConstantValueBytesDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9zZWdtZW50L2luZGV4L3JlYWRlcnMvQ29uc3RhbnRWYWx1ZUJ5dGVzRGljdGlvbmFyeS5qYXZh) | `31.25% <0.00%> (-6.25%)` | `0.00% <0.00%> (ø%)` | |
| [...config/instance/InstanceAssignmentConfigUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vY29uZmlnL2luc3RhbmNlL0luc3RhbmNlQXNzaWdubWVudENvbmZpZ1V0aWxzLmphdmE=) | `67.50% <0.00%> (-5.00%)` | `0.00% <0.00%> (ø%)` | |
| [...mpl/dictionary/DoubleOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRG91YmxlT2ZmSGVhcE11dGFibGVEaWN0aW9uYXJ5LmphdmE=) | `45.16% <0.00%> (-4.31%)` | `0.00% <0.00%> (ø%)` | |
| [...troller/helix/core/retention/RetentionManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JldGVudGlvbi9SZXRlbnRpb25NYW5hZ2VyLmphdmE=) | `75.00% <0.00%> (-4.17%)` | `0.00% <0.00%> (ø%)` | |
| ... and [30 more](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=footer). Last update [c81a656...fd80bac](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r393828263
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
+ int numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ String directoryPath = "directory_" + i;
+ File tmpDirectory = new File(_localTempDir.getPath(), directoryPath);
+ URI directoryUri = combinePath(listTestUri, directoryPath);
+ tmpDirectory.mkdir();
+
+ for (int j = 0; j < numSegments; j++) {
+ String relativePath = "segment_" + j;
+ File tmpFile = new File(tmpDirectory, relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(directoryUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments for directory_{}",
+ System.currentTimeMillis() - prepareTime, numSegments, i);
+ numSegments *= 10;
+ }
+
+ // reset numSegments
+ numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ for (int j = 0; j < DEFAULT_RETRY; j++) {
+ URI directoryUri = combinePath(listTestUri, "directory_" + i);
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(directoryUri, true);
+ LOGGER.info("{}: took {} ms to listFiles. directory_{} ({} segments)", j,
+ System.currentTimeMillis() - listFilesStart, i, lists.length);
+ Preconditions.checkState(lists.length == numSegments);
+ }
+ numSegments *= 10;
+ LOGGER.info("");
+ }
+ }
+
+ private void testListFiles() throws Exception {
+ LOGGER.info("========= List Files ==========");
+ long prepareTime = System.currentTimeMillis();
Review comment:
can we call this testStartTime?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-io edited a comment on issue #5160: Add a
simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#issuecomment-599897785
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=h1) Report
> Merging [#5160](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/c81a656aea57ff5ba1abd856ca0f0026d8b5e0ee&el=desc) will **decrease** coverage by `21.09%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5160 +/- ##
=============================================
- Coverage 66.02% 44.93% -21.10%
=============================================
Files 1050 1052 +2
Lines 54117 54170 +53
Branches 8071 8078 +7
=============================================
- Hits 35729 24339 -11390
- Misses 15734 27732 +11998
+ Partials 2654 2099 -555
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ava/org/apache/pinot/spi/data/MetricFieldSpec.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZGF0YS9NZXRyaWNGaWVsZFNwZWMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../org/apache/pinot/spi/data/DimensionFieldSpec.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZGF0YS9EaW1lbnNpb25GaWVsZFNwZWMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../org/apache/pinot/spi/data/readers/FileFormat.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZGF0YS9yZWFkZXJzL0ZpbGVGb3JtYXQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...va/org/apache/pinot/common/config/FieldConfig.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vY29uZmlnL0ZpZWxkQ29uZmlnLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../org/apache/pinot/common/http/MultiGetRequest.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vaHR0cC9NdWx0aUdldFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../org/apache/pinot/common/lineage/SegmentGroup.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbGluZWFnZS9TZWdtZW50R3JvdXAuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/spi/utils/retry/BaseRetryPolicy.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvcmV0cnkvQmFzZVJldHJ5UG9saWN5LmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...apache/pinot/spi/stream/StreamConsumerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL1N0cmVhbUNvbnN1bWVyRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...apache/pinot/spi/stream/StreamMessageMetadata.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL1N0cmVhbU1lc3NhZ2VNZXRhZGF0YS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...g/apache/pinot/server/api/resources/ErrorInfo.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3Qtc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zZXJ2ZXIvYXBpL3Jlc291cmNlcy9FcnJvckluZm8uamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| ... and [574 more](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=footer). Last update [c81a656...ca924cf](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-io edited a comment on issue #5160: Add a
simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#issuecomment-599897785
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=h1) Report
> Merging [#5160](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/c81a656aea57ff5ba1abd856ca0f0026d8b5e0ee&el=desc) will **decrease** coverage by `0.07%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5160 +/- ##
============================================
- Coverage 66.02% 65.94% -0.08%
Complexity 12 12
============================================
Files 1050 1050
Lines 54117 54112 -5
Branches 8071 8067 -4
============================================
- Hits 35729 35686 -43
- Misses 15734 15782 +48
+ Partials 2654 2644 -10
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ot/core/io/reader/impl/ConstantMVForwardIndex.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9pby9yZWFkZXIvaW1wbC9Db25zdGFudE1WRm9yd2FyZEluZGV4LmphdmE=) | `28.57% <0.00%> (-28.58%)` | `0.00% <0.00%> (ø%)` | |
| [...a/manager/realtime/RealtimeSegmentDataManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvUmVhbHRpbWVTZWdtZW50RGF0YU1hbmFnZXIuamF2YQ==) | `50.00% <0.00%> (-25.00%)` | `0.00% <0.00%> (ø%)` | |
| [...elix/core/relocation/RealtimeSegmentRelocator.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlbG9jYXRpb24vUmVhbHRpbWVTZWdtZW50UmVsb2NhdG9yLmphdmE=) | `23.68% <0.00%> (-21.06%)` | `0.00% <0.00%> (ø%)` | |
| [.../impl/dictionary/LongOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvTG9uZ09mZkhlYXBNdXRhYmxlRGljdGlvbmFyeS5qYXZh) | `58.06% <0.00%> (-9.68%)` | `0.00% <0.00%> (ø%)` | |
| [...impl/dictionary/FloatOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRmxvYXRPZmZIZWFwTXV0YWJsZURpY3Rpb25hcnkuamF2YQ==) | `59.13% <0.00%> (-8.61%)` | `0.00% <0.00%> (ø%)` | |
| [...impl/dictionary/DoubleOnHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRG91YmxlT25IZWFwTXV0YWJsZURpY3Rpb25hcnkuamF2YQ==) | `45.12% <0.00%> (-7.32%)` | `0.00% <0.00%> (ø%)` | |
| [...nt/index/readers/ConstantValueBytesDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9zZWdtZW50L2luZGV4L3JlYWRlcnMvQ29uc3RhbnRWYWx1ZUJ5dGVzRGljdGlvbmFyeS5qYXZh) | `31.25% <0.00%> (-6.25%)` | `0.00% <0.00%> (ø%)` | |
| [...config/instance/InstanceAssignmentConfigUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vY29uZmlnL2luc3RhbmNlL0luc3RhbmNlQXNzaWdubWVudENvbmZpZ1V0aWxzLmphdmE=) | `67.50% <0.00%> (-5.00%)` | `0.00% <0.00%> (ø%)` | |
| [...mpl/dictionary/DoubleOffHeapMutableDictionary.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yZWFsdGltZS9pbXBsL2RpY3Rpb25hcnkvRG91YmxlT2ZmSGVhcE11dGFibGVEaWN0aW9uYXJ5LmphdmE=) | `45.16% <0.00%> (-4.31%)` | `0.00% <0.00%> (ø%)` | |
| [...troller/helix/core/retention/RetentionManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JldGVudGlvbi9SZXRlbnRpb25NYW5hZ2VyLmphdmE=) | `75.00% <0.00%> (-4.17%)` | `0.00% <0.00%> (ø%)` | |
| ... and [30 more](https://codecov.io/gh/apache/incubator-pinot/pull/5160/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=footer). Last update [c81a656...fd80bac](https://codecov.io/gh/apache/incubator-pinot/pull/5160?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request
#5160: Add a simple PinotFS benchmark driver
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #5160: Add a simple PinotFS benchmark driver
URL: https://github.com/apache/incubator-pinot/pull/5160#discussion_r394776993
##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/filesystem/PinotFSBenchmarkDriver.java
##########
@@ -0,0 +1,252 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.tools.filesystem;
+
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class PinotFSBenchmarkDriver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PinotFSBenchmarkDriver.class);
+
+ private static final int DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST = 1000;
+ private static final int DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST = 1024; // 1GB
+ private static final int DEFAULT_RETRY = 5; // 5
+
+ private String _mode;
+ private PinotFS _pinotFS;
+ private URI _baseDirectoryUri;
+ private File _localTempDir;
+ private int _numSegmentsForListFilesTest;
+ private int _dataSizeInMBsForCopyTest;
+
+ public PinotFSBenchmarkDriver(String mode, String configFilePath, String baseDirectoryUri, String localTempDir,
+ Integer numSegmentsForListFilesTest, Integer dataSizeInMBsForCopyTest) throws ConfigurationException {
+ Configuration configuration = new PropertiesConfiguration(new File(configFilePath));
+ PinotFSFactory.init(configuration);
+ _mode = mode;
+ _baseDirectoryUri = URI.create(baseDirectoryUri);
+ _pinotFS = PinotFSFactory.create(_baseDirectoryUri.getScheme());
+ _localTempDir =
+ (localTempDir != null) ? new File(localTempDir) : new File(FileUtils.getTempDirectory(), "benchmark");
+ _numSegmentsForListFilesTest =
+ (numSegmentsForListFilesTest != null) ? numSegmentsForListFilesTest : DEFAULT_NUM_SEGMENTS_FOR_LIST_TEST;
+ _dataSizeInMBsForCopyTest =
+ (dataSizeInMBsForCopyTest != null) ? dataSizeInMBsForCopyTest : DEFAULT_DATA_SIZE_IN_MB_FOR_COPY_TEST;
+ LOGGER.info("PinotFS has been initialized sucessfully. (mode = {}, pinotFSClass = {}, configFile = {}, "
+ + "baseDirectoryUri = {}, localTempDir = {}, numSegmentsForListFilesTest = {}, "
+ + "dataSizeInMBsForCopyTest = {})", _mode, _pinotFS.getClass().getSimpleName(), configFilePath,
+ baseDirectoryUri, _localTempDir, _numSegmentsForListFilesTest, _dataSizeInMBsForCopyTest);
+ }
+
+ public void run() throws Exception {
+ prepareBenchmark();
+
+ switch (_mode.toUpperCase()) {
+ case "ALL":
+ testListFilesInMultipleDirectories();
+ testListFiles();
+ testCopies();
+ break;
+ case "LISTFILES":
+ testListFiles();
+ break;
+ case "COPY":
+ testCopies();
+ break;
+ default:
+ throw new RuntimeException("Not Supported Mode: " + _mode);
+ }
+ cleanUpBenchmark();
+ }
+
+ private void prepareBenchmark() throws IOException {
+ // Clean up base directory
+ if (_pinotFS.exists(_baseDirectoryUri)) {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ }
+
+ if (_localTempDir.exists()) {
+ _localTempDir.delete();
+ }
+
+ // Set up the base directory
+ _pinotFS.mkdir(_baseDirectoryUri);
+ _localTempDir.mkdir();
+ }
+
+ private void cleanUpBenchmark() throws IOException {
+ _pinotFS.delete(_baseDirectoryUri, true);
+ FileUtils.deleteQuietly(_localTempDir);
+ LOGGER.info("Working directories have been cleaned up successfully.");
+ }
+
+ private void testListFilesInMultipleDirectories() throws Exception {
+ LOGGER.info("========= List Files in Multiple Directories ==========");
+ long prepareTime = System.currentTimeMillis();
+ URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");
+ _pinotFS.mkdir(listTestUri);
+ LOGGER.info("Created {} for list test...", listTestUri);
+
+ int numDirectories = 5;
+ int numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ String directoryPath = "directory_" + i;
+ File tmpDirectory = new File(_localTempDir.getPath(), directoryPath);
+ URI directoryUri = combinePath(listTestUri, directoryPath);
+ tmpDirectory.mkdir();
+
+ for (int j = 0; j < numSegments; j++) {
+ String relativePath = "segment_" + j;
+ File tmpFile = new File(tmpDirectory, relativePath);
+ tmpFile.createNewFile();
+ _pinotFS.copyFromLocalFile(tmpFile, combinePath(directoryUri, relativePath));
+ }
+ LOGGER.info("Took {} ms to create {} segments for directory_{}",
+ System.currentTimeMillis() - prepareTime, numSegments, i);
+ numSegments *= 10;
+ }
+
+ // reset numSegments
+ numSegments = 1;
+ for (int i = 0; i < numDirectories; i++) {
+ for (int j = 0; j < DEFAULT_RETRY; j++) {
+ URI directoryUri = combinePath(listTestUri, "directory_" + i);
+ long listFilesStart = System.currentTimeMillis();
+ String[] lists = _pinotFS.listFiles(directoryUri, true);
+ LOGGER.info("{}: took {} ms to listFiles. directory_{} ({} segments)", j,
+ System.currentTimeMillis() - listFilesStart, i, lists.length);
+ Preconditions.checkState(lists.length == numSegments);
+ }
+ numSegments *= 10;
+ LOGGER.info("");
+ }
+ }
+
+ private void testListFiles() throws Exception {
+ LOGGER.info("========= List Files ==========");
+ long prepareTime = System.currentTimeMillis();
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org