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 @@ -55,14 +55,20 @@
import org.apache.ignite.internal.processors.authentication.UserManagementOperationFinishedMessage;
import org.apache.ignite.internal.processors.authentication.UserProposedMessage;
import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
import org.apache.ignite.internal.processors.cache.CacheClientReconnectDiscoveryData;
import org.apache.ignite.internal.processors.cache.CacheConfigurationEnrichment;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
import org.apache.ignite.internal.processors.cache.CacheEvictionEntry;
import org.apache.ignite.internal.processors.cache.CacheGroupRecoveryState;
import org.apache.ignite.internal.processors.cache.CacheInvokeDirectResult;
import org.apache.ignite.internal.processors.cache.CacheJoinInfo;
import org.apache.ignite.internal.processors.cache.CacheJoinNodeDiscoveryData;
import org.apache.ignite.internal.processors.cache.CacheReconnectInfo;
import org.apache.ignite.internal.processors.cache.CacheStatisticsClearMessage;
import org.apache.ignite.internal.processors.cache.CacheStatisticsModeChangeMessage;
import org.apache.ignite.internal.processors.cache.ClientCacheChangeDiscoveryMessage;
import org.apache.ignite.internal.processors.cache.ClientCacheChangeDummyDiscoveryMessage;
import org.apache.ignite.internal.processors.cache.ClusterCacheGroupRecoveryData;
import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
import org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest;
import org.apache.ignite.internal.processors.cache.ExchangeFailureMessage;
Expand Down Expand Up @@ -453,6 +459,12 @@ public CoreMessagesProvider(Marshaller dfltMarsh, Marshaller schemaAwareMarsh, C
withNoSchema(CacheStatisticsClearMessage.class);
withNoSchema(ClientCacheChangeDummyDiscoveryMessage.class);
withNoSchema(DynamicCacheChangeBatch.class);
withNoSchema(CacheClientReconnectDiscoveryData.class);
withNoSchema(CacheGroupRecoveryState.class);
withNoSchema(CacheJoinInfo.class);
withNoSchema(CacheJoinNodeDiscoveryData.class);
withNoSchema(CacheReconnectInfo.class);
withNoSchema(ClusterCacheGroupRecoveryData.class);

// [10000 - 10200]: Transaction and lock related messages. Most of them originally comes from Communication.
msgIdx = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,175 +17,36 @@

package org.apache.ignite.internal.processors.cache;

import java.io.Serializable;
import java.util.Map;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;

/**
* Discovery data sent from client reconnecting to cluster.
*/
public class CacheClientReconnectDiscoveryData implements Serializable {
public class CacheClientReconnectDiscoveryData implements Message {
/** */
private static final long serialVersionUID = 0L;
@Order(0)
Map<String, CacheReconnectInfo> clientCaches;

/** */
private final Map<Integer, CacheGroupInfo> clientCacheGrps;

/** */
private final Map<String, CacheInfo> clientCaches;
public CacheClientReconnectDiscoveryData() { }

/**
* @param clientCaches Information about caches started on re-joining client node.
* @param clientCacheGrps Information about cach groups started on re-joining client node.
*/
CacheClientReconnectDiscoveryData(Map<Integer, CacheGroupInfo> clientCacheGrps,
Map<String, CacheInfo> clientCaches) {
this.clientCacheGrps = clientCacheGrps;
CacheClientReconnectDiscoveryData(Map<String, CacheReconnectInfo> clientCaches) {
this.clientCaches = clientCaches;
}

/**
* @return Information about caches started on re-joining client node.
*/
Map<Integer, CacheGroupInfo> clientCacheGroups() {
return clientCacheGrps;
}

/**
* @return Information about caches started on re-joining client node.
*/
public Map<String, CacheInfo> clientCaches() {
public Map<String, CacheReconnectInfo> clientCaches() {
return clientCaches;
}

/**
*
*/
static class CacheGroupInfo implements Serializable {
/** */
private static final long serialVersionUID = 0L;

/** */
private final CacheConfiguration ccfg;

/** */
private final IgniteUuid deploymentId;

/** Flags added for future usage. */
private final long flags;

/**
* @param ccfg Cache group configuration.
* @param deploymentId Cache group deployment ID.
* @param flags Flags (for future usage).
*/
CacheGroupInfo(CacheConfiguration ccfg,
IgniteUuid deploymentId,
long flags) {
assert ccfg != null;
assert deploymentId != null;

this.ccfg = ccfg;
this.deploymentId = deploymentId;
this.flags = flags;
}

/**
* @return Cache group configuration.
*/
CacheConfiguration config() {
return ccfg;
}

/**
* @return Cache group deployment ID.
*/
IgniteUuid deploymentId() {
return deploymentId;
}
}

/**
*
*/
static class CacheInfo implements Serializable {
/** */
private static final long serialVersionUID = 0L;

/** */
private final CacheConfiguration ccfg;

/** */
private final CacheType cacheType;

/** */
private final IgniteUuid deploymentId;

/** */
private final boolean nearCache;

/** Flags added for future usage. */
private final long flags;

/**
* @param ccfg Cache configuration.
* @param cacheType Cache type.
* @param deploymentId Cache deployment ID.
* @param nearCache Near cache flag.
* @param flags Flags (for future usage).
*/
CacheInfo(CacheConfiguration ccfg,
CacheType cacheType,
IgniteUuid deploymentId,
boolean nearCache,
long flags) {
assert ccfg != null;
assert cacheType != null;
assert deploymentId != null;

this.ccfg = ccfg;
this.cacheType = cacheType;
this.deploymentId = deploymentId;
this.nearCache = nearCache;
this.flags = flags;
}

/**
* @return Cache configuration.
*/
CacheConfiguration config() {
return ccfg;
}

/**
* @return Cache type.
*/
CacheType cacheType() {
return cacheType;
}

/**
* @return Cache deployment ID.
*/
IgniteUuid deploymentId() {
return deploymentId;
}

/**
* @return Near cache flag.
*/
boolean nearCache() {
return nearCache;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(CacheInfo.class, this);
}
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(CacheClientReconnectDiscoveryData.class, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.Message;

/** */
public class CacheGroupRecoveryState implements Externalizable {
public class CacheGroupRecoveryState implements Externalizable, Message {
/** */
private static final long serialVersionUID = 0L;

/** */
private Set<Integer> lostParts;
@Order(0)
Set<Integer> lostParts;

/** */
private Set<Integer> zeroParts;
@Order(1)
Set<Integer> zeroParts;

/** */
public CacheGroupRecoveryState() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* 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.IgniteCheckedException;
import org.apache.ignite.internal.MarshallableMessage;
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.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;

/** */
public class CacheJoinInfo implements MarshallableMessage {
/** */
@GridToStringInclude
private StoredCacheData cacheData;

/** */
@Order(0)
byte[] cacheDataBytes;

/** */
@Order(1)
@GridToStringInclude
CacheType cacheType;

/** */
@Order(2)
@GridToStringInclude
boolean sql;

/** Flags added for future usage. */
@Order(3)
long flags;

/** Statically configured flag. */
@Order(4)
boolean staticallyConfigured;

/** */
public CacheJoinInfo() { }

/**
* @param cacheData Cache data.
* @param cacheType Cache type.
* @param sql SQL flag - {@code true} if cache was created with {@code CREATE TABLE}.
* @param flags Flags (for future usage).
* @param staticallyConfigured {@code true} if it was configured by static config and {@code false} otherwise.
*/
public CacheJoinInfo(StoredCacheData cacheData, CacheType cacheType, boolean sql, long flags,
boolean staticallyConfigured) {
this.cacheData = cacheData;
this.cacheType = cacheType;
this.sql = sql;
this.flags = flags;
this.staticallyConfigured = staticallyConfigured;
}

/**
* @return Cache data.
*/
public StoredCacheData cacheData() {
return cacheData;
}

/**
* @return Cache type.
*/
public CacheType cacheType() {
return cacheType;
}

/**
* @return SQL flag - {@code true} if cache was created with {@code CREATE TABLE}.
*/
public boolean sql() {
return sql;
}

/**
* @return {@code true} if it was configured by static config and {@code false} otherwise.
*/
public boolean isStaticallyConfigured() {
return staticallyConfigured;
}

/**
* @return Long which bits represent some flags.
*/
public long getFlags() {
return flags;
}

/**
* {@inheritDoc}
*/
@Override public String toString() {
return S.toString(CacheJoinInfo.class, this);
}

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

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