class CachingCalciteSchema extends CalciteSchema
CalciteSchema
that caches tables,
functions and sub-schemas.Modifier and Type | Class and Description |
---|---|
private class |
CachingCalciteSchema.AbstractCached<T>
Implementation of
CachingCalciteSchema.Cached
that drives from cache . |
private static interface |
CachingCalciteSchema.Cached<T>
Strategy for caching the value of an object and re-creating it if its
value is out of date as of a given timestamp.
|
private static class |
CachingCalciteSchema.SubSchemaCache
Information about the implicit sub-schemas of an
CalciteSchema . |
CalciteSchema.Entry, CalciteSchema.FunctionEntry, CalciteSchema.FunctionEntryImpl, CalciteSchema.LatticeEntry, CalciteSchema.LatticeEntryImpl, CalciteSchema.TableEntry, CalciteSchema.TableEntryImpl, CalciteSchema.TypeEntry, CalciteSchema.TypeEntryImpl
Modifier and Type | Field and Description |
---|---|
private boolean |
cache |
private CachingCalciteSchema.Cached<NameSet> |
implicitFunctionCache |
private CachingCalciteSchema.Cached<CachingCalciteSchema.SubSchemaCache> |
implicitSubSchemaCache |
private CachingCalciteSchema.Cached<NameSet> |
implicitTableCache |
private CachingCalciteSchema.Cached<NameSet> |
implicitTypeCache |
functionMap, functionNames, latticeMap, name, nullaryFunctionMap, schema, subSchemaMap, tableMap, typeMap
Modifier | Constructor and Description |
---|---|
(package private) |
CachingCalciteSchema(CalciteSchema parent,
Schema schema,
java.lang.String name)
Creates a CachingCalciteSchema.
|
private |
CachingCalciteSchema(CalciteSchema parent,
Schema schema,
java.lang.String name,
NameMap<CalciteSchema> subSchemaMap,
NameMap<CalciteSchema.TableEntry> tableMap,
NameMap<CalciteSchema.LatticeEntry> latticeMap,
NameMap<CalciteSchema.TypeEntry> typeMap,
NameMultimap<CalciteSchema.FunctionEntry> functionMap,
NameSet functionNames,
NameMap<CalciteSchema.FunctionEntry> nullaryFunctionMap,
java.util.List<? extends java.util.List<java.lang.String>> path) |
Modifier and Type | Method and Description |
---|---|
CalciteSchema |
add(java.lang.String name,
Schema schema)
Adds a child schema of this schema.
|
protected void |
addImplicitFuncNamesToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
Adds implicit function names to a builder.
|
protected void |
addImplicitFunctionsToBuilder(com.google.common.collect.ImmutableList.Builder<Function> builder,
java.lang.String name,
boolean caseSensitive)
Adds implicit functions to a builder.
|
protected void |
addImplicitSubSchemaToBuilder(com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,CalciteSchema> builder)
Adds implicit sub-schemas to a builder.
|
protected void |
addImplicitTablesBasedOnNullaryFunctionsToBuilder(com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,Table> builder)
Adds implicit table functions to a builder.
|
protected void |
addImplicitTableToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
Adds implicit tables to a builder.
|
protected void |
addImplicitTypeNamesToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
Adds implicit type names to a builder.
|
protected CalciteSchema |
getImplicitSubSchema(java.lang.String schemaName,
boolean caseSensitive)
Returns a sub-schema with a given name that is defined implicitly
(that is, by the underlying
Schema object, not explicitly
by a call to CalciteSchema.add(String, Schema) ), or null. |
protected CalciteSchema.TableEntry |
getImplicitTable(java.lang.String tableName,
boolean caseSensitive)
Returns a table with a given name that is defined implicitly
(that is, by the underlying
Schema object, not explicitly
by a call to CalciteSchema.add(String, Table) ), or null. |
protected CalciteSchema.TableEntry |
getImplicitTableBasedOnNullaryFunction(java.lang.String tableName,
boolean caseSensitive)
Returns table function with a given name and zero arguments that is
defined implicitly (that is, by the underlying
Schema object,
not explicitly by a call to CalciteSchema.add(String, Function) ), or null. |
protected CalciteSchema.TypeEntry |
getImplicitType(java.lang.String name,
boolean caseSensitive)
Returns a type with a given name that is defined implicitly
(that is, by the underlying
Schema object, not explicitly
by a call to CalciteSchema.add(String, RelProtoDataType) ), or null. |
protected boolean |
isCacheEnabled() |
boolean |
removeFunction(java.lang.String name) |
boolean |
removeTable(java.lang.String name) |
void |
setCache(boolean cache) |
protected CalciteSchema |
snapshot(CalciteSchema parent,
SchemaVersion version)
Returns a snapshot representation of this CalciteSchema.
|
add, add, add, createRootSchema, createRootSchema, createRootSchema, createRootSchema, createSnapshot, find, find, from, getFunctionNames, getFunctions, getLatticeMap, getName, getPath, getSubSchema, getSubSchemaMap, getTable, getTableBasedOnNullaryFunction, getTableBySql, getTableNames, getTablesBasedOnNullaryFunctions, getType, getTypeNames, isRoot, path, plus, removeSubSchema, removeType, root, tableEntry, typeEntry
private final CachingCalciteSchema.Cached<CachingCalciteSchema.SubSchemaCache> implicitSubSchemaCache
private final CachingCalciteSchema.Cached<NameSet> implicitTableCache
private final CachingCalciteSchema.Cached<NameSet> implicitFunctionCache
private final CachingCalciteSchema.Cached<NameSet> implicitTypeCache
private boolean cache
CachingCalciteSchema(CalciteSchema parent, Schema schema, java.lang.String name)
private CachingCalciteSchema(CalciteSchema parent, Schema schema, java.lang.String name, NameMap<CalciteSchema> subSchemaMap, NameMap<CalciteSchema.TableEntry> tableMap, NameMap<CalciteSchema.LatticeEntry> latticeMap, NameMap<CalciteSchema.TypeEntry> typeMap, NameMultimap<CalciteSchema.FunctionEntry> functionMap, NameSet functionNames, NameMap<CalciteSchema.FunctionEntry> nullaryFunctionMap, java.util.List<? extends java.util.List<java.lang.String>> path)
public void setCache(boolean cache)
setCache
in class CalciteSchema
protected boolean isCacheEnabled()
isCacheEnabled
in class CalciteSchema
protected CalciteSchema getImplicitSubSchema(java.lang.String schemaName, boolean caseSensitive)
CalciteSchema
Schema
object, not explicitly
by a call to CalciteSchema.add(String, Schema)
), or null.getImplicitSubSchema
in class CalciteSchema
public CalciteSchema add(java.lang.String name, Schema schema)
add
in class CalciteSchema
protected CalciteSchema.TableEntry getImplicitTable(java.lang.String tableName, boolean caseSensitive)
CalciteSchema
Schema
object, not explicitly
by a call to CalciteSchema.add(String, Table)
), or null.getImplicitTable
in class CalciteSchema
protected CalciteSchema.TypeEntry getImplicitType(java.lang.String name, boolean caseSensitive)
CalciteSchema
Schema
object, not explicitly
by a call to CalciteSchema.add(String, RelProtoDataType)
), or null.getImplicitType
in class CalciteSchema
protected void addImplicitSubSchemaToBuilder(com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,CalciteSchema> builder)
CalciteSchema
addImplicitSubSchemaToBuilder
in class CalciteSchema
protected void addImplicitTableToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
CalciteSchema
addImplicitTableToBuilder
in class CalciteSchema
protected void addImplicitFunctionsToBuilder(com.google.common.collect.ImmutableList.Builder<Function> builder, java.lang.String name, boolean caseSensitive)
CalciteSchema
addImplicitFunctionsToBuilder
in class CalciteSchema
protected void addImplicitFuncNamesToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
CalciteSchema
addImplicitFuncNamesToBuilder
in class CalciteSchema
protected void addImplicitTypeNamesToBuilder(com.google.common.collect.ImmutableSortedSet.Builder<java.lang.String> builder)
CalciteSchema
addImplicitTypeNamesToBuilder
in class CalciteSchema
protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder(com.google.common.collect.ImmutableSortedMap.Builder<java.lang.String,Table> builder)
CalciteSchema
addImplicitTablesBasedOnNullaryFunctionsToBuilder
in class CalciteSchema
protected CalciteSchema.TableEntry getImplicitTableBasedOnNullaryFunction(java.lang.String tableName, boolean caseSensitive)
CalciteSchema
Schema
object,
not explicitly by a call to CalciteSchema.add(String, Function)
), or null.getImplicitTableBasedOnNullaryFunction
in class CalciteSchema
protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version)
CalciteSchema
snapshot
in class CalciteSchema
public boolean removeTable(java.lang.String name)
removeTable
in class CalciteSchema
public boolean removeFunction(java.lang.String name)
removeFunction
in class CalciteSchema
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.