src/main/java/edu/ucla/library/bucketeer/verticles/MainVerticle.java
@SuppressWarnings("rawtypes")
    private void deployVerticles(final JsonObject aConfig, final Handler<AsyncResult<Void>> aHandler) {
        final int uploaderInstances = aConfig.getInteger(Config.S3_UPLOADER_INSTANCES, S3_UPLOADER_INSTANCES);
        final int uploaderThreads = aConfig.getInteger(Config.S3_UPLOADER_THREADS, S3_UPLOADER_THREADS);
        final DeploymentOptions uploaderOpts = new DeploymentOptions().setWorker(true);
        final DeploymentOptions workerOpts = new DeploymentOptions().setWorker(true);
        final DeploymentOptions basicOpts = new DeploymentOptions();
        final List<Future> futures = new ArrayList<>();
        final Promise<Void> promise = Promise.promise();

        // Set configuration values for our verticles to use
        uploaderOpts.setConfig(aConfig);
        workerOpts.setConfig(aConfig);
        basicOpts.setConfig(aConfig);

        // Set the deployVerticles handler to handle our verticles deploy future
        promise.future().onComplete(aHandler);

        workerOpts.setInstances(1);
        workerOpts.setWorkerPoolSize(1);
        workerOpts.setWorkerPoolName(ImageWorkerVerticle.class.getSimpleName() + THREAD_NAME);

        uploaderOpts.setInstances(uploaderInstances);

        // If we've set threads to <= 0, we want to use whatever cores are available on the system
        if (uploaderThreads <= 0) {
            uploaderOpts.setWorkerPoolSize(S3_UPLOADER_THREADS);
        } else {
            uploaderOpts.setWorkerPoolSize(uploaderThreads);
        }

        uploaderOpts.setWorkerPoolName(S3BucketVerticle.class.getSimpleName() + THREAD_NAME);

        LOGGER.debug(MessageCodes.BUCKETEER_112, uploaderInstances, uploaderOpts.getWorkerPoolSize());

        // We initiate the various verticles that Bucketeer uses
        futures.add(deployVerticle(ImageWorkerVerticle.class.getName(), workerOpts, Promise.promise()));
        futures.add(deployVerticle(S3BucketVerticle.class.getName(), uploaderOpts, Promise.promise()));
        futures.add(deployVerticle(SlackMessageVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(ItemFailureVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(FinalizeJobVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(LargeImageVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(FesterVerticle.class.getName(), basicOpts, Promise.promise()));

        // Confirm all our verticles were successfully deployed
        CompositeFuture.all(futures).onComplete(handler -> {
            if (handler.succeeded()) {
                promise.complete();
            } else {
                promise.fail(handler.cause());
            }
        });
    }
/**
     * Returns the other non-main verticles.
     *
     * @param aHandler A handler that wraps the results of our verticle deployments
     */
Returns the other non-main verticles.
@param aHandler A handler that wraps the results of our verticle deployments
Returns the other non - main verticles . @param aHandler A handler that wraps the results of our verticle deployments
@SuppressWarnings("rawtypes")
    private void deployVerticles(final JsonObject aConfig, final Handler<AsyncResult<Void>> aHandler) {
        final int uploaderInstances = aConfig.getInteger(Config.S3_UPLOADER_INSTANCES, S3_UPLOADER_INSTANCES);
        final int uploaderThreads = aConfig.getInteger(Config.S3_UPLOADER_THREADS, S3_UPLOADER_THREADS);
        final DeploymentOptions uploaderOpts = new DeploymentOptions().setWorker(true);
        final DeploymentOptions workerOpts = new DeploymentOptions().setWorker(true);
        final DeploymentOptions basicOpts = new DeploymentOptions();
        final List<Future> futures = new ArrayList<>();
        final Promise<Void> promise = Promise.promise();
        uploaderOpts.setConfig(aConfig);
        workerOpts.setConfig(aConfig);
        basicOpts.setConfig(aConfig);
        promise.future().onComplete(aHandler);
        workerOpts.setInstances(1);
        workerOpts.setWorkerPoolSize(1);
        workerOpts.setWorkerPoolName(ImageWorkerVerticle.class.getSimpleName() + THREAD_NAME);
        uploaderOpts.setInstances(uploaderInstances);
        if (uploaderThreads <= 0) {
            uploaderOpts.setWorkerPoolSize(S3_UPLOADER_THREADS);
        } else {
            uploaderOpts.setWorkerPoolSize(uploaderThreads);
        }
        uploaderOpts.setWorkerPoolName(S3BucketVerticle.class.getSimpleName() + THREAD_NAME);
        LOGGER.debug(MessageCodes.BUCKETEER_112, uploaderInstances, uploaderOpts.getWorkerPoolSize());
        futures.add(deployVerticle(ImageWorkerVerticle.class.getName(), workerOpts, Promise.promise()));
        futures.add(deployVerticle(S3BucketVerticle.class.getName(), uploaderOpts, Promise.promise()));
        futures.add(deployVerticle(SlackMessageVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(ItemFailureVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(FinalizeJobVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(LargeImageVerticle.class.getName(), basicOpts, Promise.promise()));
        futures.add(deployVerticle(FesterVerticle.class.getName(), basicOpts, Promise.promise()));
        CompositeFuture.all(futures).onComplete(handler -> {
            if (handler.succeeded()) {
                promise.complete();
            } else {
                promise.fail(handler.cause());
            }
        });
    }
@ SuppressWarnings ( "rawtypes" ) private void deployVerticles ( final JsonObject aConfig , final Handler < AsyncResult < Void > > aHandler ) { final int uploaderInstances = aConfig . getInteger ( Config . S3_UPLOADER_INSTANCES , S3_UPLOADER_INSTANCES ) ; final int uploaderThreads = aConfig . getInteger ( Config . S3_UPLOADER_THREADS , S3_UPLOADER_THREADS ) ; final DeploymentOptions uploaderOpts = new DeploymentOptions ( ) . setWorker ( true ) ; final DeploymentOptions workerOpts = new DeploymentOptions ( ) . setWorker ( true ) ; final DeploymentOptions basicOpts = new DeploymentOptions ( ) ; final List < Future > futures = new ArrayList < > ( ) ; final Promise < Void > promise = Promise . promise ( ) ; uploaderOpts . setConfig ( aConfig ) ; workerOpts . setConfig ( aConfig ) ; basicOpts . setConfig ( aConfig ) ; promise . future ( ) . onComplete ( aHandler ) ; workerOpts . setInstances ( 1 ) ; workerOpts . setWorkerPoolSize ( 1 ) ; workerOpts . setWorkerPoolName ( ImageWorkerVerticle . class . getSimpleName ( ) + THREAD_NAME ) ; uploaderOpts . setInstances ( uploaderInstances ) ; if ( uploaderThreads <= 0 ) { uploaderOpts . setWorkerPoolSize ( S3_UPLOADER_THREADS ) ; } else { uploaderOpts . setWorkerPoolSize ( uploaderThreads ) ; } uploaderOpts . setWorkerPoolName ( S3BucketVerticle . class . getSimpleName ( ) + THREAD_NAME ) ; LOGGER . debug ( MessageCodes . BUCKETEER_112 , uploaderInstances , uploaderOpts . getWorkerPoolSize ( ) ) ; futures . add ( deployVerticle ( ImageWorkerVerticle . class . getName ( ) , workerOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( S3BucketVerticle . class . getName ( ) , uploaderOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( SlackMessageVerticle . class . getName ( ) , basicOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( ItemFailureVerticle . class . getName ( ) , basicOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( FinalizeJobVerticle . class . getName ( ) , basicOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( LargeImageVerticle . class . getName ( ) , basicOpts , Promise . promise ( ) ) ) ; futures . add ( deployVerticle ( FesterVerticle . class . getName ( ) , basicOpts , Promise . promise ( ) ) ) ; CompositeFuture . all ( futures ) . onComplete ( handler -> { if ( handler . succeeded ( ) ) { promise . complete ( ) ; } else { promise . fail ( handler . cause ( ) ) ; } } ) ; }
Returns the other non-main verticles.
Returns the other non - main verticles .
// Set configuration values for our verticles to use // Set the deployVerticles handler to handle our verticles deploy future // If we've set threads to <= 0, we want to use whatever cores are available on the system // We initiate the various verticles that Bucketeer uses // Confirm all our verticles were successfully deployed