Package org.apache.hadoop.hbase.codec.prefixtree.scanner

Examples of org.apache.hadoop.hbase.codec.prefixtree.scanner.CellSearcher.current()


    try {
      searcher = DecoderFactory.checkOut(block, true);
      for (KeyValue kv : rows.getInputs()) {
        boolean hit = searcher.positionAt(kv);
        Assert.assertTrue(hit);
        Cell foundKv = searcher.current();
        Assert.assertTrue(CellComparator.equals(kv, foundKv));
      }
    } finally {
      DecoderFactory.checkIn(searcher);
    }
View Full Code Here


              }

              int expectedInputIndex = beforeVsAfterOnMiss
                  ? rowStartIndexes.get(rowIndex + 1) - 1
                  : rowStartIndexes.get(rowIndex + 1);
              Assert.assertEquals(rows.getInputs().get(expectedInputIndex), searcher.current());
            }
          }

          //previous KV
          KeyValue inputPreviousKv = KeyValueUtil.previousKey(kv);
View Full Code Here

          }else{
            Assert.assertTrue(CellScannerPosition.AFTER == position);
            /*
             * TODO: why i+1 instead of i?
             */
            Assert.assertEquals(rows.getInputs().get(i+1), searcher.current());
          }
        }
      }
    } finally {
      DecoderFactory.checkIn(searcher);
View Full Code Here

      KeyValue firstKVOnRow = KeyValueUtil.createFirstOnRow(Arrays.copyOfRange(
          kv.getRowArray(), kv.getRowOffset(),
          kv.getRowOffset() + kv.getRowLength() / 2));
      CellScannerPosition position = searcher.positionAtOrAfter(firstKVOnRow);
      Assert.assertEquals(CellScannerPosition.AFTER, position);
      Assert.assertEquals(kv, searcher.current());
    } finally {
      DecoderFactory.checkIn(searcher);
    }
  }
}
View Full Code Here

    CellSearcher searcher = null;
    try {
      boolean includesMvcc = decodingCtx.getHFileContext().isIncludesMvcc();
      searcher = DecoderFactory.checkOut(sourceAsBuffer, includesMvcc);
      while (searcher.advance()) {
        KeyValue currentCell = KeyValueUtil.copyToNewKeyValue(searcher.current());
        // needs to be modified for DirectByteBuffers. no existing methods to
        // write VLongs to byte[]
        int offset = result.arrayOffset() + result.position();
        System.arraycopy(currentCell.getBuffer(), currentCell.getOffset(), result.array(), offset,
            currentCell.getLength());
View Full Code Here

      int i = -1;
      while (searcher.advance()) {
        ++i;
        KeyValue inputCell = rows.getInputs().get(i);
        Cell outputCell = searcher.current();

        // check all 3 permutations of equals()
        Assert.assertEquals(inputCell, outputCell);
        Assert.assertEquals(outputCell, inputCell);
        Assert.assertTrue(CellComparator.equals(inputCell, outputCell));
View Full Code Here

      int i = -1;
      while (searcher.previous()) {
        ++i;
        int oppositeIndex = rows.getInputs().size() - i - 1;
        KeyValue inputKv = rows.getInputs().get(oppositeIndex);
        KeyValue outputKv = KeyValueUtil.copyToNewKeyValue(searcher.current());
        Assert.assertEquals(inputKv, outputKv);
      }
      Assert.assertEquals(rows.getInputs().size(), i + 1);
    } finally {
      DecoderFactory.checkIn(searcher);
View Full Code Here

    try {
      searcher = DecoderFactory.checkOut(block, true);
      for (KeyValue kv : rows.getInputs()) {
        boolean hit = searcher.positionAt(kv);
        Assert.assertTrue(hit);
        Cell foundKv = searcher.current();
        Assert.assertTrue(CellComparator.equals(kv, foundKv));
      }
    } finally {
      DecoderFactory.checkIn(searcher);
    }
View Full Code Here

              }

              int expectedInputIndex = beforeVsAfterOnMiss
                  ? rowStartIndexes.get(rowIndex + 1) - 1
                  : rowStartIndexes.get(rowIndex + 1);
              Assert.assertEquals(rows.getInputs().get(expectedInputIndex), searcher.current());
            }
          }

          //previous KV
          KeyValue inputPreviousKv = KeyValueUtil.previousKey(kv);
View Full Code Here

          }else{
            Assert.assertTrue(CellScannerPosition.AFTER == position);
            /*
             * TODO: why i+1 instead of i?
             */
            Assert.assertEquals(rows.getInputs().get(i+1), searcher.current());
          }
        }
      }
    } finally {
      DecoderFactory.checkIn(searcher);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.