當前位置: 首頁>>代碼示例>>Java>>正文


Java CellUtil.createCell方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.CellUtil.createCell方法的典型用法代碼示例。如果您正苦於以下問題:Java CellUtil.createCell方法的具體用法?Java CellUtil.createCell怎麽用?Java CellUtil.createCell使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hbase.CellUtil的用法示例。


在下文中一共展示了CellUtil.createCell方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseCell

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
@Override
protected Cell parseCell() throws IOException {
  byte [] row = readByteArray(this.in);
  byte [] family = readByteArray(in);
  byte [] qualifier = readByteArray(in);
  byte [] longArray = new byte[Bytes.SIZEOF_LONG];
  IOUtils.readFully(this.in, longArray);
  long timestamp = Bytes.toLong(longArray);
  byte type = (byte) this.in.read();
  byte[] value = readByteArray(in);
  // Read memstore version
  byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];
  IOUtils.readFully(this.in, memstoreTSArray);
  long memstoreTS = Bytes.toLong(memstoreTSArray);
  return CellUtil.createCell(row, family, qualifier, timestamp, type, value, memstoreTS);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:17,代碼來源:CellCodec.java

示例2: parseCell

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
protected Cell parseCell() throws IOException {
  byte[] row = readByteArray(this.in);
  byte[] family = readByteArray(in);
  byte[] qualifier = readByteArray(in);
  byte[] longArray = new byte[Bytes.SIZEOF_LONG];
  IOUtils.readFully(this.in, longArray);
  long timestamp = Bytes.toLong(longArray);
  byte type = (byte) this.in.read();
  byte[] value = readByteArray(in);
  byte[] tags = readByteArray(in);
  // Read memstore version
  byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];
  IOUtils.readFully(this.in, memstoreTSArray);
  long memstoreTS = Bytes.toLong(memstoreTSArray);
  return CellUtil.createCell(row, family, qualifier, timestamp, type, value, tags, memstoreTS);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:17,代碼來源:CellCodecWithTags.java

示例3: parseCell

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
protected Cell parseCell() throws IOException {
  CellProtos.Cell pbcell = CellProtos.Cell.parseDelimitedFrom(this.in);
  return CellUtil.createCell(pbcell.getRow().toByteArray(),
    pbcell.getFamily().toByteArray(), pbcell.getQualifier().toByteArray(),
    pbcell.getTimestamp(), (byte)pbcell.getCellType().getNumber(),
    pbcell.getValue().toByteArray());
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:8,代碼來源:MessageCodec.java

示例4: doSmokeTest

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
public static void doSmokeTest(FileSystem fs, Path path, String codec)
throws Exception {
  Configuration conf = HBaseConfiguration.create();
  HFileContext context = new HFileContextBuilder()
                         .withCompression(AbstractHFileWriter.compressionByName(codec)).build();
  HFile.Writer writer = HFile.getWriterFactoryNoCache(conf)
      .withPath(fs, path)
      .withFileContext(context)
      .create();
  // Write any-old Cell...
  final byte [] rowKey = Bytes.toBytes("compressiontestkey");
  Cell c = CellUtil.createCell(rowKey, Bytes.toBytes("compressiontestval"));
  writer.append(c);
  writer.appendFileInfo(Bytes.toBytes("compressioninfokey"), Bytes.toBytes("compressioninfoval"));
  writer.close();
  Cell cc = null;
  HFile.Reader reader = HFile.createReader(fs, path, new CacheConfig(conf), conf);
  try {
    reader.loadFileInfo();
    HFileScanner scanner = reader.getScanner(false, true);
    scanner.seekTo(); // position to the start of file
    // Scanner does not do Cells yet. Do below for now till fixed.
    cc = scanner.getKeyValue();
    if (CellComparator.compareRows(c, cc) != 0) {
      throw new Exception("Read back incorrect result: " + c.toString() + " vs " + cc.toString());
    }
  } finally {
    reader.close();
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:31,代碼來源:CompressionTest.java

示例5: toCell

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
public static Cell toCell(final CellProtos.Cell cell) {
  // Doing this is going to kill us if we do it for all data passed.
  // St.Ack 20121205
  return CellUtil.createCell(cell.getRow().toByteArray(),
    cell.getFamily().toByteArray(),
    cell.getQualifier().toByteArray(),
    cell.getTimestamp(),
    (byte)cell.getCellType().getNumber(),
    cell.getValue().toByteArray());
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:11,代碼來源:ProtobufUtil.java

示例6: map

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
public Cell map() {
    return CellUtil.createCell(rowKey, family, qualifier,
                                timestamp, type, value);
}
 
開發者ID:i-knowledge,項目名稱:hbase-client,代碼行數:5,代碼來源:SerializableCell.java


注:本文中的org.apache.hadoop.hbase.CellUtil.createCell方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。