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


Java Put.getRow方法代碼示例

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


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

示例1: processPut

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
/**
 * parse put, add index put into mdRecordList
 */
private void processPut(List<KeyValue> mdRecordList, Put put) throws IOException {
  if (put == null) return;
  byte[] rawRowkey = put.getRow();
  int[] arr = new int[dimensions];
  int i = 0;
  for (Map.Entry<byte[], TreeSet<byte[]>> entry : tableRelation.getIndexFamilyMap().entrySet()) {
    for (byte[] qualifier : entry.getValue()) {
      arr[i] = Bytes.toInt(put.get(entry.getKey(), qualifier).get(0).getValue());
      ++i;
    }
  }
  byte[] mdKey = MDUtils.bitwiseZip(arr, dimensions);
  KeyValue keyValue =
      new KeyValue(mdKey, LMDIndexConstants.FAMILY, rawRowkey, put.getTimeStamp(), Type.Put,
          LMDIndexConstants.VALUE);
  mdRecordList.add(keyValue);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:21,代碼來源:LMDIndexWriter.java

示例2: parsePut

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
@Override protected Map<TableName, Put> parsePut(Put put, boolean serverSide) {
  Map<TableName, Put> map = new HashMap<>();
  byte[] row = put.getRow();
  for (Map.Entry<byte[], List<Cell>> entry : put.getFamilyCellMap().entrySet()) {
    byte[] family = entry.getKey();
    for (Cell cell : entry.getValue()) {
      byte[] q = CellUtil.cloneQualifier(cell);
      if (tableRelation.isIndexColumn(family, q)) {
        TableName indexTableName = tableRelation.getIndexTableName(family, q);
        Put newPut = new Put(getIndexRow(row, CellUtil.cloneValue(cell)));
        if (serverSide) newPut
            .addColumn(IndexType.SEDONDARY_FAMILY_BYTES, (byte[]) null, cell.getTimestamp(),
                null);
        else newPut.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, null, null);
        map.put(indexTableName, newPut);
      }
    }
  }
  tableRelation.getIndexFamilyMap();
  return map;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:22,代碼來源:IndexPutParser.java

示例3: testRow

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
@Override
void testRow(final int i) throws IOException {
  byte [] bytes = format(i);
  // Put a known value so when we go to check it, it is there.
  Put put = new Put(bytes);
  put.addColumn(FAMILY_NAME, getQualifier(), bytes);
  this.table.put(put);
  Delete delete = new Delete(put.getRow());
  delete.addColumn(FAMILY_NAME, getQualifier());
  this.table.checkAndDelete(bytes, FAMILY_NAME, getQualifier(), CompareOp.EQUAL, bytes, delete);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:12,代碼來源:PerformanceEvaluation.java

示例4: parsePutList

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
/**
 * override this method to improve performance
 */
@Override protected Map<TableName, List<Put>> parsePutList(List<Put> puts, boolean serverSide) {
  Map<TableName, List<Put>> map = new TreeMap<>();
  for (Put put : puts) {
    byte[] row = put.getRow();
    for (Map.Entry<byte[], List<Cell>> entry : put.getFamilyCellMap().entrySet()) {
      byte[] family = entry.getKey();
      for (Cell cell : entry.getValue()) {
        byte[] q = CellUtil.cloneQualifier(cell);
        if (tableRelation.isIndexColumn(family, q)) {
          TableName indexTableName = tableRelation.getIndexTableName(family, q);
          List<Put> list = map.get(indexTableName);
          if (list == null) {
            list = new ArrayList<>();
            map.put(indexTableName, list);
          }
          Put newPut = new Put(getIndexRow(row, CellUtil.cloneValue(cell)));
          if (serverSide) newPut
              .addColumn(IndexType.SEDONDARY_FAMILY_BYTES, (byte[]) null, cell.getTimestamp(),
                  null);
          else newPut.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, null, null);
          list.add(newPut);
        }
      }
    }
  }
  tableRelation.getIndexFamilyMap();
  return map;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:32,代碼來源:IndexPutParser.java

示例5: buildModelFromPut

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
protected CellSetModel buildModelFromPut(Put put) {
  RowModel row = new RowModel(put.getRow());
  long ts = put.getTimeStamp();
  for (List<Cell> cells: put.getFamilyCellMap().values()) {
    for (Cell cell: cells) {
      row.addCell(new CellModel(CellUtil.cloneFamily(cell), CellUtil.cloneQualifier(cell),
        ts != HConstants.LATEST_TIMESTAMP ? ts : cell.getTimestamp(),
        CellUtil.cloneValue(cell)));
    }
  }
  CellSetModel model = new CellSetModel();
  model.addRow(row);
  return model;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:15,代碼來源:RemoteHTable.java


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