Package edu.brown.protorpc

Examples of edu.brown.protorpc.NIOEventLoop


     * This should not be called directly.
     * @param catalog_site
     * @return
     */
    protected static HStoreService getHStoreService(Site catalog_site) {
        NIOEventLoop eventLoop = new NIOEventLoop();
        InetSocketAddress addresses[] = new InetSocketAddress[] {
            new InetSocketAddress(catalog_site.getHost().getIpaddr(), catalog_site.getMessenger_port())
        };
        ProtoRpcChannel[] channels = null;
        try {
View Full Code Here


        this.serverSocket = serverSocket;
    }

    public static void main(String[] vargs) throws Exception {
        // Example of using VoltProcedureListener: prints procedure name, returns empty array
        NIOEventLoop eventLoop = new NIOEventLoop();
        class PrintHandler implements Handler {
            @Override
            public long getInstanceId() {
                return 0;
            }
            @Override
            public void invocationQueue(ByteBuffer serializedRequest, RpcCallback<byte[]> done) {
                StoredProcedureInvocation invocation = null;
                try {
                    invocation = FastDeserializer.deserialize(serializedRequest, StoredProcedureInvocation.class);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
                LOG.debug("request: " + invocation.getProcName() + " " +
                        invocation.getParams().toArray().length);
                done.run(serializeResponse(new VoltTable[0], invocation.getClientHandle()));               
            }
        }
        PrintHandler printer = new PrintHandler();
        VoltProcedureListener listener = new VoltProcedureListener(0, eventLoop, printer);
        listener.bind();

        eventLoop.run();
    }
View Full Code Here

TOP

Related Classes of edu.brown.protorpc.NIOEventLoop

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.