use of org.apache.hadoop.hbase.regionserver.StoreFile in project hbase by apache.
the class FIFOCompactionPolicy method hasExpiredStores.
private boolean hasExpiredStores(Collection<StoreFile> files) {
long currentTime = EnvironmentEdgeManager.currentTime();
for (StoreFile sf : files) {
// Check MIN_VERSIONS is in HStore removeUnneededFiles
Long maxTs = sf.getReader().getMaxTimestamp();
long maxTtl = storeConfigInfo.getStoreFileTtl();
if (maxTs == null || maxTtl == Long.MAX_VALUE || (currentTime - maxTtl < maxTs)) {
continue;
} else {
return true;
}
}
return false;
}
use of org.apache.hadoop.hbase.regionserver.StoreFile in project phoenix by apache.
the class RepairUtil method isLocalIndexStoreFilesConsistent.
public static boolean isLocalIndexStoreFilesConsistent(RegionCoprocessorEnvironment environment, Store store) {
byte[] startKey = environment.getRegion().getRegionInfo().getStartKey();
byte[] endKey = environment.getRegion().getRegionInfo().getEndKey();
byte[] indexKeyEmbedded = startKey.length == 0 ? new byte[endKey.length] : startKey;
for (StoreFile file : store.getStorefiles()) {
if (file.getReader() != null && file.getReader().getFirstKey() != null) {
byte[] fileFirstRowKey = KeyValue.createKeyValueFromKey(file.getReader().getFirstKey()).getRow();
;
if ((fileFirstRowKey != null && Bytes.compareTo(file.getReader().getFirstKey(), 0, indexKeyEmbedded.length, indexKeyEmbedded, 0, indexKeyEmbedded.length) != 0)) /* || (endKey.length > 0 && Bytes.compareTo(file.getLastKey(), endKey) < 0) */
{
return false;
}
}
}
return true;
}
Aggregations