public class ConnectionQueryServicesImpl extends DelegateQueryServices implements ConnectionQueryServices
ConnectionQueryServices.Feature
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
config |
INITIAL_META_DATA_TABLE_CAPACITY
ALLOW_LOCAL_INDEX_ATTRIB, ALLOW_ONLINE_TABLE_SCHEMA_UPDATE, ALLOW_USER_DEFINED_FUNCTIONS_ATTRIB, ALLOW_VIEWS_ADD_NEW_CF_BASE_TABLE, AUTO_COMMIT_ATTRIB, AUTO_UPGRADE_WHITELIST_ATTRIB, CALL_QUEUE_PRODUCER_ATTRIB_NAME, CALL_QUEUE_ROUND_ROBIN_ATTRIB, CLOCK_SKEW_INTERVAL_ATTRIB, COLLECT_REQUEST_LEVEL_METRICS, COPROCESSOR_PRIORITY_ATTRIB, DATE_FORMAT_ATTRIB, DATE_FORMAT_TIMEZONE_ATTRIB, DEFAULT_KEEP_DELETED_CELLS_ATTRIB, DEFAULT_STORE_NULLS_ATTRIB, DELAY_FOR_SCHEMA_UPDATE_CHECK, DISTINCT_VALUE_COMPRESS_THRESHOLD_ATTRIB, DROP_METADATA_ATTRIB, DYNAMIC_JARS_DIR_KEY, EXPLAIN_CHUNK_COUNT_ATTRIB, FORCE_ROW_KEY_ORDER_ATTRIB, GLOBAL_METRICS_ENABLED, GROUPBY_ESTIMATED_DISTINCT_VALUES_ATTRIB, GROUPBY_MAX_CACHE_SIZE_ATTRIB, GROUPBY_SPILL_FILES_ATTRIB, GROUPBY_SPILLABLE_ATTRIB, HBASE_CLIENT_KEYTAB, HBASE_CLIENT_PRINCIPAL, IMMUTABLE_ROWS_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_INTERVAL_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_OVERLAP_TIME_ATTRIB, INDEX_HANDLER_COUNT_ATTRIB, INDEX_MAX_FILESIZE_PERC_ATTRIB, INDEX_MUTATE_BATCH_SIZE_THRESHOLD_ATTRIB, INDEX_PRIOIRTY_ATTRIB, KEEP_ALIVE_MS_ATTRIB, MASTER_INFO_PORT_ATTRIB, MAX_CLIENT_METADATA_CACHE_SIZE_ATTRIB, MAX_MEMORY_PERC_ATTRIB, MAX_MEMORY_SIZE_ATTRIB, MAX_MEMORY_WAIT_MS_ATTRIB, MAX_MUTATION_SIZE_ATTRIB, MAX_SERVER_CACHE_SIZE_ATTRIB, MAX_SERVER_CACHE_TIME_TO_LIVE_MS_ATTRIB, MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, MAX_SPOOL_TO_DISK_BYTES_ATTRIB, MAX_TENANT_MEMORY_PERC_ATTRIB, METADATA_HANDLER_COUNT_ATTRIB, METADATA_PRIOIRTY_ATTRIB, MIN_STATS_UPDATE_FREQ_MS_ATTRIB, MUTATE_BATCH_SIZE_ATTRIB, NUM_RETRIES_FOR_SCHEMA_UPDATE_CHECK, NUMBER_FORMAT_ATTRIB, QUEUE_SIZE_ATTRIB, REGIONSERVER_INFO_PORT_ATTRIB, REGIONSERVER_LEASE_PERIOD_ATTRIB, ROW_KEY_ORDER_SALTED_TABLE_ATTRIB, RPC_TIMEOUT_ATTRIB, SCAN_CACHE_SIZE_ATTRIB, SCAN_RESULT_CHUNK_SIZE, SEQUENCE_CACHE_SIZE_ATTRIB, SEQUENCE_SALT_BUCKETS_ATTRIB, SPOOL_DIRECTORY, SPOOL_THRESHOLD_BYTES_ATTRIB, STATS_GUIDEPOST_PER_REGION_ATTRIB, STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, STATS_UPDATE_FREQ_MS_ATTRIB, STATS_USE_CURRENT_TIME_ATTRIB, THREAD_POOL_SIZE_ATTRIB, THREAD_TIMEOUT_MS_ATTRIB, TIME_FORMAT_ATTRIB, TIMESTAMP_FORMAT_ATTRIB, TRACING_CUSTOM_ANNOTATION_ATTRIB_PREFIX, TRACING_FREQ_ATTRIB, TRACING_PAGE_SIZE_ATTRIB, TRACING_PROBABILITY_THRESHOLD_ATTRIB, TRACING_STATS_TABLE_NAME_ATTRIB, USE_BYTE_BASED_REGEX_ATTRIB, USE_INDEXES_ATTRIB, USE_REVERSE_SCAN_ATTRIB, ZOOKEEPER_PORT_ATTRIB, ZOOKEEPER_QUARUM_ATTRIB, ZOOKEEPER_ROOT_NODE_ATTRIB
Constructor and Description |
---|
ConnectionQueryServicesImpl(QueryServices services,
PhoenixEmbeddedDriver.ConnectionInfo connectionInfo,
Properties info)
Construct a ConnectionQueryServicesImpl that represents a connection to an HBase
cluster.
|
Modifier and Type | Method and Description |
---|---|
MetaDataProtocol.MetaDataMutationResult |
addColumn(List<Mutation> tableMetaData,
PTable table,
Map<String,List<Pair<String,Object>>> stmtProperties,
Set<String> colFamiliesForPColumnsToBeAdded) |
PMetaData |
addColumn(PName tenantId,
String tableName,
List<PColumn> columns,
long tableTimeStamp,
long tableSeqNum,
boolean isImmutableRows,
boolean isWalDisabled,
boolean isMultitenant,
boolean storeNulls) |
void |
addConnection(PhoenixConnection connection) |
PMetaData |
addFunction(PFunction function) |
PMetaData |
addTable(PTable table) |
void |
clearCache()
Clears the Phoenix meta data cache on each region server
|
void |
clearTableFromCache(byte[] tenantId,
byte[] schemaName,
byte[] tableName,
long clientTS) |
void |
clearTableRegionCache(byte[] tableName) |
void |
close()
Closes the underlying connection to zookeeper.
|
PhoenixConnection |
connect(String url,
Properties info) |
MetaDataProtocol.MetaDataMutationResult |
createFunction(List<Mutation> functionData,
PFunction function,
boolean temporary) |
long |
createSequence(String tenantId,
String schemaName,
String sequenceName,
long startWith,
long incrementBy,
long cacheSize,
long minValue,
long maxValue,
boolean cycle,
long timestamp) |
MetaDataProtocol.MetaDataMutationResult |
createTable(List<Mutation> tableMetaData,
byte[] physicalTableName,
PTableType tableType,
Map<String,Object> tableProps,
List<Pair<byte[],Map<String,Object>>> families,
byte[][] splits) |
long |
currentSequenceValue(SequenceKey sequenceKey,
long timestamp)
Gets the current sequence value
|
MetaDataProtocol.MetaDataMutationResult |
dropColumn(List<Mutation> tableMetaData,
PTableType tableType) |
MetaDataProtocol.MetaDataMutationResult |
dropFunction(List<Mutation> functionData,
boolean ifExists) |
long |
dropSequence(String tenantId,
String schemaName,
String sequenceName,
long timestamp) |
MetaDataProtocol.MetaDataMutationResult |
dropTable(List<Mutation> tableMetaData,
PTableType tableType,
boolean cascade) |
HBaseAdmin |
getAdmin() |
List<HRegionLocation> |
getAllTableRegions(byte[] tableName) |
ConnectionQueryServices |
getChildQueryServices(ImmutableBytesWritable tenantId)
Get (and create if necessary) a child QueryService for a given tenantId.
|
MetaDataProtocol.MetaDataMutationResult |
getFunctions(PName tenantId,
List<Pair<byte[],Long>> functions,
long clientTimestamp) |
KeyValueBuilder |
getKeyValueBuilder() |
int |
getLowestClusterHBaseVersion() |
ReadOnlyProps |
getProps()
Get the properties from the HBase configuration in a
read-only structure that avoids any synchronization
|
int |
getSequenceSaltBuckets() |
HTableInterface |
getTable(byte[] tableName)
Get an HTableInterface by the given name.
|
MetaDataProtocol.MetaDataMutationResult |
getTable(PName tenantId,
byte[] schemaBytes,
byte[] tableBytes,
long tableTimestamp,
long clientTimestamp) |
HTableDescriptor |
getTableDescriptor(byte[] tableName) |
PTableStats |
getTableStats(byte[] physicalName,
long clientTimeStamp) |
String |
getUserName() |
boolean |
hasInvalidIndexConfiguration() |
void |
incrementSequences(List<SequenceAllocation> sequenceAllocations,
long timestamp,
long[] values,
SQLException[] exceptions)
Increment any of the set of sequences that need more values.
|
void |
init(String url,
Properties props) |
protected ConnectionQueryServices |
newChildQueryService() |
PMetaData |
removeColumn(PName tenantId,
String tableName,
List<PColumn> columnsToRemove,
long tableTimeStamp,
long tableSeqNum) |
void |
removeConnection(PhoenixConnection connection) |
PMetaData |
removeFunction(PName tenantId,
String function,
long functionTimeStamp) |
PMetaData |
removeTable(PName tenantId,
String tableName,
String parentTableName,
long tableTimeStamp) |
void |
returnSequences(List<SequenceKey> keys,
long timestamp,
SQLException[] exceptions) |
boolean |
supportsFeature(ConnectionQueryServices.Feature feature) |
MutationState |
updateData(MutationPlan plan) |
MetaDataProtocol.MetaDataMutationResult |
updateIndexState(List<Mutation> tableMetaData,
String parentTableName) |
void |
validateSequences(List<SequenceAllocation> sequenceAllocations,
long timestamp,
long[] values,
SQLException[] exceptions,
Sequence.ValueOp action)
Verifies that sequences exist and reserves values for them if reserveValues is true
|
getDelegate, getExecutor, getMemoryManager, getOptimizer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExecutor, getMemoryManager, getOptimizer
public ConnectionQueryServicesImpl(QueryServices services, PhoenixEmbeddedDriver.ConnectionInfo connectionInfo, Properties info)
services
- base services from where we derive our default configurationconnectionInfo
- to provide connection informationinfo
- hbase configuration propertiesSQLException
public HTableInterface getTable(byte[] tableName) throws SQLException
ConnectionQueryServices
getTable
in interface ConnectionQueryServices
tableName
- the name of the HTableSQLException
public HTableDescriptor getTableDescriptor(byte[] tableName) throws SQLException
getTableDescriptor
in interface ConnectionQueryServices
SQLException
public ReadOnlyProps getProps()
QueryServices
getProps
in interface QueryServices
getProps
in class DelegateQueryServices
public void close() throws SQLException
close
in interface SQLCloseable
close
in class DelegateQueryServices
SQLException
protected ConnectionQueryServices newChildQueryService()
public ConnectionQueryServices getChildQueryServices(ImmutableBytesWritable tenantId)
getChildQueryServices
in interface ConnectionQueryServices
tenantId
- the tenant IDpublic void clearTableRegionCache(byte[] tableName) throws SQLException
clearTableRegionCache
in interface ConnectionQueryServices
SQLException
public List<HRegionLocation> getAllTableRegions(byte[] tableName) throws SQLException
getAllTableRegions
in interface ConnectionQueryServices
SQLException
public PMetaData addTable(PTable table) throws SQLException
addTable
in interface MetaDataMutated
SQLException
public PMetaData addColumn(PName tenantId, String tableName, List<PColumn> columns, long tableTimeStamp, long tableSeqNum, boolean isImmutableRows, boolean isWalDisabled, boolean isMultitenant, boolean storeNulls) throws SQLException
addColumn
in interface MetaDataMutated
SQLException
public PMetaData removeTable(PName tenantId, String tableName, String parentTableName, long tableTimeStamp) throws SQLException
removeTable
in interface MetaDataMutated
SQLException
public PMetaData removeColumn(PName tenantId, String tableName, List<PColumn> columnsToRemove, long tableTimeStamp, long tableSeqNum) throws SQLException
removeColumn
in interface MetaDataMutated
SQLException
public PhoenixConnection connect(String url, Properties info) throws SQLException
connect
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult createTable(List<Mutation> tableMetaData, byte[] physicalTableName, PTableType tableType, Map<String,Object> tableProps, List<Pair<byte[],Map<String,Object>>> families, byte[][] splits) throws SQLException
createTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult getTable(PName tenantId, byte[] schemaBytes, byte[] tableBytes, long tableTimestamp, long clientTimestamp) throws SQLException
getTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropTable(List<Mutation> tableMetaData, PTableType tableType, boolean cascade) throws SQLException
dropTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropFunction(List<Mutation> functionData, boolean ifExists) throws SQLException
dropFunction
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult addColumn(List<Mutation> tableMetaData, PTable table, Map<String,List<Pair<String,Object>>> stmtProperties, Set<String> colFamiliesForPColumnsToBeAdded) throws SQLException
addColumn
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropColumn(List<Mutation> tableMetaData, PTableType tableType) throws SQLException
dropColumn
in interface ConnectionQueryServices
SQLException
public void init(String url, Properties props) throws SQLException
init
in interface ConnectionQueryServices
SQLException
public MutationState updateData(MutationPlan plan) throws SQLException
updateData
in interface ConnectionQueryServices
SQLException
public int getLowestClusterHBaseVersion()
getLowestClusterHBaseVersion
in interface ConnectionQueryServices
public boolean hasInvalidIndexConfiguration()
hasInvalidIndexConfiguration
in interface ConnectionQueryServices
public void clearCache() throws SQLException
clearCache
in interface ConnectionQueryServices
SQLException
public HBaseAdmin getAdmin() throws SQLException
getAdmin
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult updateIndexState(List<Mutation> tableMetaData, String parentTableName) throws SQLException
updateIndexState
in interface ConnectionQueryServices
SQLException
public long createSequence(String tenantId, String schemaName, String sequenceName, long startWith, long incrementBy, long cacheSize, long minValue, long maxValue, boolean cycle, long timestamp) throws SQLException
createSequence
in interface ConnectionQueryServices
SQLException
public long dropSequence(String tenantId, String schemaName, String sequenceName, long timestamp) throws SQLException
dropSequence
in interface ConnectionQueryServices
SQLException
public long currentSequenceValue(SequenceKey sequenceKey, long timestamp) throws SQLException
currentSequenceValue
in interface ConnectionQueryServices
SQLException
- if cached sequence cannot be foundpublic void validateSequences(List<SequenceAllocation> sequenceAllocations, long timestamp, long[] values, SQLException[] exceptions, Sequence.ValueOp action) throws SQLException
validateSequences
in interface ConnectionQueryServices
SQLException
public void incrementSequences(List<SequenceAllocation> sequenceAllocations, long timestamp, long[] values, SQLException[] exceptions) throws SQLException
incrementSequences
in interface ConnectionQueryServices
sequenceKeys
- sorted list of sequence kyestimestamp
- SQLException
- if any of the sequences cannot be foundpublic void clearTableFromCache(byte[] tenantId, byte[] schemaName, byte[] tableName, long clientTS) throws SQLException
clearTableFromCache
in interface ConnectionQueryServices
SQLException
public void returnSequences(List<SequenceKey> keys, long timestamp, SQLException[] exceptions) throws SQLException
returnSequences
in interface ConnectionQueryServices
SQLException
public void addConnection(PhoenixConnection connection) throws SQLException
addConnection
in interface ConnectionQueryServices
SQLException
public void removeConnection(PhoenixConnection connection) throws SQLException
removeConnection
in interface ConnectionQueryServices
SQLException
public KeyValueBuilder getKeyValueBuilder()
getKeyValueBuilder
in interface ConnectionQueryServices
KeyValueBuilder
that is valid for the locally installed version of HBase.public boolean supportsFeature(ConnectionQueryServices.Feature feature)
supportsFeature
in interface ConnectionQueryServices
public String getUserName()
getUserName
in interface ConnectionQueryServices
public PTableStats getTableStats(byte[] physicalName, long clientTimeStamp) throws SQLException
getTableStats
in interface ConnectionQueryServices
SQLException
public int getSequenceSaltBuckets()
getSequenceSaltBuckets
in interface ConnectionQueryServices
public PMetaData addFunction(PFunction function) throws SQLException
addFunction
in interface MetaDataMutated
SQLException
public PMetaData removeFunction(PName tenantId, String function, long functionTimeStamp) throws SQLException
removeFunction
in interface MetaDataMutated
SQLException
public MetaDataProtocol.MetaDataMutationResult getFunctions(PName tenantId, List<Pair<byte[],Long>> functions, long clientTimestamp) throws SQLException
getFunctions
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult createFunction(List<Mutation> functionData, PFunction function, boolean temporary) throws SQLException
createFunction
in interface ConnectionQueryServices
SQLException
Copyright © 2015 Apache Software Foundation. All Rights Reserved.