Class TableCache
- java.lang.Object
-
- org.apache.pinot.common.config.provider.TableCache
-
- All Implemented Interfaces:
PinotConfigProvider
public class TableCache extends Object implements PinotConfigProvider
An implementation ofPinotConfigProviderTheTableCachecaches all the table configs and schemas within the cluster, and listens on ZK changes to keep them in sync. It also maintains the table name map and the column name map for case-insensitive queries.
-
-
Constructor Summary
Constructors Constructor Description TableCache(org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.ZNRecord> propertyStore, boolean caseInsensitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActualTableName(String caseInsensitiveTableName)For case-insensitive only, returns the actual table name for the given case-insensitive table name (with or without type suffix), ornullif the table does not exist.Map<String,String>getColumnNameMap(String rawTableName)For case-insensitive only, returns a map from lower case column name to actual column name for the given table, ornullif the table schema does not exist.SchemagetSchema(String rawTableName)Returns the schema for the given table, ornullif it does not exist.TableConfiggetTableConfig(String tableNameWithType)Returns the table config for the given table, ornullif it does not exist.booleanisCaseInsensitive()Returnstrueif the TableCache is case-insensitive,falseotherwise.List<Schema>registerSchemaChangeListener(SchemaChangeListener schemaChangeListener)List<TableConfig>registerTableConfigChangeListener(TableConfigChangeListener tableConfigChangeListener)
-
-
-
Method Detail
-
isCaseInsensitive
public boolean isCaseInsensitive()
Returnstrueif the TableCache is case-insensitive,falseotherwise.
-
getActualTableName
@Nullable public String getActualTableName(String caseInsensitiveTableName)
For case-insensitive only, returns the actual table name for the given case-insensitive table name (with or without type suffix), ornullif the table does not exist.
-
getColumnNameMap
@Nullable public Map<String,String> getColumnNameMap(String rawTableName)
For case-insensitive only, returns a map from lower case column name to actual column name for the given table, ornullif the table schema does not exist.
-
getTableConfig
@Nullable public TableConfig getTableConfig(String tableNameWithType)
Returns the table config for the given table, ornullif it does not exist.- Specified by:
getTableConfigin interfacePinotConfigProvider
-
registerTableConfigChangeListener
public List<TableConfig> registerTableConfigChangeListener(TableConfigChangeListener tableConfigChangeListener)
- Specified by:
registerTableConfigChangeListenerin interfacePinotConfigProvider
-
getSchema
@Nullable public Schema getSchema(String rawTableName)
Returns the schema for the given table, ornullif it does not exist.- Specified by:
getSchemain interfacePinotConfigProvider
-
registerSchemaChangeListener
public List<Schema> registerSchemaChangeListener(SchemaChangeListener schemaChangeListener)
- Specified by:
registerSchemaChangeListenerin interfacePinotConfigProvider
-
-