@Override public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner s, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException { if (!IndexUtil.isLocalIndexStore(store)) { return s; } if (!store.hasReferences()) { InternalScanner repairScanner = null; if (request.isMajor() && (!RepairUtil.isLocalIndexStoreFilesConsistent(c.getEnvironment(), store))) { LOG.info("we have found inconsistent data for local index for region:" + c.getEnvironment().getRegion().getRegionInfo()); if (c.getEnvironment().getConfiguration().getBoolean(LOCAL_INDEX_AUTOMATIC_REPAIR, true)) { LOG.info("Starting automatic repair of local Index for region:" + c.getEnvironment().getRegion().getRegionInfo()); repairScanner = getRepairScanner(c.getEnvironment(), store); } } if (repairScanner != null) { if (s!=null) { s.close(); } return repairScanner; } else { return s; } } return s; }
boolean hasReferences() { return hasReferences(this.storefiles); }
/** * @return True if this region has references. */ public boolean hasReferences() { for (Store store : this.stores.values()) { if (store.hasReferences()) return true; } return false; }
private boolean checkForReferenceFiles() { if(!ScanUtil.isLocalIndex(scan)) return false; for (byte[] family : scan.getFamilies()) { if (getRegion().getStore(family).hasReferences()) { return true; } } return false; }
@Override public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner s, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException { if (!IndexUtil.isLocalIndexStore(store)) { return s; } if (!store.hasReferences()) { InternalScanner repairScanner = null; if (request.isMajor() && (!RepairUtil.isLocalIndexStoreFilesConsistent(c.getEnvironment(), store))) { LOG.info("we have found inconsistent data for local index for region:" + c.getEnvironment().getRegion().getRegionInfo()); if (c.getEnvironment().getConfiguration().getBoolean(LOCAL_INDEX_AUTOMATIC_REPAIR, true)) { LOG.info("Starting automatic repair of local Index for region:" + c.getEnvironment().getRegion().getRegionInfo()); repairScanner = getRepairScanner(c.getEnvironment(), store); } } if (repairScanner != null) { if (s!=null) { s.close(); } return repairScanner; } else { return s; } } return s; }
@Override public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner s, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException { if (!IndexUtil.isLocalIndexStore(store)) { return s; } if (!store.hasReferences()) { InternalScanner repairScanner = null; if (request.isMajor() && (!RepairUtil.isLocalIndexStoreFilesConsistent(c.getEnvironment(), store))) { LOG.info("we have found inconsistent data for local index for region:" + c.getEnvironment().getRegion().getRegionInfo()); if (c.getEnvironment().getConfiguration().getBoolean(LOCAL_INDEX_AUTOMATIC_REPAIR, true)) { LOG.info("Starting automatic repair of local Index for region:" + c.getEnvironment().getRegion().getRegionInfo()); repairScanner = getRepairScanner(c.getEnvironment(), store); } } if (repairScanner != null) { if (s!=null) { s.close(); } return repairScanner; } else { return s; } } return s; }
!hasReferences(compactSelection.getFilesToCompact())) {
if (s.hasReferences() || s.needsCompaction()) { getCompactionRequester().requestCompaction(r, s, "Opening Region", null);
if (s.hasReferences() || s.needsCompaction()) { this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");