Package com.basho.riak.client.core.netty

Examples of com.basho.riak.client.core.netty.HealthCheckDecoder


    private void checkHealth()
    {
        try
        {
            HealthCheckDecoder healthCheck = healthCheckFactory.makeDecoder();
            // See: doGetConnection() - this will purge closed
            // connections from the available queue and either
            // return/create a new one (meaning the node is up) or throw
            // an exception if a connection can't be made.
            Channel c = doGetConnection();

            Promise<RiakMessage> promise;
           
            if (c.pipeline().names().contains(Constants.SSL_HANDLER))
            {
                c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            else
            {
                c.pipeline().addBefore(Constants.MESSAGE_CODEC, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            logger.debug("healthCheck added to pipeline.");
           
            try
            {
                promise = healthCheck.getPromise();
                promise.await();
                if (promise.isSuccess())
                {
                    if (state == State.HEALTH_CHECKING)
                    {
View Full Code Here


    private void checkHealth()
    {
        try
        {
            HealthCheckDecoder healthCheck = healthCheckFactory.makeDecoder();
            // See: doGetConnection() - this will purge closed
            // connections from the available queue and either
            // return/create a new one (meaning the node is up) or throw
            // an exception if a connection can't be made.
            Channel c = doGetConnection();

            Promise<RiakMessage> promise;
           
            if (c.pipeline().names().contains(Constants.SSL_HANDLER))
            {
                c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            else
            {
                c.pipeline().addBefore(Constants.MESSAGE_CODEC, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            logger.debug("healthCheck added to pipeline.");
           
            try
            {
                promise = healthCheck.getPromise();
                promise.await();
                if (promise.isSuccess())
                {
                    if (state == State.HEALTH_CHECKING)
                    {
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.netty.HealthCheckDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.