This is an automated email from the ASF dual-hosted git repository. av pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push: new 69f052e83f0 IGNITE-21093 remove MvccMessage (#11144) 69f052e83f0 is described below commit 69f052e83f0d3098f21e0452df14f31ff0f3cb08 Author: Julia Bakulina <96814257+j-bak...@users.noreply.github.com> AuthorDate: Fri Dec 29 15:07:46 2023 +0300 IGNITE-21093 remove MvccMessage (#11144) --- .../java/org/apache/ignite/internal/GridTopic.java | 3 - .../managers/communication/GridIoManager.java | 13 - .../communication/GridIoMessageFactory.java | 22 -- .../cache/mvcc/msg/MvccAckRequestQueryCntr.java | 130 -------- .../cache/mvcc/msg/MvccAckRequestQueryId.java | 130 -------- .../cache/mvcc/msg/MvccAckRequestTx.java | 210 ------------- .../mvcc/msg/MvccAckRequestTxAndQueryCntr.java | 123 -------- .../cache/mvcc/msg/MvccAckRequestTxAndQueryId.java | 123 -------- .../cache/mvcc/msg/MvccActiveQueriesMessage.java | 132 --------- .../cache/mvcc/msg/MvccFutureResponse.java | 130 -------- .../processors/cache/mvcc/msg/MvccMessage.java | 35 --- .../cache/mvcc/msg/MvccQuerySnapshotRequest.java | 130 -------- .../mvcc/msg/MvccRecoveryFinishedMessage.java | 116 -------- .../cache/mvcc/msg/MvccSnapshotResponse.java | 326 --------------------- .../cache/mvcc/msg/MvccTxSnapshotRequest.java | 130 -------- .../main/resources/META-INF/classnames.properties | 12 - .../GridTransactionsSystemUserTimeMetricsTest.java | 3 +- 17 files changed, 1 insertion(+), 1767 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java index 7cc43e3f1a3..eab5c01c28c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java @@ -139,9 +139,6 @@ public enum GridTopic { /** */ TOPIC_EXCHANGE, - /** */ - TOPIC_CACHE_COORDINATOR, - /** */ TOPIC_GEN_ENC_KEY, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java index 7a0bfeab391..7327837d2e4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java @@ -93,7 +93,6 @@ import org.apache.ignite.internal.managers.deployment.GridDeployment; import org.apache.ignite.internal.managers.discovery.CustomEventListener; import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager; import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccMessage; import org.apache.ignite.internal.processors.cache.persistence.file.FileIO; import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIO; @@ -147,7 +146,6 @@ import org.jetbrains.annotations.Nullable; import static org.apache.ignite.events.EventType.EVT_NODE_FAILED; import static org.apache.ignite.events.EventType.EVT_NODE_JOINED; import static org.apache.ignite.events.EventType.EVT_NODE_LEFT; -import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE_COORDINATOR; import static org.apache.ignite.internal.GridTopic.TOPIC_COMM_SYSTEM; import static org.apache.ignite.internal.GridTopic.TOPIC_COMM_USER; import static org.apache.ignite.internal.GridTopic.TOPIC_IO_TEST; @@ -1443,17 +1441,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa return; } - if (msg.topicOrdinal() == TOPIC_CACHE_COORDINATOR.ordinal()) { - MvccMessage msg0 = (MvccMessage)msg.message(); - - // see IGNITE-8609 - /*if (msg0.processedFromNioThread()) - c.run(); - else*/ - ctx.pools().getStripedExecutorService().execute(-1, c); - - return; - } final int part = msg.partition(); // Store partition to avoid possible recalculation. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java index e5e7ca0efa3..0a2eb4bda98 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java @@ -123,17 +123,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxQu import org.apache.ignite.internal.processors.cache.distributed.near.GridNearUnlockRequest; import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotWithoutTxs; import org.apache.ignite.internal.processors.cache.mvcc.MvccVersionImpl; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestQueryCntr; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestQueryId; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTx; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTxAndQueryCntr; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTxAndQueryId; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccActiveQueriesMessage; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccFutureResponse; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccQuerySnapshotRequest; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccRecoveryFinishedMessage; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccSnapshotResponse; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccTxSnapshotRequest; import org.apache.ignite.internal.processors.cache.persistence.snapshot.IncrementalSnapshotAwareMessage; import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotFilesFailureMessage; import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotFilesRequestMessage; @@ -339,19 +328,9 @@ public class GridIoMessageFactory implements MessageFactoryProvider { factory.register((short)133, ClusterMetricsUpdateMessage::new); factory.register((short)134, ContinuousRoutineStartResultMessage::new); factory.register((short)135, LatchAckMessage::new); - factory.register((short)136, MvccTxSnapshotRequest::new); - factory.register((short)137, MvccAckRequestTx::new); - factory.register((short)138, MvccFutureResponse::new); - factory.register((short)139, MvccQuerySnapshotRequest::new); - factory.register((short)140, MvccAckRequestQueryCntr::new); - factory.register((short)141, MvccSnapshotResponse::new); factory.register((short)143, GridCacheMvccEntryInfo::new); factory.register((short)144, GridDhtTxQueryEnlistResponse::new); - factory.register((short)145, MvccAckRequestQueryId::new); - factory.register((short)146, MvccAckRequestTxAndQueryCntr::new); - factory.register((short)147, MvccAckRequestTxAndQueryId::new); factory.register((short)148, MvccVersionImpl::new); - factory.register((short)149, MvccActiveQueriesMessage::new); factory.register((short)150, MvccSnapshotWithoutTxs::new); factory.register((short)151, GridNearTxQueryEnlistRequest::new); factory.register((short)152, GridNearTxQueryEnlistResponse::new); @@ -366,7 +345,6 @@ public class GridIoMessageFactory implements MessageFactoryProvider { factory.register((short)161, GridInvokeValue::new); factory.register((short)162, GenerateEncryptionKeyRequest::new); factory.register((short)163, GenerateEncryptionKeyResponse::new); - factory.register((short)164, MvccRecoveryFinishedMessage::new); factory.register((short)167, ServiceDeploymentProcessId::new); factory.register((short)168, ServiceSingleNodeDeploymentResultBatch::new); factory.register((short)169, ServiceSingleNodeDeploymentResult::new); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryCntr.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryCntr.java deleted file mode 100644 index 0156c535f5b..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryCntr.java +++ /dev/null @@ -1,130 +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.managers.communication.GridIoMessageFactory; -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 MvccAckRequestQueryCntr implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long cntr; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccAckRequestQueryCntr() { - // No-op. - } - - /** - * @param cntr Query counter. - */ - public MvccAckRequestQueryCntr(long cntr) { - this.cntr = cntr; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** - * @return Counter. - */ - public long counter() { - return cntr; - } - - /** {@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("cntr", cntr)) - 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: - cntr = reader.readLong("cntr"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccAckRequestQueryCntr.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 140; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccAckRequestQueryCntr.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryId.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryId.java deleted file mode 100644 index 7771f4d5791..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestQueryId.java +++ /dev/null @@ -1,130 +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.managers.communication.GridIoMessageFactory; -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 MvccAckRequestQueryId implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long qryTrackerId; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccAckRequestQueryId() { - // No-op. - } - - /** - * @param qryTrackerId Query tracker Id. - */ - public MvccAckRequestQueryId(long qryTrackerId) { - this.qryTrackerId = qryTrackerId; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** - * @return Query tracker id. - */ - public long queryTrackerId() { - return qryTrackerId; - } - - /** {@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("qryTrackerId", qryTrackerId)) - 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: - qryTrackerId = reader.readLong("qryTrackerId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccAckRequestQueryId.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 145; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccAckRequestQueryId.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTx.java deleted file mode 100644 index 69dfd254c73..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTx.java +++ /dev/null @@ -1,210 +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.managers.communication.GridIoMessageFactory; -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; - -import static org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker.MVCC_TRACKER_ID_NA; -import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_COUNTER_NA; - -/** - * - */ -public class MvccAckRequestTx implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private static final int SKIP_RESPONSE_FLAG_MASK = 0x01; - - /** */ - private long futId; - - /** */ - private long txCntr; - - /** */ - private byte flags; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccAckRequestTx() { - // No-op. - } - - /** - * @param futId Future ID. - * @param txCntr Counter assigned to transaction. - */ - public MvccAckRequestTx(long futId, long txCntr) { - this.futId = futId; - this.txCntr = txCntr; - } - - /** - * @return Query counter. - */ - public long queryCounter() { - return MVCC_COUNTER_NA; - } - - /** - * @return Query tracker id. - */ - public long queryTrackerId() { - return MVCC_TRACKER_ID_NA; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** - * @return {@code True} if response message is not needed. - */ - public boolean skipResponse() { - return (flags & SKIP_RESPONSE_FLAG_MASK) != 0; - } - - /** - * @param val {@code True} if response message is not needed. - */ - public void skipResponse(boolean val) { - if (val) - flags |= SKIP_RESPONSE_FLAG_MASK; - else - flags &= ~SKIP_RESPONSE_FLAG_MASK; - } - - /** - * @return Counter assigned tp transaction. - */ - public long txCounter() { - return txCntr; - } - - /** {@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.writeByte("flags", flags)) - return false; - - writer.incrementState(); - - case 1: - if (!writer.writeLong("futId", futId)) - return false; - - writer.incrementState(); - - case 2: - if (!writer.writeLong("txCntr", txCntr)) - 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: - flags = reader.readByte("flags"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 1: - futId = reader.readLong("futId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 2: - txCntr = reader.readLong("txCntr"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccAckRequestTx.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 137; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccAckRequestTx.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryCntr.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryCntr.java deleted file mode 100644 index 99761c3f72d..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryCntr.java +++ /dev/null @@ -1,123 +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.managers.communication.GridIoMessageFactory; -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 MvccAckRequestTxAndQueryCntr extends MvccAckRequestTx { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long qryCntr; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccAckRequestTxAndQueryCntr() { - // No-op. - } - - /** - * @param futId Future ID. - * @param txCntr Counter assigned to transaction update. - * @param qryCntr Counter assigned for transaction reads. - */ - public MvccAckRequestTxAndQueryCntr(long futId, long txCntr, long qryCntr) { - super(futId, txCntr); - - this.qryCntr = qryCntr; - } - - /** {@inheritDoc} */ - @Override public long queryCounter() { - return qryCntr; - } - - /** {@inheritDoc} */ - @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { - writer.setBuffer(buf); - - if (!super.writeTo(buf, writer)) - return false; - - if (!writer.isHeaderWritten()) { - if (!writer.writeHeader(directType(), fieldsCount())) - return false; - - writer.onHeaderWritten(); - } - - switch (writer.state()) { - case 3: - if (!writer.writeLong("qryCntr", qryCntr)) - return false; - - writer.incrementState(); - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { - reader.setBuffer(buf); - - if (!reader.beforeMessageRead()) - return false; - - if (!super.readFrom(buf, reader)) - return false; - - switch (reader.state()) { - case 3: - qryCntr = reader.readLong("qryCntr"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccAckRequestTxAndQueryCntr.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 146; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 4; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccAckRequestTxAndQueryCntr.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryId.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryId.java deleted file mode 100644 index f3b3150480a..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccAckRequestTxAndQueryId.java +++ /dev/null @@ -1,123 +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.managers.communication.GridIoMessageFactory; -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 MvccAckRequestTxAndQueryId extends MvccAckRequestTx { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long qryTrackerId; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccAckRequestTxAndQueryId() { - // No-op. - } - - /** - * @param futId Future ID. - * @param txCntr Counter assigned to transaction update. - * @param qryTrackerId Query tracker id. - */ - public MvccAckRequestTxAndQueryId(long futId, long txCntr, long qryTrackerId) { - super(futId, txCntr); - - this.qryTrackerId = qryTrackerId; - } - - /** {@inheritDoc} */ - @Override public long queryTrackerId() { - return qryTrackerId; - } - - /** {@inheritDoc} */ - @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { - writer.setBuffer(buf); - - if (!super.writeTo(buf, writer)) - return false; - - if (!writer.isHeaderWritten()) { - if (!writer.writeHeader(directType(), fieldsCount())) - return false; - - writer.onHeaderWritten(); - } - - switch (writer.state()) { - case 3: - if (!writer.writeLong("qryTrackerId", qryTrackerId)) - return false; - - writer.incrementState(); - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) { - reader.setBuffer(buf); - - if (!reader.beforeMessageRead()) - return false; - - if (!super.readFrom(buf, reader)) - return false; - - switch (reader.state()) { - case 3: - qryTrackerId = reader.readLong("qryTrackerId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccAckRequestTxAndQueryId.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 147; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 4; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccAckRequestTxAndQueryId.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccActiveQueriesMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccActiveQueriesMessage.java deleted file mode 100644 index 4b78c24585f..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccActiveQueriesMessage.java +++ /dev/null @@ -1,132 +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.managers.communication.GridIoMessageFactory; -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; -import org.jetbrains.annotations.Nullable; - -/** - * - */ -public class MvccActiveQueriesMessage implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private GridLongList activeQrys; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccActiveQueriesMessage() { - // No-op. - } - - /** - * @param activeQrys Active queries. - */ - public MvccActiveQueriesMessage(GridLongList activeQrys) { - this.activeQrys = activeQrys; - } - - /** - * @return Active queries. - */ - @Nullable public GridLongList activeQueries() { - return activeQrys; - } - - /** {@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.writeMessage("activeQrys", activeQrys)) - 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: - activeQrys = reader.readMessage("activeQrys"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccActiveQueriesMessage.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 149; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccActiveQueriesMessage.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccFutureResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccFutureResponse.java deleted file mode 100644 index 72e4c52061d..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccFutureResponse.java +++ /dev/null @@ -1,130 +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.managers.communication.GridIoMessageFactory; -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 MvccFutureResponse implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long futId; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccFutureResponse() { - // No-op. - } - - /** - * @param futId Future ID. - */ - public MvccFutureResponse(long futId) { - this.futId = futId; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return false; - } - - /** {@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(); - - } - - 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(); - - } - - return reader.afterMessageRead(MvccFutureResponse.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 138; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccFutureResponse.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccMessage.java deleted file mode 100644 index 6d8b3c40425..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccMessage.java +++ /dev/null @@ -1,35 +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 org.apache.ignite.plugin.extensions.communication.Message; - -/** - * Common interface for all MVCC-related messages. - */ -public interface MvccMessage extends Message { - /** - * @return {@code True} if should wait for coordinator initialization. - */ - public boolean waitForCoordinatorInit(); - - /** - * @return {@code True} if message should be processed from NIO thread. - */ - public boolean processedFromNioThread(); -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccQuerySnapshotRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccQuerySnapshotRequest.java deleted file mode 100644 index 75d33a7213c..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccQuerySnapshotRequest.java +++ /dev/null @@ -1,130 +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.managers.communication.GridIoMessageFactory; -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; - -/** - * Request to get MVCC snapshot for a query. - */ -public class MvccQuerySnapshotRequest implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long futId; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccQuerySnapshotRequest() { - // No-op. - } - - /** - * @param futId Future ID. - */ - public MvccQuerySnapshotRequest(long futId) { - this.futId = futId; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return true; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** {@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(); - - } - - 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(); - - } - - return reader.afterMessageRead(MvccQuerySnapshotRequest.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 139; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccQuerySnapshotRequest.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccRecoveryFinishedMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccRecoveryFinishedMessage.java deleted file mode 100644 index a4ea103c3e4..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccRecoveryFinishedMessage.java +++ /dev/null @@ -1,116 +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 java.util.UUID; -import org.apache.ignite.plugin.extensions.communication.MessageReader; -import org.apache.ignite.plugin.extensions.communication.MessageWriter; - -/** */ -public class MvccRecoveryFinishedMessage implements MvccMessage { - /** */ - private static final long serialVersionUID = -505062368078979867L; - - /** */ - private UUID nearNodeId; - - /** */ - public MvccRecoveryFinishedMessage() { - } - - /** */ - public MvccRecoveryFinishedMessage(UUID nearNodeId) { - this.nearNodeId = nearNodeId; - } - - /** - * @return Left node id for which transactions were recovered. - */ - public UUID nearNodeId() { - return nearNodeId; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return false; - } - - /** {@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.writeUuid("nearNodeId", nearNodeId)) - 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: - nearNodeId = reader.readUuid("nearNodeId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccRecoveryFinishedMessage.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 164; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccSnapshotResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccSnapshotResponse.java deleted file mode 100644 index 73d3f948398..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccSnapshotResponse.java +++ /dev/null @@ -1,326 +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 java.util.Arrays; -import org.apache.ignite.internal.GridDirectTransient; -import org.apache.ignite.internal.IgniteCodeGeneratingFail; -import org.apache.ignite.internal.managers.communication.GridIoMessageFactory; -import org.apache.ignite.internal.processors.cache.mvcc.MvccLongList; -import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot; -import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotWithoutTxs; -import org.apache.ignite.internal.util.tostring.GridToStringExclude; -import org.apache.ignite.internal.util.tostring.GridToStringInclude; -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; - -/** - * - */ -@IgniteCodeGeneratingFail -public class MvccSnapshotResponse implements MvccMessage, MvccSnapshot, MvccLongList { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long futId; - - /** */ - private long crdVer; - - /** */ - private long cntr; - - /** */ - private int opCntr; - - /** */ - @GridDirectTransient - @GridToStringExclude - private int txsCnt; - - /** */ - @GridToStringInclude - private long[] txs; - - /** */ - private long cleanupVer; - - /** */ - @GridDirectTransient - private long tracking; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccSnapshotResponse() { - // No-op. - } - - /** - * @param futId Future ID. - * @param crdVer Coordinator version. - * @param cntr Counter. - * @param opCntr Operation counter. - * @param cleanupVer Cleanup version. - * @param tracking Tracking number. - */ - public void init(long futId, long crdVer, long cntr, int opCntr, long cleanupVer, long tracking) { - this.futId = futId; - this.crdVer = crdVer; - this.cntr = cntr; - this.opCntr = opCntr; - this.cleanupVer = cleanupVer; - this.tracking = tracking; - - if (txsCnt > 0 && txs.length > txsCnt) // truncate if necessary - txs = Arrays.copyOf(txs, txsCnt); - } - - /** - * @param txId Transaction counter. - */ - public void addTx(long txId) { - if (txs == null) - txs = new long[4]; - else if (txs.length == txsCnt) - txs = Arrays.copyOf(txs, txs.length << 1); - - txs[txsCnt++] = txId; - } - - /** {@inheritDoc} */ - @Override public int size() { - return txsCnt; - } - - /** {@inheritDoc} */ - @Override public long get(int i) { - return txs[i]; - } - - /** {@inheritDoc} */ - @Override public boolean contains(long val) { - for (int i = 0; i < txsCnt; i++) { - if (txs[i] == val) - return true; - } - - return false; - } - - /** - * @return Tracking counter. - */ - public long tracking() { - return tracking; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return false; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return false; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** {@inheritDoc} */ - @Override public long cleanupVersion() { - return cleanupVer; - } - - /** {@inheritDoc} */ - @Override public long counter() { - return cntr; - } - - /** {@inheritDoc} */ - @Override public int operationCounter() { - return opCntr; - } - - /** {@inheritDoc} */ - @Override public void incrementOperationCounter() { - opCntr++; - } - - /** {@inheritDoc} */ - @Override public MvccLongList activeTransactions() { - return this; - } - - /** {@inheritDoc} */ - @Override public MvccSnapshot withoutActiveTransactions() { - if (txsCnt > 0) - return new MvccSnapshotWithoutTxs(crdVer, cntr, opCntr, cleanupVer); - - return this; - } - - /** {@inheritDoc} */ - @Override public long coordinatorVersion() { - return crdVer; - } - - /** {@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("cleanupVer", cleanupVer)) - return false; - - writer.incrementState(); - - case 1: - if (!writer.writeLong("cntr", cntr)) - return false; - - writer.incrementState(); - - case 2: - if (!writer.writeLong("crdVer", crdVer)) - return false; - - writer.incrementState(); - - case 3: - if (!writer.writeLong("futId", futId)) - return false; - - writer.incrementState(); - - case 4: - if (!writer.writeInt("opCntr", opCntr)) - return false; - - writer.incrementState(); - - case 5: - if (!writer.writeLongArray("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: - cleanupVer = reader.readLong("cleanupVer"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 1: - cntr = reader.readLong("cntr"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 2: - crdVer = reader.readLong("crdVer"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 3: - futId = reader.readLong("futId"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 4: - opCntr = reader.readInt("opCntr"); - - if (!reader.isLastRead()) - return false; - - reader.incrementState(); - - case 5: - txs = reader.readLongArray("txs"); - - if (!reader.isLastRead()) - return false; - - txsCnt = txs != null ? txs.length : 0; - - reader.incrementState(); - - } - - return reader.afterMessageRead(MvccSnapshotResponse.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 141; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 6; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccSnapshotResponse.class, this); - } -} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccTxSnapshotRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccTxSnapshotRequest.java deleted file mode 100644 index 4cf6f65a44d..00000000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/msg/MvccTxSnapshotRequest.java +++ /dev/null @@ -1,130 +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.managers.communication.GridIoMessageFactory; -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; - -/** - * Request to get MVCC snapshot for a new transaction. - */ -public class MvccTxSnapshotRequest implements MvccMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long futId; - - /** - * Required by {@link GridIoMessageFactory}. - */ - public MvccTxSnapshotRequest() { - // No-op. - } - - /** - * @param futId Future ID. - */ - public MvccTxSnapshotRequest(long futId) { - this.futId = futId; - } - - /** {@inheritDoc} */ - @Override public boolean waitForCoordinatorInit() { - return true; - } - - /** {@inheritDoc} */ - @Override public boolean processedFromNioThread() { - return true; - } - - /** - * @return Future ID. - */ - public long futureId() { - return futId; - } - - /** {@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(); - - } - - 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(); - - } - - return reader.afterMessageRead(MvccTxSnapshotRequest.class); - } - - /** {@inheritDoc} */ - @Override public short directType() { - return 136; - } - - /** {@inheritDoc} */ - @Override public byte fieldsCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override public void onAckReceived() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(MvccTxSnapshotRequest.class, this); - } -} diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index 78ac4c94350..8ce87810e04 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -1148,18 +1148,6 @@ org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotWithoutTxs org.apache.ignite.internal.processors.cache.mvcc.MvccVersionImpl org.apache.ignite.internal.processors.cache.mvcc.ProbedTx org.apache.ignite.internal.processors.cache.mvcc.VacuumMetricsReducer -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestQueryCntr -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestQueryId -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTx -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTxAndQueryCntr -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccAckRequestTxAndQueryId -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccActiveQueriesMessage -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccFutureResponse -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccMessage -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccQuerySnapshotRequest -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccRecoveryFinishedMessage -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccSnapshotResponse -org.apache.ignite.internal.processors.cache.mvcc.msg.MvccTxSnapshotRequest org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter$RowData org.apache.ignite.internal.processors.cache.persistence.CheckpointState org.apache.ignite.internal.processors.cache.persistence.CorruptedDataStructureException diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java index 0b9994d449e..495e926e75f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java @@ -42,7 +42,6 @@ import org.apache.ignite.internal.TransactionsMXBeanImpl; import org.apache.ignite.internal.managers.communication.GridIoMessage; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareRequest; -import org.apache.ignite.internal.processors.cache.mvcc.msg.MvccTxSnapshotRequest; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.mxbean.TransactionsMXBean; @@ -772,7 +771,7 @@ public class GridTransactionsSystemUserTimeMetricsTest extends GridCommonAbstrac if (msg instanceof GridIoMessage) { Object msg0 = ((GridIoMessage)msg).message(); - if (msg0 instanceof GridNearLockRequest || msg0 instanceof MvccTxSnapshotRequest) { + if (msg0 instanceof GridNearLockRequest) { if (slowSystem) { slowSystem = false;