deephaven_enterprise.checkpoint_control¶
Examine and repair table checkpoint records from a Core+ Python worker.
Checkpoint records (table.size files) describe the state of a table location on disk. This module reports on -
and optionally repairs - locations that are not directories, are empty directories, or whose checkpoint record is
missing or out of date. It is the scripting equivalent of dhconfig checkpoint repair.
Nothing is modified unless force=True is passed; by default problems are only reported.
Simple usage:
from deephaven_enterprise.checkpoint_control import repair_table
result = repair_table("MyNamespace", "MyTable")
print(result)
if result.summary_status is not RepairStatus.OK:
result = repair_table("MyNamespace", "MyTable", force=True)
print(result)
Bulk usage:
from deephaven_enterprise.checkpoint_control import repair_namespace_set, repair_all
print(repair_namespace_set("User", force=True))
print(repair_all())
Module Contents¶
- class CheckpointRepairResult(j_checkpoint_repair_result)[source]¶
Bases:
deephaven._wrapper.JObjectWrapperAggregate result of a checkpoint repair operation.
- Parameters:
j_checkpoint_repair_result (jpy.JType)
- property location_results: tuple[LocationResult, ...][source]¶
The
LocationResultfor every location that had a problem, in the order encountered. Locations without problems are not reported.- Return type:
tuple[LocationResult, …]
- property locations_inspected: int[source]¶
The number of table locations that were inspected, including those without problems.
- Return type:
- property metadata_index_affected: bool[source]¶
Trueif any reported location belongs to a System historical table, whose locations may be tracked by a metadata index. WhenTrue, rebuild the index for the affected tables withdhctl metadata updateonce the locations are repaired.- Return type:
- property summary_status: RepairStatus[source]¶
Summary
RepairStatusacross all reported locations - the worst status reported, orRepairStatus.OKwhen no problems were found.- Return type:
- class LocationResult(j_location_result)[source]¶
Bases:
deephaven._wrapper.JObjectWrapperThe problem found at a single table location, and what was done about it.
- Parameters:
j_location_result (jpy.JType)
- property issue: RepairIssue[source]¶
The
RepairIssuethat was found.- Return type:
- property message: str[source]¶
A human-readable description of the problem and the action taken.
- Return type:
- property path: str | None[source]¶
The absolute path of the location, or
Nonewhen the whole table could not be inspected.- Return type:
Optional[str]
- property status: RepairStatus[source]¶
The
RepairStatusdescribing what was done about the problem.- Return type:
- class RepairIssue(*args, **kwds)[source]¶
Bases:
enum.EnumThe kind of problem found at a table location.
- class RepairStatus(*args, **kwds)[source]¶
Bases:
enum.EnumOutcome for a single table location. Also used as the summary across all reported locations, in which case it is the worst status reported.
- repair(*, tables=(), namespaces=(), namespace_sets=(), force=False)[source]¶
Report on (and, with
force=True, repair) the checkpoint records of the selected tables.The three selections are unioned, and at least one of them must be non-empty.
- Parameters:
tables (Iterable[tuple[str, str]]) –
(namespace, table_name)pairs naming individual tables to inspect.namespaces (Iterable[str]) – Namespaces whose every table should be inspected.
namespace_sets (Iterable[str]) – Namespace set names (
"System"or"User", case-insensitive) whose every namespace’s every table should be inspected.force (bool) – If
True, perform the repairs. IfFalse(the default), only report problems.
- Returns:
The
CheckpointRepairResultreported by the underlying Java call.- Raises:
DHError – If nothing was selected, a selected namespace or table does not exist, or the underlying Java call raises.
- Return type:
Example:
result = repair( tables=[("MyNamespace", "MyTable")], namespaces=["OtherNamespace"], force=True ) print(result)
- repair_all(*, force=False)[source]¶
Report on (and, with
force=True, repair) the checkpoint records of every table in every namespace.- Parameters:
force (bool) – If
True, perform the repairs. IfFalse(the default), only report problems.- Returns:
The
CheckpointRepairResultreported by the underlying Java call.- Raises:
DHError – If the underlying Java call raises.
- Return type:
Example:
result = repair_all() print(result)
- repair_namespace(namespace, *, force=False)[source]¶
Report on (and, with
force=True, repair) the checkpoint records of every table in a namespace.- Parameters:
- Returns:
The
CheckpointRepairResultreported by the underlying Java call.- Raises:
DHError – If the namespace does not exist or has no tables, or the underlying Java call raises.
- Return type:
Example:
result = repair_namespace("MyNamespace") print(result)
- repair_namespace_set(namespace_set, *, force=False)[source]¶
Report on (and, with
force=True, repair) the checkpoint records of every table in a namespace set.- Parameters:
- Returns:
The
CheckpointRepairResultreported by the underlying Java call.- Raises:
DHError – If the name does not match a namespace set, or the underlying Java call raises.
- Return type:
Example:
result = repair_namespace_set("User", force=True) print(result)
- repair_table(namespace, table_name, *, force=False)[source]¶
Report on (and, with
force=True, repair) the checkpoint records of a single table.- Parameters:
- Returns:
The
CheckpointRepairResultreported by the underlying Java call.- Raises:
DHError – If the table does not exist, or the underlying Java call raises.
- Return type:
Example:
result = repair_table("MyNamespace", "MyTable", force=True) print(result)