@Test public void testHalfScanAndReseek() throws IOException { String root_dir = TEST_UTIL.getDataTestDir().toString(); Path p = new Path(root_dir, "test"); Configuration conf = TEST_UTIL.getConfiguration(); FileSystem fs = FileSystem.get(conf); CacheConfig cacheConf = new CacheConfig(conf); HFileContext meta = new HFileContextBuilder().withBlockSize(1024).build(); HFile.Writer w = HFile.getWriterFactory(conf, cacheConf) .withPath(fs, p) .withFileContext(meta) .create(); List<KeyValue> items = genSomeKeys(); for (KeyValue kv : items) { w.append(kv); } w.close(); HFile.Reader r = HFile.createReader(fs, p, cacheConf, conf); r.loadFileInfo(); byte [] midkey = r.midkey(); KeyValue midKV = KeyValue.createKeyValueFromKey(midkey); midkey = midKV.getRow(); Reference bottom = new Reference(midkey, Reference.Range.bottom); doTestOfScanAndReseek(p, fs, bottom, cacheConf); Reference top = new Reference(midkey, Reference.Range.top); doTestOfScanAndReseek(p, fs, top, cacheConf); r.close(); }
@Override public byte[] midkey() throws IOException { return null; }
HalfStoreFileReader extends StoreFile.Reader { @Override public byte[] midkey() throws IOException { return null; } }
HalfStoreFileReader extends StoreFile.Reader { @Override public byte[] midkey() throws IOException { return null; } HalfStoreFileReader(final FileSystem fs, final Path p,
      final CacheConfig cacheConf, final Reference r, final Configuration conf);  HalfStoreFileReader(final FileSystem fs, final Path p, final FSDataInputStreamWrapper in,
      long size, final CacheConfig cacheConf,  final Reference r, final Configuration conf); }
HalfStoreFileReader extends StoreFile.Reader { @Override public byte[] midkey() throws IOException { return null; } HalfStoreFileReader(final FileSystem fs, final Path p,
      final CacheConfig cacheConf, final Reference r, final Configuration conf);  HalfStoreFileReader(final FileSystem fs, final Path p, final FSDataInputStreamWrapper in,
      long size, final CacheConfig cacheConf,  final Reference r, final Configuration conf); @Override HFileScanner getScanner(final boolean cacheBlocks,
      final boolean pread, final boolean isCompaction); @Override boolean passesKeyRangeFilter(Scan scan); @Override byte[] getLastKey(); @Override byte[] midkey(); @Override byte[] getFirstKey(); @Override long getEntries(); @Override long getFilterEntries(); }
HalfStoreFileReader extends StoreFile.Reader { @Override public byte[] midkey() throws IOException { return null; } HalfStoreFileReader(final FileSystem fs, final Path p,
      final CacheConfig cacheConf, final Reference r, final Configuration conf);  HalfStoreFileReader(final FileSystem fs, final Path p, final FSDataInputStreamWrapper in,
      long size, final CacheConfig cacheConf,  final Reference r, final Configuration conf); @Override HFileScanner getScanner(final boolean cacheBlocks,
      final boolean pread, final boolean isCompaction); @Override boolean passesKeyRangeFilter(Scan scan); @Override byte[] getLastKey(); @Override byte[] midkey(); @Override byte[] getFirstKey(); @Override long getEntries(); @Override long getFilterEntries();  }