Package voldemort.server.protocol

Examples of voldemort.server.protocol.StreamRequestHandler


            RequestHandler handler = handlerFactory.getRequestHandler(protocol);
            logger.info("Client " + socket.getRemoteSocketAddress()
                        + " connected successfully with protocol " + protocol.getCode());

            while(!isInterrupted() && !socket.isClosed() && !isClosed) {
                StreamRequestHandler srh = handler.handleRequest(inputStream, outputStream);

                if(srh != null) {
                    if(logger.isTraceEnabled())
                        logger.trace("Request is streaming");

                    StreamRequestHandlerState srhs = null;

                    try {
                        do {
                            if(logger.isTraceEnabled())
                                logger.trace("About to enter streaming request handler");

                            srhs = srh.handleRequest(inputStream, outputStream);

                            if(logger.isTraceEnabled())
                                logger.trace("Finished invocation of streaming request handler, result is "
                                             + srhs);

                        } while(srhs != StreamRequestHandlerState.COMPLETE);
                    } catch(VoldemortException e) {
                        srh.handleError(outputStream, e);
                        outputStream.flush();

                        break;
                    } finally {
                        srh.close(outputStream);
                    }
                }

                outputStream.flush();
            }
View Full Code Here

TOP

Related Classes of voldemort.server.protocol.StreamRequestHandler

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.