Skip to content

Commit

Permalink
start core servers first while we sort out shutting down CatchupServe…
Browse files Browse the repository at this point in the history
…r when a core server is copying the store down
  • Loading branch information
Mark Needham committed Sep 6, 2016
1 parent 178577a commit 572826b
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -98,9 +98,8 @@ public void start() throws InterruptedException, ExecutionException
ExecutorService executor = Executors.newCachedThreadPool( new NamedThreadFactory( "cluster-starter" ) ); ExecutorService executor = Executors.newCachedThreadPool( new NamedThreadFactory( "cluster-starter" ) );
try try
{ {
CompletionService<EdgeGraphDatabase> edgeGraphDatabaseCompletionService = startEdgeMembers( executor );
startCoreMembers( executor ); startCoreMembers( executor );
waitForEdgeServers( edgeGraphDatabaseCompletionService ); startEdgeMembers( executor );
} }
finally finally
{ {
Expand Down Expand Up @@ -425,7 +424,7 @@ private void startCoreMembers( ExecutorService executor ) throws InterruptedExce
} }
} }


private CompletionService<EdgeGraphDatabase> startEdgeMembers( ExecutorService executor ) throws InterruptedException, ExecutionException private void startEdgeMembers( ExecutorService executor ) throws InterruptedException, ExecutionException
{ {
CompletionService<EdgeGraphDatabase> ecs = new ExecutorCompletionService<>( executor ); CompletionService<EdgeGraphDatabase> ecs = new ExecutorCompletionService<>( executor );


Expand All @@ -437,7 +436,11 @@ private CompletionService<EdgeGraphDatabase> startEdgeMembers( ExecutorService e
return edgeClusterMember.database(); return edgeClusterMember.database();
} ); } );
} }
return ecs;
for ( int i = 0; i < edgeMembers.size(); i++ )
{
ecs.take().get();
}
} }


private void createEdgeMembers( int noOfEdgeMembers, private void createEdgeMembers( int noOfEdgeMembers,
Expand Down

0 comments on commit 572826b

Please sign in to comment.