uint64_t getBlockIndex(uint64_t const ikey) const { // std::cerr << "getBlockIndex(" << ikey << ")" << std::endl; if ( ! numentries ) return numentries; else if ( ikey < getMinKey() ) return 0; else if ( ikey > getMaxKey() ) return numentries-1; const_iterator ita = std::lower_bound(begin(),end(),value_type(ikey)); uint64_t const index = ita - begin(); if ( (ita != end()) && (*ita).ikey == ikey ) { return index; } else { assert ( index > 0 ); return index-1; } }
std::string MoveChunkRequest::toString() const { std::stringstream ss; ss << "ns: " << getNss().ns() << ", " << redact(ChunkRange(getMinKey(), getMaxKey()).toString()) << ", fromShard: " << getFromShardId() << ", toShard: " << getToShardId(); return ss.str(); }