ReadOnlyTsFile implements AutoCloseable { public void close() throws IOException { fileReader.close(); } ReadOnlyTsFile(TsFileSequenceReader fileReader); QueryDataSet query(QueryExpression queryExpression); QueryDataSet query(QueryExpression queryExpression, long partitionStartOffset,
      long partitionEndOffset); void close();  }
@Test public void test1() throws IOException { TSFileDescriptor.getInstance().getConfig().setTimeEncoder("TS_2DIFF"); int rowCount = 1000; TsFileGeneratorForTest.generateFile(rowCount, 16 * 1024 * 1024, 10000); fileReader = new TsFileSequenceReader(FILE_PATH); tsFile = new ReadOnlyTsFile(fileReader); queryTest(rowCount); tsFile.close(); TsFileGeneratorForTest.after(); }
@Test public void test2() throws Exception { int minRowCount = 1000, maxRowCount = 100000; TSFileDescriptor.getInstance().getConfig().setTimeEncoder("TS_2DIFF"); TsFileGeneratorForTest.generateFile(minRowCount, maxRowCount, 16 * 1024 * 1024, 10000); fileReader = new TsFileSequenceReader(FILE_PATH); tsFile = new ReadOnlyTsFile(fileReader); queryTest2(); queryNonExistPathTest(); tsFile.close(); TsFileGeneratorForTest.after(); }