ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [05/50] [abbrv] incubator-ignite git commit: Ignite-211 removed "os", fixed IgniteProductVersion fromString
Date Wed, 11 Feb 2015 03:02:31 GMT
Ignite-211 removed "os", fixed IgniteProductVersion fromString


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

Branch: refs/heads/ignite-96
Commit: d461dd124b081d833a9e528d1bed12c16d2ef937
Parents: f5901bc
Author: avinogradov <avinogradov@gridgain.com>
Authored: Mon Feb 9 18:59:35 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Mon Feb 9 18:59:35 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/GridProductImpl.java |  6 ++----
 .../apache/ignite/lang/IgniteProductVersion.java    | 12 ++++++------
 .../product/GridProductVersionSelfTest.java         | 16 +++++++---------
 3 files changed, 15 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d461dd12/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
index 8715105..618d52b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
@@ -94,7 +94,7 @@ public class GridProductImpl implements IgniteProduct, Externalizable {
 
         VER_BYTES = U.intToBytes(VER.hashCode());
 
-        COMPOUND_VER = VER + "-" + (ENT ? "ent" : "os");
+        COMPOUND_VER = VER;
 
         BUILD_TSTAMP_STR = new SimpleDateFormat("yyyyMMdd").format(new Date(BUILD_TSTAMP
* 1000));
 
@@ -118,9 +118,7 @@ public class GridProductImpl implements IgniteProduct, Externalizable
{
         this.ctx = ctx;
         this.verChecker = verChecker;
 
-        String releaseType = ctx.isEnterprise() ? "ent" : "os";
-
-        ver = IgniteProductVersion.fromString(VER + '-' + releaseType + '-' + BUILD_TSTAMP
+ '-' + REV_HASH);
+        ver = IgniteProductVersion.fromString(VER + '-' + BUILD_TSTAMP + '-' + REV_HASH);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d461dd12/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
index 44135fc..3dbe5dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
@@ -40,7 +40,7 @@ public class IgniteProductVersion implements Comparable<IgniteProductVersion>,
E
 
     /** Regexp parse pattern. */
     private static final Pattern VER_PATTERN =
-        Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)((?!-(os|ent))-([^-]+))?(-(os|ent))?(-(\\d+))?(-([\\da-f]+))?");
+        Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(-([^0123456789][^-]+))?(-(\\d+))?(-([\\da-f]+))?");
 
     /** Major version number. */
     private byte major;
@@ -267,17 +267,17 @@ public class IgniteProductVersion implements Comparable<IgniteProductVersion>,
E
                 String stage = "";
 
                 if (match.group(4) != null)
-                    stage = match.group(6);
+                    stage = match.group(5);
 
                 long revTs = 0;
 
-                if (match.group(9) != null)
-                    revTs = Long.parseLong(match.group(10));
+                if (match.group(6) != null)
+                    revTs = Long.parseLong(match.group(7));
 
                 byte[] revHash = null;
 
-                if (match.group(11) != null)
-                    revHash = U.decodeHex(match.group(12).toCharArray());
+                if (match.group(8) != null)
+                    revHash = U.decodeHex(match.group(9).toCharArray());
 
                 return new IgniteProductVersion(major, minor, maintenance, stage, revTs,
revHash);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d461dd12/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java
index bac7e78..3134175 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/product/GridProductVersionSelfTest.java
@@ -40,7 +40,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertEquals(0, ver.revisionTimestamp());
         assertArrayEquals(new byte[20], ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-ent-0-DEV");
+        ver = IgniteProductVersion.fromString("1.2.3-0-DEV");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -48,7 +48,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertEquals(0, ver.revisionTimestamp());
         assertArrayEquals(new byte[20], ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-rc1-os-4-DEV");
+        ver = IgniteProductVersion.fromString("1.2.3-rc1-4-DEV");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -66,7 +66,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertEquals(4, ver.revisionTimestamp());
         assertArrayEquals(new byte[20], ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-ent");
+        ver = IgniteProductVersion.fromString("1.2.3");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -75,7 +75,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertEquals(0, ver.revisionTimestamp());
         assertArrayEquals(new byte[20], ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-os-4");
+        ver = IgniteProductVersion.fromString("1.2.3-4");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -84,7 +84,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertEquals(4, ver.revisionTimestamp());
         assertArrayEquals(new byte[20], ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-ent-4-18e5a7ec9e3202126a69bc231a6b965bc1d73dee");
+        ver = IgniteProductVersion.fromString("1.2.3-4-18e5a7ec9e3202126a69bc231a6b965bc1d73dee");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -94,7 +94,7 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest {
         assertArrayEquals(new byte[]{24, -27, -89, -20, -98, 50, 2, 18, 106, 105, -68, 35,
26, 107, -106, 91, -63, -41, 61, -18},
             ver.revisionHash());
 
-        ver = IgniteProductVersion.fromString("1.2.3-rc1-os-4-18e5a7ec9e3202126a69bc231a6b965bc1d73dee");
+        ver = IgniteProductVersion.fromString("1.2.3-rc1-4-18e5a7ec9e3202126a69bc231a6b965bc1d73dee");
 
         assertEquals(1, ver.major());
         assertEquals(2, ver.minor());
@@ -104,8 +104,6 @@ public class GridProductVersionSelfTest extends GridCommonAbstractTest
{
         assertArrayEquals(new byte[]{24, -27, -89, -20, -98, 50, 2, 18, 106, 105, -68, 35,
26, 107, -106, 91, -63, -41, 61, -18},
             ver.revisionHash());
 
-        IgniteProductVersion.fromString(VER + '-' + "ent" + '-' + BUILD_TSTAMP + '-' + REV_HASH);
-
-        IgniteProductVersion.fromString(VER + '-' + "os" + '-' + BUILD_TSTAMP + '-' + REV_HASH);
+        IgniteProductVersion.fromString(VER + '-' + BUILD_TSTAMP + '-' + REV_HASH);
     }
 }


Mime
View raw message