Interface StoreFileTracker

All Known Implementing Classes:
DefaultStoreFileTracker, FileBasedStoreFileTracker, MigrationStoreFileTracker, StoreFileTrackerBase

@Private public interface StoreFileTracker
An interface to define how we track the store files for a give store.

In the old time, we will write store to a tmp directory first, and then rename it to the actual data file. And once a store file is under data directory, we will consider it as 'committed'. And we need to do listing when loading store files.

When cloud age is coming, now we want to store the store files on object storage, where rename and list are not as cheap as on HDFS, especially rename. Although introducing a metadata management layer for object storage could solve the problem, but we still want HBase to run on pure object storage, so here we introduce this interface to abstract how we track the store files. For the old implementation, we just persist nothing here, and do listing to load store files. When running on object storage, we could persist the store file list in a system region, or in a file on the object storage, to make it possible to write directly into the data directory to avoid renaming, and also avoid listing when loading store files.

The implementation requires to be thread safe as flush and compaction may occur as the same time, and we could also do multiple compactions at the same time. As the implementation may choose to persist the store file list to external storage, which could be slow, it is the duty for the callers to not call it inside a lock which may block normal read/write requests.