Remove unnecessary releaseUniqueValues() logic.

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

Branch: refs/heads/master
Commit: d5d89a8203f8939fa2a436a718e3f5d4b3cce3de
Parents: 37972a2
Author: Dave Johnson <[email protected]>
Authored: Thu Jul 7 13:53:45 2016 -0400
Committer: Dave Johnson <[email protected]>
Committed: Thu Jul 7 13:53:45 2016 -0400

----------------------------------------------------------------------
 .../mvcc/stage/delete/MarkCommit.java           | 36 +++++++++++---------
 .../uniquevalues/UniqueValuesService.java       |  7 ++--
 .../uniquevalues/UniqueValuesServiceImpl.java   | 30 +++++++++-------
 3 files changed, 40 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/d5d89a82/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
index 70c785e..57d92e1 100644
--- 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
+++ 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
@@ -126,23 +126,25 @@ public class MarkCommit implements 
Action1<CollectionIoEvent<MvccEntity>> {
             throw new RuntimeException( "Unable to mark entry as deleted" );
         }
 
-        // actorSystemFig may be null in testing
-        if ( actorSystemFig != null && actorSystemFig.getEnabled() ) {
-
-            String region = idIoEvent.getRegion();
-            if ( region == null ) {
-                region = uniqueValuesFig.getAuthoritativeRegion();
-            }
-            if ( region == null ) {
-                region = actorSystemFig.getRegionLocal();
-            }
-
-            try {
-                uniqueValuesService.releaseUniqueValues( applicationScope, 
entityId, version, region );
-            } catch (UniqueValueException e) {
-                throw new RuntimeException( "Unable to release unique values 
for entity " + entityId );
-            }
-        }
+        // TODO: do we need this or can we rely on UniqueCleanup + Cassandra 
replication?
+//
+//        // actorSystemFig may be null in testing
+//        if ( actorSystemFig != null && actorSystemFig.getEnabled() ) {
+//
+//            String region = idIoEvent.getRegion();
+//            if ( region == null ) {
+//                region = uniqueValuesFig.getAuthoritativeRegion();
+//            }
+//            if ( region == null ) {
+//                region = actorSystemFig.getRegionLocal();
+//            }
+//
+//            try {
+//                uniqueValuesService.releaseUniqueValues( applicationScope, 
entityId, version, region );
+//            } catch (UniqueValueException e) {
+//                throw new RuntimeException( "Unable to release unique values 
for entity " + entityId );
+//            }
+//        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d5d89a82/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesService.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesService.java
 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesService.java
index 5deddd6..1104a23 100644
--- 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesService.java
+++ 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesService.java
@@ -59,15 +59,16 @@ public interface UniqueValuesService extends RouterProducer 
{
     void confirmUniqueValues( ApplicationScope scope, Entity entity, UUID 
version , String region )
         throws UniqueValueException;
 
+    // TODO: is this really necessary? MarkCommit and UniqueCleanup should do 
the trick
     /**
      * Release unique values held by an entity.
-     *
      * @param scope Application scope of entity.
      * @param entityId Id of Entity with unique values to be released
      * @param version Version of entity.
      * @param region Authoritative Region to be used for this entity or null 
to use current region.
      * @throws UniqueValueException if unique values cannot be reserved.
      */
-    void releaseUniqueValues( ApplicationScope scope, Id entityId, UUID 
version, String region )
-        throws UniqueValueException;
+//    void releaseUniqueValues( ApplicationScope scope, Id entityId, UUID 
version, String region )
+//        throws UniqueValueException;
+
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d5d89a82/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesServiceImpl.java
 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesServiceImpl.java
index 4102090..50114be 100644
--- 
a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesServiceImpl.java
+++ 
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/uniquevalues/UniqueValuesServiceImpl.java
@@ -151,19 +151,23 @@ public class UniqueValuesServiceImpl implements 
UniqueValuesService {
     }
 
 
-    @Override
-    public void releaseUniqueValues(ApplicationScope scope, Id entityId, UUID 
version, String region)
-        throws UniqueValueException {
-
-        ready();
-
-        Iterator<UniqueValue> iterator = table.getUniqueValues( scope, 
entityId );
-
-        while ( iterator.hasNext() ) {
-            UniqueValue uniqueValue = iterator.next();
-            cancelUniqueField( scope, entityId, 
uniqueValue.getEntityVersion(), uniqueValue.getField(), region );
-        }
-    }
+    // TODO: do we need this or can we rely on UniqueCleanup + Cassandra 
replication?
+
+//    @Override
+//    public void releaseUniqueValues(ApplicationScope scope, Id entityId, 
UUID version, String region)
+//        throws UniqueValueException {
+//
+//        ready();
+//
+//        TODO: need to replicate logic from UniqueCleanup and make sure it 
happens in Authoritative Region
+//
+//        Iterator<UniqueValue> iterator = table.getUniqueValues( scope, 
entityId );
+//
+//        while ( iterator.hasNext() ) {
+//            UniqueValue uniqueValue = iterator.next();
+//            cancelUniqueField( scope, entityId, 
uniqueValue.getEntityVersion(), uniqueValue.getField(), region );
+//        }
+//    }
 
 
     private void reserveUniqueField(

Reply via email to