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/15 23:57:27 UTC
incubator-usergrid git commit: remove status serialization
Repository: incubator-usergrid
Updated Branches:
refs/heads/USERGRID-751 c6f9bb1ee -> 98b547609
remove status serialization
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/98b54760
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/98b54760
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/98b54760
Branch: refs/heads/USERGRID-751
Commit: 98b5476096d7c9865f3ea34509c2447543ee9d00
Parents: c6f9bb1
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Jun 15 15:57:13 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Jun 15 15:57:13 2015 -0600
----------------------------------------------------------------------
.../impl/MvccEntitySerializationStrategyV3Impl.java | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/98b54760/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 4737fee..f867cc4 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
@@ -349,7 +349,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
this.setSerailizationVersion(serailizationVersion);
}
- @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ @JsonSerialize()
public MvccEntity.Status getStatus() {
return status;
}
@@ -358,7 +358,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
this.status = status;
}
- @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ @JsonSerialize()
public UUID getVersion() {
return version;
}
@@ -367,7 +367,6 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
this.version = version;
}
-
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public EntityMap getEntity() {
return entity;
@@ -377,7 +376,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
this.entity = entity;
}
- @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ @JsonSerialize()
public int getSerailizationVersion() {
return serailizationVersion;
}
@@ -476,7 +475,6 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
//mark this version as empty
if ( !wrapper.getOptionalEntity().isPresent() ) {
//we're empty
- wrapper.setStatus(MvccEntity.Status.DELETED);
try {
return ByteBuffer.wrap(MAPPER.writeValueAsBytes(wrapper));
}catch (JsonProcessingException jpe){
@@ -485,15 +483,12 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
}
//we have an entity
-
if ( wrapper.getStatus() != MvccEntity.Status.COMPLETE ) {
throw new UnsupportedOperationException( "Only states " + MvccEntity.Status.DELETED + " and " + MvccEntity.Status.COMPLETE + " are supported" );
}
-
wrapper.setStatus(MvccEntity.Status.COMPLETE);
-
//Convert to internal entity map
final byte[] wrapperBytes;
try {
@@ -537,7 +532,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
}
// it's been deleted, remove it
- if ( MvccEntity.Status.DELETED == entityWrapper.getStatus()) {
+ if (!entityWrapper.getOptionalEntity().isPresent()) {
return new EntityWrapper( MvccEntity.Status.DELETED, entityWrapper.getVersion(), null,VERSION );
}
}