HBASE-26386 Refactor StoreFileTracker implementations to expose the set method (#3774)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
This commit is contained in:
parent
06db852aa0
commit
e4e7cf80b7
|
@ -62,7 +62,7 @@ class DefaultStoreFileTracker extends StoreFileTrackerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void set(List<StoreFileInfo> files) {
|
public void set(List<StoreFileInfo> files) {
|
||||||
// NOOP
|
// NOOP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@ class FileBasedStoreFileTracker extends StoreFileTrackerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void set(List<StoreFileInfo> files) throws IOException {
|
public void set(List<StoreFileInfo> files) throws IOException {
|
||||||
synchronized (storefiles) {
|
synchronized (storefiles) {
|
||||||
storefiles.clear();
|
storefiles.clear();
|
||||||
StoreFileList.Builder builder = StoreFileList.newBuilder();
|
StoreFileList.Builder builder = StoreFileList.newBuilder();
|
||||||
|
|
|
@ -21,9 +21,6 @@ import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptor;
|
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
|
||||||
import org.apache.hadoop.hbase.procedure2.util.StringUtils;
|
|
||||||
import org.apache.hadoop.hbase.regionserver.StoreContext;
|
import org.apache.hadoop.hbase.regionserver.StoreContext;
|
||||||
import org.apache.hadoop.hbase.regionserver.StoreFileInfo;
|
import org.apache.hadoop.hbase.regionserver.StoreFileInfo;
|
||||||
import org.apache.yetus.audience.InterfaceAudience;
|
import org.apache.yetus.audience.InterfaceAudience;
|
||||||
|
@ -84,7 +81,7 @@ class MigrationStoreFileTracker extends StoreFileTrackerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void set(List<StoreFileInfo> files) {
|
public void set(List<StoreFileInfo> files) {
|
||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"Should not call this method on " + getClass().getSimpleName());
|
"Should not call this method on " + getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@ package org.apache.hadoop.hbase.regionserver.storefiletracker;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptor;
|
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
||||||
import org.apache.hadoop.hbase.regionserver.CreateStoreFileWriterParams;
|
import org.apache.hadoop.hbase.regionserver.CreateStoreFileWriterParams;
|
||||||
import org.apache.hadoop.hbase.regionserver.StoreFileInfo;
|
import org.apache.hadoop.hbase.regionserver.StoreFileInfo;
|
||||||
|
@ -69,6 +67,11 @@ public interface StoreFileTracker {
|
||||||
void replace(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles)
|
void replace(Collection<StoreFileInfo> compactedFiles, Collection<StoreFileInfo> newFiles)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the store files.
|
||||||
|
*/
|
||||||
|
void set(List<StoreFileInfo> files) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a writer for writing new store files.
|
* Create a writer for writing new store files.
|
||||||
* @return Writer for a new StoreFile
|
* @return Writer for a new StoreFile
|
||||||
|
|
|
@ -21,11 +21,9 @@ import static org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTra
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
|
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptor;
|
|
||||||
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
|
||||||
import org.apache.hadoop.hbase.io.compress.Compression;
|
import org.apache.hadoop.hbase.io.compress.Compression;
|
||||||
import org.apache.hadoop.hbase.io.crypto.Encryption;
|
import org.apache.hadoop.hbase.io.crypto.Encryption;
|
||||||
|
@ -184,12 +182,4 @@ abstract class StoreFileTrackerBase implements StoreFileTracker {
|
||||||
|
|
||||||
protected abstract void doAddCompactionResults(Collection<StoreFileInfo> compactedFiles,
|
protected abstract void doAddCompactionResults(Collection<StoreFileInfo> compactedFiles,
|
||||||
Collection<StoreFileInfo> newFiles) throws IOException;
|
Collection<StoreFileInfo> newFiles) throws IOException;
|
||||||
|
|
||||||
/**
|
|
||||||
* used to mirror the store file list after loading when migration.
|
|
||||||
* <p/>
|
|
||||||
* Do not add this method to the {@link StoreFileTracker} interface since we do not need this
|
|
||||||
* method in upper layer.
|
|
||||||
*/
|
|
||||||
abstract void set(List<StoreFileInfo> files) throws IOException;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue