Package org.apache.pig.penny.impl.comm

Examples of org.apache.pig.penny.impl.comm.SyncCallResult


        return null;
    }
   
    public Tuple sendSync(Message m) throws IOException {
        m.genAck();
        SyncCallResult scr = new SyncCallResult();
        messagingClientHandler.addOutstandingAck(m.getAck(), scr);
        synchronized(scr) {
            sendAsync(m);
            while(scr.getException() == null && scr.getTuple() == null) {
                try {
                    scr.wait();
                } catch(InterruptedException e) {
                    throw new InterruptedIOException();
                }
            }
        }
        if (scr.getException() != null) {
            throw new IOException("Problem sending message", scr.getException());
        }
        return scr.getTuple();
    }
View Full Code Here


                throws Exception {
            final Message message = (Message) e.getMessage();
            if (message.getAck() == Message.NO_ACK) {
                cb.receive(message);
            } else {
                SyncCallResult scr = outstandingAcks.remove(message.getAck());
                if (scr != null) {
                    synchronized(scr) {
                        scr.setTuple(message.body());
                        scr.notifyAll();
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.pig.penny.impl.comm.SyncCallResult

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.