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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/root/RootTable.java
##########
@@ -0,0 +1,148 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master.root;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.Server;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Delete;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
+import org.apache.hadoop.hbase.master.cleaner.DirScanPool;
+import org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil;
+import org.apache.hadoop.hbase.region.LocalRegion;
+import org.apache.hadoop.hbase.region.LocalRegionParams;
+import org.apache.hadoop.hbase.regionserver.BloomType;
+import org.apache.hadoop.hbase.regionserver.RegionScanner;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Used to store the location of meta region.
+ */
+@InterfaceAudience.Private
+public class RootTable {
+
+  private static final Logger LOG = LoggerFactory.getLogger(RootTable.class);
+
+  static final String MAX_WALS_KEY = "hbase.root.table.region.maxwals";
+
+  private static final int DEFAULT_MAX_WALS = 10;
+
+  static final String USE_HSYNC_KEY = "hbase.root.table.region.wal.hsync";
+
+  static final String RING_BUFFER_SLOT_COUNT = 
"hbase.root.table.region.maxwals";
+
+  private static final int DEFAULT_RING_BUFFER_SLOT_COUNT = 64;
+
+  static final String ROOT_TABLE_DIR = "RootTable";
+
+  static final String HFILECLEANER_PLUGINS = 
"hbase.root.table.region.hfilecleaner.plugins";
+
+  static final String FLUSH_SIZE_KEY = "hbase.root.table.region.flush.size";
+
+  static final long DEFAULT_FLUSH_SIZE = 
TableDescriptorBuilder.DEFAULT_MEMSTORE_FLUSH_SIZE;
+
+  static final String FLUSH_PER_CHANGES_KEY = 
"hbase.root.table.region.flush.per.changes";
+
+  private static final long DEFAULT_FLUSH_PER_CHANGES = 1_000_000;
+
+  static final String FLUSH_INTERVAL_MS_KEY = 
"hbase.root.table.region.flush.interval.ms";
+
+  // default to flush every 15 minutes, for safety
+  private static final long DEFAULT_FLUSH_INTERVAL_MS = 
TimeUnit.MINUTES.toMillis(15);
+
+  static final String COMPACT_MIN_KEY = "hbase.root.table.region.compact.min";
+
+  private static final int DEFAULT_COMPACT_MIN = 4;
+
+  static final String ROLL_PERIOD_MS_KEY = 
"hbase.root.table.region.walroll.period.ms";
+
+  private static final long DEFAULT_ROLL_PERIOD_MS = 
TimeUnit.MINUTES.toMillis(15);
+
+  static final TableName TABLE_NAME = TableName.valueOf("master:root");
+
+  private static final TableDescriptor TABLE_DESC = 
TableDescriptorBuilder.newBuilder(TABLE_NAME)
+    
.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(HConstants.CATALOG_FAMILY)
+      .setMaxVersions(HConstants.DEFAULT_HBASE_META_VERSIONS).setInMemory(true)
+      
.setBlocksize(HConstants.DEFAULT_HBASE_META_BLOCK_SIZE).setBloomFilterType(BloomType.ROWCOL)
+      .setDataBlockEncoding(DataBlockEncoding.ROW_INDEX_V1).build())
+    .build();
+
+  private final Server server;
+
+  private final DirScanPool cleanerPool;
+
+  private LocalRegion region;
+
+  public RootTable(Server server, DirScanPool cleanerPool) {
+    this.server = server;
+    this.cleanerPool = cleanerPool;
+  }
+
+  public void initialize() throws IOException {
+    LOG.info("Initializing root table...");
+    LocalRegionParams params = new 
LocalRegionParams().server(server).regionDirName(ROOT_TABLE_DIR)

Review comment:
       Yeah, would be good if a general location for master local store.




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