Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.ignite.internal.cache.query.index.IndexQueryResultMeta;
import org.apache.ignite.internal.cache.query.index.sorted.IndexKeyDefinition;
import org.apache.ignite.internal.cache.query.index.sorted.IndexKeyTypeSettings;
import org.apache.ignite.internal.management.cache.PartitionKey;
import org.apache.ignite.internal.managers.checkpoint.GridCheckpointRequest;
import org.apache.ignite.internal.managers.communication.CompressedMessage;
import org.apache.ignite.internal.managers.communication.ErrorMessage;
Expand Down Expand Up @@ -168,6 +169,7 @@
import org.apache.ignite.internal.processors.cache.transactions.TxLock;
import org.apache.ignite.internal.processors.cache.transactions.TxLocksRequest;
import org.apache.ignite.internal.processors.cache.transactions.TxLocksResponse;
import org.apache.ignite.internal.processors.cache.verify.PartitionHashRecord;
import org.apache.ignite.internal.processors.cache.version.GridCacheRawVersionedEntry;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
Expand Down Expand Up @@ -436,6 +438,7 @@ public CoreMessagesProvider(Marshaller dfltMarsh, Marshaller schemaAwareMarsh, C
withNoSchema(ExchangeFailureMessage.class);
withNoSchema(CacheStatisticsClearMessage.class);
withNoSchema(ClientCacheChangeDummyDiscoveryMessage.class);
// TODO: revise using resolved class loader, https://issues.apache.org/jira/browse/IGNITE-28637
withNoSchemaResolvedClassLoader(DynamicCacheChangeBatch.class);

// [10000 - 10200]: Transaction and lock related messages. Most of them originally comes from Communication.
Expand Down Expand Up @@ -531,6 +534,8 @@ public CoreMessagesProvider(Marshaller dfltMarsh, Marshaller schemaAwareMarsh, C
withNoSchema(GridDhtPartitionsFullMessage.class);
withNoSchema(GridDhtPartitionsSingleMessage.class);
withNoSchema(GridDhtPartitionsSingleRequest.class);
withNoSchema(PartitionKey.class);
withNoSchema(PartitionHashRecord.class);

// [10900-11100]: Query, schema and SQL related messages.
msgIdx = 10900;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,34 @@
package org.apache.ignite.internal.management.cache;

import java.io.Serializable;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;

/**
* Partition key - pair of cache group ID and partition ID.
*/
public class PartitionKey implements Serializable {
public class PartitionKey implements Message, Serializable {
/** */
private static final long serialVersionUID = 0L;

/** Group id. */
private final int grpId;
@Order(0)
int grpId;

/** Group name. Optional field, used only for output. */
private final String grpName;
@Order(1)
String grpName;

/** Partition id. */
private final int partId;
@Order(2)
int partId;

/** Empty constructor for a {@link MessageFactory}. */
public PartitionKey() {
// No-op.
}

/**
* @param grpId Group id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,17 @@
package org.apache.ignite.internal.processors.cache.persistence.snapshot;

import java.util.Map;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.MarshallableMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.management.cache.PartitionKey;
import org.apache.ignite.internal.processors.cache.verify.PartitionHashRecord;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;

/** */
public class SnapshotCheckPartitionHashesResponse implements MarshallableMessage {
public class SnapshotCheckPartitionHashesResponse implements Message {
/** Per metas result: consistent id -> check results per partition key. */
private Map<String, Map<PartitionKey, PartitionHashRecord>> perMetaResults;

/** */
@Order(0)
byte[] perMetaResultsBytes;
Map<String, Map<PartitionKey, PartitionHashRecord>> perMetaResults;

/** Default constructor for {@link MessageFactory}. */
public SnapshotCheckPartitionHashesResponse() {
Expand All @@ -50,16 +44,4 @@ public SnapshotCheckPartitionHashesResponse(Map<String, Map<PartitionKey, Partit
public Map<String, Map<PartitionKey, PartitionHashRecord>> perMetaResults() {
return perMetaResults;
}

/** {@inheritDoc} */
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
perMetaResultsBytes = U.marshal(marsh, perMetaResults);
}

/** {@inheritDoc} */
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
if (perMetaResultsBytes != null)
perMetaResults = U.unmarshal(marsh, perMetaResultsBytes, clsLdr);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,17 @@
package org.apache.ignite.internal.processors.cache.persistence.snapshot;

import java.util.Map;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.MarshallableMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.management.cache.PartitionKey;
import org.apache.ignite.internal.processors.cache.verify.PartitionHashRecord;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;

/** */
public class SnapshotPartitionsVerifyHandlerResponse implements MarshallableMessage {
/** */
private Map<PartitionKey, PartitionHashRecord> res;

public class SnapshotPartitionsVerifyHandlerResponse implements Message {
/** */
@Order(0)
byte[] resBytes;
Map<PartitionKey, PartitionHashRecord> res;

/** Default constructor for {@link MessageFactory}. */
public SnapshotPartitionsVerifyHandlerResponse() {
Expand All @@ -50,16 +44,4 @@ public SnapshotPartitionsVerifyHandlerResponse(Map<PartitionKey, PartitionHashRe
public Map<PartitionKey, PartitionHashRecord> response() {
return res;
}

/** {@inheritDoc} */
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
resBytes = U.marshal(marsh, res);
}

/** {@inheritDoc} */
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
if (resBytes != null)
res = U.unmarshal(marsh, resBytes, clsLdr);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,27 @@
*/
package org.apache.ignite.internal.processors.cache.verify;

import java.io.Serializable;
import java.util.Objects;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.internal.MarshallableMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
import org.apache.ignite.internal.dto.IgniteDataTransferObject;
import org.apache.ignite.internal.management.cache.PartitionKey;
import org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility.VerifyPartitionContext;
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.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;
import org.jetbrains.annotations.Nullable;

/**
* Record containing partition checksum, primary flag and consistent ID of owner.
*/
public class PartitionHashRecord extends IgniteDataTransferObject {
public class PartitionHashRecord implements MarshallableMessage, Serializable {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -48,10 +53,14 @@ public class PartitionHashRecord extends IgniteDataTransferObject {
boolean isPrimary;

/** Consistent id. */
@Order(2)
@GridToStringInclude
Object consistentId;

/** Bytes of {@link #consistentId}. */
@Order(2)
@GridToStringExclude
byte[] consistentIdBytes;

/** Partition entries content hash. */
@Order(3)
@GridToStringExclude
Expand All @@ -63,10 +72,14 @@ public class PartitionHashRecord extends IgniteDataTransferObject {
int partVerHash;

/** Update counter's state. */
@Order(5)
@GridToStringInclude
Object updateCntr;

/** Bytes of {@link #updateCntr}. */
@Order(5)
@GridToStringExclude
byte[] updateCntrBytes;

/** Size. */
@Order(6)
@GridToStringExclude
Expand Down Expand Up @@ -143,9 +156,10 @@ public PartitionHashRecord(
}

/**
* Default constructor for Externalizable.
* Default constructor for Externalizable and a {@link MessageFactory}.
*/
public PartitionHashRecord() {
// No-op.
}

/**
Expand Down Expand Up @@ -234,6 +248,27 @@ public void hasExpiringEntries(boolean hasExpiringEntries) {
this.hasExpiringEntries = hasExpiringEntries;
}

/** {@inheritDoc} */
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
if (consistentId != null)
consistentIdBytes = U.marshal(marsh, consistentId);

if (updateCntr != null)
updateCntrBytes = U.marshal(marsh, updateCntr);
}

/** {@inheritDoc} */
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
if (consistentIdBytes != null)
consistentId = U.unmarshal(marsh, consistentIdBytes, clsLdr);

if (updateCntrBytes != null)
updateCntr = U.unmarshal(marsh, updateCntrBytes, clsLdr);

consistentId = null;
updateCntrBytes = null;
}

/** {@inheritDoc} */
@Override public String toString() {
return size == MOVING_PARTITION_SIZE ?
Expand Down
Loading