use of org.apache.geode.cache.CacheEvent in project geode by apache.
the class TXRmtEvent method getPutEvents.
public List getPutEvents() {
if (this.events == null) {
return Collections.EMPTY_LIST;
} else {
ArrayList result = new ArrayList(this.events.size());
Iterator it = this.events.iterator();
while (it.hasNext()) {
CacheEvent ce = (CacheEvent) it.next();
if (ce.getOperation().isUpdate() && isEventUserVisible(ce)) {
result.add(ce);
}
}
if (result.isEmpty()) {
return Collections.EMPTY_LIST;
} else {
return Collections.unmodifiableList(result);
}
}
}
use of org.apache.geode.cache.CacheEvent in project geode by apache.
the class TXRmtEvent method getEvents.
public List getEvents() {
if (this.events == null) {
return Collections.EMPTY_LIST;
} else {
ArrayList result = new ArrayList(this.events.size());
Iterator it = this.events.iterator();
while (it.hasNext()) {
CacheEvent ce = (CacheEvent) it.next();
if (isEventUserVisible(ce)) {
result.add(ce);
}
}
if (result.isEmpty()) {
return Collections.EMPTY_LIST;
} else {
return Collections.unmodifiableList(result);
}
}
}
use of org.apache.geode.cache.CacheEvent in project geode by apache.
the class TXRmtEvent method getInvalidateEvents.
public List getInvalidateEvents() {
if (this.events == null) {
return Collections.EMPTY_LIST;
} else {
ArrayList result = new ArrayList(this.events.size());
Iterator it = this.events.iterator();
while (it.hasNext()) {
CacheEvent ce = (CacheEvent) it.next();
if (ce.getOperation().isInvalidate() && isEventUserVisible(ce)) {
result.add(ce);
}
}
if (result.isEmpty()) {
return Collections.EMPTY_LIST;
} else {
return Collections.unmodifiableList(result);
}
}
}
use of org.apache.geode.cache.CacheEvent in project geode by apache.
the class TXRmtEvent method getDestroyEvents.
public List getDestroyEvents() {
if (this.events == null) {
return Collections.EMPTY_LIST;
} else {
ArrayList result = new ArrayList(this.events.size());
Iterator it = this.events.iterator();
while (it.hasNext()) {
CacheEvent ce = (CacheEvent) it.next();
if (ce.getOperation().isDestroy() && isEventUserVisible(ce)) {
result.add(ce);
}
}
if (result.isEmpty()) {
return Collections.EMPTY_LIST;
} else {
return Collections.unmodifiableList(result);
}
}
}
use of org.apache.geode.cache.CacheEvent in project geode by apache.
the class SearchLoadAndWriteProcessor method doNetWrite.
/** return true if a CacheWriter was actually invoked */
boolean doNetWrite(CacheEvent event, Set netWriteRecipients, CacheWriter localWriter, int paction) throws CacheWriterException, TimeoutException {
int action = paction;
this.requestInProgress = true;
Scope scope = this.region.getScope();
if (localWriter != null) {
doLocalWrite(localWriter, event, action);
this.requestInProgress = false;
return true;
}
if (scope == Scope.LOCAL && (region.getPartitionAttributes() == null)) {
return false;
}
@Released CacheEvent listenerEvent = getEventForListener(event);
try {
if (action == BEFOREUPDATE && listenerEvent.getOperation().isCreate()) {
action = BEFORECREATE;
}
boolean cacheWrote = netWrite(listenerEvent, action, netWriteRecipients);
this.requestInProgress = false;
return cacheWrote;
} finally {
if (event != listenerEvent) {
if (listenerEvent instanceof EntryEventImpl) {
((Releasable) listenerEvent).release();
}
}
}
}
Aggregations