|
22 | 22 | import java.util.Map;
|
23 | 23 | import org.apache.hadoop.conf.Configuration;
|
24 | 24 | import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
|
| 25 | +import org.apache.hadoop.hbase.client.RegionInfo; |
25 | 26 | import org.apache.hadoop.hbase.client.TableDescriptor;
|
26 | 27 | import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
| 28 | +import org.apache.hadoop.hbase.mob.MobUtils; |
27 | 29 | import org.apache.hadoop.hbase.procedure2.util.StringUtils;
|
28 | 30 | import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
|
29 | 31 | import org.apache.hadoop.hbase.regionserver.StoreContext;
|
@@ -118,7 +120,23 @@ public static Class<? extends StoreFileTracker> getTrackerClass(String trackerNa
|
118 | 120 |
|
119 | 121 | public static StoreFileTracker create(Configuration conf, boolean isPrimaryReplica,
|
120 | 122 | StoreContext ctx) {
|
| 123 | + RegionInfo mobRegion = MobUtils.getMobRegionInfo(ctx.getTableName()); |
| 124 | + Class<? extends StoreFileTracker> tracker; |
| 125 | + if (ctx.getRegionInfo().getEncodedName().equals(mobRegion.getEncodedName())) { |
| 126 | + tracker = Trackers.DEFAULT.clazz; |
| 127 | + } else { |
| 128 | + tracker = getTrackerClass(conf); |
| 129 | + } |
| 130 | + return createSFTInstance(conf, isPrimaryReplica, ctx, tracker); |
| 131 | + } |
| 132 | + |
| 133 | + private static StoreFileTracker create(Configuration conf, boolean isPrimaryReplica) { |
121 | 134 | Class<? extends StoreFileTracker> tracker = getTrackerClass(conf);
|
| 135 | + return createSFTInstance(conf, isPrimaryReplica, null, tracker); |
| 136 | + } |
| 137 | + |
| 138 | + private static StoreFileTracker createSFTInstance(Configuration conf, boolean isPrimaryReplica, |
| 139 | + StoreContext ctx, Class<? extends StoreFileTracker> tracker) { |
122 | 140 | LOG.debug("instantiating StoreFileTracker impl {}", tracker.getName());
|
123 | 141 | return ReflectionUtils.newInstance(tracker, conf, isPrimaryReplica, ctx);
|
124 | 142 | }
|
@@ -186,7 +204,7 @@ public static TableDescriptor updateWithTrackerConfigs(Configuration conf,
|
186 | 204 | // descriptors with the SFT impl specific configs. By the time this happens, the table has no
|
187 | 205 | // regions nor stores yet, so it can't create a proper StoreContext.
|
188 | 206 | if (StringUtils.isEmpty(descriptor.getValue(TRACKER_IMPL))) {
|
189 |
| - StoreFileTracker tracker = StoreFileTrackerFactory.create(conf, true, null); |
| 207 | + StoreFileTracker tracker = create(conf, true); |
190 | 208 | TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(descriptor);
|
191 | 209 | return tracker.updateWithTrackerConfigs(builder).build();
|
192 | 210 | }
|
|
0 commit comments