public DiskRegionInfoWithList(DiskRegionView dr, boolean couldHaveKrf, boolean krfExists) { super(dr); // we need to keep track of the version tags for entries so that we write the correct entry to the krf // both in sync and async disk write cases if (!krfExists && couldHaveKrf) { pendingKrfTags = ObjectObjectHashMap.withExpectedSize(200); } else { pendingKrfTags = null; } }
private void resetGfeResultSet() { this.getAllDone = false; this.currPos = 0; this.currentRoutingObject = null; this.getAllOnGlobalIndexDone = false; if (this.getAllKeysAndRoutingObjects != null) { this.getAllKeysAndRoutingObjects.clear(); } }
ObjectObjectHashMap.withExpectedSize(this.gfKeys.length); for (Object gfKey : this.gfKeys) { giKeys.put(((CompactCompositeRegionKey)gfKey).getKeyColumn(0), ((CompactCompositeRegionKey)gfKey)); int numKeys = giKeys.size(); if (observer != null) { observer.getAllGlobalIndexInvoked(numKeys); Set<Object> keys = giKeys.keySet(); if (doLog) { SanityManager.DEBUG_PRINT( while ((result = getNextFromGetAll(true)) != null && result.currentRowForGetAll != null) { this.getAllKeysAndRoutingObjects.put(giKeys .get(result.currentKeyForGetAll), ((GlobalRowLocation)result.currentRowForGetAll) .getRoutingObject()); return this.getAllKeysAndRoutingObjects.size();
ObjectObjectHashMap.withExpectedSize(this.regionMap.size()); ArrayList<DiskRegionInfo> targetRegions = new ArrayList<DiskRegionInfo>( this.regionMap.size()); for (KRFEntry entry : sortedLiveEntries) { if (getParent().isClosing() || indexRecoveryMap.isEmpty()) { return numRecovered; Long diskRegionId = diskRegionView.getId(); final IndexData[] affectedIndexes = indexRecoveryMap.get(diskRegionId); if (affectedIndexes == null) { continue; indexRecoveryMap.remove(diskRegionId); } finally { OffHeapHelper.release(val);
ObjectObjectHashMap.from(this.regionMap); synchronized (sync) { Iterator<Long> targetItr = targetRegions.keySet().iterator(); while (targetItr.hasNext()) { Long diskRegionId = targetItr.next(); if (targetRegions.isEmpty()) { sortedLiveEntries = getSortedLiveEntries(targetRegions.values()); if(sortedLiveEntries == null) {
ObjectObjectHashMap.withExpectedSize(this.pathToRegion.size()); this.pathToRegion.values().forEach(region -> { if (region.isInternalRegion() || (region instanceof HARegion)) return; snapshot.put(br.getFullPath(), br.getVersionVector().getSnapShotOfMemberVersion()); snapshot.put(region.getFullPath(), region.getVersionVector().getSnapShotOfMemberVersion());
/** * @see UpdatableResultSet#deleteRowDirectly() */ @Override public void deleteRowDirectly() throws StandardException { Object key = getKeyForUpdate(); Object routingObject = this.getAllKeysAndRoutingObjects != null ? this.getAllKeysAndRoutingObjects.get(key) : this.currentRoutingObject; this.gfContainer.delete(key, routingObject, true, this.tran, this.gfContainer.getActiveTXState(this.tran), lcc, false); }
/** * Retrieve a collection of tombstone GC region-versions */ public Map<T, Long> getTombstoneGCVector() { Map<T, Long> result; synchronized(memberToGCVersion) { result = ObjectObjectHashMap.from(this.memberToGCVersion); } result.put(this.myId, this.localGCVersion.get()); return result; }
while (this.currPos < this.gfKeys.length) { final Object gfKey = this.gfKeys[this.currPos++]; if (!this.getAllKeysAndRoutingObjects.containsKey(gfKey)) { final Object result = loadOneRow(gfKey, this.gfContainer.getRegion());
/** * @see UpdatableResultSet#updateRow(ExecRow) */ @Override public final void updateRow(ExecRow updateRow) throws StandardException { final Object key = getKeyForUpdate(); Object routingObject = this.getAllKeysAndRoutingObjects != null ? this.getAllKeysAndRoutingObjects.get(key) : this.currentRoutingObject; this.cachedChangedRow = GemFireDistributedResultSet.updateDirectly(key, routingObject, updateRow, ((BaseActivation)this.activation).getUpdatedColumns(), this.gfContainer, this.selectQI, this.tran, this.lcc, this.cachedChangedRow); }
/** * Retrieve a vector that can be used as a SnapShot information. * Basically we need low cost copy of memberToVersion and localVersion. * Also calling method should synchronize on cache level lock * if it wants consistent view of snapshot across cache */ public RegionVersionVector<T> getCloneForTransmission() { Map<T,RegionVersionHolder<T>> liveHolders; // we need to take a lock? so that memberToVersion is not modifed as we copy them // Find out liveHolders = ObjectObjectHashMap.from(this.memberToVersion); ConcurrentHashMap<T, RegionVersionHolder<T>> clonedHolders = new ConcurrentHashMap<T, RegionVersionHolder<T>>(liveHolders.size(), LOAD_FACTOR, CONCURRENCY_LEVEL); for (Map.Entry<T, RegionVersionHolder<T>> entry: liveHolders.entrySet()) { clonedHolders.put(entry.getKey(), entry.getValue().clone()); } ConcurrentHashMap<T, Long> gcVersions = new ConcurrentHashMap<T, Long>( this.memberToGCVersion.size(), LOAD_FACTOR, CONCURRENCY_LEVEL); gcVersions.putAll(this.memberToGCVersion); RegionVersionHolder<T> clonedLocalHolder; clonedLocalHolder = this.localExceptions.clone(); //Make sure the holder that we send to the peer does //have an accurate RegionVersionHolder for our local version return createCopy(this.myId, clonedHolders, this.localVersion.get(), gcVersions, this.localGCVersion.get(), false, clonedLocalHolder); }
/** * Get a map of member to the GC version of that member, including * the local member. */ public Map<T, Long> getMemberToGCVersion() { ObjectObjectHashMap<T, Long> results = ObjectObjectHashMap.from(memberToGCVersion); if(localGCVersion.get() > 0) { results.put(getOwnerId(), localGCVersion.get()); } return results; }
/** * Returns a map of baseline oplog files to copy that match this oplog's files for a currently running backup. * @param baselineOplogFiles a List of files to match this oplog's filenames against. * @param allFiles - a set of all files for the oplog. This set will be modified to remove all of the files * that are present in the baseline. * @return a map of baslineline oplog files to copy. May be empty if total current set for this oplog * does not match the baseline. */ Map<File,File> mapBaseline(List<File> baselineOplogFiles, Set<File> allFiles) { // Map of baseline oplog file name to oplog file Map<String,File> baselineOplogMap = TransformUtils.transformAndMap(baselineOplogFiles,TransformUtils.fileNameTransformer); // Returned Map of baseline file to current oplog file Map<File,File> baselineToOplogMap = ObjectObjectHashMap.withExpectedSize(16); for(Iterator<File> itr = allFiles.iterator(); itr.hasNext(); ) { File file = itr.next(); // If the file is in the baseline, add it to the baseline map and remove // it from the set of files to backup. if(baselineOplogMap.containsKey(file.getName())) { baselineToOplogMap.put(baselineOplogMap.get(file.getName()), file); itr.remove(); } } return baselineToOplogMap; }
/** * Retrieve a vector that can be sent to another member. This clones only * the version information for the given ID.<p> * The clone returned by this method does not have distributed garbage-collection * information. */ public RegionVersionVector<T> getCloneForTransmission(T mbr) { Map<T,RegionVersionHolder<T>> liveHolders; liveHolders = ObjectObjectHashMap.from(this.memberToVersion); RegionVersionHolder<T> holder = liveHolders.get(mbr); if (holder == null) { holder = new RegionVersionHolder<T>(-1); } else { holder = holder.clone(); } return createCopy( this.myId, new ConcurrentHashMap<T, RegionVersionHolder<T>>(Collections.singletonMap(mbr, holder)), 0, new ConcurrentHashMap<T, Long>(INITIAL_CAPACITY, LOAD_FACTOR, CONCURRENCY_LEVEL), 0, true, new RegionVersionHolder<T>(-1)); }
/** * Get a map of the member to the version and exception list for that member, * including the local member. */ public Map<T, RegionVersionHolder<T>> getMemberToVersion() { RegionVersionHolder<T> myExceptions; myExceptions = this.localExceptions.clone(); ObjectObjectHashMap<T, RegionVersionHolder<T>> results = ObjectObjectHashMap.from(memberToVersion); results.put(getOwnerId(), myExceptions); return results; }
this.getAllKeysAndRoutingObjects = ObjectObjectHashMap.withExpectedSize(8); if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager