@Test
  public void testSanity() throws Exception {
    File segmentDir = tempFolder.newFolder();
    createTestIndex(segmentDir);

    QueryableIndex qi = null;
    try {
      qi = IndexIO.loadIndex(segmentDir);
      StorageAdapter sa = new QueryableIndexStorageAdapter(qi);
      WindowedStorageAdapter wsa = new WindowedStorageAdapter(sa, sa.getInterval());
      IngestSegmentFirehose firehose =
          new IngestSegmentFirehose(
              ImmutableList.of(wsa, wsa),
              ImmutableList.of("host"),
              ImmutableList.of("visited_sum", "unique_hosts"),
              null,
              QueryGranularity.NONE);

      int count = 0;
      while (firehose.hasMore()) {
        firehose.nextRow();
        count++;
      }
      Assert.assertEquals(18, count);
    } finally {
      if (qi != null) {
        qi.close();
      }
    }
  }
 @Override
 public boolean nextKeyValue() throws IOException, InterruptedException {
   if (rowYielder.hasMore()) {
     currRow = (MapBasedRow) rowYielder.nextRow();
     return true;
   } else {
     return false;
   }
 }