usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject usergrid git commit: Finished cleanup
Date Fri, 11 Sep 2015 01:12:57 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-909 4804789d6 -> 5588f77c6


Finished cleanup


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

Branch: refs/heads/USERGRID-909
Commit: 5588f77c60f8b49aa2e7fccfc564d37f92475410
Parents: 4804789
Author: Todd Nine <tnine@apigee.com>
Authored: Thu Sep 10 19:12:54 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Thu Sep 10 19:12:54 2015 -0600

----------------------------------------------------------------------
 stack/corepersistence/graph/pom.xml             |   5 -
 .../shard/impl/NodeShardAllocationImpl.java     |  56 +----
 .../shard/impl/ShardGroupCompactionImpl.java    |   9 +-
 .../graph/guice/TestGraphModule.java            |   2 -
 .../impl/shard/NodeShardAllocationTest.java     |  47 +++-
 .../impl/shard/ShardGroupCompactionTest.java    | 231 -------------------
 6 files changed, 42 insertions(+), 308 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml
index 65fd719..cdcd2b3 100644
--- a/stack/corepersistence/graph/pom.xml
+++ b/stack/corepersistence/graph/pom.xml
@@ -41,11 +41,6 @@
       <version>${project.version}</version>
     </dependency>
 
-      <dependency>
-          <groupId>org.apache.usergrid</groupId>
-          <artifactId>locks</artifactId>
-          <version>${project.version}</version>
-      </dependency>
 
     <dependency>
       <groupId>org.apache.usergrid</groupId>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index da6041c..085dd97 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -42,9 +42,6 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntry
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
 import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
-import org.apache.usergrid.persistence.locks.LockId;
-import org.apache.usergrid.persistence.locks.LockManager;
-import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -346,6 +343,10 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
     }
 
 
+    /**
+     * Class that just ignores compaction events, since we're already evaluating the events.
 A bit of a hack
+     * that shows we need some refactoring
+     */
     private final static class NoOpCompaction implements ShardGroupCompaction {
 
         @Override
@@ -359,53 +360,4 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
     }
 
 
-    private final static class ShardKeyLockId implements LockId {
-
-        private final ApplicationScope scope;
-        private final DirectedEdgeMeta directedEdgeMeta;
-        private final Shard shard;
-
-
-        private ShardKeyLockId( final ApplicationScope scope, final DirectedEdgeMeta directedEdgeMeta,
-                                final Shard shard ) {
-            this.scope = scope;
-            this.directedEdgeMeta = directedEdgeMeta;
-            this.shard = shard;
-        }
-
-
-        @Override
-        public String generateKey() {
-
-            final StringBuilder builder = new StringBuilder();
-
-            //append the node meta data
-            for ( final DirectedEdgeMeta.NodeMeta node : directedEdgeMeta.getNodes() ) {
-
-                final Id nodeId = node.getId();
-
-                builder.append( "type(" ).append( nodeId.getType() ).append( ").uuid(" ).append(
nodeId.getUuid() )
-                       .append( ").storage(" ).append( node.getNodeType().getStorageValue()
).append( ")" );
-            }
-
-
-            //            for ( final String type : directedEdgeMeta.getTypes() ) {
-            //                builder.append( type );
-            //            }
-            //
-            //            builder.append( directedEdgeMeta.getType() );
-
-
-            //append the shard
-            builder.append( ".shard(" ).append( shard.getShardIndex() ).append( ")" );
-
-            return builder.toString();
-        }
-
-
-        @Override
-        public ApplicationScope getApplicationScope() {
-            return scope;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
index 855326f..7d8134a 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
@@ -102,26 +102,19 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction
{
     private final EdgeColumnFamilies edgeColumnFamilies;
     private final Keyspace keyspace;
     private final EdgeShardSerialization edgeShardSerialization;
-    private final NodeShardApproximation nodeShardApproximation;
 
     private final Random random;
     private final ShardCompactionTaskTracker shardCompactionTaskTracker;
     private final ShardAuditTaskTracker shardAuditTaskTracker;
-    private final RxTaskScheduler rxTaskScheduler;
-
 
     @Inject
     public ShardGroupCompactionImpl( final TimeService timeService, final GraphFig graphFig,
                                      final NodeShardAllocation nodeShardAllocation,
                                      final ShardedEdgeSerialization shardedEdgeSerialization,
                                      final EdgeColumnFamilies edgeColumnFamilies, final Keyspace
keyspace,
-                                     final EdgeShardSerialization edgeShardSerialization,
-                                     final NodeShardApproximation nodeShardApproximation,
-                                     final RxTaskScheduler rxTaskScheduler ) {
+                                     final EdgeShardSerialization edgeShardSerialization)
{
 
         this.timeService = timeService;
-        this.nodeShardApproximation = nodeShardApproximation;
-        this.rxTaskScheduler = rxTaskScheduler;
         this.countAudits = new AtomicLong();
         this.graphFig = graphFig;
         this.nodeShardAllocation = nodeShardAllocation;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
index 5235c84..c0451c5 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/guice/TestGraphModule.java
@@ -24,7 +24,6 @@ import org.apache.usergrid.persistence.core.guice.TestModule;
 import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.migration.data.TestMigrationDataProvider;
 import org.apache.usergrid.persistence.graph.serialization.impl.migration.GraphNode;
-import org.apache.usergrid.persistence.locks.guice.LockModule;
 
 import com.google.inject.TypeLiteral;
 
@@ -40,7 +39,6 @@ public class TestGraphModule extends TestModule {
          * Runtime modules
          */
         install( new CommonModule() );
-        install( new LockModule() );
         install( new GraphModule() {
 
             @Override

http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
index dc36f69..aeb65e0 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
@@ -122,6 +122,11 @@ public class NodeShardAllocationTest {
 
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType(
nodeId, type, subType );
 
+
+        //mock up returning same state
+        when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
same(targetEdgeMeta ))).thenReturn(
+            Arrays.asList(  futureShard, firstShard ).iterator() );
+
         final boolean result = approximation.auditShard( scope, shardEntryGroup, targetEdgeMeta
);
 
         assertFalse( "No shard allocated", result );
@@ -156,14 +161,23 @@ public class NodeShardAllocationTest {
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
 
+
+
         final Shard futureShard = new Shard( 10000l, timeservicetime, true );
 
         final ShardEntryGroup shardEntryGroup = new ShardEntryGroup( );
         shardEntryGroup.addShard( futureShard );
 
+
+
+
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType(
nodeId, type, subType );
 
 
+        //mock up returning empty group state
+        when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
same(targetEdgeMeta ))).thenReturn( Collections.emptyIterator() );
+
+
         //return a shard size < our max by 1
 
         final long count = graphFig.getShardSize() - 1;
@@ -204,13 +218,18 @@ public class NodeShardAllocationTest {
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
 
-        final Shard futureShard = new Shard( 0l, 0l, true );
+        final Shard firstShard = new Shard( 0l, 0l, true );
 
         final ShardEntryGroup shardEntryGroup = new ShardEntryGroup(  );
-        shardEntryGroup.addShard( futureShard );
+        shardEntryGroup.addShard( firstShard );
 
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType(
nodeId, type, subType );
 
+        //mock up returning same state
+        when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
same(targetEdgeMeta ))).thenReturn(
+                    Collections.singleton(firstShard).iterator() );
+
+
 
         /**
          * Allocate 2.5x what this shard should have.  We should ultimately have a split
at 2x
@@ -219,7 +238,7 @@ public class NodeShardAllocationTest {
 
 
         //return a shard size equal to our max
-        when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn(
shardCount );
+        when( nodeShardApproximation.getCount( scope, firstShard, targetEdgeMeta ) ).thenReturn(
shardCount );
 
 
         //this is how many we should be iterating and should set the value of the last shard
we keep
@@ -319,13 +338,17 @@ public class NodeShardAllocationTest {
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
 
-        final Shard futureShard = new Shard( 0l, 0l, true );
+        final Shard firstShard = new Shard( 0l, 0l, true );
 
         final ShardEntryGroup shardEntryGroup = new ShardEntryGroup( );
-        shardEntryGroup.addShard( futureShard );
+        shardEntryGroup.addShard( firstShard );
 
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType(
nodeId, type, subType );
 
+           //mock up returning same state
+        when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
same(targetEdgeMeta ))).thenReturn(
+            Collections.singleton( firstShard ).iterator() );
+
         final long shardCount = graphFig.getShardSize();
 
 
@@ -342,7 +365,7 @@ public class NodeShardAllocationTest {
         iteratedEdges.add( returnedEdge );
 
         //return a shard size equal to our max
-        when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn(
shardCount );
+        when( nodeShardApproximation.getCount( scope, firstShard, targetEdgeMeta ) ).thenReturn(
shardCount );
 
         ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
 
@@ -410,17 +433,21 @@ public class NodeShardAllocationTest {
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
 
-        final Shard futureShard = new Shard( 0l, 0l, true );
+        final Shard firstShard = new Shard( 0l, 0l, true );
 
         final ShardEntryGroup shardEntryGroup = new ShardEntryGroup(  );
-        shardEntryGroup.addShard( futureShard );
+        shardEntryGroup.addShard( firstShard );
 
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType(
nodeId, type, subType );
 
+            //mock up returning same state
+        when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
same(targetEdgeMeta ))).thenReturn(
+            Collections.singleton( firstShard ).iterator() );
+
         final long shardCount = graphFig.getShardSize();
 
         //return a shard size equal to our max
-        when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn(
shardCount );
+        when( nodeShardApproximation.getCount( scope, firstShard, targetEdgeMeta ) ).thenReturn(
shardCount );
 
         ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
 
@@ -442,7 +469,7 @@ public class NodeShardAllocationTest {
 
         //mock up empty shard read return
         when(edgeShardSerialization.getShardMetaDataLocal( same(scope), any(Optional.class),
any(DirectedEdgeMeta.class)  )).thenReturn( Collections.singleton(
-            futureShard).iterator() );
+            firstShard).iterator() );
 
         final boolean result = approximation.auditShard( scope, shardEntryGroup, targetEdgeMeta
);
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/5588f77c/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
deleted file mode 100644
index 246e69c..0000000
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one
- *  * or more contributor license agreements.  See the NOTICE file
- *  * distributed with this work for additional information
- *  * regarding copyright ownership.  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.
- *
- */
-
-package org.apache.usergrid.persistence.graph.serialization.impl.shard;
-
-
-import java.util.Collection;
-
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.usergrid.persistence.core.consistency.TimeService;
-import org.apache.usergrid.persistence.core.rx.RxTaskScheduler;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.core.util.IdGenerator;
-import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.ShardGroupCompactionImpl;
-
-import com.netflix.astyanax.Keyspace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-
-public class ShardGroupCompactionTest {
-
-    protected GraphFig graphFig;
-    protected ApplicationScope scope;
-
-
-    @Before
-    public void setup() {
-        graphFig = mock( GraphFig.class );
-
-        when( graphFig.getShardAuditWorkerCount() ).thenReturn( 10 );
-
-        when( graphFig.getShardAuditWorkerQueueSize() ).thenReturn( 1000 );
-
-        this.scope = new ApplicationScopeImpl( IdGenerator.createId( "application" ) );
-    }
-
-
-    @Test
-    public void shouldNotCompact() {
-
-        final TimeService timeService = mock( TimeService.class );
-
-        final NodeShardAllocation nodeShardAllocation = mock( NodeShardAllocation.class );
-
-        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class
);
-
-        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
-
-        final Keyspace keyspace = mock( Keyspace.class );
-
-        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class
);
-
-        final NodeShardApproximation nodeShardApproximation = mock(NodeShardApproximation.class);
-
-        final RxTaskScheduler rxTaskScheduler = mock(RxTaskScheduler.class);
-
-        final long delta = 10000;
-
-        final long createTime = 20000;
-
-        //we shouldn't be able to compact, should throw an exception
-        final long timeNow = createTime + delta - 1;
-
-        ShardEntryGroup group = new ShardEntryGroup( );
-        group.addShard( new Shard( 2000, createTime, false ) );
-        group.addShard( new Shard( 1000, 5000, true ) );
-
-
-        when( timeService.getCurrentTime() ).thenReturn( timeNow );
-
-        ShardGroupCompactionImpl compaction =
-                new ShardGroupCompactionImpl( timeService, graphFig, nodeShardAllocation,
shardedEdgeSerialization,
-                        edgeColumnFamilies, keyspace, edgeShardSerialization, nodeShardApproximation,
rxTaskScheduler );
-
-
-        DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( IdGenerator.createId(
"source" ), "test" );
-
-        fail("Write more of these tests");
-//        try {
-//            compaction.compact( this.scope, directedEdgeMeta, group );
-//            fail( "I should not reach this point" );
-//        }
-//        catch ( Throwable t ) {
-//            assertEquals( "Correct error message returned", "Compaction cannot be run yet.
 Ignoring compaction.",
-//                    t.getMessage() );
-//        }
-    }
-
-
-    //    /**
-    //     * Tests that when we copy edges, we do not actually run the compaction,
-    // we can only run it after we get nothing
-    //     * and the timeout has elapsed
-    //     */
-    //    @Test
-    //    public void shouldOnlyCopy() {
-    //
-    //        final TimeService timeService = mock( TimeService.class );
-    //
-    //        final NodeShardAllocation nodeShardAllocation = mock( NodeShardAllocation.class
);
-    //
-    //        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class
);
-    //
-    //        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class
);
-    //
-    //        final Keyspace keyspace = mock( Keyspace.class );
-    //
-    //        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class
);
-    //
-    //        final long delta = 10000;
-    //
-    //        final long createTime = 20000;
-    //
-    //        //we shouldn't be able to compact, should throw an exception
-    //        final long timeNow = createTime + delta ;
-    //
-    //
-    //        final Shard targetShard = new Shard( 2000, createTime, false ) ;
-    //        final Shard sourceShard =  new Shard( 1000, 5000, true );
-    //        ShardEntryGroup group = new ShardEntryGroup( delta );
-    //        group.addShard( targetShard );
-    //        group.addShard( sourceShard );
-    //
-    //
-    //        when( timeService.getCurrentTime() ).thenReturn( timeNow );
-    //
-    //        ShardGroupCompaction compaction =
-    //                new ShardGroupCompactionImpl( timeService, graphFig, nodeShardAllocation,
-    // shardedEdgeSerialization,
-    //                        edgeColumnFamilies, keyspace, edgeShardSerialization );
-    //
-    //
-    //        DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId("source"),
"test" );
-    //
-    //
-    //        /**
-    //         * Mock up returning edges from the source
-    //         */
-    //
-    //        int count = 100;
-    //
-    //        for(int i = 0; i < count; i ++){
-    //
-    //
-    //
-    //            when(shardedEdgeSerialization.getEdgesFromSource( same(edgeColumnFamilies),
same(scope), any(
-    //                    SearchByEdgeType.class), Matchers.argThat(new ShardSetMatcher(
Collections.singleton(
-    // sourceShard ) ))/*any(Set.class)*/ ));
-    //            edgeMeta.loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope,
-    //
-    //                                Collections.singleton( sourceShard ),  SearchByEdgeType.Order.DESCENDING,
-    // Long.MAX_VALUE );
-    //        }
-    //
-    //        try {
-    //            compaction.compact( this.scope, directedEdgeMeta, group );
-    //            fail( "I should not reach this point" );
-    //        }catch(Throwable t){
-    //            assertEquals("Correct error message returned", "Compaction cannot be run
yet.  Ignoring compaction
-    // .", t.getMessage());
-    //        }
-    //
-    //    }
-
-
-    private final class ShardSetMatcher extends BaseMatcher<Collection<Shard>>
{
-
-        private final Collection<Shard> expected;
-
-
-        private ShardSetMatcher( final Collection<Shard> expected ) {this.expected
= expected;}
-
-
-        @Override
-        public boolean matches( final Object o ) {
-            if ( !( o instanceof Collection ) ) {
-                return false;
-            }
-
-
-            Collection<Shard> passedShards = ( Collection<Shard> ) o;
-
-            return passedShards.containsAll( expected );
-        }
-
-
-        @Override
-        public void describeTo( final Description description ) {
-
-            StringBuilder builder = new StringBuilder();
-
-            builder.append( "Collection of shards with shards {" );
-
-            for ( Shard shard : expected ) {
-                builder.append( shard ).append( "," );
-            }
-
-            builder.setLength( builder.length() - 1 );
-
-            description.appendText( builder.toString() );
-        }
-    }
-}


Mime
View raw message