optuna.storages.JournalRedisStorage

class optuna.storages.JournalRedisStorage(url, use_cluster=False, prefix='')[source]

Warning

Deprecated in v4.0.0. This feature will be removed in the future. The removal of this feature is currently scheduled for v6.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v4.0.0.

Use JournalRedisBackend instead.

Methods

append_logs(logs)

Append logs to the backend.

load_snapshot()

Load snapshot from the backend.

read_logs(log_number_from)

Read logs with a log number greater than or equal to log_number_from.

save_snapshot(snapshot)

Save snapshot to the backend.

Parameters:
append_logs(logs)

Append logs to the backend.

Parameters:

logs (list[dict[str, Any]]) – A list that contains json-serializable logs.

Return type:

None

load_snapshot()

Load snapshot from the backend.

Returns:

A serialized snapshot (bytes) if found, otherwise None.

Return type:

bytes | None

read_logs(log_number_from)

Read logs with a log number greater than or equal to log_number_from.

If log_number_from is 0, read all the logs.

Parameters:

log_number_from (int) – A non-negative integer value indicating which logs to read.

Returns:

Logs with log number greater than or equal to log_number_from.

Return type:

list[dict[str, Any]]

save_snapshot(snapshot)

Save snapshot to the backend.

Parameters:

snapshot (bytes) – A serialized snapshot (bytes)

Return type:

None