ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [14/24] incubator-ignite git commit: #ignite-757 - decimal temporary fix
Date Wed, 29 Apr 2015 13:35:18 GMT
#ignite-757 - decimal temporary fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f674ec7b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f674ec7b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f674ec7b

Branch: refs/heads/ignite-sprint-4
Commit: f674ec7bb438215316e9a2d1291d44297ee364b6
Parents: 2fb6213
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Apr 27 11:11:13 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Apr 27 11:11:13 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/twostep/msg/GridH2Decimal.java  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f674ec7b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
index ea1b87c..c51df77 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.query.h2.twostep.msg;
 
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.h2.util.*;
 import org.h2.value.*;
 
 import java.math.*;
@@ -26,10 +27,9 @@ import java.nio.*;
 /**
  * H2 Decimal.
  */
-// TODO optimize representation
 public class GridH2Decimal extends GridH2ValueMessage {
     /** */
-    private String b;
+    private byte[] b;
 
     /**
      *
@@ -44,12 +44,12 @@ public class GridH2Decimal extends GridH2ValueMessage {
     public GridH2Decimal(Value val) {
         assert val.getType() == Value.DECIMAL : val.getType();
 
-        b = val.getString();
+        b = Utils.serialize(val.getBigDecimal(), null);
     }
 
     /** {@inheritDoc} */
     @Override public Value value() {
-        return ValueDecimal.get(new BigDecimal(b));
+        return ValueDecimal.get((BigDecimal)Utils.deserialize(b, null));
     }
 
     /** {@inheritDoc} */
@@ -68,7 +68,7 @@ public class GridH2Decimal extends GridH2ValueMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeString("b", b))
+                if (!writer.writeByteArray("b", b))
                     return false;
 
                 writer.incrementState();
@@ -90,7 +90,7 @@ public class GridH2Decimal extends GridH2ValueMessage {
 
         switch (reader.state()) {
             case 0:
-                b = reader.readString("b");
+                b = reader.readByteArray("b");
 
                 if (!reader.isLastRead())
                     return false;


Mime
View raw message