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.zookeeper.datamodel.ZNRecord> propertyStore, boolean ignoreCase)
-
Method Summary
Modifier and Type Method Description StringgetActualTableName(String tableName)Returns the actual table name for the given table name (with or without type suffix), ornullif the table does not exist.Map<String,String>getColumnNameMap(String rawTableName)Returns a map from column name to actual column name for the given table, ornullif the table schema does not exist.Map<Expression,Expression>getExpressionOverrideMap(String tableNameWithType)Returns the expression override map for the given table, ornullif no override is configured.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.Map<String,String>getTableNameMap()Returns a map from table name to actual table name.Set<String>getTimestampIndexColumns(String tableNameWithType)Returns the timestamp index columns for the given table, ornullif table does not exist.booleanisIgnoreCase()Returnstrueif the TableCache is case-insensitive,falseotherwise.booleanregisterSchemaChangeListener(SchemaChangeListener schemaChangeListener)booleanregisterTableConfigChangeListener(TableConfigChangeListener tableConfigChangeListener)
-
-
-
Method Detail
-
isIgnoreCase
public boolean isIgnoreCase()
Returnstrueif the TableCache is case-insensitive,falseotherwise.
-
getActualTableName
@Nullable public String getActualTableName(String tableName)
Returns the actual table name for the given table name (with or without type suffix), ornullif the table does not exist.
-
getTableNameMap
public Map<String,String> getTableNameMap()
Returns a map from table name to actual table name. For case-insensitive case, the keys of the map are in lower case.
-
getColumnNameMap
@Nullable public Map<String,String> getColumnNameMap(String rawTableName)
Returns a map from column name to actual column name for the given table, ornullif the table schema does not exist. For case-insensitive case, the keys of the map are in lower case.
-
getExpressionOverrideMap
@Nullable public Map<Expression,Expression> getExpressionOverrideMap(String tableNameWithType)
Returns the expression override map for the given table, ornullif no override is configured.
-
getTimestampIndexColumns
@Nullable public Set<String> getTimestampIndexColumns(String tableNameWithType)
Returns the timestamp index columns for the given table, ornullif table 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 boolean 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 boolean registerSchemaChangeListener(SchemaChangeListener schemaChangeListener)
- Specified by:
registerSchemaChangeListenerin interfacePinotConfigProvider
-
-