saintstack commented on a change in pull request #1115: HBASE-23782 We still 
reference the hard coded meta descriptor in some…
URL: https://github.com/apache/hbase/pull/1115#discussion_r374233401
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseMetaEdit.java
 ##########
 @@ -63,6 +63,23 @@ public void after() throws Exception {
     UTIL.shutdownMiniCluster();
   }
 
+  // make sure that with every possible way, we get the same meta table 
descriptor.
+  private TableDescriptor getMetaDescriptor() throws TableNotFoundException, 
IOException {
+    Admin admin = UTIL.getAdmin();
+    TableDescriptor get = admin.getDescriptor(TableName.META_TABLE_NAME);
+    TableDescriptor list =
+      admin.listTableDescriptors(true).stream().filter(td -> 
td.isMetaTable()).findAny().get();
+    TableDescriptor listByName =
+      
admin.listTableDescriptors(Collections.singletonList(TableName.META_TABLE_NAME)).get(0);
+    TableDescriptor listByNs =
+      
admin.listTableDescriptorsByNamespace(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME).stream()
+        .filter(td -> td.isMetaTable()).findAny().get();
+    assertEquals(get, list);
+    assertEquals(get, listByName);
+    assertEquals(get, listByNs);
+    return get;
+  }
+
 
 Review comment:
   Nice test

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


With regards,
Apache Git Services

Reply via email to