You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2015/11/03 15:48:47 UTC
[1/2] ignite git commit: IGNITE-950 - Implement Binarylizable.
Repository: ignite
Updated Branches:
refs/heads/ignite-950-new e0a1a6602 -> ab32d0af7
IGNITE-950 - Implement Binarylizable.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a101bdfd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a101bdfd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a101bdfd
Branch: refs/heads/ignite-950-new
Commit: a101bdfdf2bead718dfa06c26e0ac2456732d604
Parents: e0a1a66
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Nov 3 17:44:29 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Nov 3 17:44:29 2015 +0300
----------------------------------------------------------------------
.../yardstick/cache/model/Organization.java | 19 ++++++++++++++--
.../ignite/yardstick/cache/model/Person.java | 24 +++++++++++++++++++-
.../ignite/yardstick/cache/model/SampleKey.java | 16 ++++++++++++-
.../yardstick/cache/model/SampleValue.java | 16 ++++++++++++-
4 files changed, 70 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a101bdfd/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Organization.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Organization.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Organization.java
index 10d09ce..f457e7e 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Organization.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Organization.java
@@ -21,12 +21,16 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
/**
* Organization record used for query test.
*/
-public class Organization implements Externalizable {
+public class Organization implements Externalizable, Binarylizable {
/** Organization ID. */
@QuerySqlField(index = true)
private int id;
@@ -94,9 +98,20 @@ public class Organization implements Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ writer.writeInt("id", id);
+ writer.writeString("name", name);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ id = reader.readInt("id");
+ name = reader.readString("name");
+ }
+
+ /** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || (o instanceof Organization) && id == ((Organization)o).id;
-
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a101bdfd/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Person.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Person.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Person.java
index 84360f6..e59ba19 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Person.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/Person.java
@@ -21,12 +21,16 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
/**
* Person record used for query test.
*/
-public class Person implements Externalizable {
+public class Person implements Externalizable, Binarylizable {
/** Person ID. */
@QuerySqlField(index = true)
private int id;
@@ -172,6 +176,24 @@ public class Person implements Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ writer.writeInt("id", id);
+ writer.writeInt("orgId", orgId);
+ writer.writeString("firstName", firstName);
+ writer.writeString("lastName", lastName);
+ writer.writeDouble("salary", salary);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ id = reader.readInt("id");
+ orgId = reader.readInt("orgId");
+ firstName = reader.readString("firstName");
+ lastName = reader.readString("lastName");
+ salary = reader.readDouble("salary");
+ }
+
+ /** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || (o instanceof Person) && id == ((Person)o).id;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a101bdfd/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleKey.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleKey.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleKey.java
index 9b65985..e089696 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleKey.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleKey.java
@@ -21,11 +21,15 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
/**
* Key class for benchmark.
*/
-public class SampleKey implements Externalizable {
+public class SampleKey implements Externalizable, Binarylizable {
/** */
private int id;
@@ -66,6 +70,16 @@ public class SampleKey implements Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ writer.writeInt("id", id);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ id = reader.readInt("id");
+ }
+
+ /** {@inheritDoc} */
@Override public boolean equals(Object o) {
if (this == o)
return true;
http://git-wip-us.apache.org/repos/asf/ignite/blob/a101bdfd/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleValue.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleValue.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleValue.java
index 81b0225..b28862c 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleValue.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/model/SampleValue.java
@@ -21,11 +21,15 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
/**
* Entity class for benchmark.
*/
-public class SampleValue implements Externalizable {
+public class SampleValue implements Externalizable, Binarylizable {
/** */
private int id;
@@ -66,6 +70,16 @@ public class SampleValue implements Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ writer.writeInt("id", id);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ id = reader.readInt("id");
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return "Value [id=" + id + ']';
}
[2/2] ignite git commit: IGNITE-950 - Debug.
Posted by ag...@apache.org.
IGNITE-950 - Debug.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ab32d0af
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ab32d0af
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ab32d0af
Branch: refs/heads/ignite-950-new
Commit: ab32d0af71ae04a085e734263321f5511f35a7a2
Parents: a101bdf
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Nov 3 17:48:37 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Nov 3 17:48:37 2015 +0300
----------------------------------------------------------------------
.../cache/distributed/GridDistributedCacheAdapter.java | 4 ++--
.../cache/distributed/GridDistributedTxRemoteAdapter.java | 2 ++
.../processors/cache/transactions/IgniteTxLocalAdapter.java | 3 +++
3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ab32d0af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index 77035df..3eb60a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -370,8 +370,6 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter
if (cache == null)
return true;
- U.debug(">>>> Running global remove all job: " + cache.name());
-
final GridCacheContext<K, V> ctx = cache.context();
ctx.gate().enter();
@@ -397,6 +395,8 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter
dataLdr.skipStore(skipStore);
dataLdr.keepBinary(keepBinary);
+ U.debug("Will use streamer [skipStore=" + skipStore + ", keepBinary=" + keepBinary + ']');
+
dataLdr.receiver(DataStreamerCacheUpdaters.<KeyCacheObject, Object>batched());
for (int part : ctx.affinity().primaryPartitions(ctx.localNodeId(), topVer)) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/ab32d0af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 3aa7e1c..b678679 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -505,6 +505,8 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
for (IgniteTxEntry txEntry : (near() ? allEntries() : writeEntries())) {
GridCacheContext cacheCtx = txEntry.context();
+ U.debug(log, "Will write transactional entry: " + txEntry);
+
boolean replicate = cacheCtx.isDrEnabled();
try {
http://git-wip-us.apache.org/repos/asf/ignite/blob/ab32d0af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 214ba45..4c53d88 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -2076,6 +2076,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
return new GridFinishedFuture<>(e);
}
+ if (!keepBinary)
+ U.dumpStack("Writing to cache without keepBinary: " + keys);
+
Set<KeyCacheObject> skipped = null;
boolean rmv = lookup == null && invokeMap == null;