You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/01/20 06:21:46 UTC
[15/51] [abbrv] git commit: Add concurrency for unique value
verification,
make thread pool and unique value TTL configurable via new WriteFig. Plus,
license headers and import re-orgs.
Add concurrency for unique value verification, make thread pool and unique value TTL configurable via new WriteFig. Plus, license headers and import re-orgs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/000a219e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/000a219e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/000a219e
Branch: refs/pull/18/merge
Commit: 000a219ec94f10403954c9eea69351d89aefb892
Parents: 82bea51
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Jan 15 13:15:06 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Jan 15 13:15:06 2014 -0500
----------------------------------------------------------------------
.../collection/guice/CollectionModule.java | 27 +++-
.../collection/mvcc/entity/ValidationUtils.java | 2 +-
.../mvcc/stage/write/WriteCommit.java | 2 +-
.../collection/mvcc/stage/write/WriteFig.java | 42 ++++++
.../mvcc/stage/write/WriteUniqueVerify.java | 132 ++++++++++++++-----
.../collection/serialization/UniqueUpdate.java | 28 ----
.../changelog/ChangeLogGeneratorImplTest.java | 20 ---
.../mvcc/stage/AbstractEntityStageTest.java | 17 +++
.../mvcc/stage/AbstractIdStageTest.java | 17 +++
.../mvcc/stage/AbstractMvccEntityStageTest.java | 32 ++++-
.../mvcc/stage/InvalidMvccEntityGenerator.java | 26 ++--
.../mvcc/stage/TestEntityGenerator.java | 17 +++
.../write/EntityVersionSerializerTest.java | 2 -
.../mvcc/stage/write/FieldSerializerTest.java | 1 -
...niqueValueSerializationStrategyImplTest.java | 4 +-
.../mvcc/stage/write/WriteCommitTest.java | 17 +++
.../mvcc/stage/write/WriteStartTest.java | 17 +++
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 23 +++-
.../collection/util/InvalidEntityGenerator.java | 27 +++-
.../collection/util/InvalidIdGenerator.java | 18 ++-
.../src/test/resources/log4j.properties | 11 +-
.../impl/EdgeMetadataSerializationImpl.java | 3 +-
22 files changed, 361 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index e05084b..294c5fc 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@ -1,6 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.guice;
-
import org.safehaus.guicyfig.GuicyFigModule;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
@@ -20,6 +36,7 @@ import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategy;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategyImpl;
+import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteFig;
import rx.Scheduler;
@@ -34,8 +51,12 @@ public class CollectionModule extends AbstractModule {
@Override
protected void configure() {
//noinspection unchecked
- install( new GuicyFigModule( RxFig.class, MigrationManagerFig.class,
- CassandraFig.class, SerializationFig.class ) );
+ install( new GuicyFigModule(
+ RxFig.class,
+ MigrationManagerFig.class,
+ CassandraFig.class,
+ SerializationFig.class,
+ WriteFig.class ) );
install( new SerializationModule() );
install( new ServiceModule() );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
index 910da91..e8a8481 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
@@ -82,7 +82,7 @@ public class ValidationUtils {
final UUID uuid = entityId.getUuid();
- Preconditions.checkNotNull( uuid, "The id uuid is required to be set" );
+ Preconditions.checkArgument( uuid != null, "The id uuid is required to be set" );
Preconditions.checkArgument( uuid.version() == UUID_VERSION, "The uuid must be version 1" );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index 31212eb..bcec305 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -105,7 +105,7 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, Entity>
if ( field.isUnique() ) {
UniqueValue written = new UniqueValueImpl(
ioEvent.getEntityCollection(), field, entity.getId(), entity.getVersion());
- MutationBatch mb = uniqueValueStrat.write( written, null );
+ MutationBatch mb = uniqueValueStrat.write( written );
// merge into our existing mutation batch
logMutation.mergeShallow( mb );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
new file mode 100644
index 0000000..d2282a8
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.usergrid.persistence.collection.mvcc.stage.write;
+
+import org.safehaus.guicyfig.Default;
+import org.safehaus.guicyfig.GuicyFig;
+import org.safehaus.guicyfig.Key;
+
+/**
+ * Configuration for Write stage classes.
+ */
+public interface WriteFig extends GuicyFig {
+
+ /**
+ * Max number of threads the uniqueness verification pool can allocate. Can be dynamically changed after starting
+ */
+ @Key( "collection.stage.write.verification.threads" )
+ @Default( "20" )
+ int getMaxThreadCount();
+
+ /**
+ * Time to Live for Unique Values before commit.
+ */
+ @Key( "collection.stage.write.verification.ttl.seconds" )
+ @Default( "10" )
+ int getUniqueValueTimeToLive();
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index a147469..b6ae94d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -17,7 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-
import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
import org.apache.usergrid.persistence.collection.mvcc.entity.ValidationUtils;
import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -26,6 +25,13 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.netflix.astyanax.MutationBatch;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.field.Field;
@@ -35,63 +41,121 @@ import org.slf4j.LoggerFactory;
import rx.util.functions.Func1;
/**
- * This phase should execute any verification on the MvccEntity
+ * This phase execute all unique value verification on the MvccEntity.
*/
@Singleton
-public class WriteUniqueVerify
- implements Func1<CollectionIoEvent<MvccEntity>, CollectionIoEvent<MvccEntity>> {
+public class WriteUniqueVerify
+ implements Func1<CollectionIoEvent<MvccEntity>, CollectionIoEvent<MvccEntity>> {
private static final Logger LOG = LoggerFactory.getLogger( WriteUniqueVerify.class );
- private UniqueValueSerializationStrategy uniqueValueStrat;
+ private final WriteFig writeFig;
+
+ private final UniqueValueSerializationStrategy uniqueValueStrat;
+
+ private final ExecutorService threadPool;
@Inject
- public WriteUniqueVerify( UniqueValueSerializationStrategy uniqueValueSerializiationStrategy ) {
+ public WriteUniqueVerify( WriteFig writeFig,
+ UniqueValueSerializationStrategy uniqueValueSerializiationStrategy ) {
+ this.writeFig = writeFig;
this.uniqueValueStrat = uniqueValueSerializiationStrategy;
+ this.threadPool = Executors.newFixedThreadPool( writeFig.getMaxThreadCount() );
}
@Override
public CollectionIoEvent<MvccEntity> call( final CollectionIoEvent<MvccEntity> ioevent ) {
+ final Entity entity = ioevent.getEvent().getEntity().get();
+
ValidationUtils.verifyMvccEntityWithEntity( ioevent.getEvent() );
- Entity entity = ioevent.getEvent().getEntity().get();
+ // use simple thread pool to verify fields in parallel
+ final List<Future<FieldUniquenessResult>> results =
+ new ArrayList<Future<FieldUniquenessResult>>();
- for ( Field field : entity.getFields() ) {
+ for ( final Field field : entity.getFields() ) {
if ( field.isUnique() ) {
- // use write-first then read strategy
- UniqueValue written = new UniqueValueImpl(
- ioevent.getEntityCollection(), field, entity.getId(), entity.getVersion());
-
- // use TTL in case something goes wrong before entity is finally committed
- // TODO: make TTL configurable
- MutationBatch mb = uniqueValueStrat.write( written, 10 );
- try {
- mb.execute();
- } catch (ConnectionException ex) {
- throw new CollectionRuntimeException(
- "Error writing unique value " + field.toString(), ex );
- }
-
- // does the database value match what we wrote?
- UniqueValue loaded;
- try {
- loaded = uniqueValueStrat.load(
- ioevent.getEntityCollection(), field );
-
- } catch (ConnectionException ex) {
- throw new CollectionRuntimeException( ex );
- }
+ results.add( threadPool.submit( new Callable<FieldUniquenessResult>() {
- if ( !loaded.equals(written) ) {
- throw new CollectionRuntimeException( "Duplicate field value " + field.toString() );
- }
+ public FieldUniquenessResult call() throws Exception {
+
+ // use write-first then read strategy
+ UniqueValue written = new UniqueValueImpl( ioevent.getEntityCollection(),
+ field, entity.getId(), entity.getVersion() );
+
+ // use TTL in case something goes wrong before entity is finally committed
+ MutationBatch mb = uniqueValueStrat.write(
+ written, writeFig.getUniqueValueTimeToLive() );
+
+ try {
+ mb.execute();
+ } catch ( ConnectionException ex ) {
+ throw new CollectionRuntimeException(
+ "Error writing unique value " + field.toString(), ex );
+ }
+
+ // does the database value match what we wrote?
+ UniqueValue loaded;
+ try {
+ loaded = uniqueValueStrat.load(
+ ioevent.getEntityCollection(), field );
+
+ } catch ( ConnectionException ex ) {
+ throw new CollectionRuntimeException( ex );
+ }
+
+ return new FieldUniquenessResult( field, loaded.equals( written ));
+ }
+
+ } ) );
+
+ }
+ }
+ for ( Future<FieldUniquenessResult> result : results ) {
+ try {
+ if ( !result.get().isUnique() ) {
+ Field field = result.get().getField();
+ throw new CollectionRuntimeException( "Duplicate field value "
+ + field.getName() + " = " + field.getValue().toString());
+ }
+ } catch ( InterruptedException ex ) {
+ LOG.error( "Error verifing uniqueness", ex );
+ } catch ( ExecutionException ex ) {
+ LOG.error( "Error verifing uniqueness", ex );
}
}
return ioevent;
}
+
+ static class FieldUniquenessResult {
+ private Field field;
+ private Boolean unique;
+
+ public FieldUniquenessResult( Field f, Boolean u ) {
+ this.field = f;
+ this.unique = u;
+ }
+
+ public Boolean isUnique() {
+ return unique;
+ }
+
+ public void setUnique( Boolean isUnique ) {
+ this.unique = isUnique;
+ }
+
+ public Field getField() {
+ return field;
+ }
+
+ public void setField( Field field ) {
+ this.field = field;
+ }
+
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
deleted file mode 100644
index d4c0ffc..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.usergrid.persistence.collection.serialization;
-
-
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.field.Field;
-
-
-/**
- * Interface to define how unique updates should be performed
- */
-public interface UniqueUpdate {
-
- /**
- * WriteUniqueVerify the entity we're trying to write in our current context has the correct most current version
- *
- * @param context The mvcc context
- * @param uniqueField The field to check for uniqueness
- *
- * @return True if the value in the uniqueField is unique in the collection context
- */
- public boolean verifyUnique( MvccEntity context, Field<?> uniqueField );
-
- /**
- * During the commit phase, ensure this entity is committed as a unique value. This may release locks or overwrite
- * expiring timeout values since we are at the final commit phase
- */
- public void commitUnique( MvccEntity entity, Field<?> uniqueField );
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
index 5f40f0e..c9fb131 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
@@ -69,26 +69,6 @@ public class ChangeLogGeneratorImplTest {
@Inject
MvccEntitySerializationStrategy mvccEntitySerializationStrategy;
- public ChangeLogGeneratorImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() {
- }
-
- @AfterClass
- public static void tearDownClass() {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() {
- }
-
-
/**
* Test that change log creation follows Todd's example.
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
index c3e7f68..3882dc9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
index 4d30ced..ea071ac 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
index 6154dbe..fafefc3 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
@@ -34,6 +51,7 @@ public abstract class AbstractMvccEntityStageTest {
@InvalidMvccEntityGenerator.NullFields final MvccEntity mvccEntity,
@InvalidEntityGenerator.NullFields final Entity entity,
@InvalidIdGenerator.NullFields final Id nullValidationFailId ) throws Exception {
+
testStage( mvccEntity, entity, nullValidationFailId );
}
@@ -56,16 +74,16 @@ public abstract class AbstractMvccEntityStageTest {
public void testStage(
final MvccEntity mvccEntity, final Entity entity, final Id id ) throws Exception {
- if(entity != null){
- EntityUtils.setId( entity, id );
- }
+// if ( entity != null ) {
+// EntityUtils.setId( entity, id );
+// }
final CollectionScope context = mock( CollectionScope.class );
- if(mvccEntity != null){
- when(mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
- when(mvccEntity.getId()).thenReturn( id );
- }
+// if ( mvccEntity != null ) {
+// when(mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
+// when(mvccEntity.getId()).thenReturn( id );
+// }
validateStage( new CollectionIoEvent<MvccEntity>( context, mvccEntity ) );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
index c1fef8d..e1393c2 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
@@ -43,12 +60,9 @@ public class InvalidMvccEntityGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "nullValue", null ) );
result.add( PotentialAssignment.forValue( "nullSubTypes", nullSubElements() ) );
-
-
return result;
}
@@ -56,11 +70,7 @@ public class InvalidMvccEntityGenerator {
/** Missing fields */
private static MvccEntity nullSubElements() {
-
final MvccEntity entity = mock( MvccEntity.class );
-
- when( entity.getVersion() ).thenReturn( UUIDGenerator.newTimeUUID() );
-
return entity;
}
@@ -84,11 +94,9 @@ public class InvalidMvccEntityGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "wrongUuidType", wrongUuidType() ) );
result.add( PotentialAssignment.forValue( "invalidSubTypes", mock( MvccEntity.class )) );
-
return result;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
index 133154d..4f7bd17 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
index b11cdcf..8b4a4f7 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
@@ -17,8 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.EntityVersion;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.EntityVersionSerializer;
import java.nio.ByteBuffer;
import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
index de683af..b7deff8 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
@@ -17,7 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.FieldSerializer;
import com.netflix.astyanax.model.CompositeBuilder;
import com.netflix.astyanax.model.CompositeParser;
import com.netflix.astyanax.model.Composites;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
index 10a70f9..144e634 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
@@ -65,7 +65,7 @@ public class UniqueValueSerializationStrategyImplTest {
Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), "entity");
UUID version = UUIDGenerator.newTimeUUID();
UniqueValue stored = new UniqueValueImpl( scope, field, entityId, version );
- strategy.write( stored, null ).execute();
+ strategy.write( stored ).execute();
UniqueValue retrieved = strategy.load( scope, field );
Assert.assertNotNull( retrieved );
@@ -111,7 +111,7 @@ public class UniqueValueSerializationStrategyImplTest {
Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), "entity");
UUID version = UUIDGenerator.newTimeUUID();
UniqueValue stored = new UniqueValueImpl( scope, field, entityId, version );
- strategy.write( stored, null ).execute();
+ strategy.write( stored ).execute();
strategy.delete( stored ).execute();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
index ca1a057..981a14d 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
index 9a344f8..ecb458a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
index ec095bf..7569c18 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
@@ -21,6 +21,8 @@ import com.google.inject.Inject;
import org.junit.Test;
import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.collection.guice.CollectionModule;
import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
import org.apache.usergrid.persistence.collection.mvcc.stage.AbstractMvccEntityStageTest;
import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -28,17 +30,29 @@ import org.apache.usergrid.persistence.model.entity.Entity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.fromEntity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.generateEntity;
+import org.jukito.JukitoRunner;
+import org.jukito.UseModules;
import static org.junit.Assert.assertSame;
+import org.junit.ClassRule;
+import org.junit.runner.RunWith;
import static org.mockito.Mockito.mock;
-/** @author tnine */
-
+/**
+ * @author tnine
+ */
+@RunWith( JukitoRunner.class )
+@UseModules( CollectionModule.class )
public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
+ @ClassRule
+ public static CassandraRule rule = new CassandraRule();
+
@Inject
private UniqueValueSerializationStrategy uniqueValueSerializiationStrategy;
+ @Inject
+ private WriteFig writeFig;
/** Standard flow */
@Test
@@ -52,7 +66,7 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
final MvccEntity mvccEntity = fromEntity( entity );
// run the stage
- WriteUniqueVerify newStage = new WriteUniqueVerify( uniqueValueSerializiationStrategy );
+ WriteUniqueVerify newStage = new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy );
CollectionIoEvent<MvccEntity>
result = newStage.call( new CollectionIoEvent<MvccEntity>( collectionScope, mvccEntity ) );
@@ -70,10 +84,9 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
assertSame( "Entity correct", entity, entry.getEntity().get() );
}
-
@Override
protected void validateStage( final CollectionIoEvent<MvccEntity> event ) {
- new WriteUniqueVerify( uniqueValueSerializiationStrategy ).call( event );
+ new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy ).call( event );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
index 632ecc0..df4fb72 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.util;
@@ -13,6 +30,8 @@ import org.junit.experimental.theories.ParametersSuppliedBy;
import org.junit.experimental.theories.PotentialAssignment;
import org.apache.usergrid.persistence.model.entity.Entity;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
/**
@@ -38,12 +57,14 @@ public class InvalidEntityGenerator {
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
-
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
- result.add( PotentialAssignment.forValue( "nullEntity", null ) );
- result.add( PotentialAssignment.forValue( "nullIdsEntity", new Entity() ) );
+ final Entity entity = mock( Entity.class );
+ when( entity.getId() ).thenReturn( null );
+ when( entity.getVersion() ).thenReturn( null );
+ result.add( PotentialAssignment.forValue( "nullEntity", null ) );
+ result.add( PotentialAssignment.forValue( "nullIdsEntity", entity ) );
return result;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
index 6354c55..5341813 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
package org.apache.usergrid.persistence.collection.util;
@@ -41,7 +58,6 @@ public class InvalidIdGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "nullId", null ) );
result.add( PotentialAssignment.forValue( "nullEntityId", nullEntityId() ) );
result.add( PotentialAssignment.forValue( "nullEntityType", nullEntityType() ) );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/log4j.properties b/stack/corepersistence/collection/src/test/resources/log4j.properties
index 1a7a06c..8a482db 100644
--- a/stack/corepersistence/collection/src/test/resources/log4j.properties
+++ b/stack/corepersistence/collection/src/test/resources/log4j.properties
@@ -1,9 +1,8 @@
# suppress inspection "UnusedProperty" for whole file
-log4j.rootLogger=WARN,stdout
-log4j.rootCategory=WARN,stdout
+log4j.rootLogger=INFO,standard
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{3}.%M(%L)<%t>- %m%n
+log4j.appender.standard=org.apache.log4j.ConsoleAppender
+log4j.appender.standard.layout=org.apache.log4j.PatternLayout
+log4j.appender.standard.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{3}.%M(%L)<%t>- %m%n
-log4j.logger.org.apache.usergrid=DEBUG,stdout
+log4j.logger.org.apache.usergrid=DEBUG
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
index fb3c6b7..c9d3f6c 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
@@ -134,8 +134,9 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
//write source->target edge type and id type to meta data
+ EdgeIdTypeKey tk = new EdgeIdTypeKey( source, edgeType );
final ScopedRowKey<OrganizationScope, EdgeIdTypeKey> sourceTypeKey =
- new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, new EdgeIdTypeKey( source, edgeType ) );
+ new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, tk );
batch.withRow( CF_TARGET_EDGE_ID_TYPES, sourceTypeKey ).setTimestamp( timestamp )