* @throws Exception
*/
@SuppressWarnings("unchecked")
public void testNextingAtOffsetinHalfMapFile() throws Exception {
Path p = writeMapFile(getName());
WritableComparable midkey = getMidkey(p);
// Now test reading from the top.
HalfMapFileReader top = new HalfMapFileReader(this.fs, p.toString(),
this.conf, Reference.Range.top, midkey, null);
ImmutableBytesWritable val = new ImmutableBytesWritable();
final String startRowPrefix = "zy";
HStoreKey key = new HStoreKey(startRowPrefix);
WritableComparable closest = top.getClosest(key, val);
assertTrue(closest.toString().startsWith(startRowPrefix));
int count = 0;
for (boolean first = true; top.next(key, val); count++) {
if (first) {
assertTrue(key.toString().compareTo(startRowPrefix) > 0);
}