tlc.core.objects.tables.system_tables.indexing_table#

The base class for tables which are populated by scanning the contents of a URL

Module Contents#

Classes#

Class

Description

IndexingTable

The base class for tables which are populated by scanning the contents of a URL.

API#

class tlc.core.objects.tables.system_tables.indexing_table.IndexingTable(url: tlc.core.url.Url | None = None, created: str | None = None, row_cache_url: tlc.core.url.Url | None = None, row_cache_populated: bool | None = None, project_scan_urls: Sequence[str | tlc.core.url.Url] | None = None, extra_scan_urls: Sequence[str | tlc.core.url.Url] | None = None, constrain_to_type: str | None = None, scan_wait: float | None = None, file_extensions: list[str] | None = None, create_default_dirs: bool | None = None, init_parameters: Any = None)#

Bases: tlc.core.objects.table.Table

The base class for tables which are populated by scanning the contents of a URL.

The scanning can be limited to a particular object type (e.g. Run).

Parameters:
  • url – The URL of the table.

  • created – The creation timestamp of the table.

  • row_cache_url – The URL of the row cache.

  • row_cache_populated – Indicates whether the row cache is populated.

  • scan_urls – The URLs to be scanned.

  • project_scan_urls – The URLs to be scanned. Folder layout must adhere to 3LC conventions.

  • constrain_to_type – The type of objects to be included in the table.

  • scan_wait – The time interval (in seconds) between subsequent scans.

  • file_extensions – The file extensions to be considered while scanning.

  • init_parameters – Any additional initialization parameters.

add_extra_scan_urls(scan_urls: list[tlc.core.url.Url | str]) None#

Add extra scan urls to this indexing table

If the indexing table is running changes will be propagated to worker threads.

add_project_scan_urls(project_scan_urls: list[tlc.core.url.Url | str]) None#

Add scan urls to this indexing table

If the indexing table is running changes will be propagated to worker threads.

consider_indexing_object(obj: tlc.core.object.Object, url: tlc.core.url.Url, event_type: tlc.core.object_registry.IndexerCallbackEventType) bool#
add_indexing_object(obj: tlc.core.object.Object, url: tlc.core.url.Url) bool#

Adds a URL to the wait list (if it’s considerable)

should_consider_url(url: tlc.core.url.Url) bool#

Whether the indexer should consider the given URL for indexing

should_consider_object(obj: tlc.core.object.Object) bool#

Only consider registered types that are derived from the constrain_to_type

start() None#
ensure_dependent_properties() None#

This is where the table is populated with the objects from the indexed URLs

A call to this function is a no-op if no new data is available, when the table is queried it will simply return the last populated index.

If new data is available, from indexing or “fast-track”, it will re-populate the table with the new data.

append_row(row: Any, location_index: int) None#

Register row in owned row list

stop() None#
wait_for_complete_index(timeout: float = 0.0) bool#

Wait for a complete indexing cycle to finish

If timeout is 0 waits forever

Parameters:

timeout – timeout in seconds

Returns:

True if the next index is available, False if timed out

property counter: int#