Skip to content

Commit

Permalink
Issue #112 remove AggregatorConfig.zookeeper_prefix
Browse files Browse the repository at this point in the history
Replaced by `AggregatorBackendConfig.zookeeper_prefix`
  • Loading branch information
soxofaan committed Mar 1, 2024
1 parent 4d15931 commit c41e8e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/openeo_aggregator/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def get_memoizer(memoizer_type: str, memoizer_conf: dict) -> Memoizer:
# TODO: better solution than using a module level global here?
stats=zk_memoizer_stats,
)
zookeeper_prefix = get_backend_config().zookeeper_prefix or config.zookeeper_prefix
zookeeper_prefix = get_backend_config().zookeeper_prefix
return ZkMemoizer(
client=kazoo_client,
path_prefix=f"{zookeeper_prefix}/cache/{namespace}",
Expand Down
7 changes: 1 addition & 6 deletions src/openeo_aggregator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class AggregatorConfig(dict):

config_source = dict_item()

# TODO #112 Deprecated, use AggregatorBackendConfig.zookeeper_prefix instead
zookeeper_prefix = dict_item(default="/openeo-aggregator/")

# TODO #112 Deprecated, use AggregatorBackendConfig.memoizer instead
memoizer = dict_item(default={"type": "dict"})

Expand Down Expand Up @@ -137,9 +134,7 @@ class AggregatorBackendConfig(OpenEoBackendConfig):
# List of collection ids to cover with the aggregator (when None: support union of all upstream collections)
collection_whitelist: Optional[List[Union[str, re.Pattern]]] = None

# TODO #112: empty default is to allow config migration from AggregatorConfig to AggregatorBackendConfig.
# To be replaced eventually with "/openeo-aggregator/"
zookeeper_prefix: str = ""
zookeeper_prefix: str = "/openeo-aggregator/"

# See `memoizer_from_config` for details.
# TODO #112: empty default is to allow migration. Te be replaced with `attrs.Factory(lambda: {"type": "dict"})`
Expand Down
2 changes: 1 addition & 1 deletion src/openeo_aggregator/partitionedjobs/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def from_config(cls, config: AggregatorConfig) -> "ZooKeeperPartitionedJobDB":
else:
raise ConfigException("Failed to construct zk_client")
# Determine ZooKeeper prefix
base_prefix = get_backend_config().zookeeper_prefix or config.zookeeper_prefix
base_prefix = get_backend_config().zookeeper_prefix
assert len(base_prefix.replace("/", "")) >= 3
partitioned_jobs_prefix = pjt_config.get("zookeeper_prefix", cls.NAMESPACE)
prefix = strip_join("/", base_prefix, partitioned_jobs_prefix)
Expand Down

0 comments on commit c41e8e9

Please sign in to comment.