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 @@ -20,6 +20,7 @@
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.jetbrains.annotations.Nullable;

/**
* Message related to particular cache group.
Expand All @@ -37,6 +38,11 @@ public int groupId() {
return grpId;
}

/** {@inheritDoc} */
@Nullable @Override public CacheGroupDescriptor descriptor(GridCacheSharedContext<?, ?> ctx) {
return ctx.cache().cacheGroupDescriptors().get(grpId);
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridCacheGroupIdMessage.class, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.plugin.extensions.communication.CacheIdAware;
import org.jetbrains.annotations.Nullable;

/**
* Message related to particular cache.
Expand All @@ -36,6 +37,11 @@ public abstract class GridCacheIdMessage extends GridCacheMessage implements Cac
return cacheId;
}

/** {@inheritDoc} */
@Nullable @Override public DynamicCacheDescriptor descriptor(GridCacheSharedContext<?, ?> ctx) {
return ctx.cache().cacheDescriptor(cacheId);
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridCacheIdMessage.class, this, "super", super.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1561,12 +1561,7 @@ private void unmarshall(UUID nodeId, GridCacheMessage cacheMsg) {
* @return Cache or group descriptor.
*/
private Object descriptorForMessage(GridCacheMessage msg) {
if (msg instanceof GridCacheIdMessage)
return cctx.cache().cacheDescriptor(((GridCacheIdMessage)msg).cacheId());
else if (msg instanceof GridCacheGroupIdMessage)
return cctx.cache().cacheGroupDescriptors().get(((GridCacheGroupIdMessage)msg).groupId());

return null;
return msg.descriptor(cctx);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,15 @@ public IgniteLogger messageLogger(GridCacheSharedContext<?, ?> ctx) {
return ctx.messageLogger();
}

/**
* @param ctx Context.
* @return Descriptor of the cache or cache group this message relates to, or {@code null} if the message
* is not related to a particular cache or cache group.
*/
@Nullable public Object descriptor(GridCacheSharedContext<?, ?> ctx) {
return null;
}

/**
* @param str Bulder.
* @param name Flag name.
Expand Down
Loading