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;
}
}
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);
}
}
}
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);
}
}
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);
}
}
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;
}
Aggregations