Search in sources :

Example 1 with PutOperationContainer

use of com.ms.silverking.cloud.dht.daemon.storage.protocol.PutOperationContainer in project SilverKing by Morgan-Stanley.

the class ActiveProxyPut method localOp.

protected void localOp(List<? extends DHTKey> _entries, OpCommunicator<MessageGroupKeyEntry, PutResult> comm) {
    boolean useUpdate;
    PutCommunicator pComm;
    pComm = (PutCommunicator) comm;
    useUpdate = _entries.size() > 0 && (_entries.get(0) instanceof MessageGroupKeyOrdinalEntry);
    if (!useUpdate) {
        List<StorageValueAndParameters> values;
        long creationTime;
        creationTime = SystemTimeUtil.systemTimeSource.absTimeNanos();
        values = new ArrayList<>(_entries.size());
        for (DHTKey _entry : _entries) {
            values.add(new StorageValueAndParameters((MessageGroupPutEntry) _entry, (PutOperationContainer) this, creationTime));
            if (debug) {
                System.out.printf("localOp: %s\n", _entry);
            }
        // Log.fine(entry);
        }
        getStorage().put(getContext(), values, getUserData(), pComm);
        if (forwardingMode.forwards()) {
            for (DHTKey _entry : _entries) {
                storageOperation.localUpdate(_entry, StorageProtocolUtil.initialStorageStateOrdinal, OpResult.SUCCEEDED, pComm);
            }
        }
    } else {
        localOp_putupdate(_entries, pComm);
    }
}
Also used : MessageGroupKeyOrdinalEntry(com.ms.silverking.cloud.dht.net.MessageGroupKeyOrdinalEntry) PutCommunicator(com.ms.silverking.cloud.dht.daemon.storage.protocol.PutCommunicator) DHTKey(com.ms.silverking.cloud.dht.common.DHTKey) PutOperationContainer(com.ms.silverking.cloud.dht.daemon.storage.protocol.PutOperationContainer) StorageValueAndParameters(com.ms.silverking.cloud.dht.daemon.storage.StorageValueAndParameters) MessageGroupPutEntry(com.ms.silverking.cloud.dht.net.MessageGroupPutEntry)

Aggregations

DHTKey (com.ms.silverking.cloud.dht.common.DHTKey)1 StorageValueAndParameters (com.ms.silverking.cloud.dht.daemon.storage.StorageValueAndParameters)1 PutCommunicator (com.ms.silverking.cloud.dht.daemon.storage.protocol.PutCommunicator)1 PutOperationContainer (com.ms.silverking.cloud.dht.daemon.storage.protocol.PutOperationContainer)1 MessageGroupKeyOrdinalEntry (com.ms.silverking.cloud.dht.net.MessageGroupKeyOrdinalEntry)1 MessageGroupPutEntry (com.ms.silverking.cloud.dht.net.MessageGroupPutEntry)1