private void validateContains(
     MessageType schema, PageReadStore pages, String[] path, int values, BytesInput bytes)
     throws IOException {
   PageReader pageReader = pages.getPageReader(schema.getColumnDescription(path));
   Page page = pageReader.readPage();
   assertEquals(values, page.getValueCount());
   assertArrayEquals(bytes.toByteArray(), page.getBytes().toByteArray());
 }
Пример #2
0
 @Test
 public void test() throws IOException {
   MemPageStore memPageStore = new MemPageStore(10);
   ColumnDescriptor col = new ColumnDescriptor(path, PrimitiveTypeName.INT64, 2, 2);
   LongStatistics stats = new LongStatistics();
   PageWriter pageWriter = memPageStore.getPageWriter(col);
   pageWriter.writePage(BytesInput.from(new byte[735]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
   pageWriter.writePage(BytesInput.from(new byte[743]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
   pageWriter.writePage(BytesInput.from(new byte[743]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
   pageWriter.writePage(BytesInput.from(new byte[735]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
   PageReader pageReader = memPageStore.getPageReader(col);
   long totalValueCount = pageReader.getTotalValueCount();
   System.out.println(totalValueCount);
   int total = 0;
   do {
     Page readPage = pageReader.readPage();
     total += readPage.getValueCount();
     System.out.println(readPage);
     // TODO: assert
   } while (total < totalValueCount);
 }