Class LocalTablePathManager
java.lang.Object
com.illumon.iris.db.v2.locations.local.LocalTablePathManager
Manage the layout of an on disk database. All decisions about where files and
folders are located should be encapsulated here.
This is taking ownership of DbTableLocation's role (a dumping ground of parallel ways in which we find data).
This should be the main resource for OnDiskDatabase and OnDiskQueryDatabase
for pathing decisions.
See also LocalTableDataService and LocalTableLocation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, expects the root location to be set in property OnDiskDatabase.rootDirectory.LocalTablePathManager
(File dbroot) Constructor for an arbitrary root location.LocalTablePathManager
(File dbroot, String userNamespacesDirectoryName) Constructor for an arbitrary root location.LocalTablePathManager
(String dbroot) Constructor for an arbitrary root location. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Find all existing locations for a table key.Get the root for this LocalTablePathManager.static File
Get the default database root.static LocalTablePathManager
getExistingLocations
(FullTableLocationKey tableLocationKey) Gets a collection of all column locations for all existing intraday table files for this FullTableLocationKey, which might be an AggregateTableLocationKey.static LocalTablePathManager
getInstance
(String dbroot) Return a LocalTablePathManager with the specified dbroot.Deprecated.getLocation
(FullTableLocationKey table) get the directory that should contain table files for the given table identifier.getTableRoot
(TableKey tableKey) Get the root folder for the given TableKey.getTableRootExtended
(TableKey tableKey) Get the extended root folder for the given TableKey.getWritablePartitionsRoot
(String namespace, TableType tableType) int
hashCode()
Compute the root path for the given tableType.
-
Field Details
-
SYSTEM_NAMESPACES_DIR_NAME
- See Also:
-
DEFAULT_USER_NAMESPACES_DIR_NAME
- See Also:
-
PARTITION_DIR_NAME
- See Also:
-
-
Constructor Details
-
LocalTablePathManager
public LocalTablePathManager()Default constructor, expects the root location to be set in property OnDiskDatabase.rootDirectory. -
LocalTablePathManager
Constructor for an arbitrary root location.- Parameters:
dbroot
- database root location- Throws:
IllegalArgumentException
- if the given location is not a valid directory
-
LocalTablePathManager
Constructor for an arbitrary root location.- Parameters:
dbroot
- database root location- Throws:
IllegalArgumentException
- if the given location is not a valid directory
-
LocalTablePathManager
Constructor for an arbitrary root location.- Parameters:
dbroot
- database root locationuserNamespacesDirectoryName
- name of the user namespace root folder- Throws:
IllegalArgumentException
- if the given location is not a valid directory
-
-
Method Details
-
getDefaultInstance
- Returns:
- The default instance
-
getInstance
Return a LocalTablePathManager with the specified dbroot. If this is null or matches the default dbroot, return the singleton default as ingetDefaultInstance()
.- Parameters:
dbroot
- optional database root location- Returns:
- a LocalTablePathManager with the specified dbroot value.
-
getDefaultDbRoot
Get the default database root.- Returns:
- the value for db root used by default instances.
-
getDbRoot
Get the root for this LocalTablePathManager.- Returns:
- The directory under which all files will be found.
-
pathFor
Compute the root path for the given tableType.- Parameters:
tableType
- the type of table we'll be computing paths for- Returns:
- the root for files for the given table type
-
getLocation
get the directory that should contain table files for the given table identifier.- Parameters:
table
- The table identifier for the table.- Returns:
- The directory that should contain table files for the given table identifier.
-
getTableRoot
Get the root folder for the given TableKey. This will be above partitioning folders for partitioned tables. TODO: it is likely that the consumer of this result should be using this (LocalTablePathManager) class to compute further locations.- Parameters:
tableKey
- the TableKey defining the location- Returns:
- The root of the table specified by tableKey
-
getTableRootExtended
Get the extended root folder for the given TableKey. Only SYSTEM_PERMANENT tables are supported, so this will be '/db/Systems/NAMESPACE/Extended`.- Parameters:
tableKey
- the TableKey defining the location- Returns:
- The root of the table specified by tableKey
-
getWritablePartitionsRoot
-
getIntradayRoot
Deprecated. -
getExistingLocations
Gets a collection of all column locations for all existing intraday table files for this FullTableLocationKey, which might be an AggregateTableLocationKey. This will search all internal partition directories for data for this key if it is an aggregate, else the single location will be returned if it exists.- Returns:
- Collection of existing FullTableLocationKeys for existing intraday table files for this TableLocationKey
-
getMetadataLocation
-
getAllExistingTableLocations
Find all existing locations for a table key. -
equals
-
hashCode
public int hashCode()
-