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


Java Put.setFamilyCellMap方法代碼示例

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


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

示例1: put

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
/**
 * Add updates first to the wal and then add values to memstore. Warning: Assumption is caller has
 * lock on passed in row.
 *
 * @param edits Cell updates by column
 * @throws IOException
 */
private void put(final byte[] row, byte[] family, List<Cell> edits) throws IOException {
  NavigableMap<byte[], List<Cell>> familyMap;
  familyMap = new TreeMap<byte[], List<Cell>>(Bytes.BYTES_COMPARATOR);

  familyMap.put(family, edits);
  Put p = new Put(row);
  p.setFamilyCellMap(familyMap);
  doBatchMutate(p);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:17,代碼來源:HRegion.java

示例2: checkAndDelete

import org.apache.hadoop.hbase.client.Put; //導入方法依賴的package包/類
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
    byte[] value, Delete delete) throws IOException {
  Put put = new Put(row);
  put.setFamilyCellMap(delete.getFamilyCellMap());
  // column to check-the-value
  put.add(new KeyValue(row, family, qualifier, value));
  CellSetModel model = buildModelFromPut(put);
  StringBuilder sb = new StringBuilder();
  sb.append('/');
  sb.append(Bytes.toStringBinary(name));
  sb.append('/');
  sb.append(Bytes.toStringBinary(row));
  sb.append("?check=delete");

  for (int i = 0; i < maxRetries; i++) {
    Response response = client.put(sb.toString(),
      Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput());
    int code = response.getCode();
    switch (code) {
    case 200:
      return true;
    case 304: // NOT-MODIFIED
      return false;
    case 509:
      try {
        Thread.sleep(sleepTime);
      } catch (final InterruptedException e) {
        throw (InterruptedIOException)new InterruptedIOException().initCause(e);
      }
      break;
    default:
      throw new IOException("checkAndDelete request failed with " + code);
    }
  }
  throw new IOException("checkAndDelete request timed out");
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:38,代碼來源:RemoteHTable.java


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