/** * Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath. */ public static void main(String[] args) { // Suppress any output to stdout PrintStream stdout = System.out; System.setOut(new PrintStream(new NullOutputStream())); Version version = HBaseVersion.get(); // Restore stdout System.setOut(stdout); System.out.println(version.getMajorVersion()); if (args.length == 1 && "-v".equals(args[0])) { // Print versionString if verbose System.out.println("versionString=" + getVersionString()); } }
/** * Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath. */ public static void main(String[] args) { // Suppress any output to stdout PrintStream stdout = System.out; System.setOut(new PrintStream(new NullOutputStream())); Version version = HBaseVersion.get(); // Restore stdout System.setOut(stdout); System.out.println(version.getMajorVersion()); if (args.length == 1 && "-v".equals(args[0])) { // Print versionString if verbose System.out.println("versionString=" + getVersionString()); } }
instance = createInstance(getLatestHBaseCDHClassName()); LOG.info("CDH HBase version '{}' is unsupported. Continuing with latest CDH HBase version '{}'.", hbaseVersion.getMajorVersion(), getLatestHBaseCDHClassName()); break; } else { instance = createInstance(getLatestHBaseClassName()); LOG.info("HBase version '{}' is unsupported. Continuing with latest HBase version '{}'.", hbaseVersion.getMajorVersion(), getLatestHBaseClassName()); break; } else {
instance = createInstance(getLatestHBaseCDHClassName()); LOG.info("CDH HBase version '{}' is unsupported. Continuing with latest CDH HBase version '{}'.", hbaseVersion.getMajorVersion(), getLatestHBaseCDHClassName()); break; } else { instance = createInstance(getLatestHBaseClassName()); LOG.info("HBase version '{}' is unsupported. Continuing with latest HBase version '{}'.", hbaseVersion.getMajorVersion(), getLatestHBaseClassName()); break; } else {
/** * Get {@link TableDescriptorBuilder} with default properties set. * @param tableId id of the table for which the descriptor is to be returned * @param cConf the instance of the {@link CConfiguration} * @return the builder with default properties set */ public static TableDescriptorBuilder getTableDescriptorBuilder(TableId tableId, CConfiguration cConf) { String tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); TableName tableName = HTableNameConverter.toTableName(tablePrefix, tableId); TableDescriptorBuilder tdBuilder = new TableDescriptorBuilder(tableName.getNamespaceAsString(), tableName.getQualifierAsString()); tdBuilder .addProperty(Constants.Dataset.TABLE_PREFIX, tablePrefix) .addProperty(HBaseTableUtil.CDAP_VERSION, ProjectInfo.getVersion().toString()) .addProperty(HBaseTableUtil.CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); return tdBuilder; }
/** * Get {@link TableDescriptorBuilder} with default properties set. * @param tableId id of the table for which the descriptor is to be returned * @param cConf the instance of the {@link CConfiguration} * @return the builder with default properties set */ public static TableDescriptorBuilder getTableDescriptorBuilder(TableId tableId, CConfiguration cConf) { String tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); TableName tableName = HTableNameConverter.toTableName(tablePrefix, tableId); TableDescriptorBuilder tdBuilder = new TableDescriptorBuilder(tableName.getNamespaceAsString(), tableName.getQualifierAsString()); tdBuilder .addProperty(Constants.Dataset.TABLE_PREFIX, tablePrefix) .addProperty(HBaseTableUtil.CDAP_VERSION, ProjectInfo.getVersion().toString()) .addProperty(HBaseTableUtil.CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); return tdBuilder; }
public static void setHBaseVersion(HTableDescriptorBuilder tableDescriptorBuilder) { tableDescriptorBuilder.setValue(CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); }
public static void setHBaseVersion(HTableDescriptorBuilder tableDescriptorBuilder) { tableDescriptorBuilder.setValue(CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); }