Class StoreFileTrackerValidationUtils
java.lang.Object
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerValidationUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkForCreateTable
(org.apache.hadoop.conf.Configuration conf, TableDescriptor table) Pre check when creating a new table.static void
checkForModifyTable
(org.apache.hadoop.conf.Configuration conf, TableDescriptor oldTable, TableDescriptor newTable, boolean isTableDisabled) Pre check when modifying a table.private static void
checkForNewFamily
(org.apache.hadoop.conf.Configuration conf, TableDescriptor table, ColumnFamilyDescriptor family) static void
validatePreRestoreSnapshot
(TableDescriptor currentTableDesc, TableDescriptor snapshotTableDesc, org.apache.hadoop.conf.Configuration baseConf) Makes sure restoring a snapshot does not break the current SFT setup follows StoreUtils.createStoreConfiguration
-
Constructor Details
-
StoreFileTrackerValidationUtils
private StoreFileTrackerValidationUtils()
-
-
Method Details
-
checkForNewFamily
private static void checkForNewFamily(org.apache.hadoop.conf.Configuration conf, TableDescriptor table, ColumnFamilyDescriptor family) throws IOException - Throws:
IOException
-
checkForCreateTable
public static void checkForCreateTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor table) throws IOException Pre check when creating a new table. For now, only make sure that we do not useStoreFileTrackerFactory.Trackers.MIGRATION
for newly created tables.- Throws:
IOException
- when there are check errors, the upper layer should fail theCreateTableProcedure
.
-
checkForModifyTable
public static void checkForModifyTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor oldTable, TableDescriptor newTable, boolean isTableDisabled) throws IOException Pre check when modifying a table. The basic idea is when you want to change the store file tracker implementation, you should useStoreFileTrackerFactory.Trackers.MIGRATION
first and then change to the destination store file tracker implementation. There are several rules:- For newly added family, you should not use
StoreFileTrackerFactory.Trackers.MIGRATION
. - For modifying a family:
- If old tracker is
StoreFileTrackerFactory.Trackers.MIGRATION
, then:- The new tracker is also
StoreFileTrackerFactory.Trackers.MIGRATION
, then they must have the same src and dst tracker. - The new tracker is not
StoreFileTrackerFactory.Trackers.MIGRATION
, then the new tracker must be the dst tracker of the old tracker.
- The new tracker is also
- If the old tracker is not
StoreFileTrackerFactory.Trackers.MIGRATION
, then:- If the new tracker is
StoreFileTrackerFactory.Trackers.MIGRATION
, then the old tracker must be the src tracker of the new tracker. - If the new tracker is not
StoreFileTrackerFactory.Trackers.MIGRATION
, then the new tracker must be the same with old tracker.
- If the new tracker is
- If old tracker is
- Throws:
IOException
- when there are check errors, the upper layer should fail theModifyTableProcedure
.
- For newly added family, you should not use
-
validatePreRestoreSnapshot
public static void validatePreRestoreSnapshot(TableDescriptor currentTableDesc, TableDescriptor snapshotTableDesc, org.apache.hadoop.conf.Configuration baseConf) throws RestoreSnapshotException Makes sure restoring a snapshot does not break the current SFT setup follows StoreUtils.createStoreConfiguration- Parameters:
currentTableDesc
- Existing Table's TableDescriptorsnapshotTableDesc
- Snapshot's TableDescriptorbaseConf
- Current global configuration- Throws:
RestoreSnapshotException
- if restore would break the current SFT setup
-