|
18 | 18 |
|
19 | 19 | import java.io.Serializable; |
20 | 20 | import org.apache.ignite.IgniteCheckedException; |
| 21 | +import org.apache.ignite.internal.MarshallableMessage; |
21 | 22 | import org.apache.ignite.internal.Order; |
22 | 23 | import org.apache.ignite.internal.binary.BinaryMetadata; |
23 | 24 | import org.apache.ignite.internal.util.typedef.internal.U; |
24 | | -import org.apache.ignite.plugin.extensions.communication.Message; |
25 | | - |
26 | | -import static org.apache.ignite.marshaller.Marshallers.jdk; |
| 25 | +import org.apache.ignite.marshaller.Marshaller; |
27 | 26 |
|
28 | 27 | /** |
29 | 28 | * Wrapper for {@link BinaryMetadata} which is stored in metadata local cache on each node. |
30 | 29 | * Used internally to track version counters (see javadoc for {@link MetadataUpdateProposedMessage} for more details). |
31 | 30 | * The version refers solely to the internal protocol for updating BinaryMetadata and is unknown externally. |
32 | 31 | * It can be updated dynamically from different nodes and threads on the same node. |
33 | 32 | */ |
34 | | -public final class BinaryMetadataVersionInfo implements Serializable, Message { |
| 33 | +public final class BinaryMetadataVersionInfo implements Serializable, MarshallableMessage { |
35 | 34 | /** */ |
36 | 35 | private static final long serialVersionUID = 0L; |
37 | 36 |
|
@@ -130,24 +129,16 @@ boolean removing() { |
130 | 129 | return removing; |
131 | 130 | } |
132 | 131 |
|
133 | | - /** |
134 | | - * Marshals binary metadata to byte array. |
135 | | - * |
136 | | - * @throws IgniteCheckedException If failed. |
137 | | - */ |
138 | | - public void marshalMetadata() throws IgniteCheckedException { |
139 | | - if (metadataBytes == null) |
140 | | - metadataBytes = U.marshal(jdk(), metadata); |
| 132 | + /** {@inheritDoc} */ |
| 133 | + @Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException { |
| 134 | + if (metadata != null) |
| 135 | + metadataBytes = U.marshal(marsh, metadata); |
141 | 136 | } |
142 | 137 |
|
143 | | - /** |
144 | | - * Unmarshals binary metadata from byte array. |
145 | | - * |
146 | | - * @throws IgniteCheckedException If failed. |
147 | | - */ |
148 | | - public void unmarshalMetadata() throws IgniteCheckedException { |
149 | | - if (metadata == null && metadataBytes != null) { |
150 | | - metadata = U.unmarshal(jdk(), metadataBytes, U.gridClassLoader()); |
| 138 | + /** {@inheritDoc} */ |
| 139 | + @Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException { |
| 140 | + if (metadataBytes != null) { |
| 141 | + metadata = U.unmarshal(marsh, metadataBytes, clsLdr); |
151 | 142 |
|
152 | 143 | // It is not required anymore. |
153 | 144 | metadataBytes = null; |
|
0 commit comments