Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport StoreFileTracker (HBASE-26067, HBASE-26584, and others) to branch-2.5 #4241

Merged
merged 32 commits into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1d4b084
HBASE-26064 Introduce a StoreFileTracker to abstract the store file t…
Apache9 Jul 29, 2021
177cbf9
HBASE-25988 Store the store file list by a file (#3578)
Apache9 Aug 26, 2021
37e0b0e
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
apurtell Mar 18, 2022
727d613
HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin…
Apache9 Sep 9, 2021
1242f95
HBASE-26246 Persist the StoreFileTracker configurations to TableDescr…
wchevreuil Sep 12, 2021
7eaff3a
HBASE-26248 Should find a suitable way to let users specify the store…
Apache9 Sep 14, 2021
9d5dd03
HBASE-26264 Add more checks to prevent misconfiguration on store file…
Apache9 Sep 15, 2021
1e127f6
HBASE-26280 Use store file tracker when snapshoting (#3685)
Apache9 Sep 17, 2021
9c51b69
HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker…
wchevreuil Oct 13, 2021
9287a37
HBASE-26386 Refactor StoreFileTracker implementations to expose the s…
Apache9 Oct 21, 2021
73c0633
HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT…
wchevreuil Oct 22, 2021
d6146c2
HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur…
GeorryHuang Nov 6, 2021
43997fa
HBASE-26271 Cleanup the broken store files under data directory (#3786)
BukrosSzabolcs Nov 9, 2021
062ee1d
HBASE-26454 CreateTableProcedure still relies on temp dir and renames…
wchevreuil Nov 19, 2021
899c700
HBASE-26286: Add support for specifying store file tracker when resto…
BukrosSzabolcs Dec 16, 2021
fed9993
HBASE-26265 Update ref guide to mention the new store file tracker im…
wchevreuil Dec 16, 2021
44718fa
HBASE-26585 Add SFT configuration to META table descriptor when creat…
wchevreuil Jan 5, 2022
e386198
HBASE-26639 The implementation of TestMergesSplitsAddToTracker is pro…
Apache9 Jan 7, 2022
6169def
HBASE-26586 Should not rely on the global config when setting SFT imp…
Apache9 Jan 7, 2022
3631145
HBASE-26654 ModifyTableDescriptorProcedure shoud load TableDescriptor…
Apache9 Jan 16, 2022
84c833d
HBASE-26674 Should modify filesCompacting under storeWriteLock (#4040)
Apache9 Jan 19, 2022
277e1c8
HBASE-26675 Data race on Compactor.writer (#4035)
Apache9 Jan 24, 2022
31219ba
HBASE-26700 The way we bypass broken track file is not enough in Stor…
Apache9 Jan 25, 2022
922a516
HBASE-26690 Modify FSTableDescriptors to not rely on renaming when wr…
Apache9 Jan 27, 2022
068ab82
HBASE-26587 Introduce a new Admin API to change SFT implementation (#…
Apache9 Jan 30, 2022
1d3d35c
HBASE-26673 Implement a shell command for change SFT implementation (…
2005hithlj Feb 19, 2022
a3d1419
HBASE-26640 Reimplement master local region initialization to better …
Apache9 Feb 24, 2022
44d4999
HBASE-26707: Reduce number of renames during bulkload (#4066) (#4122)
BukrosSzabolcs Feb 25, 2022
43cb672
HBASE-26611 Changing SFT implementation on disabled table is dangerou…
Apache9 Mar 15, 2022
5acfe6d
HBASE-26837 Set SFT config when creating TableDescriptor in TestClone…
Apache9 Mar 16, 2022
541d748
HBASE-26881 Backport HBASE-25368 to branch-2 (#4267)
wchevreuil Mar 25, 2022
4e80f0e
HBASE-26826 Backport StoreFileTracker (HBASE-26067, HBASE-26584, and …
apurtell Mar 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,31 @@ default void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor colu
Future<Void> modifyColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily)
throws IOException;

/**
* Change the store file tracker of the given table's given family.
* @param tableName the table you want to change
* @param family the family you want to change
* @param dstSFT the destination store file tracker
* @throws IOException if a remote or network exception occurs
*/
default void modifyColumnFamilyStoreFileTracker(TableName tableName, byte[] family, String dstSFT)
throws IOException {
get(modifyColumnFamilyStoreFileTrackerAsync(tableName, family, dstSFT), getSyncWaitTimeout(),
TimeUnit.MILLISECONDS);
}

/**
* Change the store file tracker of the given table's given family.
* @param tableName the table you want to change
* @param family the family you want to change
* @param dstSFT the destination store file tracker
* @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the
* operation to complete
* @throws IOException if a remote or network exception occurs
*/
Future<Void> modifyColumnFamilyStoreFileTrackerAsync(TableName tableName, byte[] family,
String dstSFT) throws IOException;

/**
* Uses {@link #unassign(byte[], boolean)} to unassign the region. For expert-admins.
*
Expand Down Expand Up @@ -1632,6 +1657,28 @@ default Future<Void> modifyTableAsync(TableName tableName, TableDescriptor td)
*/
Future<Void> modifyTableAsync(TableDescriptor td) throws IOException;

/**
* Change the store file tracker of the given table.
* @param tableName the table you want to change
* @param dstSFT the destination store file tracker
* @throws IOException if a remote or network exception occurs
*/
default void modifyTableStoreFileTracker(TableName tableName, String dstSFT) throws IOException {
get(modifyTableStoreFileTrackerAsync(tableName, dstSFT), getSyncWaitTimeout(),
TimeUnit.MILLISECONDS);
}

/**
* Change the store file tracker of the given table.
* @param tableName the table you want to change
* @param dstSFT the destination store file tracker
* @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the
* operation to complete
* @throws IOException if a remote or network exception occurs
*/
Future<Void> modifyTableStoreFileTrackerAsync(TableName tableName, String dstSFT)
throws IOException;

/**
* Shuts down the HBase cluster.
* <p/>
Expand Down Expand Up @@ -2410,7 +2457,25 @@ default void cloneSnapshot(byte[] snapshotName, TableName tableName)
*/
default void cloneSnapshot(String snapshotName, TableName tableName)
throws IOException, TableExistsException, RestoreSnapshotException {
cloneSnapshot(snapshotName, tableName, false);
cloneSnapshot(snapshotName, tableName, false, null);
}

/**
* Create a new table by cloning the snapshot content.
* @param snapshotName name of the snapshot to be cloned
* @param tableName name of the table where the snapshot will be restored
* @param restoreAcl <code>true</code> to clone acl into newly created table
* @param customSFT specify the StoreFileTracker used for the table
* @throws IOException if a remote or network exception occurs
* @throws TableExistsException if table to be created already exists
* @throws RestoreSnapshotException if snapshot failed to be cloned
* @throws IllegalArgumentException if the specified table has not a valid name
*/
default void cloneSnapshot(String snapshotName, TableName tableName, boolean restoreAcl,
String customSFT)
throws IOException, TableExistsException, RestoreSnapshotException {
get(cloneSnapshotAsync(snapshotName, tableName, restoreAcl, customSFT), getSyncWaitTimeout(),
TimeUnit.MILLISECONDS);
}

/**
Expand Down Expand Up @@ -2457,8 +2522,25 @@ default Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName
* @throws RestoreSnapshotException if snapshot failed to be cloned
* @throws IllegalArgumentException if the specified table has not a valid name
*/
Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean restoreAcl)
throws IOException, TableExistsException, RestoreSnapshotException;
default Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName,
boolean restoreAcl)
throws IOException, TableExistsException, RestoreSnapshotException {
return cloneSnapshotAsync(snapshotName, tableName, restoreAcl, null);
}

/**
* Create a new table by cloning the snapshot content.
* @param snapshotName name of the snapshot to be cloned
* @param tableName name of the table where the snapshot will be restored
* @param restoreAcl <code>true</code> to clone acl into newly created table
* @param customSFT specify the StroreFileTracker used for the table
* @throws IOException if a remote or network exception occurs
* @throws TableExistsException if table to be created already exists
* @throws RestoreSnapshotException if snapshot failed to be cloned
* @throws IllegalArgumentException if the specified table has not a valid name
*/
Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean restoreAcl,
String customSFT) throws IOException, TableExistsException, RestoreSnapshotException;

/**
* Execute a distributed procedure on a cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ CompletableFuture<Void> createTable(TableDescriptor desc, byte[] startKey, byte[
*/
CompletableFuture<Void> modifyTable(TableDescriptor desc);

/**
* Change the store file tracker of the given table.
* @param tableName the table you want to change
* @param dstSFT the destination store file tracker
*/
CompletableFuture<Void> modifyTableStoreFileTracker(TableName tableName, String dstSFT);

/**
* Deletes a table.
* @param tableName name of table to delete
Expand Down Expand Up @@ -259,6 +266,15 @@ CompletableFuture<Void> addColumnFamily(TableName tableName,
CompletableFuture<Void> modifyColumnFamily(TableName tableName,
ColumnFamilyDescriptor columnFamily);

/**
* Change the store file tracker of the given table's given family.
* @param tableName the table you want to change
* @param family the family you want to change
* @param dstSFT the destination store file tracker
*/
CompletableFuture<Void> modifyColumnFamilyStoreFileTracker(TableName tableName, byte[] family,
String dstSFT);

/**
* Create a new namespace.
* @param descriptor descriptor which describes the new namespace
Expand Down Expand Up @@ -872,8 +888,20 @@ default CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tab
* @param tableName name of the table where the snapshot will be restored
* @param restoreAcl <code>true</code> to restore acl of snapshot
*/
default CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName,
boolean restoreAcl) {
return cloneSnapshot(snapshotName, tableName, restoreAcl, null);
}

/**
* Create a new table by cloning the snapshot content.
* @param snapshotName name of the snapshot to be cloned
* @param tableName name of the table where the snapshot will be restored
* @param restoreAcl <code>true</code> to restore acl of snapshot
* @param customSFT specify the StroreFileTracker used for the table
*/
CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName,
boolean restoreAcl);
boolean restoreAcl, String customSFT);

/**
* List completed snapshots.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public CompletableFuture<Void> modifyTable(TableDescriptor desc) {
return wrap(rawAdmin.modifyTable(desc));
}

@Override
public CompletableFuture<Void> modifyTableStoreFileTracker(TableName tableName, String dstSFT) {
return wrap(rawAdmin.modifyTableStoreFileTracker(tableName, dstSFT));
}

@Override
public CompletableFuture<Void> deleteTable(TableName tableName) {
return wrap(rawAdmin.deleteTable(tableName));
Expand Down Expand Up @@ -199,6 +204,12 @@ public CompletableFuture<Void> modifyColumnFamily(TableName tableName,
return wrap(rawAdmin.modifyColumnFamily(tableName, columnFamily));
}

@Override
public CompletableFuture<Void> modifyColumnFamilyStoreFileTracker(TableName tableName,
byte[] family, String dstSFT) {
return wrap(rawAdmin.modifyColumnFamilyStoreFileTracker(tableName, family, dstSFT));
}

@Override
public CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor) {
return wrap(rawAdmin.createNamespace(descriptor));
Expand Down Expand Up @@ -483,14 +494,14 @@ public CompletableFuture<Void> restoreSnapshot(String snapshotName) {

@Override
public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot,
boolean restoreAcl) {
boolean restoreAcl) {
return wrap(rawAdmin.restoreSnapshot(snapshotName, takeFailSafeSnapshot, restoreAcl));
}

@Override
public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName,
boolean restoreAcl) {
return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName, restoreAcl));
boolean restoreAcl, String customSFT) {
return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName, restoreAcl, customSFT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ public interface ColumnFamilyDescriptor {
* @return A clone value. Null if no mapping for the key
*/
Bytes getValue(Bytes key);
/**
* @param key The key.
* @return A clone value. Null if no mapping for the key
*/
String getValue(String key);
/**
* @param key The key.
* @return A clone value. Null if no mapping for the key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ public byte[] getValue(byte[] key) {
return value == null ? null : value.get();
}

@Override
public String getValue(String key) {
Bytes rval = values.get(new Bytes(Bytes.toBytes(key)));
return rval == null ? null : Bytes.toString(rval.get(), rval.getOffset(), rval.getLength());
}

@Override
public Map<Bytes, Bytes> getValues() {
return Collections.unmodifiableMap(values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsRpcThrottleEnabledResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListDecommissionedRegionServersRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListDecommissionedRegionServersResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnStoreFileTrackerRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnStoreFileTrackerResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableStoreFileTrackerRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableStoreFileTrackerResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.NormalizeRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.NormalizeResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RecommissionRegionServerRequest;
Expand Down Expand Up @@ -1948,6 +1952,20 @@ public HBaseProtos.LogEntry getLogEntries(RpcController controller,
HBaseProtos.LogRequest request) throws ServiceException {
return stub.getLogEntries(controller, request);
}

@Override
public ModifyTableStoreFileTrackerResponse modifyTableStoreFileTracker(
RpcController controller, ModifyTableStoreFileTrackerRequest request)
throws ServiceException {
return stub.modifyTableStoreFileTracker(controller, request);
}

@Override
public ModifyColumnStoreFileTrackerResponse modifyColumnStoreFileTracker(
RpcController controller, ModifyColumnStoreFileTrackerRequest request)
throws ServiceException {
return stub.modifyColumnStoreFileTracker(controller, request);
}
};
}

Expand Down
Loading