本文整理汇总了Java中org.apache.hadoop.hbase.Cell.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.equals方法的具体用法?Java Cell.equals怎么用?Java Cell.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.Cell
的用法示例。
在下文中一共展示了Cell.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformCell
import org.apache.hadoop.hbase.Cell; //导入方法依赖的package包/类
@Override
public Cell transformCell(Cell v) throws IOException {
// transformCell() is expected to follow an inclusive filterKeyValue() immediately:
if (!v.equals(this.referenceKV)) {
throw new IllegalStateException("Reference Cell: " + this.referenceKV + " does not match: "
+ v);
}
return this.transformedKV;
}
示例2: runTest
import org.apache.hadoop.hbase.Cell; //导入方法依赖的package包/类
private void runTest(Path path, DataBlockEncoding blockEncoding,
List<Cell> seeks) throws IOException {
// read all of the key values
StoreFile storeFile = new StoreFile(testingUtility.getTestFileSystem(),
path, configuration, cacheConf, BloomType.NONE);
long totalSize = 0;
StoreFile.Reader reader = storeFile.createReader();
StoreFileScanner scanner = reader.getStoreFileScanner(true, false);
long startReadingTime = System.nanoTime();
Cell current;
scanner.seek(KeyValue.LOWESTKEY);
while (null != (current = scanner.next())) { // just iterate it!
if (KeyValueUtil.ensureKeyValue(current).getLength() < 0) {
throw new IOException("Negative KV size: " + current);
}
totalSize += KeyValueUtil.ensureKeyValue(current).getLength();
}
long finishReadingTime = System.nanoTime();
// do seeks
long startSeeksTime = System.nanoTime();
for (Cell keyValue : seeks) {
scanner.seek(keyValue);
Cell toVerify = scanner.next();
if (!keyValue.equals(toVerify)) {
System.out.println(String.format("KeyValue doesn't match:\n" + "Orig key: %s\n"
+ "Ret key: %s", KeyValueUtil.ensureKeyValue(keyValue).getKeyString(), KeyValueUtil
.ensureKeyValue(toVerify).getKeyString()));
break;
}
}
long finishSeeksTime = System.nanoTime();
if (finishSeeksTime < startSeeksTime) {
throw new AssertionError("Finish time " + finishSeeksTime +
" is earlier than start time " + startSeeksTime);
}
// write some stats
double readInMbPerSec = (totalSize * NANOSEC_IN_SEC) /
(BYTES_IN_MEGABYTES * (finishReadingTime - startReadingTime));
double seeksPerSec = (seeks.size() * NANOSEC_IN_SEC) /
(finishSeeksTime - startSeeksTime);
storeFile.closeReader(cacheConf.shouldEvictOnClose());
clearBlockCache();
System.out.println(blockEncoding);
System.out.printf(" Read speed: %8.2f (MB/s)\n", readInMbPerSec);
System.out.printf(" Seeks per second: %8.2f (#/s)\n", seeksPerSec);
System.out.printf(" Total KV size: %d\n", totalSize);
}