use of com.ms.silverking.cloud.dht.VersionConstraint in project SilverKing by Morgan-Stanley.
the class AbstractSegment method getResolvedOffset.
int getResolvedOffset(DHTKey key, VersionConstraint vc) {
int offset;
offset = getRawOffset(key);
if (debugRetrieve || Log.levelMet(Level.FINE)) {
Log.warning("segment number: " + getSegmentNumber());
Log.warning("key offset: ", key + " " + offset);
}
if (offset == noSuchKey) {
if (debugRetrieve) {
Log.warning("noSuchKey");
}
return noSuchKey;
} else {
if (offset < 0) {
OffsetList offsetList;
// System.out.printf("offset %d -offset %d\n", offset, -offset);
if (debugRetrieve) {
Log.warning("Looking in offset list: " + -offset);
}
offsetList = offsetListStore.getOffsetList(-offset);
if (debugRetrieve) {
Log.warning("offsetList: ", offsetList);
offsetList.displayForDebug();
}
offset = offsetList.getOffset(vc, null);
if (offset < 0) {
// FUTURE - think about this
offset = noSuchKey;
if (debugRetrieve) {
Log.warning("Couldn't find key in offset list. options: " + vc);
}
}
if (debugRetrieve || Log.levelMet(Level.FINE)) {
Log.warning("offset list offset: ", key + " " + offset);
}
}
if (offset < 0) {
Log.fine("getResolvedOffset < 0");
return noSuchKey;
} else {
return offset;
}
}
}
Aggregations