Class InMemoryMetaStore
- java.lang.Object
-
- org.apache.beam.sdk.extensions.sql.meta.store.InMemoryMetaStore
-
- All Implemented Interfaces:
TableProvider,MetaStore
public class InMemoryMetaStore extends java.lang.Object implements MetaStore
AMetaStorewhich stores the meta info in memory.NOTE, because this implementation is memory based, the metadata is NOT persistent. for tables which created, you need to create again every time you launch the
BeamSqlCli.
-
-
Constructor Summary
Constructors Constructor Description InMemoryMetaStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeamSqlTablebuildBeamSqlTable(Table table)Build aBeamSqlTableusing the given table meta info.voidcreateTable(Table table)Creates a table.voiddropTable(java.lang.String tableName)Drops a table.TableProvidergetProvider(java.lang.String type)Fetches aTableProviderfor this type.java.util.Map<java.lang.String,Table>getTables()Get all tables from this provider.java.lang.StringgetTableType()Gets the table type this provider handles.voidregisterProvider(TableProvider provider)Register a table provider.booleansupportsPartitioning(Table table)java.util.Map<java.lang.String,TableProvider>tableProviders()Returns all the registeredTableProviders in thisMetaStore, organized by type.protected voidvalidateTableType(Table table)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.beam.sdk.extensions.sql.meta.provider.TableProvider
getSubProvider, getSubProviders, getTable
-
-
-
-
Method Detail
-
getTableType
public java.lang.String getTableType()
Description copied from interface:TableProviderGets the table type this provider handles.- Specified by:
getTableTypein interfaceTableProvider
-
createTable
public void createTable(Table table)
Description copied from interface:TableProviderCreates a table.- Specified by:
createTablein interfaceTableProvider
-
dropTable
public void dropTable(java.lang.String tableName)
Description copied from interface:TableProviderDrops a table.- Specified by:
dropTablein interfaceTableProvider
-
getTables
public java.util.Map<java.lang.String,Table> getTables()
Description copied from interface:TableProviderGet all tables from this provider.- Specified by:
getTablesin interfaceTableProvider
-
buildBeamSqlTable
public BeamSqlTable buildBeamSqlTable(Table table)
Description copied from interface:TableProviderBuild aBeamSqlTableusing the given table meta info.- Specified by:
buildBeamSqlTablein interfaceTableProvider
-
validateTableType
protected void validateTableType(Table table)
-
registerProvider
public void registerProvider(TableProvider provider)
Description copied from interface:MetaStoreRegister a table provider.- Specified by:
registerProviderin interfaceMetaStore
-
tableProviders
public java.util.Map<java.lang.String,TableProvider> tableProviders()
Description copied from interface:MetaStoreReturns all the registeredTableProviders in thisMetaStore, organized by type.- Specified by:
tableProvidersin interfaceMetaStore
-
supportsPartitioning
public boolean supportsPartitioning(Table table)
- Specified by:
supportsPartitioningin interfaceTableProvider
-
getProvider
public TableProvider getProvider(java.lang.String type)
Fetches aTableProviderfor this type. This provider can exist in the currentInMemoryMetaStoreor a nestedInMemoryMetaStore.- Parameters:
type-- Returns:
-
-