get_compaction_plans()
Addedv2.6.x
This operation returns the compaction plans for a specific compaction job, including the merge plans showing which segments will be combined.
Request syntax
client.get_compaction_plans(
job_id: int,
timeout: float = None
) -> CompactionPlans
PARAMETERS:
-
job_id (int) -
[REQUIRED]
The ID of the compaction job returned by
compact(). -
timeout (float | None) -
The timeout duration for this operation. Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.
RETURN TYPE:
CompactionPlans
EXCEPTIONS:
-
MilvusException
This exception will be raised when any error occurs during this operation.
Example
from pymilvus import MilvusClient
client = MilvusClient(
uri="YOUR_CLUSTER_ENDPOINT",
token="YOUR_CLUSTER_TOKEN"
)
job_id = client.compact(collection_name="my_collection")
plans = client.get_compaction_plans(job_id=job_id)
print(plans)