private int getRegionSizeNoLock(boolean includeHDFSResults) { int result = getRegionMap().size(); // if this is a client with no tombstones then we subtract the number // of entries being affected by register-interest refresh if (this.imageState.isClient() && !this.concurrencyChecksEnabled) { result -= this.imageState.getDestroyedEntriesCount(); } if (includeHDFSResults) { return result; } else { return result - this.tombstoneCount.get(); } }
/** * @return size after considering imageState */ protected int getRegionSize() { synchronized(getSizeGuard()) { int result = getRegionMap().size(); // if this is a client with no tombstones then we subtract the number // of entries being affected by register-interest refresh if (this.imageState.isClient() && !this.concurrencyChecksEnabled) { return result - this.imageState.getDestroyedEntriesCount(); } if (includeHDFSResults()) { return result; } return result - this.tombstoneCount.get(); } }