huaxiangsun commented on a change in pull request #2644:
URL: https://github.com/apache/hbase/pull/2644#discussion_r521596248



##########
File path: 
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
##########
@@ -2276,7 +2319,38 @@ boolean testRow(final int i, final long startTime) 
throws IOException {
       return true;
     }
   }
+  static class MetaWriteTest extends Test {
+
+    MetaWriteTest(Connection con, TestOptions options, Status status) {
+      super(con, options, status);
+    }
+
+    @Override
+    void onStartup() throws IOException {
+    }
 
+    @Override
+    void onTakedown() throws IOException {
+    }
+    @Override
+    boolean testRow(final int i, final long startTime) throws IOException {
+      List<RegionInfo> regionInfos = new ArrayList<RegionInfo>();
+
+      for (int index = 0; index < i; index++) {
+        
regionInfos.add(RegionInfoBuilder.newBuilder(TableName.valueOf("hbase:meta"))
+          .setRegionId(this.rand.nextLong())

Review comment:
       We do not need to set region id, builder will fill it internally, same 
for offline(), repilcaId, split bit.
   We do need to set the startKey and endKey correctly to make sure that there 
is no overlay for regions. I think it is only one region if startKey and endKey 
are same.
   
   We need to use the following as an example, it will insert about 11m entries 
to metatable, which has the continuous key space.
     byte[5] startKey, endKey;
       for (byte b1 = 'a'; b1 <= 'z'; b1++) {
         startKey[0] = b1;
         endKey[0] = b1;
         for (byte b2 = 'a'; b2 <= 'z'; b2++) {
           startKey[1] = b2;
           endKey[1] = b2;
           for (byte b3 = 'a'; b3 <= 'z'; b3++) {
             startKey[2] = b3;
             endKey[2] = b3;
             for (byte b4 = 'a'; b4 <= 'z'; b4++) {
               startKey[3] = b4;
               endKey[3] = b4;
               for (byte b5 = 'a'; b5 <= 'z'; b5++) {
                 endKey[4] = b5;
                 if (b5 == 'a') {
                   startKey[4] = '';
                 }
                 // TODO: add to Meta 
                 startKey[4] = endKey[4];
               }
           }
         }
       }
   
   




----------------------------------------------------------------
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]


Reply via email to