ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [44/50] [abbrv] ignite git commit: Page Memory WIP.
Date Wed, 13 Jan 2016 13:55:28 GMT
Page Memory WIP.


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

Branch: refs/heads/ignite-gg-10837
Commit: 59a893c2598a64a4777d4db3875f99df70577193
Parents: 10012b4
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Mon Jan 11 20:05:55 2016 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Mon Jan 11 20:05:55 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/GridStringBuilder.java  | 19 +++++++++++++++++++
 .../apache/ignite/internal/util/IgniteUtils.java | 10 ++++++++++
 2 files changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/59a893c2/modules/core/src/main/java/org/apache/ignite/internal/util/GridStringBuilder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridStringBuilder.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridStringBuilder.java
index bc979f5..e9b72cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridStringBuilder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridStringBuilder.java
@@ -425,6 +425,25 @@ public class GridStringBuilder implements Serializable {
     }
 
     /**
+     * Appends given long value as a hex string to this string builder.
+     *
+     * @param val Value to append.
+     * @return This builder for chaining method calls.
+     */
+    public GridStringBuilder appendHex(long val) {
+        String hex = Long.toHexString(val);
+
+        int len = hex.length();
+
+        for (int i = 0; i < 16 - len; i++)
+            a('0');
+
+        a(hex);
+
+        return this;
+    }
+
+    /**
      *
      * @param s Stream to write to.
      * @throws IOException Thrown in case of any IO errors.

http://git-wip-us.apache.org/repos/asf/ignite/blob/59a893c2/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 480859d..6a7145c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -2482,6 +2482,16 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Gets a hex string representation of the given long value.
+     *
+     * @param val Value to convert to string.
+     * @return Hex string.
+     */
+    public static String hexLong(long val) {
+        return new SB().appendHex(val).toString();
+    }
+
+    /**
      * Return byte value for certain character.
      *
      * @param ch Character


Mime
View raw message