Skip to content
Merged
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 @@ -83,10 +83,6 @@ public long fragmentId() {
return MessageType.QUERY_ERROR_MESSAGE;
}

/** {@inheritDoc} */
@Override public short directType() {
return MessageType.QUERY_ERROR_MESSAGE.directType();
}

/** {@inheritDoc} */
@Override public void prepareMarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,4 @@ public interface CalciteMessage extends Message {
* @return Message type.
*/
MessageType type();

/** {@inheritDoc} */
@Override default short directType() {
return type().directType();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ public class CalciteMessageFactory implements MessageFactoryProvider {
/** {@inheritDoc} */
@SuppressWarnings({"unchecked", "rawtypes"})
@Override public void registerAll(MessageFactory factory) {
for (MessageType type : MessageType.values()) {
// TODO: Temporary check — remove once all inheritors have migrated to the new serialization framework
if (type.serializer() != null)
factory.register(type.directType(), (Supplier)type.factory(), type.serializer());
else
factory.register(type.directType(), (Supplier)type.factory());
}
for (MessageType type : MessageType.values())
factory.register(type.directType(), (Supplier)type.factory(), type.serializer());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,10 @@ public enum MessageType {
private final Supplier<CalciteMessage> factory;

/** */
private MessageSerializer serializer;
private final MessageSerializer serializer;

/**
* @param directType Message direct type.
* @param factory Message factory.
*/
MessageType(int directType, Supplier<CalciteMessage> factory) {
this.directType = directType;
this.factory = factory;
}

/**
* @param directType Message direct type.
* @param directType Direct type.
* @param factory Message factory.
* @param serializer Message serializer.
*/
Expand All @@ -96,17 +87,17 @@ public enum MessageType {
}

/**
* @return Message direct type;
* @return Message factory.
*/
public short directType() {
return (short)directType;
public Supplier<CalciteMessage> factory() {
return factory;
}

/**
* @return Message factory.
* @return Message direct type.
*/
public Supplier<CalciteMessage> factory() {
return factory;
public short directType() {
return (short)directType;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public ExchangeInfo() {
this.topVer = topVer;
}

/** {@inheritDoc} */
@Override public short directType() {
return -63;
}

/** {@inheritDoc} */
@Override public void appendInfo(StringBuilder sb, GridKernalContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ public boolean system() {
return system;
}

/** {@inheritDoc} */
@Override public short directType() {
return 0;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,6 @@ public AffinityTopologyVersion topologyVersion() {
return topVer;
}

/** {@inheritDoc} */
@Override public short directType() {
return 1;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,6 @@ private void wrapSerializationError(IgniteCheckedException e, String msg, @Nulla
U.error(log, msg, e);
}

/** {@inheritDoc} */
@Override public short directType() {
return 2;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ public long topicId() {
return topicId;
}

/** {@inheritDoc} */
@Override public short directType() {
return 3;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ public void unmarshalSiblings(Marshaller marsh) throws IgniteCheckedException {
}
}

/** {@inheritDoc} */
@Override public short directType() {
return 4;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public IgniteUuid sessionId() {
return sesId;
}

/** {@inheritDoc} */
@Override public short directType() {
return 5;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ public IgniteUuid jobId() {
return jobId;
}

/** {@inheritDoc} */
@Override public short directType() {
return 6;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ public long futureId() {
return infos;
}

/** {@inheritDoc} */
@Override public short directType() {
return -61;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public long futureId() {
return respInfo;
}

/** {@inheritDoc} */
@Override public short directType() {
return -62;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public TxEntriesInfo() {
this.keys = new HashSet<>(keys);
}

/** {@inheritDoc} */
@Override public short directType() {
return -64;
}

/** {@inheritDoc} */
@Override public void appendInfo(StringBuilder sb, GridKernalContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public TxInfo() {
this.nearVer = nearVer;
}

/** {@inheritDoc} */
@Override public short directType() {
return -65;
}

/** {@inheritDoc} */
@Override public void appendInfo(StringBuilder sb, GridKernalContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ public IndexQueryResultMeta(SortedIndexDefinition def, int critSize) {
}
}

/** {@inheritDoc} */
@Override public short directType() {
return 18;
}

/** */
public IndexKeyTypeSettings keyTypeSettings() {
return keyTypeSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ public IndexKeyDefinition(int idxTypeCode, long precision, boolean asc) {
this.precision = (int)precision;
}

/** {@inheritDoc} */
@Override public short directType() {
return 113;
}

/** */
public boolean ascending() {
return asc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ public class IndexKeyTypeSettings implements Message {
@Order(3)
boolean binaryUnsigned = true;

/** {@inheritDoc} */
@Override public short directType() {
return 19;
}

/** */
public boolean inlineObjectHash() {
return inlineObjHash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ public String checkpointSpi() {
return cpSpi;
}

/** {@inheritDoc} */
@Override public short directType() {
return 7;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
* WARNING: CompressedMessage is not intended for explicit use in messages.
*/
public class CompressedMessage implements Message {
/** Type code. */
public static final short TYPE_CODE = -101;

/** Chunk size. */
static final int CHUNK_SIZE = 10 * 1024;

Expand Down Expand Up @@ -203,11 +200,6 @@ public byte[] uncompressed() {
}
}

/** {@inheritDoc} */
@Override public short directType() {
return TYPE_CODE;
}

/**
* @param buf Buffer.
* @return Compressed data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public ErrorMessage(@Nullable Throwable err) {
return errorMsg == null ? null : errorMsg.error();
}

/** {@inheritDoc} */
@Override public short directType() {
return -66;
}

/** {@inheritDoc} */
@Override public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ public boolean isOrdered() {
throw new AssertionError();
}

/** {@inheritDoc} */
@Override public short directType() {
return 8;
}

/** {@inheritDoc} */
@Override public void span(byte[] span) {
Expand Down
Loading
Loading