Source:
public void update( Entity entity ) throws Exception { CollectionScope collectionScope = new CollectionScopeImpl( appScope.getApplication(), appScope.getApplication(), getCollectionScopeNameFromEntityType( entity.getType() ) ); EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope ); Id entityId = new SimpleId( entity.getUuid(), entity.getType() ); if ( logger.isDebugEnabled() ) { logger.debug( "Updating entity {}:{} from scope\n app {}\n owner {}\n name {}", new Object[] { entityId.getType(), entityId.getUuid(), collectionScope.getApplication(), collectionScope.getOwner(), collectionScope.getName() } ); } org.apache.usergrid.persistence.model.entity.Entity cpEntity = ecm.load( entityId ).toBlockingObservable().last(); cpEntity = CpEntityMapUtils.fromMap( cpEntity, entity.getProperties(), entity.getType(), true ); try { logger.debug("About to Write {}:{} version {}", new Object[] { cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() }); cpEntity = ecm.update( cpEntity ).toBlockingObservable().last(); refreshIndex(); cpEntity = ecm.load( entityId ).toBlockingObservable().last(); logger.debug("Wrote {}:{} version {}", new Object[] { cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() }); } catch ( WriteUniqueVerifyException wuve ) { handleWriteUniqueVerifyException( entity, wuve ); } catch ( HystrixRuntimeException hre ) { if ( hre.getCause() instanceof WriteUniqueVerifyException ) { WriteUniqueVerifyException wuve = ( WriteUniqueVerifyException ) hre.getCause(); handleWriteUniqueVerifyException( entity, wuve ); } } CpRelationManager rm = (CpRelationManager)getRelationManager( entity ); rm.updateContainingCollectionAndCollectionIndexes( entity, cpEntity ); }

Target:
public void update( Entity entity ) throws Exception { CollectionScope collectionScope = new CollectionScopeImpl( getApplicationScope().getApplication(), getApplicationScope().getApplication(), CpNamingUtils.getCollectionScopeNameFromEntityType( entity.getType() ) ); EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope ); Id entityId = new SimpleId( entity.getUuid(), entity.getType() ); if ( logger.isDebugEnabled() ) { logger.debug( "Updating entity {}:{} from scope\n app {}\n owner {}\n name {}", new Object[] { entityId.getType(), entityId.getUuid(), collectionScope.getApplication(), collectionScope.getOwner(), collectionScope.getName() } ); } org.apache.usergrid.persistence.model.entity.Entity cpEntity = new org.apache.usergrid.persistence.model.entity.Entity( entityId ); cpEntity = CpEntityMapUtils.fromMap( cpEntity, entity.getProperties(), entity.getType(), true ); try { cpEntity = ecm.update( cpEntity ).toBlockingObservable().last(); cpEntity = ecm.load( entityId ).toBlockingObservable().last(); logger.debug("Wrote {}:{} version {}", new Object[] { cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() }); } catch ( WriteUniqueVerifyException wuve ) { handleWriteUniqueVerifyException( entity, wuve ); } catch ( HystrixRuntimeException hre ) { if ( hre.getCause() instanceof WriteUniqueVerifyException ) { WriteUniqueVerifyException wuve = ( WriteUniqueVerifyException ) hre.getCause(); handleWriteUniqueVerifyException( entity, wuve ); } } CpRelationManager rm = (CpRelationManager)getRelationManager( entity ); rm.updateContainingCollectionAndCollectionIndexes( entity, cpEntity ); }