huaxiangsun commented on a change in pull request #2644:
URL: https://github.com/apache/hbase/pull/2644#discussion_r521606998
##########
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:
Just found out that there is no info family. Can we populate this info
to meta table as well? Sample code as below, we can populate the same server
info here.
`ServerName sn = ServerName.valueOf("bar", 0, 0);
try (Table meta = MetaTableAccessor.getMetaHTable(UTIL.getConnection()))
{
List<RegionInfo> regionInfos = Lists.newArrayList(regionInfoA,
regionInfoB);
MetaTableAccessor.addRegionsToMeta(UTIL.getConnection(), regionInfos,
1);
// write the serverName column with a big current time, but set the
masters time as even
// bigger. When region merge deletes the rows for regionA and regionB,
the serverName columns
// should not be seen by the following get
long serverNameTime = EnvironmentEdgeManager.currentTime() + 100000000;
long masterSystemTime = EnvironmentEdgeManager.currentTime() +
123456789;
// write the serverName columns
MetaTableAccessor.updateRegionLocation(UTIL.getConnection(),
regionInfoA, sn, 1,
serverNameTime);`
----------------------------------------------------------------
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]