Search in sources :

Example 1 with StoreFileEntry

use of org.apache.hadoop.hbase.shaded.protobuf.generated.StoreFileTrackerProtos.StoreFileEntry in project hbase by apache.

the class FileBasedStoreFileTracker method load.

@Override
public List<StoreFileInfo> load() throws IOException {
    StoreFileList list = backedFile.load();
    if (list == null) {
        return Collections.emptyList();
    }
    FileSystem fs = ctx.getRegionFileSystem().getFileSystem();
    List<StoreFileInfo> infos = new ArrayList<>();
    for (StoreFileEntry entry : list.getStoreFileList()) {
        infos.add(ServerRegionReplicaUtil.getStoreFileInfo(conf, fs, ctx.getRegionInfo(), ctx.getRegionFileSystem().getRegionInfoForFS(), ctx.getFamily().getNameAsString(), new Path(ctx.getFamilyStoreDirectoryPath(), entry.getName())));
    }
    // for safety, let's still keep the synchronized here.
    synchronized (storefiles) {
        for (StoreFileInfo info : infos) {
            storefiles.put(info.getPath().getName(), info);
        }
    }
    return infos;
}
Also used : Path(org.apache.hadoop.fs.Path) FileSystem(org.apache.hadoop.fs.FileSystem) ArrayList(java.util.ArrayList) StoreFileList(org.apache.hadoop.hbase.shaded.protobuf.generated.StoreFileTrackerProtos.StoreFileList) StoreFileInfo(org.apache.hadoop.hbase.regionserver.StoreFileInfo) StoreFileEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.StoreFileTrackerProtos.StoreFileEntry)

Aggregations

ArrayList (java.util.ArrayList)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 StoreFileInfo (org.apache.hadoop.hbase.regionserver.StoreFileInfo)1 StoreFileEntry (org.apache.hadoop.hbase.shaded.protobuf.generated.StoreFileTrackerProtos.StoreFileEntry)1 StoreFileList (org.apache.hadoop.hbase.shaded.protobuf.generated.StoreFileTrackerProtos.StoreFileList)1