Package org.apache.pig.penny

Examples of org.apache.pig.penny.Location


   
    public static Message fromTuple(Tuple t) throws IOException {
        Tuple body = (Tuple) t.get(0);
        Type type = stringToType((String) t.get(1));
        int ack = (Integer)t.get(2);
        Location source = (t.get(4) instanceof Integer)? new PhysicalLocation((String) t.get(3), (Integer) t.get(4)) : new LogicalLocation((String) t.get(3));
        Location destination = (t.get(6) instanceof Integer)? new PhysicalLocation((String) t.get(5), (Integer) t.get(6)) : new LogicalLocation((String) t.get(5));
        return new Message(type, ack, source, destination, body);
    }
View Full Code Here


    }
   
    private synchronized Tuple processRegistration(Message m) {
        // this method is synchronized to avoid concurrency problems between registering a new location and sending a message
       
        Location src = m.source();
        LogicalLocation logSrc = src.asLogical();
       
        if (!maxPhysicalIds.containsKey(logSrc)) {
            initLLState(logSrc);                    // first time we're seeing this logical location, so initialize some state for it
        }
       
View Full Code Here

   
    private synchronized void handleSendRequest(boolean synchronous, Message message) {
        // this method is synchronized to avoid concurrency problems between sending a message and registering a new location

        assert !synchronous: "We should not be sending synchronous requests from the coordinator";
        Location dst = message.destination();
        if (dst.isLogicalOnly()) {
            if (!maxPhysicalIds.containsKey(dst)) {
                initLLState(dst.asLogical());            // first time we're seeing this logical location, so initialize some state for it
            }
           
            // send to all currently registered physical instances of the logical destination
            for (int physId = 0; physId <= maxPhysicalIds.get(dst); physId++) {
                senderReceiver.sendAsync(message, new PhysicalLocation((LogicalLocation)dst, physId));
View Full Code Here

TOP

Related Classes of org.apache.pig.penny.Location

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.