@Test public void testExtractQuorum() { assertEquals("host1:2171", HBaseTablespace.extractQuorum(URI.create("hbase:zk: assertEquals("host1:2171", HBaseTablespace.extractQuorum(URI.create("hbase:zk: assertEquals("host1:2171,host2:2172", HBaseTablespace.extractQuorum(URI.create("hbase:zk: }
static String extractQuorum(URI uri) { String uriStr = uri.toString(); int start = uriStr.indexOf("/") + 2; int pathIndex = uriStr.lastIndexOf("/"); if (pathIndex < start) { return uriStr.substring(start); } else { return uriStr.substring(start, pathIndex); } }
HBaseTablespace extends Tablespace { static String extractQuorum(URI uri) { String uriStr = uri.toString(); int start = uriStr.indexOf("/") + 2; int pathIndex = uriStr.lastIndexOf("/"); if (pathIndex < start) { return uriStr.substring(start); } else { return uriStr.substring(start, pathIndex); } } }
HBaseTablespace extends Tablespace { static String extractQuorum(URI uri) { String uriStr = uri.toString(); int start = uriStr.indexOf("/") + 2; int pathIndex = uriStr.lastIndexOf("/"); if (pathIndex < start) { return uriStr.substring(start); } else { return uriStr.substring(start, pathIndex); } } HBaseTablespace(String spaceName, URI uri, JSONObject config); }
HBaseTablespace extends Tablespace { static String extractQuorum(URI uri) { String uriStr = uri.toString(); int start = uriStr.indexOf("/") + 2; int pathIndex = uriStr.lastIndexOf("/"); if (pathIndex < start) { return uriStr.substring(start); } else { return uriStr.substring(start, pathIndex); } } HBaseTablespace(String spaceName, URI uri, JSONObject config); @Override void storageInit(); Configuration getHbaseConf(); @Override long getTableVolume(TableDesc table, Optional<EvalNode> filter); @Override void close(); @Override void createTable(TableDesc tableDesc, boolean ifNotExists); static HTableDescriptor parseHTableDescriptor(TableMeta tableMeta, Schema schema); @Override void purgeTable(TableDesc tableDesc); @Override URI getTableUri(TableMeta meta, String databaseName, String tableName); @Override List<Fragment> getSplits(String inputSourceId,
                                  TableDesc table,
                                  boolean requireSorted,
                                  @Nullable EvalNode filterCondition); @Override Appender getAppenderForInsertRow(OverridableConf queryContext,
                                          TaskAttemptId taskAttemptId,
                                          TableMeta meta,
                                          Schema schema,
                                          Path workDir); @Override Appender getAppender(OverridableConf queryContext,
                              TaskAttemptId taskAttemptId, TableMeta meta, Schema schema, Path workDir); HConnection getConnection(); List<IndexPredication> getIndexPredications(ColumnMapping columnMapping,
                                                     TableDesc tableDesc,
                                                     @Nullable EvalNode filterCondition); List<Set<EvalNode>> findIndexablePredicateSet(@Nullable EvalNode qual,
                                                       Column[] indexableColumns); static boolean isIndexableOperator(EvalNode expr); Pair<Datum, Datum> getIndexablePredicateValue(ColumnMapping columnMapping,
                                                       Set<EvalNode> evalNodes); @Override Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId,
                          LogicalPlan plan, Schema schema,
                          TableDesc tableDesc); @Override TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc,
                                          Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange); @Override void rewritePlan(OverridableConf context, LogicalPlan plan); @Override StorageProperty getProperty(); @Override FormatProperty getFormatProperty(TableMeta meta); void prepareTable(LogicalNode node); @Override void rollbackTable(LogicalNode node); @Override URI getStagingUri(OverridableConf context, String queryId, TableMeta meta); URI prepareStagingSpace(TajoConf conf, String queryId, OverridableConf context,
                                 TableMeta meta); @Override void verifySchemaToWrite(TableDesc tableDesc, Schema outSchema); }
HBaseTablespace extends Tablespace { static String extractQuorum(URI uri) { String uriStr = uri.toString(); int start = uriStr.indexOf("/") + 2; int pathIndex = uriStr.lastIndexOf("/"); if (pathIndex < start) { return uriStr.substring(start); } else { return uriStr.substring(start, pathIndex); } } HBaseTablespace(String spaceName, URI uri, JSONObject config); @Override void storageInit(); Configuration getHbaseConf(); @Override long getTableVolume(TableDesc table, Optional<EvalNode> filter); @Override void close(); @Override void createTable(TableDesc tableDesc, boolean ifNotExists); static HTableDescriptor parseHTableDescriptor(TableMeta tableMeta, Schema schema); @Override void purgeTable(TableDesc tableDesc); @Override URI getTableUri(TableMeta meta, String databaseName, String tableName); @Override List<Fragment> getSplits(String inputSourceId,
                                  TableDesc table,
                                  boolean requireSorted,
                                  @Nullable EvalNode filterCondition); @Override Appender getAppenderForInsertRow(OverridableConf queryContext,
                                          TaskAttemptId taskAttemptId,
                                          TableMeta meta,
                                          Schema schema,
                                          Path workDir); @Override Appender getAppender(OverridableConf queryContext,
                              TaskAttemptId taskAttemptId, TableMeta meta, Schema schema, Path workDir); HConnection getConnection(); List<IndexPredication> getIndexPredications(ColumnMapping columnMapping,
                                                     TableDesc tableDesc,
                                                     @Nullable EvalNode filterCondition); List<Set<EvalNode>> findIndexablePredicateSet(@Nullable EvalNode qual,
                                                       Column[] indexableColumns); static boolean isIndexableOperator(EvalNode expr); Pair<Datum, Datum> getIndexablePredicateValue(ColumnMapping columnMapping,
                                                       Set<EvalNode> evalNodes); @Override Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId,
                          LogicalPlan plan, Schema schema,
                          TableDesc tableDesc); @Override TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc,
                                          Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange); @Override void rewritePlan(OverridableConf context, LogicalPlan plan); @Override StorageProperty getProperty(); @Override FormatProperty getFormatProperty(TableMeta meta); void prepareTable(LogicalNode node); @Override void rollbackTable(LogicalNode node); @Override URI getStagingUri(OverridableConf context, String queryId, TableMeta meta); URI prepareStagingSpace(TajoConf conf, String queryId, OverridableConf context,
                                 TableMeta meta); @Override void verifySchemaToWrite(TableDesc tableDesc, Schema outSchema); static final StorageProperty HBASE_STORAGE_PROPERTIES; static final FormatProperty HFILE_FORMAT_PROPERTIES; static final FormatProperty PUT_MODE_PROPERTIES; static final List<byte []> EMPTY_START_ROW_KEY; static final List<byte []> EMPTY_END_ROW_KEY; }