|
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
/** The Milvus Client Interface */
|
|
|
public interface MilvusClient {
|
|
|
|
|
|
- /** Close Milvus client channel, timeout: 1 minute */
|
|
|
+ /** Disconnects from a Milvus server with timeout of 1 minute */
|
|
|
default void close() {
|
|
|
try {
|
|
|
close(TimeUnit.MINUTES.toSeconds(1));
|
|
@@ -46,14 +46,14 @@ public interface MilvusClient {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Close Milvus client channel.
|
|
|
+ * Disconnects from a Milvus server with configurable timeout.
|
|
|
*
|
|
|
* @param maxWaitSeconds timeout unit: second
|
|
|
*/
|
|
|
void close(long maxWaitSeconds) throws InterruptedException;
|
|
|
|
|
|
/**
|
|
|
- * Check if a collection exists.
|
|
|
+ * Checks if a collection exists.
|
|
|
*
|
|
|
* @param requestParam {@link HasCollectionParam}
|
|
|
* @return {status:result code, data: boolean, whether if has collection or not}
|
|
@@ -61,7 +61,7 @@ public interface MilvusClient {
|
|
|
R<Boolean> hasCollection(HasCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Create a collection in Milvus.
|
|
|
+ * Creates a collection in Milvus.
|
|
|
*
|
|
|
* @param requestParam {@link CreateCollectionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -69,7 +69,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> createCollection(CreateCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Drop a collection. Note that this drops all data in the collection.
|
|
|
+ * Drops a collection. Note that this method drops all data in the collection.
|
|
|
*
|
|
|
* @param requestParam {@link DropCollectionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -77,7 +77,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> dropCollection(DropCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Load collection to cache before search/query.
|
|
|
+ * Loads a collection to memory before search or query.
|
|
|
*
|
|
|
* @param requestParam {@link LoadCollectionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -85,8 +85,8 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> loadCollection(LoadCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Release a collection from cache to reduce cache usage. Note that you cannot
|
|
|
- * search while the corresponding collection is unloaded.
|
|
|
+ * Releases a collection from memory to reduce memory usage. Note that you
|
|
|
+ * cannot search while the corresponding collection is released from memory.
|
|
|
*
|
|
|
* @param requestParam {@link ReleaseCollectionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -94,7 +94,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> releaseCollection(ReleaseCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show the details of a collection, e.g. name, schema.
|
|
|
+ * Shows the details of a collection, e.g. name, schema.
|
|
|
*
|
|
|
* @param requestParam {@link DescribeCollectionParam}
|
|
|
* @return {status:result code, data:DescribeCollectionResponse{schema,collectionID}}
|
|
@@ -102,7 +102,7 @@ public interface MilvusClient {
|
|
|
R<DescribeCollectionResponse> describeCollection(DescribeCollectionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show the statistics information of a collection.
|
|
|
+ * Shows the statistics information of a collection.
|
|
|
*
|
|
|
* @param requestParam {@link GetCollectionStatisticsParam}
|
|
|
* @return {status:result code, data: GetCollectionStatisticsResponse{status,stats}}
|
|
@@ -110,7 +110,7 @@ public interface MilvusClient {
|
|
|
R<GetCollectionStatisticsResponse> getCollectionStatistics(GetCollectionStatisticsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * List all collections or get collection loading status.
|
|
|
+ * Lists all collections or gets collection loading status.
|
|
|
*
|
|
|
* @param requestParam {@link ShowCollectionsParam}
|
|
|
* @return {status:result code, data: ShowCollectionsResponse{status,collection_names,collection_ids,created_timestamps,created_utc_timestamps}}
|
|
@@ -118,8 +118,8 @@ public interface MilvusClient {
|
|
|
R<ShowCollectionsResponse> showCollections(ShowCollectionsParam requestParam);
|
|
|
|
|
|
// /**
|
|
|
-// * Flush collections.
|
|
|
-// * Currently we don't allow client call this method since server side has no compaction function
|
|
|
+// * Flushes collections.
|
|
|
+// * Currently we do not support this method on client since compaction is not supported on server.
|
|
|
// *
|
|
|
// * @param requestParam {@link FlushParam}
|
|
|
// * @return {status:result code,data: FlushResponse{flush segment ids}}
|
|
@@ -127,7 +127,7 @@ public interface MilvusClient {
|
|
|
// R<FlushResponse> flush(FlushParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Create a partition in a collection.
|
|
|
+ * Creates a partition in the specified collection.
|
|
|
*
|
|
|
* @param requestParam {@link CreatePartitionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -135,7 +135,8 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> createPartition(CreatePartitionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * To drop a partition will drop all data in this partition and the _default partition cannot be dropped.
|
|
|
+ * Drops a partition. Note that this method drops all data in this partition
|
|
|
+ * and the _default partition cannot be dropped.
|
|
|
*
|
|
|
* @param requestParam {@link DropPartitionParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -143,7 +144,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> dropPartition(DropPartitionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Check if a partition exists in a collection.
|
|
|
+ * Checks if a partition exists in the specified collection.
|
|
|
*
|
|
|
* @param requestParam {@link HasPartitionParam}
|
|
|
* @return {status:result code, data: boolean, whether if has collection or not}
|
|
@@ -151,7 +152,7 @@ public interface MilvusClient {
|
|
|
R<Boolean> hasPartition(HasPartitionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Load a partition into cache.
|
|
|
+ * Loads a partition into memory.
|
|
|
*
|
|
|
* @param requestParam {@link LoadPartitionsParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -159,7 +160,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> loadPartitions(LoadPartitionsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Release a partition from cache.
|
|
|
+ * Releases a partition from memory.
|
|
|
*
|
|
|
* @param requestParam {@link ReleasePartitionsParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -167,7 +168,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> releasePartitions(ReleasePartitionsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show the statistics information of a partition.
|
|
|
+ * Shows the statistics information of a partition.
|
|
|
*
|
|
|
* @param requestParam {@link GetPartitionStatisticsParam}
|
|
|
* @return {status:result code,data:GetPartitionStatisticsResponse{status,stats}}
|
|
@@ -175,7 +176,7 @@ public interface MilvusClient {
|
|
|
R<GetPartitionStatisticsResponse> getPartitionStatistics(GetPartitionStatisticsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show all partitions in a collection.
|
|
|
+ * Shows all partitions in the specified collection.
|
|
|
*
|
|
|
* @param requestParam {@link ShowPartitionsParam}
|
|
|
* @return {status:result code, data:ShowPartitionsResponse{partition_names,partitionIDs,created_timestamps,created_utc_timestamps}}
|
|
@@ -183,8 +184,8 @@ public interface MilvusClient {
|
|
|
R<ShowPartitionsResponse> showPartitions(ShowPartitionsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Create an alias for a collection.
|
|
|
- * Alias can be used in search/query to replace collection name
|
|
|
+ * Creates an alias for a collection.
|
|
|
+ * Alias can be used in search or query to replace the collection name
|
|
|
*
|
|
|
* @param requestParam {@link CreateAliasParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -192,7 +193,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> createAlias(CreateAliasParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Drop an alias.
|
|
|
+ * Drops an alias for the specified collection.
|
|
|
*
|
|
|
* @param requestParam {@link DropAliasParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -200,7 +201,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> dropAlias(DropAliasParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Alter alias from a collection to another.
|
|
|
+ * Alters alias from a collection to another.
|
|
|
*
|
|
|
* @param requestParam {@link AlterAliasParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -208,7 +209,8 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> alterAlias(AlterAliasParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Create an index on a vector field. Note that index building is an async progress.
|
|
|
+ * Creates an index on a vector field in the specified collection.
|
|
|
+ * Note that index building is an async progress.
|
|
|
*
|
|
|
* @param requestParam {@link CreateIndexParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -216,7 +218,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> createIndex(CreateIndexParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Drop an index.
|
|
|
+ * Drops the index on a vector field in the specified collection.
|
|
|
*
|
|
|
* @param requestParam {@link DropIndexParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -224,7 +226,8 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> dropIndex(DropIndexParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show index information. Current release of Milvus only supports showing latest built index.
|
|
|
+ * Shows the information of the specified index. Current release of Milvus
|
|
|
+ * only supports showing latest built index.
|
|
|
*
|
|
|
* @param requestParam {@link DescribeIndexParam}
|
|
|
* @return {status:result code, data:DescribeIndexResponse{status,index_descriptions}}
|
|
@@ -232,7 +235,7 @@ public interface MilvusClient {
|
|
|
R<DescribeIndexResponse> describeIndex(DescribeIndexParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show index building state(in-progress/finished/failed), failed reason.
|
|
|
+ * Shows the index building state(in-progress/finished/failed), and the reason for failure (if any).
|
|
|
*
|
|
|
* @param requestParam {@link GetIndexStateParam}
|
|
|
* @return {status:result code, data:GetIndexStateResponse{status,state}}
|
|
@@ -240,7 +243,7 @@ public interface MilvusClient {
|
|
|
R<GetIndexStateResponse> getIndexState(GetIndexStateParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Show index building progress, such as how many rows are indexed.
|
|
|
+ * Shows the index building progress, such as how many rows are indexed.
|
|
|
*
|
|
|
* @param requestParam {@link GetIndexBuildProgressParam}
|
|
|
* @return {status:result code, data:GetIndexBuildProgressResponse{status,indexed_rows}}
|
|
@@ -248,7 +251,8 @@ public interface MilvusClient {
|
|
|
R<GetIndexBuildProgressResponse> getIndexBuildProgress(GetIndexBuildProgressParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Insert entities into collection. Note that you don't need to input values for auto-id field.
|
|
|
+ * Inserts entities into a specified collection. Note that you don't need to
|
|
|
+ * input primary key field if auto_id is enabled.
|
|
|
*
|
|
|
* @param requestParam {@link InsertParam}
|
|
|
* @return {status:result code, data: MutationResult{insert results}}
|
|
@@ -256,7 +260,8 @@ public interface MilvusClient {
|
|
|
R<MutationResult> insert(InsertParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Delete entities by expression. Currently release of Milvus only support expression like "xxx in [1, 2, ...]"
|
|
|
+ * Deletes entity(s) based on primary key(s) filtered by boolean expression. Current release
|
|
|
+ * of Milvus only supports expression in the format "pk_field in [1, 2, ...]"
|
|
|
*
|
|
|
* @param requestParam {@link DeleteParam}
|
|
|
* @return {status:result code, data: MutationResult{delete results}}
|
|
@@ -264,7 +269,7 @@ public interface MilvusClient {
|
|
|
R<MutationResult> delete(DeleteParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Do ANN search base on a vector field. Use expression to do filtering before search.
|
|
|
+ * Conducts ANN search on a vector field. Use expression to do filtering before search.
|
|
|
*
|
|
|
* @param requestParam {@link SearchParam}
|
|
|
* @return {status:result code, data: SearchResults{topK results}}
|
|
@@ -272,7 +277,8 @@ public interface MilvusClient {
|
|
|
R<SearchResults> search(SearchParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Query entities by expression. Note that the returned entities sequence cannot be guaranteed.
|
|
|
+ * Queries entity(s) based on scalar field(s) filtered by boolean expression.
|
|
|
+ * Note that the order of the returned entities cannot be guaranteed.
|
|
|
*
|
|
|
* @param requestParam {@link QueryParam}
|
|
|
* @return {status:result code,data: QueryResults{filter results}}
|
|
@@ -280,7 +286,7 @@ public interface MilvusClient {
|
|
|
R<QueryResults> query(QueryParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Calculate distance between specified vectors.
|
|
|
+ * Calculates the distance between the specified vectors.
|
|
|
*
|
|
|
* @param requestParam {@link CalcDistanceParam}
|
|
|
* @return {status:result code, data: CalcDistanceResults{distances}}
|
|
@@ -288,7 +294,7 @@ public interface MilvusClient {
|
|
|
R<CalcDistanceResults> calcDistance(CalcDistanceParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Get runtime metrics information of Milvus, return in json format.
|
|
|
+ * Gets the runtime metrics information of Milvus, returns the result in .json format.
|
|
|
*
|
|
|
* @param requestParam {@link GetMetricsParam}
|
|
|
* @return {status:result code, data:GetMetricsResponse{status,metrics}}
|
|
@@ -296,7 +302,8 @@ public interface MilvusClient {
|
|
|
R<GetMetricsResponse> getMetrics(GetMetricsParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Get information of persistent segments, including row count, persist state(growing or flushed), etc.
|
|
|
+ * Gets the information of persistent segments, including row count,
|
|
|
+ * persistence state(growing or flushed), etc.
|
|
|
*
|
|
|
* @param requestParam {@link GetPersistentSegmentInfoParam}
|
|
|
* @return {status:result code, data:GetPersistentSegmentInfoResponse{status,info}}
|
|
@@ -304,7 +311,8 @@ public interface MilvusClient {
|
|
|
R<GetPersistentSegmentInfoResponse> getPersistentSegmentInfo(GetPersistentSegmentInfoParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Get query information of segments in a collection, including row count, mem size, index name, etc.
|
|
|
+ * Gets the query information of segments in a collection, including row count,
|
|
|
+ * memory usage size, index name, etc.
|
|
|
*
|
|
|
* @param requestParam {@link GetQuerySegmentInfoParam}
|
|
|
* @return {status:result code, data:GetQuerySegmentInfoResponse{status,info}}
|
|
@@ -312,7 +320,7 @@ public interface MilvusClient {
|
|
|
R<GetQuerySegmentInfoResponse> getQuerySegmentInfo(GetQuerySegmentInfoParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Move segment from a query node to another, to keep load balance.
|
|
|
+ * Moves segment from a query node to another to keep the load balanced.
|
|
|
*
|
|
|
* @param requestParam {@link LoadBalanceParam}
|
|
|
* @return {status:result code, data:RpcStatus{msg: result message}}
|
|
@@ -320,7 +328,7 @@ public interface MilvusClient {
|
|
|
R<RpcStatus> loadBalance(LoadBalanceParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Get compaction action state by id.
|
|
|
+ * Gets the compaction state by id.
|
|
|
*
|
|
|
* @param requestParam {@link GetCompactionStateParam}
|
|
|
* @return {status:result code, data:GetCompactionStateResponse{status,info}}
|
|
@@ -328,7 +336,7 @@ public interface MilvusClient {
|
|
|
R<GetCompactionStateResponse> getCompactionState(GetCompactionStateParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Ask server to perform a compaction action.
|
|
|
+ * Performs a manual compaction.
|
|
|
*
|
|
|
* @param requestParam {@link ManualCompactionParam}
|
|
|
* @return {status:result code, data:ManualCompactionResponse{status,info}}
|
|
@@ -336,7 +344,7 @@ public interface MilvusClient {
|
|
|
R<ManualCompactionResponse> manualCompaction(ManualCompactionParam requestParam);
|
|
|
|
|
|
/**
|
|
|
- * Get compaction action state with its plan.
|
|
|
+ * Gets compaction state with its plan.
|
|
|
*
|
|
|
* @param requestParam {@link GetCompactionPlansParam}
|
|
|
* @return {status:result code, data:GetCompactionPlansResponse{status,info}}
|