public static void main( String[] args ) { try { Path clusterPath = Files.createTempDirectory( "causal-cluster" ); System.out.println( "clusterPath = " + clusterPath ); CausalClusterInProcessBuilder.CausalCluster cluster = CausalClusterInProcessBuilder.init() .withCores( 3 ) .withReplicas( 3 ) .withLogger( toOutputStream( System.out ) ) .atPath( clusterPath ) .build(); System.out.println( "Waiting for cluster to boot up..." ); cluster.boot(); System.out.println( "Press ENTER to exit..." ); //noinspection ResultOfMethodCallIgnored System.in.read(); System.out.println( "Shutting down..." ); cluster.shutdown(); } catch ( Throwable e ) { e.printStackTrace(); System.exit( -1 ); } System.exit( 0 ); }
public static void main( String[] args ) { try { Path clusterPath = Files.createTempDirectory( "causal-cluster" ); System.out.println( "clusterPath = " + clusterPath ); CausalClusterInProcessBuilder.CausalCluster cluster = CausalClusterInProcessBuilder.init() .withCores( 6 ) .withReplicas( 4 ) .withLogger( toOutputStream( System.out ) ) .atPath( clusterPath ) .withOptionalDatabases( Arrays.asList("foo", "bar") ) .build(); System.out.println( "Waiting for cluster to boot up..." ); cluster.boot(); System.out.println( "Press ENTER to exit ..." ); //noinspection ResultOfMethodCallIgnored System.in.read(); System.out.println( "Shutting down..." ); cluster.shutdown(); } catch ( Throwable e ) { e.printStackTrace(); System.exit( -1 ); } System.exit( 0 ); }
public static WithCores init() { return new Builder(); }