org.apache.hadoop.hbase.Cell.getFamily()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.apache.hadoop.hbase.Cell.getFamily()方法的一些代码示例,展示了Cell.getFamily()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cell.getFamily()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.Cell
类名称:Cell
方法名:getFamily

Cell.getFamily介绍

[英]WARNING do not use, expensive. This gets an arraycopy of the cell's family. Added to ease transition from 0.94 -> 0.96.
[中]警告不要使用,价格昂贵。这将获取单元格族的阵列副本。添加以简化从0.94->0.96的转换。

代码示例

代码示例来源:origin: harbby/presto-connectors

@Override
@Deprecated
public byte[] getFamily() {
 return cell.getFamily();
}

代码示例来源:origin: harbby/presto-connectors

@Override
public Entry filter(Entry entry) {
 NavigableMap<byte[], Integer> scopes = entry.getKey().getScopes();
 if (scopes == null || scopes.isEmpty()) {
  return null;
 }
 ArrayList<Cell> cells = entry.getEdit().getCells();
 int size = cells.size();
 for (int i = size - 1; i >= 0; i--) {
  Cell cell = cells.get(i);
  // The scope will be null or empty if
  // there's nothing to replicate in that WALEdit
  if (!scopes.containsKey(cell.getFamily())
    || scopes.get(cell.getFamily()) == HConstants.REPLICATION_SCOPE_LOCAL) {
   cells.remove(i);
  }
 }
 if (cells.size() < size / 2) {
  cells.trimToSize();
 }
 return entry;
}

代码示例来源:origin: harbby/presto-connectors

if ((cfs != null && !cfs.contains(Bytes.toString(cell.getFamily())))) {
 cells.remove(i);

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-0.96

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: caskdata/tephra

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: co.cask.tephra/tephra-hbase-compat-0.96

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: co.cask.tephra/tephra-hbase-compat-1.1

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: caskdata/tephra

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: caskdata/tephra

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: caskdata/tephra

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-0.98

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-1.0

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-1.0-cdh

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: co.cask.tephra/tephra-hbase-compat-1.0

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-1.1

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: caskdata/tephra

private Put transactionalizeAction(Put put) throws IOException {
 Put txPut = new Put(put.getRow(), tx.getWritePointer());
 Set<Map.Entry<byte[], List<Cell>>> familyMap = put.getFamilyCellMap().entrySet();
 if (!familyMap.isEmpty()) {
  for (Map.Entry<byte[], List<Cell>> family : familyMap) {
   List<Cell> familyValues = family.getValue();
   if (!familyValues.isEmpty()) {
    for (Cell value : familyValues) {
     txPut.add(value.getFamily(), value.getQualifier(), tx.getWritePointer(), value.getValue());
     addToChangeSet(txPut.getRow(), value.getFamily(), value.getQualifier());
    }
   }
  }
 }
 for (Map.Entry<String, byte[]> entry : put.getAttributesMap().entrySet()) {
  txPut.setAttribute(entry.getKey(), entry.getValue());
 }
 txPut.setDurability(put.getDurability());
 addToOperation(txPut, tx);
 return txPut;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Utility method used to set the correct scopes on each log key. Doesn't set a scope on keys
 * from compaction WAL edits and if the scope is local.
 * @param htd Descriptor used to find the scope to use
 * @param logKey Key that may get scoped according to its edits
 * @param logEdit Edits used to lookup the scopes
 */
public static void scopeWALEdits(HTableDescriptor htd, WALKey logKey,
                 WALEdit logEdit) {
 NavigableMap<byte[], Integer> scopes =
   new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
 byte[] family;
 for (Cell cell : logEdit.getCells()) {
  family = cell.getFamily();
  // This is expected and the KV should not be replicated
  if (CellUtil.matchingFamily(cell, WALEdit.METAFAMILY)) continue;
  // Unexpected, has a tendency to happen in unit tests
  assert htd.getFamily(family) != null;
  int scope = htd.getFamily(family).getScope();
  if (scope != REPLICATION_SCOPE_LOCAL &&
    !scopes.containsKey(family)) {
   scopes.put(family, scope);
  }
 }
 if (!scopes.isEmpty()) {
  logKey.setScopes(scopes);
 }
}

代码示例来源:origin: harbby/presto-connectors

for (Cell cell : value.getCells()) {
 if (WALEdit.isMetaEditFamily(cell.getFamily())) continue;

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-0.98

txDelete.deleteColumns(value.getFamily(), value.getQualifier(), transactionTimestamp);
addToChangeSet(deleteRow, value.getFamily(), value.getQualifier());

代码示例来源:origin: co.cask.tephra/tephra-hbase-compat-1.1

txDelete.deleteColumns(value.getFamily(), value.getQualifier(), transactionTimestamp);
addToChangeSet(deleteRow, value.getFamily(), value.getQualifier());

相关文章