Repository: ignite Updated Branches: refs/heads/ignite-10537 [created] 3a8b66f31
http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java index 52fb1db..123ddf1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/StaticMvccQueryTracker.java @@ -80,11 +80,6 @@ public class StaticMvccQueryTracker implements MvccQueryTracker { } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Void> onDone(@NotNull GridNearTxLocal tx, boolean commit) { - throw new UnsupportedOperationException("Operation is not supported."); - } - - /** {@inheritDoc} */ @Override public long onMvccCoordinatorChange(MvccCoordinator newCrd) { return MVCC_TRACKER_ID_NA; } http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccWaitTxsRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccWaitTxsRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccWaitTxsRequest.java deleted file mode 100644 index 5c6d4aa..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccWaitTxsRequest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.mvcc.msg; - -import java.nio.ByteBuffer; - -import org.apache.ignite.internal.util.GridLongList; -import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.plugin.extensions.communication.MessageReader; -import org.apache.ignite.plugin.extensions.communication.MessageWriter; - -/** - * - */ -public class MvccWaitTxsRequest implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long futId; - - /** */ - private GridLongList txs; - - /** - * - */ - public MvccWaitTxsRequest() { - // No-op. - } - - /** - * @param futId Future ID. - * @param txs Transactions to wait for. - */ - public MvccWaitTxsRequest(long futId, GridLongList txs) { - assert txs != null && !txs.isEmpty() : txs; - - this.futId = futId; - this.txs = txs; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** - * @return Transactions to wait for. - */ - public GridLongList transactions() { - return txs; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** {@inheritDoc} */ - @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { - writer.setBuffer(buf); - - if (!writer.isHeaderWritten()) { - if (!writer.writeHeader(directType(), fieldsCount())) - return false; - - writer.onHeaderWritten(); - } - - switch (writer.state()) { - case 0: - if (!writer.writeLong("futId", futId)) - return false; - - writer.incrementState(); - - case 1: - if (!writer.writeMessage("txs", txs)) - return false; - - writer.incrementState(); - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { - reader.setBuffer(buf); - - if (!reader.beforeMessageRead()) - return false; - - switch (reader.state()) { - case 0: - futId = reader.readLong("futId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 1: - txs = reader.readMessage("txs"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccWaitTxsRequest.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 142; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 2; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccWaitTxsRequest.class, this); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java index 47a0276..5f44606 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java @@ -17,8 +17,6 @@ package org.apache.ignite.internal.processors.cache.transactions; -import javax.cache.expiry.ExpiryPolicy; -import javax.cache.processor.EntryProcessor; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -39,6 +37,8 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; +import javax.cache.expiry.ExpiryPolicy; +import javax.cache.processor.EntryProcessor; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; @@ -1659,8 +1659,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter implement /*closure name */recordEvt ? F.first(txEntry.entryProcessors()).get1() : null, resolveTaskName(), null, - keepBinary, - null); // TODO IGNITE-7371 + keepBinary); } boolean modified = false; http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java index 319073b..ab7fdd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java @@ -1789,8 +1789,7 @@ public class IgniteTxHandler { /*transformClo*/null, tx.resolveTaskName(), /*expiryPlc*/null, - /*keepBinary*/true, - null); // TODO IGNITE-7371 + /*keepBinary*/true); if (val == null) val = cacheCtx.toCacheObject(cacheCtx.store().load(null, entry.key())); http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java index df43615..b1e2731 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java @@ -68,7 +68,6 @@ import org.apache.ignite.internal.processors.dr.GridDrType; import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException; import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException; import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException; -import org.apache.ignite.internal.util.GridLongList; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.lang.GridTuple; @@ -157,9 +156,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig protected CacheWriteSynchronizationMode syncMode; /** */ - private GridLongList mvccWaitTxs; - - /** */ private volatile boolean qryEnlisted; /** Whether to skip update of completed versions map during rollback caused by empty update set in MVCC TX. */ @@ -225,10 +221,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig txState = implicitSingle ? new IgniteTxImplicitSingleStateImpl() : new IgniteTxStateImpl(); } - public GridLongList mvccWaitTransactions() { - return mvccWaitTxs; - } - /** * @return Transaction write synchronization mode. */ @@ -576,8 +568,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig cctx.tm().addCommittedTx(this); if (!empty) { - assert mvccWaitTxs == null; - batchStoreCommit(writeEntries()); WALPointer ptr = null; @@ -750,17 +740,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig CU.subjectId(this, cctx), resolveTaskName(), dhtVer, - null, - mvccSnapshot()); + null); - if (updRes.success()) { + if (updRes.success()) txEntry.updateCounter(updRes.updateCounter()); - GridLongList waitTxs = updRes.mvccWaitTransactions(); - - updateWaitTxs(waitTxs); - } - if (updRes.loggedPointer() != null) ptr = updRes.loggedPointer(); @@ -790,8 +774,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig CU.subjectId(this, cctx), resolveTaskName(), dhtVer0, - null, - mvccSnapshot()) + null) ); } } @@ -813,17 +796,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig CU.subjectId(this, cctx), resolveTaskName(), dhtVer, - null, - mvccSnapshot()); + null); - if (updRes.success()) { + if (updRes.success()) txEntry.updateCounter(updRes.updateCounter()); - GridLongList waitTxs = updRes.mvccWaitTransactions(); - - updateWaitTxs(waitTxs); - } - if (updRes.loggedPointer() != null) ptr = updRes.loggedPointer(); @@ -848,8 +825,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig CU.subjectId(this, cctx), resolveTaskName(), dhtVer0, - null, - mvccSnapshot()) + null) ); } } @@ -982,18 +958,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig } /** - * @param waitTxs Tx ids to wait for. - */ - private void updateWaitTxs(@Nullable GridLongList waitTxs) { - if (waitTxs != null) { - if (this.mvccWaitTxs == null) - this.mvccWaitTxs = waitTxs; - else - this.mvccWaitTxs.addAll(waitTxs); - } - } - - /** * Safely performs {@code updateClojure} operation on near cache entry with given {@code entryKey}. * In case of {@link GridCacheEntryRemovedException} operation will be retried. * @@ -1237,8 +1201,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig null, resolveTaskName(), null, - txEntry.keepBinary(), - null); // TODO IGNITE-7371 + txEntry.keepBinary()); } } else { http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java index 6fb200d..a4cdfda 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java @@ -408,8 +408,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr Object transformClo, String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, - boolean keepBinary, - MvccSnapshot mvccVer) { + boolean keepBinary) { return val; } @@ -426,7 +425,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, - MvccSnapshot mvccVer, @Nullable ReaderArguments args) throws IgniteCheckedException, GridCacheEntryRemovedException { assert false; @@ -444,7 +442,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr String taskName, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean keepBinary, - MvccSnapshot mvccVer, @Nullable ReaderArguments readerArgs) { assert false; @@ -477,8 +474,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr UUID subjId, String taskName, @Nullable GridCacheVersion dhtVer, - @Nullable Long updateCntr, - MvccSnapshot mvccVer + @Nullable Long updateCntr ) throws IgniteCheckedException, GridCacheEntryRemovedException { @@ -592,9 +588,8 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr UUID subjId, String taskName, @Nullable GridCacheVersion dhtVer, - @Nullable Long updateCntr, - MvccSnapshot mvccVer - ) throws IgniteCheckedException, GridCacheEntryRemovedException { + @Nullable Long updateCntr + ) throws IgniteCheckedException, GridCacheEntryRemovedException { obsoleteVer = ver; val = null; http://git-wip-us.apache.org/repos/asf/ignite/blob/7301ada3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java index a6100d8..4751d86 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java @@ -115,7 +115,8 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA */ public abstract class CacheMvccAbstractTest extends GridCommonAbstractTest { /** */ - private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); + private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true) + .setAddresses(Collections.singleton("127.0.0.1:47500")); /** */ protected static final ObjectCodec<Integer> INTEGER_CODEC = new IntegerCodec();
