public class Catalog extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CATALOG_NAME
The name of the catalog's underlying BDB database.
|
Constructor and Description |
---|
Catalog() |
Modifier and Type | Method and Description |
---|---|
static void |
close()
Closes the catalog and ensures all changes have been written to disk.
|
static OperationStatus |
getMetadata(Table table)
Reads the entry for the specified table from the catalog of
metadata and adds the column information to the Table object.
|
static void |
open()
Opens the catalog so that it can be used to store and retrieve metadata.
|
static OperationStatus |
putMetadata(Table table)
Adds an entry to the catalog for the specified table.
|
static OperationStatus |
removeMetadata(Table table)
Removes the entry for the specified table from the catalog of metadata.
|
public static final String CATALOG_NAME
public static void open() throws DatabaseException, FileNotFoundException
DatabaseException
- if Berkeley DB encounters a problem opening
the underlying database.FileNotFoundException
- if the Berkeley DB cannot access the
catalog's database file.public static void close() throws DatabaseException
DatabaseException
- if Berkeley DB encounters a problem closing
the underlying database.public static OperationStatus putMetadata(Table table) throws DeadlockException, DatabaseException, IOException
table
- the table whose metadata we need to addOperationStatus.KEYEXIST
if there is already
a table with the same name, and
OperationStatus.SUCCESS
otherwise.DeadlockException
- if deadlock occurs while accessing
the catalog's underlying database.DatabaseException
- if Berkeley DB encounters another problem
accessing the catalog's underlying database.IOException
public static OperationStatus getMetadata(Table table) throws DatabaseException, DeadlockException
table
- the table whose metadata we need to retrieveOperationStatus.NOTFOUND
if the table is not in
the catalog, and OperationStatus.SUCCESS
otherwise.DeadlockException
- if deadlock occurs while accessing
the catalog's underlying database.DatabaseException
- if Berkeley DB encounters another problem
accessing the catalog's underlying database.public static OperationStatus removeMetadata(Table table) throws DeadlockException, DatabaseException
table
- the table whose metadata we need to removeOperationStatus.NOTFOUND
if the table is not in
the catalog, and OperationStatus.SUCCESS
otherwise.DeadlockException
- if deadlock occurs while accessing
the catalog's underlying database.DatabaseException
- if Berkeley DB encounters another problem
accessing the catalog's underlying database.