Search in sources :

Example 1 with OpResult

use of com.ms.silverking.cloud.dht.common.OpResult in project SilverKing by Morgan-Stanley.

the class AsyncPutOperationImpl method getOpResult.

@Override
protected OpResult getOpResult(K key) {
    OpResult opResult;
    opResult = opResults.get(keyToDHTKey.get(key));
    if (opResult == null) {
        return OpResult.INCOMPLETE;
    } else {
        return opResult;
    }
}
Also used : OpResult(com.ms.silverking.cloud.dht.common.OpResult)

Example 2 with OpResult

use of com.ms.silverking.cloud.dht.common.OpResult in project SilverKing by Morgan-Stanley.

the class AsyncPutOperationImpl method debugTimeout.

protected void debugTimeout() {
    /**/
    for (OperationUUID opUUID : opUUIDs) {
        ConcurrentMap<DHTKey, WeakReference<ActiveKeyedOperationResultListener<OpResult>>> keyMap;
        System.out.println("opUUID:\t" + opUUID);
        // keyMap = activePutListeners.get(opUUID);
        keyMap = activePutListeners.getKeyMap(opUUID);
        for (DHTKey key : keyMap.keySet()) {
            if (keyMap.get(key).get() == this) {
                OpResult result;
                result = opResults.get(key);
                if (result == null || !result.isComplete()) {
                    System.out.printf("IncompleteA: %s\t%s\n", opUUID, key);
                }
            } else {
                System.out.println(key + " -> " + keyMap.get(key));
            }
        }
    }
    /**/
    for (DHTKey key : dhtKeys) {
        OpResult result;
        result = opResults.get(key);
        if (result == null || !result.isComplete()) {
            System.out.printf("IncompleteB: %s\t%d\n", key, creationCalls);
        }
    }
}
Also used : WeakReference(java.lang.ref.WeakReference) OpResult(com.ms.silverking.cloud.dht.common.OpResult) DHTKey(com.ms.silverking.cloud.dht.common.DHTKey)

Example 3 with OpResult

use of com.ms.silverking.cloud.dht.common.OpResult in project SilverKing by Morgan-Stanley.

the class ActiveVersionedBasicOperations method receivedOpResponse.

public void receivedOpResponse(MessageGroup message) {
    AsyncVersionedBasicOperationImpl op;
    UUIDBase uuid;
    byte resultCode;
    long uuidMSL;
    long uuidLSL;
    uuidMSL = message.getBuffers()[0].getLong(0);
    uuidLSL = message.getBuffers()[0].getLong(NumConversion.BYTES_PER_LONG);
    resultCode = message.getBuffers()[0].get(2 * NumConversion.BYTES_PER_LONG);
    uuid = new UUIDBase(uuidMSL, uuidLSL);
    op = getOp(uuid);
    if (op != null) {
        OpResult result;
        result = EnumValues.opResult[resultCode];
        op.setResult(result);
    } else {
        Log.warning("No operation for response: ", uuid);
    }
}
Also used : OpResult(com.ms.silverking.cloud.dht.common.OpResult) UUIDBase(com.ms.silverking.id.UUIDBase)

Example 4 with OpResult

use of com.ms.silverking.cloud.dht.common.OpResult in project SilverKing by Morgan-Stanley.

the class KeyedOpGroup method checkForCompletion.

/*
     * If this class is to used in the future, this
     * method must take the NonExistenceResonse into
     * consideration when calling hasFailed
     */
private void checkForCompletion() {
    OpResult groupResult;
    groupResult = null;
    for (OpResult result : results.values()) {
        if (!result.isComplete()) {
            break;
        } else {
            if (groupResult == null) {
                groupResult = result;
            } else {
                if (groupResult.hasFailed()) {
                    if (result.hasFailed()) {
                        if (groupResult != result) {
                            groupResult = OpResult.MULTIPLE;
                        }
                    } else {
                        groupResult = OpResult.MULTIPLE;
                    }
                } else {
                    if (result.hasFailed()) {
                        groupResult = OpResult.MULTIPLE;
                    }
                }
            }
        }
    }
    if (groupResult.isComplete()) {
        parent.update(parentKey, groupResult);
    }
}
Also used : OpResult(com.ms.silverking.cloud.dht.common.OpResult)

Example 5 with OpResult

use of com.ms.silverking.cloud.dht.common.OpResult in project SilverKing by Morgan-Stanley.

the class SegmentedPutValue method getResult.

private OpResult getResult(DHTKey key) {
    OpResult result;
    result = results.get(key);
    return result == null ? OpResult.INCOMPLETE : result;
}
Also used : OpResult(com.ms.silverking.cloud.dht.common.OpResult)

Aggregations

OpResult (com.ms.silverking.cloud.dht.common.OpResult)32 DHTKey (com.ms.silverking.cloud.dht.common.DHTKey)7 IOException (java.io.IOException)5 ProtoOpResponseMessageGroup (com.ms.silverking.cloud.dht.net.ProtoOpResponseMessageGroup)4 Waiter (com.ms.silverking.cloud.dht.daemon.Waiter)3 ConvergencePoint (com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)3 MessageGroupKeyOrdinalEntry (com.ms.silverking.cloud.dht.net.MessageGroupKeyOrdinalEntry)3 VersionConstraint (com.ms.silverking.cloud.dht.VersionConstraint)2 MessageGroupRetrievalResponseEntry (com.ms.silverking.cloud.dht.net.MessageGroupRetrievalResponseEntry)2 IPAndPort (com.ms.silverking.net.IPAndPort)2 WeakReference (java.lang.ref.WeakReference)2 ImmutableList (com.google.common.collect.ImmutableList)1 NamespaceVersionMode (com.ms.silverking.cloud.dht.NamespaceVersionMode)1 NonExistenceResponse (com.ms.silverking.cloud.dht.NonExistenceResponse)1 RetrievalOptions (com.ms.silverking.cloud.dht.RetrievalOptions)1 WaitOptions (com.ms.silverking.cloud.dht.WaitOptions)1 CorruptValueException (com.ms.silverking.cloud.dht.common.CorruptValueException)1 InternalRetrievalOptions (com.ms.silverking.cloud.dht.common.InternalRetrievalOptions)1 RawRetrievalResult (com.ms.silverking.cloud.dht.common.RawRetrievalResult)1 SimpleKey (com.ms.silverking.cloud.dht.common.SimpleKey)1