public class InMemoryExternalCatalog extends Object implements CrudExternalCatalog
ExternalCatalog
.
param: name The name of the catalog
It could be used for testing or developing instead of used in production environment.
Constructor and Description |
---|
InMemoryExternalCatalog(String name) |
Modifier and Type | Method and Description |
---|---|
void |
alterSubCatalog(String catalogName,
ExternalCatalog catalog,
boolean ignoreIfNotExists)
Modifies an existing sub catalog of this catalog.
|
void |
alterTable(String tableName,
ExternalCatalogTable table,
boolean ignoreIfNotExists)
Modifies an existing table of this catalog.
|
void |
createSubCatalog(String catalogName,
ExternalCatalog catalog,
boolean ignoreIfExists)
Adds a subcatalog to this catalog.
|
void |
createTable(String tableName,
ExternalCatalogTable table,
boolean ignoreIfExists)
Adds a table to this catalog.
|
void |
dropSubCatalog(String catalogName,
boolean ignoreIfNotExists)
Deletes a sub catalog from this catalog.
|
void |
dropTable(String tableName,
boolean ignoreIfNotExists)
Deletes table from this catalog.
|
ExternalCatalog |
getSubCatalog(String catalogName)
Gets a sub catalog from this catalog.
|
ExternalCatalogTable |
getTable(String tableName)
Get a table from this catalog.
|
List<String> |
listSubCatalogs()
Gets the names of all sub catalogs registered in this catalog.
|
List<String> |
listTables()
Gets the names of all tables registered in this catalog.
|
public InMemoryExternalCatalog(String name)
public void createTable(String tableName, ExternalCatalogTable table, boolean ignoreIfExists) throws TableAlreadyExistException
CrudExternalCatalog
createTable
in interface CrudExternalCatalog
tableName
- The name of the table to add.table
- The table to add.ignoreIfExists
- Flag to specify behavior if a table with the given name already exists:
if set to false, it throws a TableAlreadyExistException,
if set to true, nothing happens.TableAlreadyExistException
- thrown if table already exists and ignoreIfExists is falsepublic void dropTable(String tableName, boolean ignoreIfNotExists) throws TableNotExistException
CrudExternalCatalog
dropTable
in interface CrudExternalCatalog
tableName
- Name of the table to delete.ignoreIfNotExists
- Flag to specify behavior if the table does not exist:
if set to false, throw an exception,
if set to true, nothing happens.TableNotExistException
- thrown if the table does not exist in the catalogpublic void alterTable(String tableName, ExternalCatalogTable table, boolean ignoreIfNotExists) throws TableNotExistException
CrudExternalCatalog
alterTable
in interface CrudExternalCatalog
tableName
- The name of the table to modify.table
- The new table which replaces the existing table.ignoreIfNotExists
- Flag to specify behavior if the table does not exist:
if set to false, throw an exception,
if set to true, nothing happens.TableNotExistException
- thrown if the table does not exist in the catalogpublic void createSubCatalog(String catalogName, ExternalCatalog catalog, boolean ignoreIfExists) throws CatalogAlreadyExistException
CrudExternalCatalog
createSubCatalog
in interface CrudExternalCatalog
catalogName
- The name of the sub catalog to add.catalog
- Description of the catalog to add.ignoreIfExists
- Flag to specify behavior if a sub catalog with the given name already
exists: if set to false, it throws a CatalogAlreadyExistException,
if set to true, nothing happens.CatalogAlreadyExistException
- thrown if the sub catalog does already exist in the catalog
and ignoreIfExists is falsepublic void dropSubCatalog(String catalogName, boolean ignoreIfNotExists) throws CatalogNotExistException
CrudExternalCatalog
dropSubCatalog
in interface CrudExternalCatalog
catalogName
- Name of the sub catalog to delete.ignoreIfNotExists
- Flag to specify behavior if the catalog does not exist:
if set to false, throw an exception,
if set to true, nothing happens.CatalogNotExistException
- thrown if the sub catalog does not exist in the catalogpublic void alterSubCatalog(String catalogName, ExternalCatalog catalog, boolean ignoreIfNotExists)
CrudExternalCatalog
alterSubCatalog
in interface CrudExternalCatalog
catalogName
- Name of the catalog to modify.catalog
- The new sub catalog to replace the existing sub catalog.ignoreIfNotExists
- Flag to specify behavior if the sub catalog does not exist:
if set to false, throw an exception,
if set to true, nothing happens.public ExternalCatalogTable getTable(String tableName)
ExternalCatalog
getTable
in interface ExternalCatalog
tableName
- The name of the table.public List<String> listTables()
ExternalCatalog
listTables
in interface ExternalCatalog
public ExternalCatalog getSubCatalog(String catalogName) throws CatalogNotExistException
ExternalCatalog
getSubCatalog
in interface ExternalCatalog
catalogName
- (undocumented)CatalogNotExistException
public List<String> listSubCatalogs()
ExternalCatalog
listSubCatalogs
in interface ExternalCatalog
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.