Skip to content

Commit 6902cb2

Browse files
committed
HBASE-26826 Backport StoreFileTracker (HBASE-26067, HBASE-26584, and others) to branch-2.5
Previous cherry picks: commit 6aaef89 HBASE-26064 Introduce a StoreFileTracker to abstract the store file tracking logic commit 43b40e9 HBASE-25988 Store the store file list by a file #3578) commit 6e05376 HBASE-26079 Use StoreFileTracker when splitting and merging #3617) commit 090b2fe HBASE-26224 HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin… #3656) commit 0ee1689 HBASE-26246 Persist the StoreFileTracker configurations to TableDescriptor when creating table #3666) commit 2052e80 HBASE-26248 Should find a suitable way to let users specify the store… #3665) commit 5ff0f98 HBASE-26264 Add more checks to prevent misconfiguration on store file… #3681) commit fc4f6d1 HBASE-26280 HBASE-26280 Use store file tracker when snapshoting #3685) commit 06db852 HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker… #3721) commit e4e7cf8 HBASE-26386 Refactor StoreFileTracker implementations to expose the s… #3774) commit 08d1171 HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT impl #3749) commit 8bec26e HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur… #3700) commit a288365 HBASE-26271: Cleanup the broken store files under data directory #3786) commit d00b5fa HBASE-26454 CreateTableProcedure still relies on temp dir and renames… #3845) commit 771e552 HBASE-26286: Add support for specifying store file tracker when restoring or cloning snapshot commit f16b7b1 HBASE-26265 Update ref guide to mention the new store file tracker im… #3942) commit 755b3b4 HBASE-26585 Add SFT configuration to META table descriptor when creating META #3998) commit 39c42c7 HBASE-26639 The implementation of TestMergesSplitsAddToTracker is pro… #4010) commit 6e1f5b7 HBASE-26586 Should not rely on the global config when setting SFT implementation for a table while upgrading #4006) commit f1dd865 HBASE-26654 ModifyTableDescriptorProcedure shoud load TableDescriptor… #4034) commit 8fbc9a2 HBASE-26674 Should modify filesCompacting under storeWriteLock #4040) commit 5aa0fd2 HBASE-26675 Data race on Compactor.writer #4035) commit 3021c58 HBASE-26700 The way we bypass broken track file is not enough in Stor… #4055) commit a8b68c9 HBASE-26690 Modify FSTableDescriptors to not rely on renaming when wr… #4054) commit dffeb8e HBASE-26587 Introduce a new Admin API to change SFT implementation (#… #4080) commit b265fe5 HBASE-26673 Implement a shell command for change SFT implementation #4113) commit 4cdb380 HBASE-26640 Reimplement master local region initialization to better … #4111) commit 77bb153 HBASE-26707: Reduce number of renames during bulkload (#4066) #4122) commit a4b192e HBASE-26611 Changing SFT implementation on disabled table is dangerous #4082) commit d3629bb HBASE-26837 Set SFT config when creating TableDescriptor in TestClone… #4226) commit 541d748 HBASE-26881 Backport HBASE-25368 to branch-2 (#4267) Fixups for precommit error prone, checkstyle, and javadoc warnings after applying cherry picks. Signed-off-by: Josh Elser <[email protected]> Reviewed-by: Wellington Ramos Chevreuil <[email protected]>
1 parent 2bbddfe commit 6902cb2

File tree

15 files changed

+34
-33
lines changed

15 files changed

+34
-33
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,10 +2868,10 @@ private Future<Void> internalRestoreSnapshotAsync(final String snapshotName,
28682868
@Override
28692869
protected RestoreSnapshotResponse rpcCall() throws Exception {
28702870
final RestoreSnapshotRequest.Builder builder = RestoreSnapshotRequest.newBuilder()
2871-
.setSnapshot(snapshot)
2872-
.setNonceGroup(nonceGroup)
2873-
.setNonce(nonce)
2874-
.setRestoreACL(restoreAcl);
2871+
.setSnapshot(snapshot)
2872+
.setNonceGroup(nonceGroup)
2873+
.setNonce(nonce)
2874+
.setRestoreACL(restoreAcl);
28752875
if (customSFT != null) {
28762876
builder.setCustomSFT(customSFT);
28772877
}

hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,8 @@ public ModifyableTableDescriptor removeValue(Bytes key) {
818818
/**
819819
* Remove metadata represented by the key from the {@link #values} map
820820
*
821-
* @param key Key whose key and value we're to remove from TableDescriptor
822-
* parameters.
823-
* @return the modifyable TD
821+
* @param key Key whose key and value we're to remove from TableDescriptor parameters
822+
* @return the modifiable TD
824823
*/
825824
public ModifyableTableDescriptor removeValue(final byte[] key) {
826825
return removeValue(new Bytes(key));

hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestFileBasedSFTBulkLoad.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
@Category(IntegrationTests.class)
6767
public class IntegrationTestFileBasedSFTBulkLoad extends IntegrationTestBulkLoad {
6868

69-
private static final Logger LOG = LoggerFactory.getLogger(IntegrationTestFileBasedSFTBulkLoad.class);
69+
private static final Logger LOG =
70+
LoggerFactory.getLogger(IntegrationTestFileBasedSFTBulkLoad.class);
7071

7172
private static String NUM_MAPS_KEY = "hbase.IntegrationTestBulkLoad.numMaps";
7273
private static String NUM_IMPORT_ROUNDS_KEY = "hbase.IntegrationTestBulkLoad.numImportRounds";

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ public long timeOfOldestEdit() {
232232
}
233233

234234
/**
235-
* This method is protected under {@link HStore#lock} write lock,<br/>
236-
* and this method is used by {@link HStore#updateStorefiles} after flushing is completed.<br/>
235+
* This method is protected under HStore write lock.<br/>
237236
* The passed snapshot was successfully persisted; it can be let go.
238237
* @param id Id of the snapshot to clean out.
239238
* @see MemStore#snapshot()

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public String getFamilyName() {
395395
}
396396

397397
/**
398-
* This method is protected under {@link HStore#lock} read lock.
398+
* This method is protected under HStore read lock.
399399
*/
400400
@Override
401401
public List<KeyValueScanner> getScanners(long readPt) throws IOException {

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,8 @@ private void initializeThreads() {
22622262
double brokenStoreFileCleanerDelayJitter = conf.getDouble(
22632263
BrokenStoreFileCleaner.BROKEN_STOREFILE_CLEANER_DELAY_JITTER,
22642264
BrokenStoreFileCleaner.DEFAULT_BROKEN_STOREFILE_CLEANER_DELAY_JITTER);
2265-
double jitterRate = (ThreadLocalRandom.current().nextDouble() - 0.5D) * brokenStoreFileCleanerDelayJitter;
2265+
double jitterRate = (ThreadLocalRandom.current().nextDouble() - 0.5D) *
2266+
brokenStoreFileCleanerDelayJitter;
22662267
long jitterValue = Math.round(brokenStoreFileCleanerDelay * jitterRate);
22672268
this.brokenStoreFileCleaner =
22682269
new BrokenStoreFileCleaner((int) (brokenStoreFileCleanerDelay + jitterValue),

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SecureBulkLoadManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public SecureBulkLoadListener(FileSystem fs, String stagingDir, Configuration co
364364

365365
@Override
366366
public String prepareBulkLoad(final byte[] family, final String srcPath, boolean copyFile,
367-
String customStaging ) throws IOException {
367+
String customStaging) throws IOException {
368368
Path p = new Path(srcPath);
369369

370370
//store customStaging for failedBulkLoad

hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
package org.apache.hadoop.hbase.snapshot;
2020

21-
import static org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerFactory.TRACKER_IMPL;
22-
2321
import java.io.IOException;
2422
import java.io.InputStream;
2523
import java.io.OutputStream;

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkloadBase.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
import org.junit.Rule;
6060
import org.junit.rules.TemporaryFolder;
6161
import org.junit.rules.TestName;
62-
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
63-
import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos;
6462
import org.junit.runner.RunWith;
6563
import org.junit.runners.Parameterized;
64+
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
65+
import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos;
6666

6767
@RunWith(Parameterized.class)
6868
public class TestBulkloadBase {
@@ -135,7 +135,8 @@ protected HRegion testRegionWithFamiliesAndSpecifiedTableName(TableName tableNam
135135
}
136136

137137
protected HRegion testRegionWithFamilies(byte[]... families) throws IOException {
138-
TableName tableName = TableName.valueOf(name.getMethodName().substring(0, name.getMethodName().indexOf("[")));
138+
TableName tableName =
139+
TableName.valueOf(name.getMethodName().substring(0, name.getMethodName().indexOf("[")));
139140
return testRegionWithFamiliesAndSpecifiedTableName(tableName, families);
140141
}
141142

@@ -175,7 +176,9 @@ private String createHFileForFamilies(byte[] family) throws IOException {
175176

176177
private static String generateUniqueName(final String suffix) {
177178
String name = UUID.randomUUID().toString().replaceAll("-", "");
178-
if (suffix != null) name += suffix;
179+
if (suffix != null) {
180+
name += suffix;
181+
}
179182
return name;
180183
}
181184

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMergesSplitsAddToTracker.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ private void validateDaughterRegionsFiles(HRegion region, String orignalFileName
234234
List<StoreFileInfo> infos = region.getRegionFileSystem().getStoreFiles("info");
235235
final MutableBoolean foundLink = new MutableBoolean(false);
236236
infos.stream().forEach(i -> {
237-
i.getActiveFileName().contains(orignalFileName);
238237
if(i.getActiveFileName().contains(untrackedFile)){
239238
fail();
240239
}

0 commit comments

Comments
 (0)