You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vk...@apache.org on 2015/02/02 04:28:37 UTC
[45/52] [abbrv] incubator-ignite git commit: Merge branch 'sprint-1'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
index 0000000,40c9479..2047adb
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
@@@ -1,0 -1,445 +1,435 @@@
+ /*
+ * 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.managers.communication;
+
+ import org.apache.ignite.configuration.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.lang.*;
+ import org.apache.ignite.internal.managers.deployment.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+ import org.apache.ignite.internal.util.tostring.*;
+ import org.jetbrains.annotations.*;
+
+ import java.io.*;
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * User message wrapper.
+ */
+ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Message body. */
+ @GridDirectTransient
+ private Object body;
+
+ /** Serialized message body. */
+ private byte[] bodyBytes;
+
+ /** Class loader ID. */
+ private IgniteUuid clsLdrId;
+
+ /** Message topic. */
+ @GridDirectTransient
+ private Object topic;
+
+ /** Serialized message topic. */
+ private byte[] topicBytes;
+
+ /** Deployment mode. */
+ private IgniteDeploymentMode depMode;
+
+ /** Deployment class name. */
+ private String depClsName;
+
+ /** User version. */
+ private String userVer;
+
+ /** Node class loader participants. */
+ @GridToStringInclude
+ @GridDirectMap(keyType = UUID.class, valueType = IgniteUuid.class)
+ private Map<UUID, IgniteUuid> ldrParties;
+
+ /** Message deployment. */
+ @GridDirectTransient
+ private GridDeployment dep;
+
+ /**
+ * @param body Message body.
+ * @param bodyBytes Serialized message body.
+ * @param depClsName Message body class name.
+ * @param topic Message topic.
+ * @param topicBytes Serialized message topic bytes.
+ * @param clsLdrId Class loader ID.
+ * @param depMode Deployment mode.
+ * @param userVer User version.
+ * @param ldrParties Node loader participant map.
+ */
+ GridIoUserMessage(
+ Object body,
+ @Nullable byte[] bodyBytes,
+ @Nullable String depClsName,
+ @Nullable Object topic,
+ @Nullable byte[] topicBytes,
+ @Nullable IgniteUuid clsLdrId,
+ @Nullable IgniteDeploymentMode depMode,
+ @Nullable String userVer,
+ @Nullable Map<UUID, IgniteUuid> ldrParties) {
+ this.body = body;
+ this.bodyBytes = bodyBytes;
+ this.depClsName = depClsName;
+ this.topic = topic;
+ this.topicBytes = topicBytes;
+ this.depMode = depMode;
+ this.clsLdrId = clsLdrId;
+ this.userVer = userVer;
+ this.ldrParties = ldrParties;
+ }
+
+ /**
+ * Default constructor, required for {@link Externalizable}.
+ */
+ public GridIoUserMessage() {
+ // No-op.
+ }
+
+ /**
+ * @return Serialized message body.
+ */
+ @Nullable public byte[] bodyBytes() {
+ return bodyBytes;
+ }
+
+ /**
+ * @return the Class loader ID.
+ */
+ @Nullable public IgniteUuid classLoaderId() {
+ return clsLdrId;
+ }
+
+ /**
+ * @return Deployment mode.
+ */
+ @Nullable public IgniteDeploymentMode deploymentMode() {
+ return depMode;
+ }
+
+ /**
+ * @return Message body class name.
+ */
+ @Nullable public String deploymentClassName() {
+ return depClsName;
+ }
+
+ /**
+ * @return User version.
+ */
+ @Nullable public String userVersion() {
+ return userVer;
+ }
+
+ /**
+ * @return Node class loader participant map.
+ */
+ @Nullable public Map<UUID, IgniteUuid> loaderParticipants() {
+ return ldrParties != null ? Collections.unmodifiableMap(ldrParties) : null;
+ }
+
+ /**
+ * @return Serialized message topic.
+ */
+ @Nullable public byte[] topicBytes() {
+ return topicBytes;
+ }
+
+ /**
+ * @param topic New message topic.
+ */
+ public void topic(Object topic) {
+ this.topic = topic;
+ }
+
+ /**
+ * @return Message topic.
+ */
+ @Nullable public Object topic() {
+ return topic;
+ }
+
+ /**
+ * @param body New message body.
+ */
+ public void body(Object body) {
+ this.body = body;
+ }
+
+ /**
+ * @return Message body.
+ */
+ @Nullable public Object body() {
+ return body;
+ }
+
+ /**
+ * @param dep New message deployment.
+ */
+ public void deployment(GridDeployment dep) {
+ this.dep = dep;
+ }
+
+ /**
+ * @return Message deployment.
+ */
+ @Nullable public GridDeployment deployment() {
+ return dep;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridIoUserMessage _clone = new GridIoUserMessage();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ GridIoUserMessage _clone = (GridIoUserMessage)_msg;
+
+ _clone.body = body;
+ _clone.bodyBytes = bodyBytes;
+ _clone.clsLdrId = clsLdrId;
+ _clone.topic = topic;
+ _clone.topicBytes = topicBytes;
+ _clone.depMode = depMode;
+ _clone.depClsName = depClsName;
+ _clone.userVer = userVer;
+ _clone.ldrParties = ldrParties;
+ _clone.dep = dep;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 0:
- if (!commState.putByteArray(bodyBytes))
++ if (!commState.putByteArray("bodyBytes", bodyBytes))
+ return false;
+
+ commState.idx++;
+
+ case 1:
- if (!commState.putGridUuid(clsLdrId))
++ if (!commState.putGridUuid("clsLdrId", clsLdrId))
+ return false;
+
+ commState.idx++;
+
+ case 2:
- if (!commState.putString(depClsName))
++ if (!commState.putString("depClsName", depClsName))
+ return false;
+
+ commState.idx++;
+
+ case 3:
- if (!commState.putEnum(depMode))
++ if (!commState.putEnum("depMode", depMode))
+ return false;
+
+ commState.idx++;
+
+ case 4:
+ if (ldrParties != null) {
+ if (commState.it == null) {
- if (!commState.putInt(ldrParties.size()))
++ if (!commState.putInt(null, ldrParties.size()))
+ return false;
+
+ commState.it = ldrParties.entrySet().iterator();
+ }
+
+ while (commState.it.hasNext() || commState.cur != NULL) {
+ if (commState.cur == NULL)
+ commState.cur = commState.it.next();
+
+ Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
+
+ if (!commState.keyDone) {
- if (!commState.putUuid(e.getKey()))
++ if (!commState.putUuid(null, e.getKey()))
+ return false;
+
+ commState.keyDone = true;
+ }
+
- if (!commState.putGridUuid(e.getValue()))
++ if (!commState.putGridUuid(null, e.getValue()))
+ return false;
+
+ commState.keyDone = false;
+
+ commState.cur = NULL;
+ }
+
+ commState.it = null;
+ } else {
- if (!commState.putInt(-1))
++ if (!commState.putInt(null, -1))
+ return false;
+ }
+
+ commState.idx++;
+
+ case 5:
- if (!commState.putByteArray(topicBytes))
++ if (!commState.putByteArray("topicBytes", topicBytes))
+ return false;
+
+ commState.idx++;
+
+ case 6:
- if (!commState.putString(userVer))
++ if (!commState.putString("userVer", userVer))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ switch (commState.idx) {
+ case 0:
- byte[] bodyBytes0 = commState.getByteArray();
++ bodyBytes = commState.getByteArray("bodyBytes");
+
- if (bodyBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- bodyBytes = bodyBytes0;
-
+ commState.idx++;
+
+ case 1:
- IgniteUuid clsLdrId0 = commState.getGridUuid();
++ clsLdrId = commState.getGridUuid("clsLdrId");
+
- if (clsLdrId0 == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- clsLdrId = clsLdrId0;
-
+ commState.idx++;
+
+ case 2:
- String depClsName0 = commState.getString();
++ depClsName = commState.getString("depClsName");
+
- if (depClsName0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- depClsName = depClsName0;
-
+ commState.idx++;
+
+ case 3:
- if (buf.remaining() < 1)
- return false;
++ byte depMode0 = commState.getByte("depMode");
+
- byte depMode0 = commState.getByte();
++ if (!commState.lastRead())
++ return false;
+
+ depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
+
+ commState.idx++;
+
+ case 4:
+ if (commState.readSize == -1) {
- if (buf.remaining() < 4)
- return false;
++ commState.readSize = commState.getInt(null);
+
- commState.readSize = commState.getInt();
++ if (!commState.lastRead())
++ return false;
+ }
+
+ if (commState.readSize >= 0) {
+ if (ldrParties == null)
- ldrParties = U.newHashMap(commState.readSize);
++ ldrParties = new HashMap<>(commState.readSize, 1.0f);
+
+ for (int i = commState.readItems; i < commState.readSize; i++) {
+ if (!commState.keyDone) {
- UUID _val = commState.getUuid();
++ UUID _val = commState.getUuid(null);
+
- if (_val == UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ commState.cur = _val;
+ commState.keyDone = true;
+ }
+
- IgniteUuid _val = commState.getGridUuid();
++ IgniteUuid _val = commState.getGridUuid(null);
+
- if (_val == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ ldrParties.put((UUID)commState.cur, _val);
+
+ commState.keyDone = false;
+
+ commState.readItems++;
+ }
+ }
+
+ commState.readSize = -1;
+ commState.readItems = 0;
+ commState.cur = null;
+
+ commState.idx++;
+
+ case 5:
- byte[] topicBytes0 = commState.getByteArray();
++ topicBytes = commState.getByteArray("topicBytes");
+
- if (topicBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- topicBytes = topicBytes0;
-
+ commState.idx++;
+
+ case 6:
- String userVer0 = commState.getString();
++ userVer = commState.getString("userVer");
+
- if (userVer0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- userVer = userVer0;
-
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 9;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridIoUserMessage.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
index 0000000,d49e280..d4de347
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
@@@ -1,0 -1,359 +1,355 @@@
+ /*
+ * 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.managers.deployment;
+
+ import org.apache.ignite.configuration.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.lang.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+ import org.apache.ignite.internal.util.tostring.*;
+
+ import java.io.*;
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * Deployment info bean.
+ */
+ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter implements GridDeploymentInfo,
+ Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private IgniteUuid clsLdrId;
+
+ /** */
+ private IgniteDeploymentMode depMode;
+
+ /** */
+ private String userVer;
+
+ /** */
+ private boolean locDepOwner;
+
+ /** Node class loader participant map. */
+ @GridToStringInclude
+ @GridDirectMap(keyType = UUID.class, valueType = IgniteUuid.class)
+ private Map<UUID, IgniteUuid> participants;
+
+ /**
+ * Required by {@link Externalizable}.
+ */
+ public GridDeploymentInfoBean() {
+ /* No-op. */
+ }
+
+ /**
+ * @param clsLdrId Class loader ID.
+ * @param userVer User version.
+ * @param depMode Deployment mode.
+ * @param participants Participants.
+ * @param locDepOwner Local deployment owner flag.
+ */
+ public GridDeploymentInfoBean(IgniteUuid clsLdrId, String userVer, IgniteDeploymentMode depMode,
+ Map<UUID, IgniteUuid> participants, boolean locDepOwner) {
+ this.clsLdrId = clsLdrId;
+ this.depMode = depMode;
+ this.userVer = userVer;
+ this.participants = participants;
+ this.locDepOwner = locDepOwner;
+ }
+
+ /**
+ * @param dep Grid deployment.
+ */
+ public GridDeploymentInfoBean(GridDeploymentInfo dep) {
+ clsLdrId = dep.classLoaderId();
+ depMode = dep.deployMode();
+ userVer = dep.userVersion();
+ locDepOwner = dep.localDeploymentOwner();
+ participants = dep.participants();
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteUuid classLoaderId() {
+ return clsLdrId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteDeploymentMode deployMode() {
+ return depMode;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String userVersion() {
+ return userVer;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long sequenceNumber() {
+ return clsLdrId.localId();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean localDeploymentOwner() {
+ return locDepOwner;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<UUID, IgniteUuid> participants() {
+ return participants;
+ }
+
+ /**
+ * Sets local deployment ownership flag.
+ *
+ * @param locDepOwner Local deployment ownership flag.
+ */
+ public void localDeploymentOwner(boolean locDepOwner) {
+ this.locDepOwner = locDepOwner;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return clsLdrId.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ return o == this || o instanceof GridDeploymentInfoBean &&
+ clsLdrId.equals(((GridDeploymentInfoBean)o).clsLdrId);
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridDeploymentInfoBean _clone = new GridDeploymentInfoBean();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ GridDeploymentInfoBean _clone = (GridDeploymentInfoBean)_msg;
+
+ _clone.clsLdrId = clsLdrId;
+ _clone.depMode = depMode;
+ _clone.userVer = userVer;
+ _clone.locDepOwner = locDepOwner;
+ _clone.participants = participants;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 0:
- if (!commState.putGridUuid(clsLdrId))
++ if (!commState.putGridUuid("clsLdrId", clsLdrId))
+ return false;
+
+ commState.idx++;
+
+ case 1:
- if (!commState.putEnum(depMode))
++ if (!commState.putEnum("depMode", depMode))
+ return false;
+
+ commState.idx++;
+
+ case 2:
- if (!commState.putBoolean(locDepOwner))
++ if (!commState.putBoolean("locDepOwner", locDepOwner))
+ return false;
+
+ commState.idx++;
+
+ case 3:
+ if (participants != null) {
+ if (commState.it == null) {
- if (!commState.putInt(participants.size()))
++ if (!commState.putInt(null, participants.size()))
+ return false;
+
+ commState.it = participants.entrySet().iterator();
+ }
+
+ while (commState.it.hasNext() || commState.cur != NULL) {
+ if (commState.cur == NULL)
+ commState.cur = commState.it.next();
+
+ Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
+
+ if (!commState.keyDone) {
- if (!commState.putUuid(e.getKey()))
++ if (!commState.putUuid(null, e.getKey()))
+ return false;
+
+ commState.keyDone = true;
+ }
+
- if (!commState.putGridUuid(e.getValue()))
++ if (!commState.putGridUuid(null, e.getValue()))
+ return false;
+
+ commState.keyDone = false;
+
+ commState.cur = NULL;
+ }
+
+ commState.it = null;
+ } else {
- if (!commState.putInt(-1))
++ if (!commState.putInt(null, -1))
+ return false;
+ }
+
+ commState.idx++;
+
+ case 4:
- if (!commState.putString(userVer))
++ if (!commState.putString("userVer", userVer))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ switch (commState.idx) {
+ case 0:
- IgniteUuid clsLdrId0 = commState.getGridUuid();
++ clsLdrId = commState.getGridUuid("clsLdrId");
+
- if (clsLdrId0 == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- clsLdrId = clsLdrId0;
-
+ commState.idx++;
+
+ case 1:
- if (buf.remaining() < 1)
- return false;
++ byte depMode0 = commState.getByte("depMode");
+
- byte depMode0 = commState.getByte();
++ if (!commState.lastRead())
++ return false;
+
+ depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
+
+ commState.idx++;
+
+ case 2:
- if (buf.remaining() < 1)
- return false;
++ locDepOwner = commState.getBoolean("locDepOwner");
+
- locDepOwner = commState.getBoolean();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ case 3:
+ if (commState.readSize == -1) {
- if (buf.remaining() < 4)
- return false;
++ commState.readSize = commState.getInt(null);
+
- commState.readSize = commState.getInt();
++ if (!commState.lastRead())
++ return false;
+ }
+
+ if (commState.readSize >= 0) {
+ if (participants == null)
- participants = U.newHashMap(commState.readSize);
++ participants = new HashMap<>(commState.readSize, 1.0f);
+
+ for (int i = commState.readItems; i < commState.readSize; i++) {
+ if (!commState.keyDone) {
- UUID _val = commState.getUuid();
++ UUID _val = commState.getUuid(null);
+
- if (_val == UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ commState.cur = _val;
+ commState.keyDone = true;
+ }
+
- IgniteUuid _val = commState.getGridUuid();
++ IgniteUuid _val = commState.getGridUuid(null);
+
- if (_val == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ participants.put((UUID)commState.cur, _val);
+
+ commState.keyDone = false;
+
+ commState.readItems++;
+ }
+ }
+
+ commState.readSize = -1;
+ commState.readItems = 0;
+ commState.cur = null;
+
+ commState.idx++;
+
+ case 4:
- String userVer0 = commState.getString();
++ userVer = commState.getString("userVer");
+
- if (userVer0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- userVer = userVer0;
-
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 10;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ U.writeGridUuid(out, clsLdrId);
+ U.writeEnum(out, depMode);
+ U.writeString(out, userVer);
+ out.writeBoolean(locDepOwner);
+ U.writeMap(out, participants);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ clsLdrId = U.readGridUuid(in);
+ depMode = IgniteDeploymentMode.fromOrdinal(in.readByte());
+ userVer = U.readString(in);
+ locDepOwner = in.readBoolean();
+ participants = U.readMap(in);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridDeploymentInfoBean.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
index 0000000,177976a..c9f1c6b
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
@@@ -1,0 -1,336 +1,330 @@@
+ /*
+ * 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.managers.deployment;
+
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.lang.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+ import org.apache.ignite.internal.util.tostring.*;
+
+ import java.io.*;
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * Deployment request.
+ */
+ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Response topic. Response should be sent back to this topic. */
+ @GridDirectTransient
+ private Object resTopic;
+
+ /** Serialized topic. */
+ private byte[] resTopicBytes;
+
+ /** Requested class name. */
+ private String rsrcName;
+
+ /** Class loader ID. */
+ private IgniteUuid ldrId;
+
+ /** Undeploy flag. */
+ private boolean isUndeploy;
+
+ /** Nodes participating in request (chain). */
+ @GridToStringInclude
+ @GridDirectCollection(UUID.class)
+ private Collection<UUID> nodeIds;
+
+ /**
+ * No-op constructor to support {@link Externalizable} interface.
+ * This constructor is not meant to be used for other purposes.
+ */
+ public GridDeploymentRequest() {
+ // No-op.
+ }
+
+ /**
+ * Creates new request.
+ *
+ * @param resTopic Response topic.
+ * @param ldrId Class loader ID.
+ * @param rsrcName Resource name that should be found and sent back.
+ * @param isUndeploy Undeploy property.
+ */
+ GridDeploymentRequest(Object resTopic, IgniteUuid ldrId, String rsrcName, boolean isUndeploy) {
+ assert isUndeploy || resTopic != null;
+ assert isUndeploy || ldrId != null;
+ assert rsrcName != null;
+
+ this.resTopic = resTopic;
+ this.ldrId = ldrId;
+ this.rsrcName = rsrcName;
+ this.isUndeploy = isUndeploy;
+ }
+
+ /**
+ * Get topic response should be sent to.
+ *
+ * @return Response topic name.
+ */
+ Object responseTopic() {
+ return resTopic;
+ }
+
+ /**
+ * @param resTopic Response topic.
+ */
+ void responseTopic(Object resTopic) {
+ this.resTopic = resTopic;
+ }
+
+ /**
+ * @return Serialized topic.
+ */
+ byte[] responseTopicBytes() {
+ return resTopicBytes;
+ }
+
+ /**
+ * @param resTopicBytes Serialized topic.
+ */
+ void responseTopicBytes(byte[] resTopicBytes) {
+ this.resTopicBytes = resTopicBytes;
+ }
+
+ /**
+ * Class name/resource name that is being requested.
+ *
+ * @return Resource or class name.
+ */
+ String resourceName() {
+ return rsrcName;
+ }
+
+ /**
+ * Gets property ldrId.
+ *
+ * @return Property ldrId.
+ */
+ IgniteUuid classLoaderId() {
+ return ldrId;
+ }
+
+ /**
+ * Gets property undeploy.
+ *
+ * @return Property undeploy.
+ */
+ boolean isUndeploy() {
+ return isUndeploy;
+ }
+
+ /**
+ * @return Node IDs chain which is updated as request jumps
+ * from node to node.
+ */
+ public Collection<UUID> nodeIds() {
+ return nodeIds;
+ }
+
+ /**
+ * @param nodeIds Node IDs chain which is updated as request jumps
+ * from node to node.
+ */
+ public void nodeIds(Collection<UUID> nodeIds) {
+ this.nodeIds = nodeIds;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridDeploymentRequest _clone = new GridDeploymentRequest();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ GridDeploymentRequest _clone = (GridDeploymentRequest)_msg;
+
+ _clone.resTopic = resTopic;
+ _clone.resTopicBytes = resTopicBytes;
+ _clone.rsrcName = rsrcName;
+ _clone.ldrId = ldrId;
+ _clone.isUndeploy = isUndeploy;
+ _clone.nodeIds = nodeIds;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 0:
- if (!commState.putBoolean(isUndeploy))
++ if (!commState.putBoolean("isUndeploy", isUndeploy))
+ return false;
+
+ commState.idx++;
+
+ case 1:
- if (!commState.putGridUuid(ldrId))
++ if (!commState.putGridUuid("ldrId", ldrId))
+ return false;
+
+ commState.idx++;
+
+ case 2:
+ if (nodeIds != null) {
+ if (commState.it == null) {
- if (!commState.putInt(nodeIds.size()))
++ if (!commState.putInt(null, nodeIds.size()))
+ return false;
+
+ commState.it = nodeIds.iterator();
+ }
+
+ while (commState.it.hasNext() || commState.cur != NULL) {
+ if (commState.cur == NULL)
+ commState.cur = commState.it.next();
+
- if (!commState.putUuid((UUID)commState.cur))
++ if (!commState.putUuid(null, (UUID)commState.cur))
+ return false;
+
+ commState.cur = NULL;
+ }
+
+ commState.it = null;
+ } else {
- if (!commState.putInt(-1))
++ if (!commState.putInt(null, -1))
+ return false;
+ }
+
+ commState.idx++;
+
+ case 3:
- if (!commState.putByteArray(resTopicBytes))
++ if (!commState.putByteArray("resTopicBytes", resTopicBytes))
+ return false;
+
+ commState.idx++;
+
+ case 4:
- if (!commState.putString(rsrcName))
++ if (!commState.putString("rsrcName", rsrcName))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ switch (commState.idx) {
+ case 0:
- if (buf.remaining() < 1)
- return false;
++ isUndeploy = commState.getBoolean("isUndeploy");
+
- isUndeploy = commState.getBoolean();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ case 1:
- IgniteUuid ldrId0 = commState.getGridUuid();
++ ldrId = commState.getGridUuid("ldrId");
+
- if (ldrId0 == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- ldrId = ldrId0;
-
+ commState.idx++;
+
+ case 2:
+ if (commState.readSize == -1) {
- if (buf.remaining() < 4)
- return false;
++ commState.readSize = commState.getInt(null);
+
- commState.readSize = commState.getInt();
++ if (!commState.lastRead())
++ return false;
+ }
+
+ if (commState.readSize >= 0) {
+ if (nodeIds == null)
+ nodeIds = new ArrayList<>(commState.readSize);
+
+ for (int i = commState.readItems; i < commState.readSize; i++) {
- UUID _val = commState.getUuid();
++ UUID _val = commState.getUuid(null);
+
- if (_val == UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ nodeIds.add((UUID)_val);
+
+ commState.readItems++;
+ }
+ }
+
+ commState.readSize = -1;
+ commState.readItems = 0;
+
+ commState.idx++;
+
+ case 3:
- byte[] resTopicBytes0 = commState.getByteArray();
++ resTopicBytes = commState.getByteArray("resTopicBytes");
+
- if (resTopicBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- resTopicBytes = resTopicBytes0;
-
+ commState.idx++;
+
+ case 4:
- String rsrcName0 = commState.getString();
++ rsrcName = commState.getString("rsrcName");
+
- if (rsrcName0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- rsrcName = rsrcName0;
-
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 11;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridDeploymentRequest.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
index 0000000,3bcd5dd..bdd5b63
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
@@@ -1,0 -1,212 +1,208 @@@
+ /*
+ * 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.managers.deployment;
+
+ import org.apache.ignite.internal.util.*;
+ import org.apache.ignite.internal.util.direct.*;
+
+ import org.apache.ignite.internal.util.typedef.internal.*;
+
+ import java.io.*;
+ import java.nio.*;
+
+ /**
+ * Grid deployment response containing requested resource bytes.
+ */
+ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Result state. */
+ private boolean success;
+
+ /** */
+ private String errMsg;
+
+ /** Raw class/resource/task. */
+ private GridByteArrayList byteSrc;
+
+ /**
+ * No-op constructor to support {@link Externalizable} interface.
+ * This constructor is not meant to be used for other purposes.
+ */
+ @SuppressWarnings({"RedundantNoArgConstructor"})
+ public GridDeploymentResponse() {
+ // No-op.
+ }
+
+ /**
+ * Sets raw class/resource or serialized task as bytes array.
+ *
+ * @param byteSrc Class/resource/task source.
+ */
+ void byteSource(GridByteArrayList byteSrc) {
+ this.byteSrc = byteSrc;
+ }
+
+ /**
+ * Gets raw class/resource or serialized task source as bytes array.
+ * @return Class/resource/task source.
+ */
+ GridByteArrayList byteSource() {
+ return byteSrc;
+ }
+
+ /**
+ * Tests whether corresponding request was processed successful of not.
+ *
+ * @return {@code true} if request for the source processed
+ * successfully and {@code false} if not.
+ */
+ boolean success() {
+ return success;
+ }
+
+ /**
+ * Sets corresponding request processing status.
+ *
+ * @param success {@code true} if request processed successfully and
+ * response keeps source inside and {@code false} otherwise.
+ */
+ void success(boolean success) {
+ this.success = success;
+ }
+
+ /**
+ * Gets request processing error message. If request processed with error,
+ * message will be put in response.
+ *
+ * @return Request processing error message.
+ */
+ String errorMessage() {
+ return errMsg;
+ }
+
+ /**
+ * Sets request processing error message.
+ *
+ * @param errMsg Request processing error message.
+ */
+ void errorMessage(String errMsg) {
+ this.errMsg = errMsg;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridDeploymentResponse _clone = new GridDeploymentResponse();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ GridDeploymentResponse _clone = (GridDeploymentResponse)_msg;
+
+ _clone.success = success;
+ _clone.errMsg = errMsg;
+ _clone.byteSrc = byteSrc;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 0:
- if (!commState.putByteArrayList(byteSrc))
++ if (!commState.putByteArrayList("byteSrc", byteSrc))
+ return false;
+
+ commState.idx++;
+
+ case 1:
- if (!commState.putString(errMsg))
++ if (!commState.putString("errMsg", errMsg))
+ return false;
+
+ commState.idx++;
+
+ case 2:
- if (!commState.putBoolean(success))
++ if (!commState.putBoolean("success", success))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ switch (commState.idx) {
+ case 0:
- GridByteArrayList byteSrc0 = commState.getByteArrayList();
++ byteSrc = commState.getByteArrayList("byteSrc");
+
- if (byteSrc0 == BYTE_ARR_LIST_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- byteSrc = byteSrc0;
-
+ commState.idx++;
+
+ case 1:
- String errMsg0 = commState.getString();
++ errMsg = commState.getString("errMsg");
+
- if (errMsg0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- errMsg = errMsg0;
-
+ commState.idx++;
+
+ case 2:
- if (buf.remaining() < 1)
- return false;
++ success = commState.getBoolean("success");
+
- success = commState.getBoolean();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 12;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridDeploymentResponse.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
index 0000000,5abe905..dd46441
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
@@@ -1,0 -1,537 +1,523 @@@
+ /*
+ * 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.managers.eventstorage;
+
+ import org.apache.ignite.configuration.*;
+ import org.apache.ignite.events.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.lang.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+ import org.apache.ignite.internal.util.tostring.*;
+ import org.jetbrains.annotations.*;
+
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * Event storage message.
+ */
+ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ @GridDirectTransient
+ private Object resTopic;
+
+ /** */
+ private byte[] resTopicBytes;
+
+ /** */
+ private byte[] filter;
+
+ /** */
+ @GridDirectTransient
+ private Collection<IgniteEvent> evts;
+
+ /** */
+ private byte[] evtsBytes;
+
+ /** */
+ @GridDirectTransient
+ private Throwable ex;
+
+ /** */
+ private byte[] exBytes;
+
+ /** */
+ private IgniteUuid clsLdrId;
+
+ /** */
+ private IgniteDeploymentMode depMode;
+
+ /** */
+ private String filterClsName;
+
+ /** */
+ private String userVer;
+
+ /** Node class loader participants. */
+ @GridToStringInclude
+ @GridDirectMap(keyType = UUID.class, valueType = IgniteUuid.class)
+ private Map<UUID, IgniteUuid> ldrParties;
+
+ /** */
+ public GridEventStorageMessage() {
+ // No-op.
+ }
+
+ /**
+ * @param resTopic Response topic,
+ * @param filter Query filter.
+ * @param filterClsName Filter class name.
+ * @param clsLdrId Class loader ID.
+ * @param depMode Deployment mode.
+ * @param userVer User version.
+ * @param ldrParties Node loader participant map.
+ */
+ GridEventStorageMessage(
+ Object resTopic,
+ byte[] filter,
+ String filterClsName,
+ IgniteUuid clsLdrId,
+ IgniteDeploymentMode depMode,
+ String userVer,
+ Map<UUID, IgniteUuid> ldrParties) {
+ this.resTopic = resTopic;
+ this.filter = filter;
+ this.filterClsName = filterClsName;
+ this.depMode = depMode;
+ this.clsLdrId = clsLdrId;
+ this.userVer = userVer;
+ this.ldrParties = ldrParties;
+
+ evts = null;
+ ex = null;
+ }
+
+ /**
+ * @param evts Grid events.
+ * @param ex Exception occurred during processing.
+ */
+ GridEventStorageMessage(Collection<IgniteEvent> evts, Throwable ex) {
+ this.evts = evts;
+ this.ex = ex;
+
+ resTopic = null;
+ filter = null;
+ filterClsName = null;
+ depMode = null;
+ clsLdrId = null;
+ userVer = null;
+ }
+
+ /**
+ * @return Response topic.
+ */
+ Object responseTopic() {
+ return resTopic;
+ }
+
+ /**
+ * @param resTopic Response topic.
+ */
+ void responseTopic(Object resTopic) {
+ this.resTopic = resTopic;
+ }
+
+ /**
+ * @return Serialized response topic.
+ */
+ byte[] responseTopicBytes() {
+ return resTopicBytes;
+ }
+
+ /**
+ * @param resTopicBytes Serialized response topic.
+ */
+ void responseTopicBytes(byte[] resTopicBytes) {
+ this.resTopicBytes = resTopicBytes;
+ }
+
+ /**
+ * @return Filter.
+ */
+ byte[] filter() {
+ return filter;
+ }
+
+ /**
+ * @return Events.
+ */
+ @Nullable Collection<IgniteEvent> events() {
+ return evts != null ? Collections.unmodifiableCollection(evts) : null;
+ }
+
+ /**
+ * @param evts Events.
+ */
+ void events(@Nullable Collection<IgniteEvent> evts) {
+ this.evts = evts;
+ }
+
+ /**
+ * @return Serialized events.
+ */
+ byte[] eventsBytes() {
+ return evtsBytes;
+ }
+
+ /**
+ * @param evtsBytes Serialized events.
+ */
+ void eventsBytes(byte[] evtsBytes) {
+ this.evtsBytes = evtsBytes;
+ }
+
+ /**
+ * @return the Class loader ID.
+ */
+ IgniteUuid classLoaderId() {
+ return clsLdrId;
+ }
+
+ /**
+ * @return Deployment mode.
+ */
+ IgniteDeploymentMode deploymentMode() {
+ return depMode;
+ }
+
+ /**
+ * @return Filter class name.
+ */
+ String filterClassName() {
+ return filterClsName;
+ }
+
+ /**
+ * @return User version.
+ */
+ String userVersion() {
+ return userVer;
+ }
+
+ /**
+ * @return Node class loader participant map.
+ */
+ @Nullable Map<UUID, IgniteUuid> loaderParticipants() {
+ return ldrParties != null ? Collections.unmodifiableMap(ldrParties) : null;
+ }
+
+ /**
+ * @param ldrParties Node class loader participant map.
+ */
+ void loaderParticipants(Map<UUID, IgniteUuid> ldrParties) {
+ this.ldrParties = ldrParties;
+ }
+
+ /**
+ * @return Exception.
+ */
+ Throwable exception() {
+ return ex;
+ }
+
+ /**
+ * @param ex Exception.
+ */
+ void exception(Throwable ex) {
+ this.ex = ex;
+ }
+
+ /**
+ * @return Serialized exception.
+ */
+ byte[] exceptionBytes() {
+ return exBytes;
+ }
+
+ /**
+ * @param exBytes Serialized exception.
+ */
+ void exceptionBytes(byte[] exBytes) {
+ this.exBytes = exBytes;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridEventStorageMessage _clone = new GridEventStorageMessage();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ GridEventStorageMessage _clone = (GridEventStorageMessage)_msg;
+
+ _clone.resTopic = resTopic;
+ _clone.resTopicBytes = resTopicBytes;
+ _clone.filter = filter;
+ _clone.evts = evts;
+ _clone.evtsBytes = evtsBytes;
+ _clone.ex = ex;
+ _clone.exBytes = exBytes;
+ _clone.clsLdrId = clsLdrId;
+ _clone.depMode = depMode;
+ _clone.filterClsName = filterClsName;
+ _clone.userVer = userVer;
+ _clone.ldrParties = ldrParties;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 0:
- if (!commState.putGridUuid(clsLdrId))
++ if (!commState.putGridUuid("clsLdrId", clsLdrId))
+ return false;
+
+ commState.idx++;
+
+ case 1:
- if (!commState.putEnum(depMode))
++ if (!commState.putEnum("depMode", depMode))
+ return false;
+
+ commState.idx++;
+
+ case 2:
- if (!commState.putByteArray(evtsBytes))
++ if (!commState.putByteArray("evtsBytes", evtsBytes))
+ return false;
+
+ commState.idx++;
+
+ case 3:
- if (!commState.putByteArray(exBytes))
++ if (!commState.putByteArray("exBytes", exBytes))
+ return false;
+
+ commState.idx++;
+
+ case 4:
- if (!commState.putByteArray(filter))
++ if (!commState.putByteArray("filter", filter))
+ return false;
+
+ commState.idx++;
+
+ case 5:
- if (!commState.putString(filterClsName))
++ if (!commState.putString("filterClsName", filterClsName))
+ return false;
+
+ commState.idx++;
+
+ case 6:
+ if (ldrParties != null) {
+ if (commState.it == null) {
- if (!commState.putInt(ldrParties.size()))
++ if (!commState.putInt(null, ldrParties.size()))
+ return false;
+
+ commState.it = ldrParties.entrySet().iterator();
+ }
+
+ while (commState.it.hasNext() || commState.cur != NULL) {
+ if (commState.cur == NULL)
+ commState.cur = commState.it.next();
+
+ Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
+
+ if (!commState.keyDone) {
- if (!commState.putUuid(e.getKey()))
++ if (!commState.putUuid(null, e.getKey()))
+ return false;
+
+ commState.keyDone = true;
+ }
+
- if (!commState.putGridUuid(e.getValue()))
++ if (!commState.putGridUuid(null, e.getValue()))
+ return false;
+
+ commState.keyDone = false;
+
+ commState.cur = NULL;
+ }
+
+ commState.it = null;
+ } else {
- if (!commState.putInt(-1))
++ if (!commState.putInt(null, -1))
+ return false;
+ }
+
+ commState.idx++;
+
+ case 7:
- if (!commState.putByteArray(resTopicBytes))
++ if (!commState.putByteArray("resTopicBytes", resTopicBytes))
+ return false;
+
+ commState.idx++;
+
+ case 8:
- if (!commState.putString(userVer))
++ if (!commState.putString("userVer", userVer))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ switch (commState.idx) {
+ case 0:
- IgniteUuid clsLdrId0 = commState.getGridUuid();
++ clsLdrId = commState.getGridUuid("clsLdrId");
+
- if (clsLdrId0 == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- clsLdrId = clsLdrId0;
-
+ commState.idx++;
+
+ case 1:
- if (buf.remaining() < 1)
- return false;
++ byte depMode0 = commState.getByte("depMode");
+
- byte depMode0 = commState.getByte();
++ if (!commState.lastRead())
++ return false;
+
+ depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
+
+ commState.idx++;
+
+ case 2:
- byte[] evtsBytes0 = commState.getByteArray();
++ evtsBytes = commState.getByteArray("evtsBytes");
+
- if (evtsBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- evtsBytes = evtsBytes0;
-
+ commState.idx++;
+
+ case 3:
- byte[] exBytes0 = commState.getByteArray();
++ exBytes = commState.getByteArray("exBytes");
+
- if (exBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- exBytes = exBytes0;
-
+ commState.idx++;
+
+ case 4:
- byte[] filter0 = commState.getByteArray();
++ filter = commState.getByteArray("filter");
+
- if (filter0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- filter = filter0;
-
+ commState.idx++;
+
+ case 5:
- String filterClsName0 = commState.getString();
++ filterClsName = commState.getString("filterClsName");
+
- if (filterClsName0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- filterClsName = filterClsName0;
-
+ commState.idx++;
+
+ case 6:
+ if (commState.readSize == -1) {
- if (buf.remaining() < 4)
- return false;
++ commState.readSize = commState.getInt(null);
+
- commState.readSize = commState.getInt();
++ if (!commState.lastRead())
++ return false;
+ }
+
+ if (commState.readSize >= 0) {
+ if (ldrParties == null)
- ldrParties = U.newHashMap(commState.readSize);
++ ldrParties = new HashMap<>(commState.readSize, 1.0f);
+
+ for (int i = commState.readItems; i < commState.readSize; i++) {
+ if (!commState.keyDone) {
- UUID _val = commState.getUuid();
++ UUID _val = commState.getUuid(null);
+
- if (_val == UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ commState.cur = _val;
+ commState.keyDone = true;
+ }
+
- IgniteUuid _val = commState.getGridUuid();
++ IgniteUuid _val = commState.getGridUuid(null);
+
- if (_val == GRID_UUID_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ ldrParties.put((UUID)commState.cur, _val);
+
+ commState.keyDone = false;
+
+ commState.readItems++;
+ }
+ }
+
+ commState.readSize = -1;
+ commState.readItems = 0;
+ commState.cur = null;
+
+ commState.idx++;
+
+ case 7:
- byte[] resTopicBytes0 = commState.getByteArray();
++ resTopicBytes = commState.getByteArray("resTopicBytes");
+
- if (resTopicBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- resTopicBytes = resTopicBytes0;
-
+ commState.idx++;
+
+ case 8:
- String userVer0 = commState.getString();
++ userVer = commState.getString("userVer");
+
- if (userVer0 == STR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- userVer = userVer0;
-
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 13;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridEventStorageMessage.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
index 0000000,3465efd..b0b773c
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
@@@ -1,0 -1,252 +1,250 @@@
+ /*
+ * 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;
+
+ import org.apache.ignite.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.internal.processors.cache.version.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.lang.*;
+ import org.apache.ignite.internal.util.tostring.*;
+ import org.apache.ignite.internal.util.typedef.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+
+ import java.io.*;
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * Cache eviction request.
+ */
+ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> implements GridCacheDeployable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Future id. */
+ private long futId;
+
+ /** Entries to clear from near and backup nodes. */
+ @GridToStringInclude
+ @GridDirectTransient
+ private Collection<GridTuple3<K, GridCacheVersion, Boolean>> entries;
+
+ /** Serialized entries. */
+ @GridToStringExclude
+ private byte[] entriesBytes;
+
+ /** Topology version. */
+ private long topVer;
+
+ /**
+ * Required by {@link Externalizable}.
+ */
+ public GridCacheEvictionRequest() {
+ // No-op.
+ }
+
+ /**
+ * @param cacheId Cache ID.
+ * @param futId Future id.
+ * @param size Size.
+ * @param topVer Topology version.
+ */
+ GridCacheEvictionRequest(int cacheId, long futId, int size, long topVer) {
+ assert futId > 0;
+ assert size > 0;
+ assert topVer > 0;
+
+ this.cacheId = cacheId;
+ this.futId = futId;
+
+ entries = new ArrayList<>(size);
+
+ this.topVer = topVer;
+ }
+
+ /** {@inheritDoc}
+ * @param ctx*/
+ @Override public void prepareMarshal(GridCacheSharedContext<K, V> ctx) throws IgniteCheckedException {
+ super.prepareMarshal(ctx);
+
+ if (entries != null) {
+ if (ctx.deploymentEnabled())
+ prepareObjects(entries, ctx);
+
+ entriesBytes = ctx.marshaller().marshal(entries);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void finishUnmarshal(GridCacheSharedContext<K, V> ctx, ClassLoader ldr) throws IgniteCheckedException {
+ super.finishUnmarshal(ctx, ldr);
+
+ if (entriesBytes != null)
+ entries = ctx.marshaller().unmarshal(entriesBytes, ldr);
+ }
+
+ /**
+ * @return Future id.
+ */
+ long futureId() {
+ return futId;
+ }
+
+ /**
+ * @return Entries - {{Key, Version, Boolean (near or not)}, ...}.
+ */
+ Collection<GridTuple3<K, GridCacheVersion, Boolean>> entries() {
+ return entries;
+ }
+
+ /**
+ * @return Topology version.
+ */
+ @Override public long topologyVersion() {
+ return topVer;
+ }
+
+ /**
+ * Add key to request.
+ *
+ * @param key Key to evict.
+ * @param ver Entry version.
+ * @param near {@code true} if key should be evicted from near cache.
+ */
+ void addKey(K key, GridCacheVersion ver, boolean near) {
+ assert key != null;
+ assert ver != null;
+
+ entries.add(F.t(key, ver, near));
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean ignoreClassErrors() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridCacheEvictionRequest _clone = new GridCacheEvictionRequest();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ super.clone0(_msg);
+
+ GridCacheEvictionRequest _clone = (GridCacheEvictionRequest)_msg;
+
+ _clone.futId = futId;
+ _clone.entries = entries;
+ _clone.entriesBytes = entriesBytes;
+ _clone.topVer = topVer;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!super.writeTo(buf))
+ return false;
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 3:
- if (!commState.putByteArray(entriesBytes))
++ if (!commState.putByteArray("entriesBytes", entriesBytes))
+ return false;
+
+ commState.idx++;
+
+ case 4:
- if (!commState.putLong(futId))
++ if (!commState.putLong("futId", futId))
+ return false;
+
+ commState.idx++;
+
+ case 5:
- if (!commState.putLong(topVer))
++ if (!commState.putLong("topVer", topVer))
+ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!super.readFrom(buf))
+ return false;
+
+ switch (commState.idx) {
+ case 3:
- byte[] entriesBytes0 = commState.getByteArray();
++ entriesBytes = commState.getByteArray("entriesBytes");
+
- if (entriesBytes0 == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
- entriesBytes = entriesBytes0;
-
+ commState.idx++;
+
+ case 4:
- if (buf.remaining() < 8)
- return false;
++ futId = commState.getLong("futId");
+
- futId = commState.getLong();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ case 5:
- if (buf.remaining() < 8)
- return false;
++ topVer = commState.getLong("topVer");
+
- topVer = commState.getLong();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 16;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridCacheEvictionRequest.class, this);
+ }
+ }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3dbb6acc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
index 0000000,afd1e6a..10adb63
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionResponse.java
@@@ -1,0 -1,281 +1,281 @@@
+ /*
+ * 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;
+
+ import org.apache.ignite.*;
+ import org.apache.ignite.internal.*;
+ import org.apache.ignite.internal.util.direct.*;
+ import org.apache.ignite.internal.util.tostring.*;
+ import org.apache.ignite.internal.util.typedef.internal.*;
+
+ import java.io.*;
+ import java.nio.*;
+ import java.util.*;
+
+ /**
+ * Cache eviction response.
+ */
+ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Future ID. */
+ private long futId;
+
+ /** Rejected keys. */
+ @GridToStringInclude
+ @GridDirectTransient
+ private Collection<K> rejectedKeys = new HashSet<>();
+
+ /** Serialized rejected keys. */
+ @GridToStringExclude
+ @GridDirectCollection(byte[].class)
+ private Collection<byte[]> rejectedKeyBytes;
+
+ /** Flag to indicate whether request processing has finished with error. */
+ private boolean err;
+
+ /**
+ * Required by {@link Externalizable}.
+ */
+ public GridCacheEvictionResponse() {
+ // No-op.
+ }
+
+ /**
+ * @param cacheId Cache ID.
+ * @param futId Future ID.
+ */
+ GridCacheEvictionResponse(int cacheId, long futId) {
+ this(cacheId, futId, false);
+ }
+
+ /**
+ * @param cacheId Cache ID.
+ * @param futId Future ID.
+ * @param err {@code True} if request processing has finished with error.
+ */
+ GridCacheEvictionResponse(int cacheId, long futId, boolean err) {
+ this.cacheId = cacheId;
+ this.futId = futId;
+ this.err = err;
+ }
+
+ /** {@inheritDoc}
+ * @param ctx*/
+ @Override public void prepareMarshal(GridCacheSharedContext<K, V> ctx) throws IgniteCheckedException {
+ super.prepareMarshal(ctx);
+
+ rejectedKeyBytes = marshalCollection(rejectedKeys, ctx);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void finishUnmarshal(GridCacheSharedContext<K, V> ctx, ClassLoader ldr) throws IgniteCheckedException {
+ super.finishUnmarshal(ctx, ldr);
+
+ rejectedKeys = unmarshalCollection(rejectedKeyBytes, ctx, ldr);
+ }
+
+ /**
+ * @return Future ID.
+ */
+ long futureId() {
+ return futId;
+ }
+
+ /**
+ * @return Rejected keys.
+ */
+ Collection<K> rejectedKeys() {
+ return rejectedKeys;
+ }
+
+ /**
+ * Add rejected key to response.
+ *
+ * @param key Evicted key.
+ */
+ void addRejected(K key) {
+ assert key != null;
+
+ rejectedKeys.add(key);
+ }
+
+ /**
+ * @return {@code True} if request processing has finished with error.
+ */
+ boolean error() {
+ return err;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean ignoreClassErrors() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
+ @Override public GridTcpCommunicationMessageAdapter clone() {
+ GridCacheEvictionResponse _clone = new GridCacheEvictionResponse();
+
+ clone0(_clone);
+
+ return _clone;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+ super.clone0(_msg);
+
+ GridCacheEvictionResponse _clone = (GridCacheEvictionResponse)_msg;
+
+ _clone.futId = futId;
+ _clone.rejectedKeys = rejectedKeys;
+ _clone.rejectedKeyBytes = rejectedKeyBytes;
+ _clone.err = err;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean writeTo(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!super.writeTo(buf))
+ return false;
+
+ if (!commState.typeWritten) {
- if (!commState.putByte(directType()))
++ if (!commState.putByte(null, directType()))
+ return false;
+
+ commState.typeWritten = true;
+ }
+
+ switch (commState.idx) {
+ case 3:
- if (!commState.putBoolean(err))
++ if (!commState.putBoolean("err", err))
+ return false;
+
+ commState.idx++;
+
+ case 4:
- if (!commState.putLong(futId))
++ if (!commState.putLong("futId", futId))
+ return false;
+
+ commState.idx++;
+
+ case 5:
+ if (rejectedKeyBytes != null) {
+ if (commState.it == null) {
- if (!commState.putInt(rejectedKeyBytes.size()))
++ if (!commState.putInt(null, rejectedKeyBytes.size()))
+ return false;
+
+ commState.it = rejectedKeyBytes.iterator();
+ }
+
+ while (commState.it.hasNext() || commState.cur != NULL) {
+ if (commState.cur == NULL)
+ commState.cur = commState.it.next();
+
- if (!commState.putByteArray((byte[])commState.cur))
++ if (!commState.putByteArray(null, (byte[])commState.cur))
+ return false;
+
+ commState.cur = NULL;
+ }
+
+ commState.it = null;
+ } else {
- if (!commState.putInt(-1))
++ if (!commState.putInt(null, -1))
+ return false;
+ }
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("all")
+ @Override public boolean readFrom(ByteBuffer buf) {
+ commState.setBuffer(buf);
+
+ if (!super.readFrom(buf))
+ return false;
+
+ switch (commState.idx) {
+ case 3:
- if (buf.remaining() < 1)
- return false;
++ err = commState.getBoolean("err");
+
- err = commState.getBoolean();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ case 4:
- if (buf.remaining() < 8)
- return false;
++ futId = commState.getLong("futId");
+
- futId = commState.getLong();
++ if (!commState.lastRead())
++ return false;
+
+ commState.idx++;
+
+ case 5:
+ if (commState.readSize == -1) {
- if (buf.remaining() < 4)
- return false;
++ commState.readSize = commState.getInt(null);
+
- commState.readSize = commState.getInt();
++ if (!commState.lastRead())
++ return false;
+ }
+
+ if (commState.readSize >= 0) {
+ if (rejectedKeyBytes == null)
+ rejectedKeyBytes = new ArrayList<>(commState.readSize);
+
+ for (int i = commState.readItems; i < commState.readSize; i++) {
- byte[] _val = commState.getByteArray();
++ byte[] _val = commState.getByteArray(null);
+
- if (_val == BYTE_ARR_NOT_READ)
++ if (!commState.lastRead())
+ return false;
+
+ rejectedKeyBytes.add((byte[])_val);
+
+ commState.readItems++;
+ }
+ }
+
+ commState.readSize = -1;
+ commState.readItems = 0;
+
+ commState.idx++;
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 17;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridCacheEvictionResponse.class, this);
+ }
+ }