saintstack commented on a change in pull request #1955:
URL: https://github.com/apache/hbase/pull/1955#discussion_r444297274



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/BoundedRecoveredHFilesOutputSink.java
##########
@@ -191,50 +186,22 @@ public boolean keepRegionEvent(Entry entry) {
     return false;
   }
 
+  /**
+   * @return Returns a base HFile without compressions or encodings; good 
enough for recovery
+   *   given hfile has metadata on how it was written.
+   */
   private StoreFileWriter createRecoveredHFileWriter(TableName tableName, 
String regionName,
       long seqId, String familyName, boolean isMetaTable) throws IOException {
     Path outputDir = 
WALSplitUtil.tryCreateRecoveredHFilesDir(walSplitter.rootFS, walSplitter.conf,
       tableName, regionName, familyName);
     StoreFileWriter.Builder writerBuilder =
         new StoreFileWriter.Builder(walSplitter.conf, CacheConfig.DISABLED, 
walSplitter.rootFS)
             .withOutputDir(outputDir);
-
-    TableDescriptor tableDesc =
-        tableDescCache.computeIfAbsent(tableName, t -> getTableDescriptor(t));
-    if (tableDesc == null) {
-      throw new IOException("Failed to get table descriptor for table " + 
tableName);
-    }
-    ColumnFamilyDescriptor cfd = 
tableDesc.getColumnFamily(Bytes.toBytesBinary(familyName));
-    HFileContext hFileContext = createFileContext(cfd, isMetaTable);
-    return 
writerBuilder.withFileContext(hFileContext).withBloomType(cfd.getBloomFilterType())
-        .build();
-  }
-
-  private HFileContext createFileContext(ColumnFamilyDescriptor cfd, boolean 
isMetaTable)
-      throws IOException {
-    return new HFileContextBuilder().withCompression(cfd.getCompressionType())
-        .withChecksumType(HStore.getChecksumType(walSplitter.conf))
-        .withBytesPerCheckSum(HStore.getBytesPerChecksum(walSplitter.conf))
-        
.withBlockSize(cfd.getBlocksize()).withCompressTags(cfd.isCompressTags())
-        .withDataBlockEncoding(cfd.getDataBlockEncoding()).withCellComparator(
-          isMetaTable ? CellComparatorImpl.META_COMPARATOR : 
CellComparatorImpl.COMPARATOR)
-        .build();
-  }
-
-  private TableDescriptor getTableDescriptor(TableName tableName) {
-    if (walSplitter.rsServices != null) {
-      try {
-        return 
walSplitter.rsServices.getConnection().getAdmin().getDescriptor(tableName);
-      } catch (IOException e) {
-        LOG.warn("Failed to get table descriptor for {}", tableName, e);
-      }
-    }
-    LOG.info("Failed getting {} table descriptor from master; trying local", 
tableName);
-    try {
-      return walSplitter.tableDescriptors.get(tableName);

Review comment:
       Good question.
   
   Looking at it, it usually gets them from the hosting Server, not by RPC to 
Master so there it should not suffer the issue we see here.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to