You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/02/25 13:31:36 UTC
[37/51] [abbrv] ignite git commit: Fixed copyrights and javadocs.
Fixed copyrights and javadocs.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/82a848d1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/82a848d1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/82a848d1
Branch: refs/heads/ignite-2523
Commit: 82a848d1776f4ebccc730c9b22a636b93328f959
Parents: 4318860
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Thu Feb 25 12:32:26 2016 +0300
Committer: Ilya Lantukh <il...@gridgain.com>
Committed: Thu Feb 25 12:32:26 2016 +0300
----------------------------------------------------------------------
.../GridDhtAtomicSingleUpdateRequest.java | 26 ++-
.../GridDhtAtomicSingleUpdateResponse.java | 26 ++-
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 188 ++++++++++++++++---
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 98 +++++++---
.../GridNearAtomicMultipleUpdateResponse.java | 9 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 3 +-
.../atomic/GridNearAtomicUpdateResponse.java | 132 ++++++++++++-
7 files changed, 394 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
index b78cc4a..4e91429 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
@@ -1,20 +1,18 @@
/*
+ * 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
*
- * * 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.
+ * 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.distributed.dht.atomic;
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
index 4930968..c8ae721 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
@@ -1,20 +1,18 @@
/*
+ * 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
*
- * * 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.
+ * 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.distributed.dht.atomic;
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 280b98e..1e9fcd2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -1,20 +1,18 @@
/*
+ * 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
*
- * * 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.
+ * 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.distributed.dht.atomic;
@@ -23,9 +21,11 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.Nullable;
@@ -34,10 +34,26 @@ import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.UUID;
-public interface GridDhtAtomicUpdateRequest {
+/**
+ * Base interface for DHT atomic update requests.
+ */
+public interface GridDhtAtomicUpdateRequest extends Message {
+ /**
+ * @return Force transform backups flag.
+ */
boolean forceTransformBackups();
+ /**
+ * @param key Key to add.
+ * @param val Value, {@code null} if should be removed.
+ * @param entryProcessor Entry processor.
+ * @param ttl TTL (optional).
+ * @param conflictExpireTime Conflict expire time (optional).
+ * @param conflictVer Conflict version (optional).
+ * @param addPrevVal If {@code true} adds previous value.
+ * @param prevVal Previous value.
+ */
void addWriteValue(KeyCacheObject key,
@Nullable CacheObject val,
EntryProcessor<Object, Object, Object> entryProcessor,
@@ -50,83 +66,209 @@ public interface GridDhtAtomicUpdateRequest {
@Nullable Long updateIdx,
boolean storeLocPrevVal);
+ /**
+ * @param key Key to add.
+ * @param val Value, {@code null} if should be removed.
+ * @param entryProcessor Entry processor.
+ * @param ttl TTL.
+ * @param expireTime Expire time.
+ */
void addNearWriteValue(KeyCacheObject key,
@Nullable CacheObject val,
EntryProcessor<Object, Object, Object> entryProcessor,
long ttl,
long expireTime);
+ /**
+ * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
+ *
+ * @return Message lookup index.
+ */
int lookupIndex();
+ /**
+ * @return Node ID.
+ */
UUID nodeId();
+ /**
+ * @return Subject ID.
+ */
UUID subjectId();
+ /**
+ * @return Task name.
+ */
int taskNameHash();
+ /**
+ * @return Keys size.
+ */
int size();
+ /**
+ * @return Keys size.
+ */
int nearSize();
+ /**
+ * @return Version assigned on primary node.
+ */
GridCacheVersion futureVersion();
+ /**
+ * @return Write version.
+ */
GridCacheVersion writeVersion();
+ /**
+ * @return Cache write synchronization mode.
+ */
CacheWriteSynchronizationMode writeSynchronizationMode();
+ /**
+ * @return Topology version.
+ */
AffinityTopologyVersion topologyVersion();
+ /**
+ * @return Keys.
+ */
Collection<KeyCacheObject> keys();
+ /**
+ * @param idx Key index.
+ * @return Key.
+ */
KeyCacheObject key(int idx);
+ /**
+ * @param idx Partition index.
+ * @return Partition id.
+ */
int partitionId(int idx);
+ /**
+ * @param updCntr Update counter.
+ * @return Update counter.
+ */
Long updateCounter(int updCntr);
+ /**
+ * @param idx Near key index.
+ * @return Key.
+ */
KeyCacheObject nearKey(int idx);
+ /**
+ * @return Keep binary flag.
+ */
boolean keepBinary();
+ /**
+ * @param idx Key index.
+ * @return Value.
+ */
@Nullable CacheObject value(int idx);
+ /**
+ * @param idx Key index.
+ * @return Value.
+ */
@Nullable CacheObject previousValue(int idx);
+ /**
+ * @param idx Key index.
+ * @return Value.
+ */
@Nullable CacheObject localPreviousValue(int idx);
+ /**
+ * @param idx Key index.
+ * @return Entry processor.
+ */
@Nullable EntryProcessor<Object, Object, Object> entryProcessor(int idx);
+ /**
+ * @param idx Near key index.
+ * @return Value.
+ */
@Nullable CacheObject nearValue(int idx);
+ /**
+ * @param idx Key index.
+ * @return Transform closure.
+ */
@Nullable EntryProcessor<Object, Object, Object> nearEntryProcessor(int idx);
+ /**
+ * @param idx Index.
+ * @return Conflict version.
+ */
@Nullable GridCacheVersion conflictVersion(int idx);
+ /**
+ * @param idx Index.
+ * @return TTL.
+ */
long ttl(int idx);
+ /**
+ * @param idx Index.
+ * @return TTL for near cache update.
+ */
long nearTtl(int idx);
+ /**
+ * @param idx Index.
+ * @return Conflict expire time.
+ */
long conflictExpireTime(int idx);
+ /**
+ * @param idx Index.
+ * @return Expire time for near cache update.
+ */
long nearExpireTime(int idx);
+ /**
+ * @return {@code True} if on response flag changed.
+ */
boolean onResponse();
+ /**
+ * @return Optional arguments for entry processor.
+ */
@Nullable Object[] invokeArguments();
+ /**
+ * This method is called before the whole message is serialized
+ * and is responsible for pre-marshalling state.
+ *
+ * @param ctx Cache context.
+ * @throws IgniteCheckedException If failed.
+ */
void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
+ /**
+ * This method is called after the message is deserialized and is responsible for
+ * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
+ *
+ * @param ctx Context.
+ * @param ldr Class loader.
+ * @throws IgniteCheckedException If failed.
+ */
void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+ /**
+ * Deployment enabled flag indicates whether deployment info has to be added to this message.
+ *
+ * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+ */
boolean addDeploymentInfo();
- boolean writeTo(ByteBuffer buf, MessageWriter writer);
-
- boolean readFrom(ByteBuffer buf, MessageReader reader);
-
- byte directType();
-
- byte fieldsCount();
-
+ /**
+ * @return Error.
+ */
IgniteCheckedException classError();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index a74fed6..8076245 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -1,63 +1,115 @@
/*
+ * 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
*
- * * 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.
+ * 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.distributed.dht.atomic;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import java.nio.ByteBuffer;
import java.util.Collection;
-public interface GridDhtAtomicUpdateResponse {
+/**
+ * Base interface for DHT atomic update responses.
+ */
+public interface GridDhtAtomicUpdateResponse extends Message {
+
+ /**
+ * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
+ *
+ * @return Message lookup index.
+ */
int lookupIndex();
+ /**
+ * @return Version assigned on primary node.
+ */
GridCacheVersion futureVersion();
+ /**
+ * Sets update error.
+ *
+ * @param err Error.
+ */
void onError(IgniteCheckedException err);
+ /**
+ * @return Error, if any.
+ */
IgniteCheckedException error();
+ /**
+ * @return Failed keys.
+ */
Collection<KeyCacheObject> failedKeys();
+ /**
+ * Adds key to collection of failed keys.
+ *
+ * @param key Key to add.
+ * @param e Error cause.
+ */
void addFailedKey(KeyCacheObject key, Throwable e);
+ /**
+ * @return Evicted readers.
+ */
Collection<KeyCacheObject> nearEvicted();
+ /**
+ * Adds near evicted key..
+ *
+ * @param key Evicted key.
+ */
void addNearEvicted(KeyCacheObject key);
+ /**
+ * This method is called before the whole message is serialized
+ * and is responsible for pre-marshalling state.
+ *
+ * @param ctx Cache context.
+ * @throws IgniteCheckedException If failed.
+ */
void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
+ /**
+ * This method is called after the message is deserialized and is responsible for
+ * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
+ *
+ * @param ctx Context.
+ * @param ldr Class loader.
+ * @throws IgniteCheckedException If failed.
+ */
void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+ /**
+ * Deployment enabled flag indicates whether deployment info has to be added to this message.
+ *
+ * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+ */
boolean addDeploymentInfo();
- boolean writeTo(ByteBuffer buf, MessageWriter writer);
-
- boolean readFrom(ByteBuffer buf, MessageReader reader);
-
- byte directType();
-
- byte fieldsCount();
-
+ /**
+ * @return Message ID.
+ */
long messageId();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
index da6d061..cbab328 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
@@ -157,7 +157,7 @@ public class GridNearAtomicMultipleUpdateResponse extends GridCacheMessage imple
*
* @param err Error.
*/
- @Override public void error(IgniteCheckedException err){
+ @Override public void error(IgniteCheckedException err) {
this.err = err;
}
@@ -321,9 +321,9 @@ public class GridNearAtomicMultipleUpdateResponse extends GridCacheMessage imple
/**
* @return Indexes of keys for which values were generated on primary node.
*/
- @Override @Nullable public List<Integer> nearValuesIndexes() {
+ @Override @Nullable public List<Integer> nearValuesIndexes() {
return nearValsIdxs;
- }
+ }
/**
* @param idx Index.
@@ -378,7 +378,8 @@ public class GridNearAtomicMultipleUpdateResponse extends GridCacheMessage imple
* @param e Error cause.
* @param ctx Context.
*/
- @Override public synchronized void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e, GridCacheContext ctx) {
+ @Override public synchronized void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e,
+ GridCacheContext ctx) {
if (failedKeys == null)
failedKeys = new ArrayList<>(keys.size());
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index bf93559..b2d847b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.GridCacheOperation;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.jetbrains.annotations.Nullable;
import javax.cache.expiry.ExpiryPolicy;
@@ -34,7 +35,7 @@ import java.util.UUID;
/**
* Base interface for near atomic update requests.
*/
-public interface GridNearAtomicUpdateRequest {
+public interface GridNearAtomicUpdateRequest extends Message {
/**
* @return Message ID.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/82a848d1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 51d388c..4d261f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -20,83 +20,197 @@ package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
import org.apache.ignite.internal.processors.cache.GridCacheReturn;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.Nullable;
+import java.io.Externalizable;
import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
-public interface GridNearAtomicUpdateResponse {
+/**
+ * Base interface for near atomic update responses.
+ */
+public interface GridNearAtomicUpdateResponse extends Message {
+ /**
+ * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
+ *
+ * @return Message lookup index.
+ */
int lookupIndex();
+ /**
+ * @return Mapped node ID.
+ */
UUID nodeId();
+ /**
+ * @param nodeId Node ID.
+ */
void nodeId(UUID nodeId);
+ /**
+ * @return Future version.
+ */
GridCacheVersion futureVersion();
+ /**
+ * Sets update error.
+ *
+ * @param err Error.
+ */
void error(IgniteCheckedException err);
+ /**
+ * @return Error, if any.
+ */
IgniteCheckedException error();
+ /**
+ * @return Collection of failed keys.
+ */
Collection<KeyCacheObject> failedKeys();
+ /**
+ * @return Return value.
+ */
GridCacheReturn returnValue();
+ /**
+ * @param ret Return value.
+ */
@SuppressWarnings("unchecked") void returnValue(GridCacheReturn ret);
+ /**
+ * @param remapKeys Remap keys.
+ */
void remapKeys(List<KeyCacheObject> remapKeys);
+ /**
+ * @return Remap keys.
+ */
Collection<KeyCacheObject> remapKeys();
+ /**
+ * Adds value to be put in near cache on originating node.
+ *
+ * @param keyIdx Key index.
+ * @param val Value.
+ * @param ttl TTL for near cache update.
+ * @param expireTime Expire time for near cache update.
+ */
void addNearValue(int keyIdx,
@Nullable CacheObject val,
long ttl,
long expireTime);
+ /**
+ * @param keyIdx Key index.
+ * @param ttl TTL for near cache update.
+ * @param expireTime Expire time for near cache update.
+ */
@SuppressWarnings("ForLoopReplaceableByForEach") void addNearTtl(int keyIdx, long ttl, long expireTime);
+ /**
+ * @param idx Index.
+ * @return Expire time for near cache update.
+ */
long nearExpireTime(int idx);
+ /**
+ * @param idx Index.
+ * @return TTL for near cache update.
+ */
long nearTtl(int idx);
+ /**
+ * @param nearVer Version generated on primary node to be used for originating node's near cache update.
+ */
void nearVersion(GridCacheVersion nearVer);
+ /**
+ * @return Version generated on primary node to be used for originating node's near cache update.
+ */
GridCacheVersion nearVersion();
+ /**
+ * @param keyIdx Index of key for which update was skipped
+ */
void addSkippedIndex(int keyIdx);
+ /**
+ * @return Indexes of keys for which update was skipped
+ */
@Nullable List<Integer> skippedIndexes();
+ /**
+ * @return Indexes of keys for which values were generated on primary node.
+ */
@Nullable List<Integer> nearValuesIndexes();
+ /**
+ * @param idx Index.
+ * @return Value generated on primary node which should be put to originating node's near cache.
+ */
@Nullable CacheObject nearValue(int idx);
+ /**
+ * Adds key to collection of failed keys.
+ *
+ * @param key Key to add.
+ * @param e Error cause.
+ */
void addFailedKey(KeyCacheObject key, Throwable e);
+ /**
+ * Adds keys to collection of failed keys.
+ *
+ * @param keys Key to add.
+ * @param e Error cause.
+ */
void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e);
+ /**
+ * Adds keys to collection of failed keys.
+ *
+ * @param keys Key to add.
+ * @param e Error cause.
+ * @param ctx Context.
+ */
void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e, GridCacheContext ctx);
+ /**
+ * This method is called before the whole message is serialized
+ * and is responsible for pre-marshalling state.
+ *
+ * @param ctx Cache context.
+ * @throws IgniteCheckedException If failed.
+ */
void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
+ /**
+ * This method is called after the message is deserialized and is responsible for
+ * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
+ *
+ * @param ctx Context.
+ * @param ldr Class loader.
+ * @throws IgniteCheckedException If failed.
+ */
void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+ /**
+ * Deployment enabled flag indicates whether deployment info has to be added to this message.
+ *
+ * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+ */
boolean addDeploymentInfo();
-
- boolean writeTo(ByteBuffer buf, MessageWriter writer);
-
- boolean readFrom(ByteBuffer buf, MessageReader reader);
-
- byte directType();
-
- byte fieldsCount();
}