Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardCache;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
import org.apache.usergrid.persistence.model.entity.Id;

Expand Down Expand Up @@ -595,7 +596,7 @@ public void onFailure( final Throwable t ) {

while ( groups.hasNext() ) {

group = groups.next();;
group = groups.next();

log.info( "Shard size for group is {}", group.getReadShards() );

Expand All @@ -604,7 +605,7 @@ public void onFailure( final Throwable t ) {


//we're done, 1 shard remains, we have a group, and it's our default shard
if ( shardCount == 1 && group != null && group.getMinShard().getShardIndex() == 0 ) {
if ( shardCount == 1 && group != null && group.getMinShard().getShardIndex() == Shard.MIN_SHARD.getShardIndex() ) {
log.info( "All compactions complete," );

break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.netflix.astyanax.MutationBatch;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;

import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;


Expand Down Expand Up @@ -252,7 +254,7 @@ public void hasEdges() throws ExecutionException, InterruptedException {
//now check when marked we also retain them

final Iterator<MarkedEdge> markedEdgeIterator = Collections.singleton(
( MarkedEdge ) new SimpleMarkedEdge( createId( "source" ), "type", createId( "target" ), 1000, false ) )
( MarkedEdge ) new SimpleMarkedEdge( createId( "source" ), "type", createId( "target" ), 1000, true ) )
.iterator();


Expand All @@ -266,7 +268,7 @@ public void hasEdges() throws ExecutionException, InterruptedException {


@Test
public void testDeletion() throws ExecutionException, InterruptedException {
public void testDeletion() throws ExecutionException, InterruptedException, ConnectionException {

final long createTime = 10000;

Expand All @@ -290,9 +292,10 @@ public void testDeletion() throws ExecutionException, InterruptedException {
//mock up returning a mutation
final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );

final MutationBatch batch = mock( MutationBatch.class );

when( edgeShardSerialization.removeShardMeta( same( scope ), same( shard0 ), same( directedEdgeMeta ) ) )
.thenReturn( mock( MutationBatch.class ) );
.thenReturn( batch );

final TimeService timeService = mock( TimeService.class );

Expand All @@ -310,6 +313,8 @@ public void testDeletion() throws ExecutionException, InterruptedException {
final ShardGroupDeletion.DeleteResult result = future.get();

assertEquals( "should delete", ShardGroupDeletion.DeleteResult.DELETED, result );

verify(batch).execute();
}


Expand Down