コード例 #1
0
ファイル: TestStoreScanner.java プロジェクト: 06094051/hindex
 /** TODO this fails, since we don't handle deletions, etc, in peek */
 public void SKIP_testPeek() throws Exception {
   KeyValue[] kvs =
       new KeyValue[] {
         KeyValueTestUtil.create("R1", "cf", "a", 1, KeyValue.Type.Put, "dont-care"),
         KeyValueTestUtil.create("R1", "cf", "a", 1, KeyValue.Type.Delete, "dont-care"),
       };
   List<KeyValueScanner> scanners = scanFixture(kvs);
   Scan scanSpec = new Scan(Bytes.toBytes("R1"));
   StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType, getCols("a"), scanners);
   assertNull(scan.peek());
 }
コード例 #2
0
ファイル: TestStoreScanner.java プロジェクト: 06094051/hindex
  public void testScannerReseekDoesntNPE() throws Exception {
    List<KeyValueScanner> scanners = scanFixture(kvs);
    StoreScanner scan =
        new StoreScanner(new Scan(), scanInfo, scanType, getCols("a", "d"), scanners);

    // Previously a updateReaders twice in a row would cause an NPE.  In test this would also
    // normally cause an NPE because scan.store is null.  So as long as we get through these
    // two calls we are good and the bug was quashed.

    scan.updateReaders();

    scan.updateReaders();

    scan.peek();
  }