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/09/08 14:46:15 UTC
[33/50] ignite git commit: Mnors.
Mnors.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eb08a67c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eb08a67c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eb08a67c
Branch: refs/heads/ignite-3199-1
Commit: eb08a67cdaa572843ca124e55891bf6a5e000618
Parents: 9807ee3
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Sep 7 20:30:38 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Sep 7 20:30:38 2016 +0300
----------------------------------------------------------------------
.../KeyValueDirtyTrackedCollection.java | 44 +++++++++++---------
.../platform/websession/SessionStateData.java | 28 ++++++-------
2 files changed, 39 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/eb08a67c/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
index 581dbb3..058e146 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
@@ -23,6 +23,7 @@ import org.apache.ignite.binary.BinaryRawWriter;
import org.apache.ignite.binary.BinaryReader;
import org.apache.ignite.binary.BinaryWriter;
import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.util.typedef.internal.S;
import java.util.ArrayList;
import java.util.List;
@@ -40,6 +41,27 @@ public class KeyValueDirtyTrackedCollection implements Binarylizable {
/** */
private List<String> removedKeys;
+ /**
+ * Apply changes from another instance.
+ *
+ * @param other Items.
+ */
+ public void applyChanges(KeyValueDirtyTrackedCollection other) {
+ assert other != null;
+
+ if (other.removedKeys != null) {
+ for (String key : other.removedKeys)
+ entries.remove(key);
+ }
+ else {
+ // Not a diff: remove all
+ entries.clear();
+ }
+
+ for (Map.Entry<String, byte[]> e : other.entries.entrySet())
+ entries.put(e.getKey(), e.getValue());
+ }
+
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
assert removedKeys == null; // Can't write diff.
@@ -79,24 +101,8 @@ public class KeyValueDirtyTrackedCollection implements Binarylizable {
}
}
- /**
- * Apply changes from another instance.
- *
- * @param other Items.
- */
- public void applyChanges(KeyValueDirtyTrackedCollection other) {
- assert other != null;
-
- if (other.removedKeys != null) {
- for (String key : other.removedKeys)
- entries.remove(key);
- }
- else {
- // Not a diff: remove all
- entries.clear();
- }
-
- for (Map.Entry<String, byte[]> e : other.entries.entrySet())
- entries.put(e.getKey(), e.getValue());
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(KeyValueDirtyTrackedCollection.class, this);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/eb08a67c/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/SessionStateData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/SessionStateData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/SessionStateData.java
index e850706..08a02e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/SessionStateData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/SessionStateData.java
@@ -105,6 +105,20 @@ public class SessionStateData implements Binarylizable {
lockTime = null;
}
+ /**
+ * Apply changes from another instance.
+ *
+ * @param other Data.
+ */
+ public void applyChanges(SessionStateData other) {
+ assert other != null;
+ assert items != null;
+
+ timeout = other.timeout;
+ staticObjects = other.staticObjects;
+ items.applyChanges(other.items);
+ }
+
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
BinaryRawWriter raw = writer.rawWriter();
@@ -129,20 +143,6 @@ public class SessionStateData implements Binarylizable {
staticObjects = raw.readByteArray();
}
- /**
- * Apply changes from another instance.
- *
- * @param other Data.
- */
- public void applyChanges(SessionStateData other) {
- assert other != null;
- assert items != null;
-
- timeout = other.timeout;
- staticObjects = other.staticObjects;
- items.applyChanges(other.items);
- }
-
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(SessionStateData.class, this);