use of org.apache.geode.internal.cache.tx.DistTxEntryEvent in project geode by apache.
the class DistPeerTXStateStub method destroyExistingEntry.
/*
* (non-Javadoc)
*
* @see org.apache.geode.internal.cache.TXStateInterface#destroyExistingEntry
* (org.apache.geode.internal.cache.EntryEventImpl, boolean, java.lang.Object)
*/
public void destroyExistingEntry(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue) throws EntryNotFoundException {
// logger.debug("DistPeerTXStateStub.destroyExistingEntry", new Throwable());
this.primaryTransactionalOperations.add(new DistTxEntryEvent(event));
super.destroyExistingEntry(event, cacheWrite, expectedOldValue);
}
use of org.apache.geode.internal.cache.tx.DistTxEntryEvent in project geode by apache.
the class DistPeerTXStateStub method invalidateExistingEntry.
/*
* (non-Javadoc)
*
* @see org.apache.geode.internal.cache.TXStateInterface#invalidateExistingEntry
* (org.apache.geode.internal.cache.EntryEventImpl, boolean, boolean)
*/
public void invalidateExistingEntry(EntryEventImpl event, boolean invokeCallbacks, boolean forceNewEntry) {
// logger
// .debug("DistPeerTXStateStub.invalidateExistingEntry", new Throwable());
super.invalidateExistingEntry(event, invokeCallbacks, forceNewEntry);
this.primaryTransactionalOperations.add(new DistTxEntryEvent(event));
}
use of org.apache.geode.internal.cache.tx.DistTxEntryEvent in project geode by apache.
the class DistPeerTXStateStubTest method shouldBeMockable.
@Test
public void shouldBeMockable() throws Exception {
DistPeerTXStateStub mockDistPeerTXStateStub = mock(DistPeerTXStateStub.class);
DistTxEntryEvent mockDistTxEntryEvent = mock(DistTxEntryEvent.class);
ArrayList<DistTxEntryEvent> arrayOfDistTxEntryEvents = new ArrayList<>();
arrayOfDistTxEntryEvents.add(mockDistTxEntryEvent);
when(mockDistPeerTXStateStub.getPrimaryTransactionalOperations()).thenReturn(arrayOfDistTxEntryEvents);
assertThat(mockDistPeerTXStateStub.getPrimaryTransactionalOperations()).isSameAs(arrayOfDistTxEntryEvents);
}
use of org.apache.geode.internal.cache.tx.DistTxEntryEvent in project geode by apache.
the class DistPeerTXStateStub method destroyOnRemote.
/*
* (non-Javadoc)
*
* @see org.apache.geode.internal.cache.InternalDataView#destroyOnRemote(java .lang.Integer,
* org.apache.geode.internal.cache.EntryEventImpl, java.lang.Object)
*/
public void destroyOnRemote(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue) throws DataLocationException {
// logger.debug("DistPeerTXStateStub.destroyOnRemote", new Throwable());
super.destroyOnRemote(event, cacheWrite, expectedOldValue);
this.primaryTransactionalOperations.add(new DistTxEntryEvent(event));
}
use of org.apache.geode.internal.cache.tx.DistTxEntryEvent in project geode by apache.
the class DistPeerTXStateStub method postPutAll.
public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts, LocalRegion region) {
super.postPutAll(putallOp, successfulPuts, region);
// TODO DISTTX: event is never released
EntryEventImpl event = EntryEventImpl.createPutAllEvent(putallOp, region, Operation.PUTALL_CREATE, putallOp.getBaseEvent().getKey(), putallOp.getBaseEvent().getValue());
event.setEventId(putallOp.getBaseEvent().getEventId());
DistTxEntryEvent dtop = new DistTxEntryEvent(event);
dtop.setPutAllOperation(putallOp);
this.primaryTransactionalOperations.add(dtop);
}
Aggregations