flush_all()
Near Deprecation此操作会封存所有 Segment。
请求语法
python
flush_all(
using: str = "default",
timeout: float | None,
**kwargs,
)
参数:
-
using (str) -
所使用连接的别名。
默认值为 default,表示此操作使用默认连接。
-
timeout (float | None)
此操作的超时时长。将其设置为 None 表示,当收到任何响应或发生任何错误时,此操作即超时。
返回类型:
NoneType
返回值:
None
异常:
N/A
示例
python
from pymilvus import (
connections,
Collection,
FieldSchema,
CollectionSchema,
DataType,
utility,
)
# Connect to YOUR_CLUSTER_ENDPOINT
connections.connect()
# Create a collection
collection = Collection(
name="test_collection_flush",
schema=CollectionSchema(fields=[
FieldSchema("film_id", DataType.INT64, is_primary=True),
FieldSchema("films", dtype=DataType.FLOAT_VECTOR, dim=128)
])
)
# Insert data
collection.insert([[1, 2], [[1.0, 2.0], [3.0, 4.0]]])
utility.flush_all(_async=False) # synchronized flush_all
# or use `future` to flush_all asynchronously
future = utility.flush_all(_async=True)
future.done() # flush_all finished
相关操作
以下操作与 flush_all() 方法相关: