Search in sources :

Example 6 with DistTxEntryEvent

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);
}
Also used : DistTxEntryEvent(org.apache.geode.internal.cache.tx.DistTxEntryEvent)

Example 7 with DistTxEntryEvent

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));
}
Also used : DistTxEntryEvent(org.apache.geode.internal.cache.tx.DistTxEntryEvent)

Example 8 with DistTxEntryEvent

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);
}
Also used : ArrayList(java.util.ArrayList) DistTxEntryEvent(org.apache.geode.internal.cache.tx.DistTxEntryEvent) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Example 9 with DistTxEntryEvent

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));
}
Also used : DistTxEntryEvent(org.apache.geode.internal.cache.tx.DistTxEntryEvent)

Example 10 with DistTxEntryEvent

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);
}
Also used : DistTxEntryEvent(org.apache.geode.internal.cache.tx.DistTxEntryEvent)

Aggregations

DistTxEntryEvent (org.apache.geode.internal.cache.tx.DistTxEntryEvent)15 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 InvalidDeltaException (org.apache.geode.InvalidDeltaException)1 CacheWriterException (org.apache.geode.cache.CacheWriterException)1 DistributedMember (org.apache.geode.distributed.DistributedMember)1 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)1 DistTxKeyInfo (org.apache.geode.internal.cache.tx.DistTxKeyInfo)1 UnitTest (org.apache.geode.test.junit.categories.UnitTest)1 Test (org.junit.Test)1