public class CatalogStore extends Object
This class replaces GSP's legacy triple-index architecture (schemaObjectList + objectIndex + tablesByName) with a clean, type-aware storage system backed by LinkedHashMaps for O(1) lookups.
Key improvements over legacy storage:
NameServiceThread safety: This class is NOT thread-safe. External synchronization is required if accessed from multiple threads.
| Modifier and Type | Class and Description |
|---|---|
static class |
CatalogStore.QualifiedName
Immutable qualified name used as a canonical key.
|
| Constructor and Description |
|---|
CatalogStore(EDbVendor vendor)
Deprecated.
Use
CatalogStore(EDbVendor, IdentifierService) instead |
CatalogStore(EDbVendor vendor,
IdentifierService identifierService)
Creates a new CatalogStore for the specified database vendor with IdentifierService.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all objects from the store.
|
TSQLSchemaObject |
get(String catalog,
String schema,
String objectName,
ESQLDataObjectType type)
Finds an object by its fully-qualified name and type.
|
Collection<TSQLSchemaObject> |
getAll()
Returns all objects in insertion order.
|
List<TSQLSchemaObject> |
getByName(String objectName,
ESQLDataObjectType type)
Finds objects by name only, regardless of catalog/schema.
|
Collection<TSQLSchemaObject> |
getByType(ESQLDataObjectType type)
Finds all objects of a specific type.
|
NameService |
getNameService()
Returns the name service used by this store.
|
EDbVendor |
getVendor()
Returns the database vendor associated with this store.
|
TSQLSchemaObject |
put(TSQLSchemaObject object)
Adds or updates an object in the store.
|
boolean |
remove(TSQLSchemaObject object)
Removes an object from the store.
|
int |
size()
Returns the total number of objects in the store.
|
@Deprecated public CatalogStore(EDbVendor vendor)
CatalogStore(EDbVendor, IdentifierService) insteadvendor - the database vendorpublic CatalogStore(EDbVendor vendor, IdentifierService identifierService)
This is the preferred constructor that uses IdentifierService for proper per-object-type identifier normalization.
vendor - the database vendoridentifierService - the identifier service for normalizationpublic EDbVendor getVendor()
public NameService getNameService()
public TSQLSchemaObject put(TSQLSchemaObject object)
The object is indexed by its fully-qualified canonical name and also added to type-specific and name-only indexes for efficient lookups.
object - the schema object to addpublic TSQLSchemaObject get(String catalog, String schema, String objectName, ESQLDataObjectType type)
This is an O(1) lookup using the canonical key index.
catalog - the catalog name (may be null)schema - the schema name (may be null)objectName - the object name (required)type - the object typepublic List<TSQLSchemaObject> getByName(String objectName, ESQLDataObjectType type)
This is used for partial name resolution when the full path is not specified.
objectName - the object nametype - the object type (optional - null returns all types)public Collection<TSQLSchemaObject> getByType(ESQLDataObjectType type)
type - the object typepublic boolean remove(TSQLSchemaObject object)
object - the object to removepublic int size()
public void clear()
public Collection<TSQLSchemaObject> getAll()