org.apache.hadoop.hbase.client.Get.addFamily()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(140)

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

Get.addFamily介绍

[英]Get all columns from the specified family.

Overrides previous calls to addColumn for this family.
[中]获取指定族中的所有列。
覆盖以前对此族的addColumn调用。

代码示例

代码示例来源:origin: apache/hbase

private Get createGetForDeleteOperation() {
 Get get = new Get(DELETE_OP_ROW);
 get.addFamily(META_FAMILY);
 return get;
}

代码示例来源:origin: apache/hbase

private Get createGetForMergeOperation() {
 Get get = new Get(MERGE_OP_ROW);
 get.addFamily(META_FAMILY);
 return get;
}

代码示例来源:origin: apache/hbase

public static Get makeGetForNamespaceQuotas(final String namespace) {
 Get get = new Get(getNamespaceRowKey(namespace));
 get.addFamily(QUOTA_FAMILY_INFO);
 return get;
}

代码示例来源:origin: apache/hbase

public static Get makeGetForTableQuotas(final TableName table) {
 Get get = new Get(getTableRowKey(table));
 get.addFamily(QUOTA_FAMILY_INFO);
 return get;
}

代码示例来源:origin: apache/hbase

public static Get makeGetForRegionServerQuotas(final String regionServer) {
 Get get = new Get(getRegionServerRowKey(regionServer));
 get.addFamily(QUOTA_FAMILY_INFO);
 return get;
}

代码示例来源:origin: apache/hbase

/**
 * Creates Get operation to load backup set content
 * @return get operation
 */
private Get createGetForBackupSet(String name) {
 Get get = new Get(rowkey(SET_KEY_PREFIX, name));
 get.addFamily(BackupSystemTable.META_FAMILY);
 return get;
}

代码示例来源:origin: apache/hbase

/**
 * Creates Get to retrieve incremental backup table set from backup system table
 * @return get operation
 * @throws IOException exception
 */
private Get createGetForIncrBackupTableSet(String backupRoot) throws IOException {
 Get get = new Get(rowkey(INCR_BACKUP_SET, backupRoot));
 get.addFamily(BackupSystemTable.META_FAMILY);
 get.setMaxVersions(1);
 return get;
}

代码示例来源:origin: apache/hbase

/**
 * Creates Get operation for a given backup id
 * @param backupId backup's ID
 * @return get operation
 * @throws IOException exception
 */
private Get createGetForBackupInfo(String backupId) throws IOException {
 Get get = new Get(rowkey(BACKUP_INFO_PREFIX, backupId));
 get.addFamily(BackupSystemTable.SESSIONS_FAMILY);
 get.setMaxVersions(1);
 return get;
}

代码示例来源:origin: apache/hbase

/**
 * Gets the result in hbase:meta for the specified region.
 * @param connection connection we're using
 * @param regionName region we're looking for
 * @return result of the specified region
 */
public static Result getRegionResult(Connection connection,
  byte[] regionName) throws IOException {
 Get get = new Get(regionName);
 get.addFamily(HConstants.CATALOG_FAMILY);
 return get(getMetaHTable(connection), get);
}

代码示例来源:origin: apache/hbase

/**
 * Creates Get operation to retrieve start code from backup system table
 * @return get operation
 * @throws IOException exception
 */
private Get createGetForStartCode(String rootPath) throws IOException {
 Get get = new Get(rowkey(START_CODE_ROW, rootPath));
 get.addFamily(BackupSystemTable.META_FAMILY);
 get.setMaxVersions(1);
 return get;
}

代码示例来源:origin: apache/hbase

/**
 * Creates Get operation for a given wal file name TODO: support for backup destination
 * @param file file
 * @return get operation
 */
private Get createGetForCheckWALFile(String file) {
 Get get = new Get(rowkey(WALS_PREFIX, BackupUtils.getUniqueWALFileNamePart(file)));
 // add backup root column
 get.addFamily(BackupSystemTable.META_FAMILY);
 return get;
}

代码示例来源:origin: apache/hbase

private Result getRegionFromMeta(Connection connection, List<RegionInfo> regionsOfTable)
  throws IOException {
 byte[] metaKeyForRegion = MetaTableAccessor.getMetaKeyForRegion(regionsOfTable.get(0));
 Get get = new Get(metaKeyForRegion);
 get.addFamily(HConstants.CATALOG_FAMILY);
 Table metaTable = MetaTableAccessor.getMetaHTable(connection);
 Result r = metaTable.get(get);
 return r;
}

代码示例来源:origin: apache/storm

public Get constructGetRequests(byte[] rowKey, HBaseProjectionCriteria projectionCriteria) {
  Get get = new Get(rowKey);
  if (projectionCriteria != null) {
    for (byte[] columnFamily : projectionCriteria.getColumnFamilies()) {
      get.addFamily(columnFamily);
    }
    for (HBaseProjectionCriteria.ColumnMetaData columnMetaData : projectionCriteria.getColumns()) {
      get.addColumn(columnMetaData.getColumnFamily(), columnMetaData.getQualifier());
    }
  }
  return get;
}

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  Get g = new Get(TEST_ROW);
  g.addFamily(family1);
  g.addFamily(family2);
  try (Connection conn = ConnectionFactory.createConnection(conf);
    Table t = conn.getTable(tableName)) {
   t.get(g);
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

/**
 * Returns the HRegionLocation from meta for the given region
 * @param connection connection we're using
 * @param regionInfo region information
 * @return HRegionLocation for the given region
 */
public static HRegionLocation getRegionLocation(Connection connection, RegionInfo regionInfo)
  throws IOException {
 byte[] row = getMetaKeyForRegion(regionInfo);
 Get get = new Get(row);
 get.addFamily(HConstants.CATALOG_FAMILY);
 Result r = get(getMetaHTable(connection), get);
 return getRegionLocation(r, regionInfo, regionInfo.getReplicaId());
}

代码示例来源:origin: apache/hbase

void validateData(Table table, int rownum) throws IOException {
 String row = "row" + String.format("%1$04d", rownum);
 Get get = new Get(Bytes.toBytes(row));
 get.addFamily(HConstants.CATALOG_FAMILY);
 Result result = table.get(get);
 assertTrue(result.size() == 1);
 assertTrue(Bytes.equals(value,
       result.getValue(HConstants.CATALOG_FAMILY, null)));
 LOG.info("Validated row " + row);
}

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  Get g = new Get(TEST_ROW);
  g.addFamily(family2);
  try (Connection conn = ConnectionFactory.createConnection(conf);
    Table t = conn.getTable(tableName)) {
   t.get(g);
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  Get g = new Get(TEST_ROW);
  g.addFamily(TEST_FAMILY);
  try(Connection conn = ConnectionFactory.createConnection(conf);
    Table t = conn.getTable(TEST_TABLE)) {
   t.get(g);
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

private void ensureRowNotReplicated(byte[] row, byte[] fam, Table... tables) throws IOException {
 Get get = new Get(row);
 get.addFamily(fam);
 for (Table table : tables) {
  Result res = table.get(get);
  assertEquals(0, res.size());
 }
}

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  Get g = new Get(TEST_ROW);
  g.addFamily(family1);
  try (Connection conn = ConnectionFactory.createConnection(conf);
    Table t = conn.getTable(tableName)) {
   t.get(g);
  }
  return null;
 }
};

相关文章