You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/06/17 00:16:49 UTC

incubator-usergrid git commit: remove version

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev ee3a1da56 -> 4b9a310ea


remove version


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

Branch: refs/heads/two-dot-o-dev
Commit: 4b9a310eaeef2bc5cdfb60b05325f615a7877a48
Parents: ee3a1da
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Jun 16 16:06:25 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Jun 16 16:06:25 2015 -0600

----------------------------------------------------------------------
 .../MvccEntitySerializationStrategyV3Impl.java  | 24 ++++----------------
 1 file changed, 4 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4b9a310e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
index 766dc74..a89ba61 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
@@ -109,7 +109,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
 
         Optional<EntityMap> map =  EntityMap.fromEntity(entity.getEntity());
         return doWrite( applicationScope, entityId, version, colMutation -> colMutation.putColumn( COL_VALUE,
-                entitySerializer.toByteBuffer( new EntityWrapper(entityId,entity.getVersion(), entity.getStatus(), VERSION, map.isPresent() ? map.get() : null ) ) ) );
+                entitySerializer.toByteBuffer( new EntityWrapper(entityId,entity.getVersion(), entity.getStatus(), map.isPresent() ? map.get() : null ) ) ) );
     }
 
 
@@ -265,7 +265,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
 
         return doWrite(applicationScope, entityId, version, colMutation ->
                 colMutation.putColumn(COL_VALUE,
-                    entitySerializer.toByteBuffer(new EntityWrapper(entityId, version, MvccEntity.Status.DELETED, VERSION, null))
+                    entitySerializer.toByteBuffer(new EntityWrapper(entityId, version, MvccEntity.Status.DELETED, null))
                 )
         );
     }
@@ -388,8 +388,6 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
                 return null;
             }
 
-            wrapper.setSerailizationVersion(VERSION);
-
             //mark this version as empty
             if ( wrapper.getEntityMap() == null ) {
                 //we're empty
@@ -445,10 +443,6 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
             try {
                 entityWrapper = MAPPER.readValue(byteBuffer.array(), EntityWrapper.class);
 
-                if ( VERSION != entityWrapper.getSerailizationVersion()) {
-                    throw new UnsupportedOperationException( "A version of type " + entityWrapper.getSerailizationVersion() + " is unsupported" );
-                }
-
             }
             catch ( Exception e ) {
                 if( log.isDebugEnabled() ){
@@ -459,7 +453,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
 
             // it's been deleted, remove it
             if ( entityWrapper.getEntityMap() == null) {
-                return new EntityWrapper( entityWrapper.getId(), entityWrapper.getVersion(),MvccEntity.Status.DELETED, VERSION,null );
+                return new EntityWrapper( entityWrapper.getId(), entityWrapper.getVersion(),MvccEntity.Status.DELETED,null );
             }
 
             entityWrapper.setStatus(MvccEntity.Status.COMPLETE);
@@ -477,17 +471,15 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
         private MvccEntity.Status status;
         private UUID version;
         private EntityMap entityMap;
-        private int serailizationVersion;
 
 
         public EntityWrapper( ) {
         }
-        public EntityWrapper( final Id id , final UUID version, final MvccEntity.Status status, final int serailizationVersion, final EntityMap entity ) {
+        public EntityWrapper( final Id id , final UUID version, final MvccEntity.Status status, final EntityMap entity ) {
             this.setStatus(status);
             this.version=  version;
             this.entityMap = entity;
             this.id = id;
-            this.setSerailizationVersion(serailizationVersion);
         }
 
         /**
@@ -519,14 +511,6 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
             return entityMap;
         }
 
-        @JsonSerialize()
-        public int getSerailizationVersion() {
-            return serailizationVersion;
-        }
-
-        public void setSerailizationVersion(int serailizationVersion) {
-            this.serailizationVersion = serailizationVersion;
-        }
 
         @JsonIgnore
         public Optional<Entity> getOptionalEntity() {