use of com.ms.silverking.cloud.dht.WaitMode in project SilverKing by Morgan-Stanley.
the class ProtoRetrievalMessageGroup method getRetrievalOptions.
public static InternalRetrievalOptions getRetrievalOptions(MessageGroup mg) {
int retrievalWaitByte;
RetrievalType retrievalType;
WaitMode waitMode;
int miscOptionsByte;
VersionConstraint vc;
ByteBuffer optionBuffer;
boolean verifyIntegrity;
boolean updateSecondariesOnMiss;
optionBuffer = mg.getBuffers()[optionBufferIndex];
retrievalWaitByte = optionBuffer.get(RetrievalResponseMessageFormat.retrievalTypeWaitModeOffset);
// begin retrievalType, waitMode decoding
// see ProtoRetrievalMessageGroup() for encoding
retrievalType = EnumValues.retrievalType[retrievalWaitByte >> 4];
waitMode = EnumValues.waitMode[retrievalWaitByte & 0x0f];
// end retrievalType, waitMode decoding
miscOptionsByte = optionBuffer.get(RetrievalResponseMessageFormat.miscOptionsOffset);
verifyIntegrity = (miscOptionsByte & 0x2) != 0;
updateSecondariesOnMiss = (miscOptionsByte & 0x1) != 0;
vc = new VersionConstraint(optionBuffer.getLong(RetrievalResponseMessageFormat.vcMinOffset), optionBuffer.getLong(RetrievalResponseMessageFormat.vcMaxOffset), EnumValues.versionConstraint_Mode[optionBuffer.get(RetrievalResponseMessageFormat.vcModeOffset)], optionBuffer.getLong(RetrievalResponseMessageFormat.vcMaxStorageTimeOffset));
return new InternalRetrievalOptions(OptionsHelper.newRetrievalOptions(retrievalType, waitMode, vc, updateSecondariesOnMiss, getSecondaryTargets(mg)), verifyIntegrity);
}
Aggregations