Search in sources :

Example 1 with ProtoPutResponseMessageGroup

use of com.ms.silverking.cloud.dht.net.ProtoPutResponseMessageGroup in project SilverKing by Morgan-Stanley.

the class MessageModule method sendPutResults.

// //////////////////////////
// FUTURE make ActiveProxyPut use this after we have it working for PutUpdate
// and after the below FUTUREs have been resolved
protected void sendPutResults(MessageGroup message, long version, MessageGroupConnectionProxy connection, List<PutResult> results, byte storageState, int deadlineRelativeMillis) {
    ProtoPutResponseMessageGroup response;
    if (results.size() > 0) {
        response = new ProtoPutResponseMessageGroup(message.getUUID(), message.getContext(), // FUTURE - does ProtoPutResponseMessageGroup really need version when we're using the uuid now?
        version, results.size(), mgBase.getMyID(), storageState, // FUTURE - allow constructor without this?
        deadlineRelativeMillis);
        if (debug) {
            System.out.println("results.size " + results.size());
        }
        for (PutResult result : results) {
            if (debug) {
                System.out.println(result);
            }
            response.addResult(result.getKey(), result.getResult());
        }
        try {
            MessageGroup mg;
            mg = response.toMessageGroup();
            if (Log.levelMet(Level.FINE)) {
                Log.warning("sendResults: " + connection.getConnectionID());
                mg.displayForDebug(true);
            }
            connection.sendAsynchronous(mg, mg.getDeadlineAbsMillis(getAbsMillisTimeSource()));
        } catch (IOException ioe) {
            Log.logErrorWarning(ioe);
        }
    }
}
Also used : ProtoPutResponseMessageGroup(com.ms.silverking.cloud.dht.net.ProtoPutResponseMessageGroup) ProtoPingMessageGroup(com.ms.silverking.cloud.dht.net.ProtoPingMessageGroup) ProtoChecksumTreeRequestMessageGroup(com.ms.silverking.cloud.dht.net.ProtoChecksumTreeRequestMessageGroup) MessageGroup(com.ms.silverking.cloud.dht.net.MessageGroup) ProtoSnapshotMessageGroup(com.ms.silverking.cloud.dht.net.ProtoSnapshotMessageGroup) ProtoNopMessageGroup(com.ms.silverking.cloud.dht.net.ProtoNopMessageGroup) ProtoRetrievalMessageGroup(com.ms.silverking.cloud.dht.net.ProtoRetrievalMessageGroup) ProtoPutResponseMessageGroup(com.ms.silverking.cloud.dht.net.ProtoPutResponseMessageGroup) ProtoPutUpdateMessageGroup(com.ms.silverking.cloud.dht.net.ProtoPutUpdateMessageGroup) ProtoPingAckMessageGroup(com.ms.silverking.cloud.dht.net.ProtoPingAckMessageGroup) ProtoVersionedBasicOpMessageGroup(com.ms.silverking.cloud.dht.net.ProtoVersionedBasicOpMessageGroup) ProtoOpResponseMessageGroup(com.ms.silverking.cloud.dht.net.ProtoOpResponseMessageGroup) IOException(java.io.IOException) PutResult(com.ms.silverking.cloud.dht.net.PutResult)

Aggregations

MessageGroup (com.ms.silverking.cloud.dht.net.MessageGroup)1 ProtoChecksumTreeRequestMessageGroup (com.ms.silverking.cloud.dht.net.ProtoChecksumTreeRequestMessageGroup)1 ProtoNopMessageGroup (com.ms.silverking.cloud.dht.net.ProtoNopMessageGroup)1 ProtoOpResponseMessageGroup (com.ms.silverking.cloud.dht.net.ProtoOpResponseMessageGroup)1 ProtoPingAckMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPingAckMessageGroup)1 ProtoPingMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPingMessageGroup)1 ProtoPutResponseMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPutResponseMessageGroup)1 ProtoPutUpdateMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPutUpdateMessageGroup)1 ProtoRetrievalMessageGroup (com.ms.silverking.cloud.dht.net.ProtoRetrievalMessageGroup)1 ProtoSnapshotMessageGroup (com.ms.silverking.cloud.dht.net.ProtoSnapshotMessageGroup)1 ProtoVersionedBasicOpMessageGroup (com.ms.silverking.cloud.dht.net.ProtoVersionedBasicOpMessageGroup)1 PutResult (com.ms.silverking.cloud.dht.net.PutResult)1 IOException (java.io.IOException)1