clarax commented on a change in pull request #2682:
URL: https://github.com/apache/hbase/pull/2682#discussion_r527885165
##########
File path:
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
##########
@@ -1999,6 +2032,47 @@ protected void testTakedown() throws IOException {
}
}
+ /*
+ Send random reads against fake regions inserted by MetaWriteTest
+ */
+ static class MetaRandomReadTest extends MetaTest {
+ private Random rd = new Random();
+ private RegionLocator regionLocator;
+
+ MetaRandomReadTest(Connection con, TestOptions options, Status status) {
+ super(con, options, status);
+ LOG.info("call getRegionLocation");
+ }
+
+ @Override
+ void onStartup() throws IOException {
+ super.onStartup();
+ this.regionLocator = connection.getRegionLocator(table.getName());
+ }
+
+ @Override
+ boolean testRow(final int i, final long startTime) throws IOException,
InterruptedException {
+ if (opts.randomSleep > 0) {
+ Thread.sleep(rd.nextInt(opts.randomSleep));
+ }
+ HRegionLocation hRegionLocation = regionLocator.getRegionLocation(
+ getSplitKey(rd.nextInt(opts.perClientRunRows)), true);
+ LOG.debug("get location for region: " + hRegionLocation);
+ return true;
+ }
+
+ @Override
+ protected int getReportingPeriod() {
+ int period = opts.perClientRunRows / 10;
Review comment:
I didn't implement the others but my understanding is it depends on the
balance of getting more frequent reports and the overhead of IO. I chose 10
because random read test uses 10. And it works fine in my test. We might want
to make it configurable in the future if we run into issues with too many IO.
----------------------------------------------------------------
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:
[email protected]