use of org.apache.geode.internal.cache.tier.sockets.ClientMarkerMessageImpl in project geode by apache.
the class HARegionQueue method putGIIDataInRegion.
/**
* Repopulates the HARegion after the GII is over so as to reset the counters and populate the
* DACE objects for the thread identifiers . This method should be invoked as the last method in
* the constructor . Thus while creating BlockingQueue this method should be invoked lastly in the
* derived class constructor , after the HARegionQueue contructor is complete. Otherwise, the
* ReentrantLock will be null.
*/
void putGIIDataInRegion() throws CacheException, InterruptedException {
Set entrySet = this.region.entrySet(false);
// be populated
if (!entrySet.isEmpty()) {
this.puttingGIIDataInQueue = true;
final boolean isDebugEnabled = logger.isDebugEnabled();
try {
Region.Entry entry = null;
Map orderedMap = new TreeMap();
Iterator iterator = entrySet.iterator();
Object key = null;
while (iterator.hasNext()) {
entry = (Region.Entry) iterator.next();
key = entry.getKey();
if (isDebugEnabled) {
logger.debug("processing queue key {} and value {}", key, entry.getValue());
}
if (key instanceof Long) {
if (!(entry.getValue() instanceof ClientMarkerMessageImpl)) {
orderedMap.put(key, entry.getValue());
}
}
this.region.localDestroy(key);
}
long max = 0;
long counterInRegion = 0;
entrySet = orderedMap.entrySet();
if (!entrySet.isEmpty()) {
Map.Entry mapEntry = null;
iterator = entrySet.iterator();
while (iterator.hasNext()) {
mapEntry = (Map.Entry) iterator.next();
Conflatable val = (Conflatable) mapEntry.getValue();
if (val != null && val.getEventId() != null) {
counterInRegion = ((Long) mapEntry.getKey()).intValue();
// TODO: remove this assertion
Assert.assertTrue(counterInRegion > max);
max = counterInRegion;
// putInQueue(val);
// logger.info(LocalizedStrings.DEBUG, this + " putting GII entry #" + counterInRegion
// + " into queue: " + val);
this.put(val);
} else if (isDebugEnabled) {
logger.debug("bug 44959 encountered: HARegion.putGIIDataInRegion found null eventId in {}", val);
}
}
}
this.tailKey.set(max);
} finally {
this.puttingGIIDataInQueue = false;
if (isDebugEnabled) {
logger.debug("{} done putting GII data into queue", this);
}
}
}
// TODO:Asif: Avoid invocation of this method
startHAServices(this.region.getCache());
}
Aggregations