bharathv 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_r374407677
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
 ##########
 @@ -135,33 +130,30 @@ public FSTableDescriptors(final Configuration conf, 
final FileSystem fs,
    *                     see HMaster#finishActiveMasterInitialization
    *                     TODO: This is a workaround. Should remove this ugly 
code...
    */
-  public FSTableDescriptors(final Configuration conf, final FileSystem fs,
-       final Path rootdir, final boolean fsreadonly, final boolean usecache,
-       Function<TableDescriptorBuilder, TableDescriptorBuilder> metaObserver) 
throws IOException {
+  public FSTableDescriptors(final Configuration conf, final FileSystem fs, 
final Path rootdir,
+    final boolean fsreadonly, final boolean usecache,
+    Function<TableDescriptorBuilder, TableDescriptorBuilder> metaObserver) 
throws IOException {
     this.fs = fs;
     this.rootdir = rootdir;
     this.fsreadonly = fsreadonly;
     this.usecache = usecache;
-    TableDescriptor td = null;
-    try {
-      td = getTableDescriptorFromFs(fs, rootdir, TableName.META_TABLE_NAME);
-    } catch (TableInfoMissingException e) {
-      td = metaObserver == null? createMetaTableDescriptor(conf):
-        metaObserver.apply(createMetaTableDescriptorBuilder(conf)).build();
-      if (!fsreadonly) {
+    if (!fsreadonly) {
+      // see if we already have meta descriptor on fs. Write one if not.
+      try {
+        getTableDescriptorFromFs(fs, rootdir, TableName.META_TABLE_NAME);
+      } catch (TableInfoMissingException e) {
+        TableDescriptorBuilder builder = 
createMetaTableDescriptorBuilder(conf);
+        if (metaObserver != null) {
+          metaObserver.apply(builder);
 
 Review comment:
   Just FYI, this change broke the error prone build.
   
https://builds.apache.org/job/HBase%20Nightly/job/master/1618/artifact/output-general/patch-compile-root.txt
   [ERROR] 
/home/jenkins/jenkins-slave/workspace/HBase_Nightly_master@2/component/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java:[147,28]
 error: [ReturnValueIgnored] Return value of this method must be used
       (see https://errorprone.info/bugpattern/ReturnValueIgnored)
     Did you mean to remove this line?
   [INFO] 1 error
   
   You can reproduce with "mvn clean compile -DskipTests -PerrorProne"

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