Refine search
/** * 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; }
/** * 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; }
/** * 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); }
/** * 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; }
/** * 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; }
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; }
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; }
/** * 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()); }
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); }