Package io.milvus.client
Class MilvusMultiServiceClient
- java.lang.Object
-
- io.milvus.client.MilvusMultiServiceClient
-
- All Implemented Interfaces:
MilvusClient
public class MilvusMultiServiceClient extends java.lang.Object implements MilvusClient
-
-
Constructor Summary
Constructors Constructor Description MilvusMultiServiceClient(@NonNull MultiConnectParam multiConnectParam)
Sets connect param for multi milvus clusters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R<RpcStatus>
addUserToRole(AddUserToRoleParam requestParam)
The user will get permissions that the role are allowed to perform operations.R<RpcStatus>
alterAlias(AlterAliasParam requestParam)
Alters alias from a collection to another.R<RpcStatus>
alterCollection(AlterCollectionParam requestParam)
Alter collection.R<io.milvus.grpc.ImportResponse>
bulkInsert(BulkInsertParam requestParam)
Import data from external files, currently support JSON formatR<io.milvus.grpc.CheckHealthResponse>
checkHealth()
Check server healthvoid
close(long maxWaitSeconds)
Disconnects from a Milvus server with configurable timeout.R<RpcStatus>
createAlias(CreateAliasParam requestParam)
Creates an alias for a collection.R<RpcStatus>
createCollection(CreateCollectionParam requestParam)
Creates a collection in Milvus.R<RpcStatus>
createCollection(CreateSimpleCollectionParam requestParam)
Creates a collection in Milvus.R<RpcStatus>
createCredential(CreateCredentialParam requestParam)
Create credential using the given user and password.R<RpcStatus>
createDatabase(CreateDatabaseParam requestParam)
Creates a database in Milvus.R<RpcStatus>
createIndex(CreateIndexParam requestParam)
Creates an index on a vector field in the specified collection.R<RpcStatus>
createPartition(CreatePartitionParam requestParam)
Creates a partition in the specified collection.R<RpcStatus>
createRole(CreateRoleParam requestParam)
It will success if the role isn't existed, otherwise fail.R<io.milvus.grpc.MutationResult>
delete(DeleteParam requestParam)
Deletes entity(s) based on primary key(s) filtered by boolean expression.R<DeleteResponse>
delete(DeleteIdsParam requestParam)
Deletes entity(s) based on the value of primary key.R<RpcStatus>
deleteCredential(DeleteCredentialParam requestParam)
Delete credential corresponding to the user.R<io.milvus.grpc.DescribeCollectionResponse>
describeCollection(DescribeCollectionParam requestParam)
Shows the details of a collection, e.g.R<io.milvus.grpc.DescribeIndexResponse>
describeIndex(DescribeIndexParam requestParam)
Shows the information of the specified index.R<RpcStatus>
dropAlias(DropAliasParam requestParam)
Drops an alias for the specified collection.R<RpcStatus>
dropCollection(DropCollectionParam requestParam)
Drops a collection.R<RpcStatus>
dropDatabase(DropDatabaseParam requestParam)
Drops a database.R<RpcStatus>
dropIndex(DropIndexParam requestParam)
Drops the index on a vector field in the specified collection.R<RpcStatus>
dropPartition(DropPartitionParam requestParam)
Drops a partition.R<RpcStatus>
dropRole(DropRoleParam requestParam)
It will success if the role is existed, otherwise fail.R<io.milvus.grpc.FlushResponse>
flush(FlushParam requestParam)
Flushes inserted data in buffer into storage.R<io.milvus.grpc.FlushAllResponse>
flushAll(boolean syncFlushAll, long syncFlushAllWaitingInterval, long syncFlushAllTimeout)
Flush all collections.R<GetResponse>
get(GetIdsParam requestParam)
Get entity(s) based on the value of primary key.R<io.milvus.grpc.GetImportStateResponse>
getBulkInsertState(GetBulkInsertStateParam requestParam)
Get state of bulk insert taskR<io.milvus.grpc.GetCollectionStatisticsResponse>
getCollectionStatistics(GetCollectionStatisticsParam requestParam)
Shows the statistics information of a collection.R<io.milvus.grpc.GetCompactionStateResponse>
getCompactionState(GetCompactionStateParam requestParam)
Gets the compaction state by id.R<io.milvus.grpc.GetCompactionPlansResponse>
getCompactionStateWithPlans(GetCompactionPlansParam requestParam)
Gets compaction state with its plan.R<io.milvus.grpc.GetFlushAllStateResponse>
getFlushAllState(GetFlushAllStateParam requestParam)
Get flush state of all segments.R<io.milvus.grpc.GetFlushStateResponse>
getFlushState(GetFlushStateParam requestParam)
Get flush state of specified collection.R<io.milvus.grpc.GetIndexBuildProgressResponse>
getIndexBuildProgress(GetIndexBuildProgressParam requestParam)
Shows the index building progress, such as how many rows are indexed.R<io.milvus.grpc.GetIndexStateResponse>
getIndexState(GetIndexStateParam requestParam)
Shows the index building state(in-progress/finished/failed), and the reason for failure (if any).R<io.milvus.grpc.GetLoadingProgressResponse>
getLoadingProgress(GetLoadingProgressParam requestParam)
Get collection loading progressR<io.milvus.grpc.GetLoadStateResponse>
getLoadState(GetLoadStateParam requestParam)
Get collection loading stateR<io.milvus.grpc.GetMetricsResponse>
getMetrics(GetMetricsParam requestParam)
Gets the runtime metrics information of Milvus, returns the result in .json format.R<io.milvus.grpc.GetPartitionStatisticsResponse>
getPartitionStatistics(GetPartitionStatisticsParam requestParam)
Shows the statistics information of a partition.R<io.milvus.grpc.GetPersistentSegmentInfoResponse>
getPersistentSegmentInfo(GetPersistentSegmentInfoParam requestParam)
Gets the information of persistent segments from data node, including row count, persistence state(growing or flushed), etc.R<io.milvus.grpc.GetQuerySegmentInfoResponse>
getQuerySegmentInfo(GetQuerySegmentInfoParam requestParam)
Gets the query information of segments in a collection from query node, including row count, memory usage size, index name, etc.R<io.milvus.grpc.GetReplicasResponse>
getReplicas(GetReplicasParam requestParam)
Returns the collection's replica informationR<io.milvus.grpc.GetVersionResponse>
getVersion()
Get server versionR<RpcStatus>
grantRolePrivilege(GrantRolePrivilegeParam requestParam)
Grant Role Privilege.R<java.lang.Boolean>
hasCollection(HasCollectionParam requestParam)
Checks if a collection exists.R<java.lang.Boolean>
hasPartition(HasPartitionParam requestParam)
Checks if a partition exists in the specified collection.R<io.milvus.grpc.MutationResult>
insert(InsertParam requestParam)
Inserts entities into a specified collection .R<InsertResponse>
insert(InsertRowsParam requestParam)
Inserts rows data into a specified collection .com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>>
insertAsync(InsertParam requestParam)
Inserts entities into a specified collection asynchronously.R<io.milvus.grpc.ListImportTasksResponse>
listBulkInsertTasks(ListBulkInsertTasksParam requestParam)
List bulk insert tasksR<ListCollectionsResponse>
listCollections(ListCollectionsParam requestParam)
Lists all collectionsR<io.milvus.grpc.ListCredUsersResponse>
listCredUsers(ListCredUsersParam requestParam)
List all user names.R<io.milvus.grpc.ListDatabasesResponse>
listDatabases()
List databases.R<RpcStatus>
loadBalance(LoadBalanceParam requestParam)
Moves segment from a query node to another to keep the load balanced.R<RpcStatus>
loadCollection(LoadCollectionParam requestParam)
Loads a collection to memory before search or query.R<RpcStatus>
loadPartitions(LoadPartitionsParam requestParam)
Loads a partition into memory.R<io.milvus.grpc.ManualCompactionResponse>
manualCompact(ManualCompactParam requestParam)
Performs a manual compaction.R<io.milvus.grpc.QueryResults>
query(QueryParam requestParam)
Queries entity(s) based on scalar field(s) filtered by boolean expression.R<QueryResponse>
query(QuerySimpleParam requestParam)
Queries entity(s) based on scalar field(s) filtered by boolean expression.com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.QueryResults>>
queryAsync(QueryParam requestParam)
Queries entity(s) asynchronously based on scalar field(s) filtered by boolean expression.R<RpcStatus>
releaseCollection(ReleaseCollectionParam requestParam)
Releases a collection from memory to reduce memory usage.R<RpcStatus>
releasePartitions(ReleasePartitionsParam requestParam)
Releases a partition from memory.R<RpcStatus>
removeUserFromRole(RemoveUserFromRoleParam requestParam)
The user will remove permissions that the role are allowed to perform operations.R<RpcStatus>
renameCollection(RenameCollectionParam requestParam)
rename a collectionR<RpcStatus>
revokeRolePrivilege(RevokeRolePrivilegeParam requestParam)
Revoke Role Privilege.R<io.milvus.grpc.SearchResults>
search(SearchParam requestParam)
Conducts ANN search on a vector field.R<SearchResponse>
search(SearchSimpleParam requestParam)
Conducts ANN search on a vector field.com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>>
searchAsync(SearchParam requestParam)
Conducts ANN search on a vector field asynchronously.R<io.milvus.grpc.SelectGrantResponse>
selectGrantForRole(SelectGrantForRoleParam requestParam)
List a grant info for the role and the specific objectR<io.milvus.grpc.SelectGrantResponse>
selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam)
List a grant info for the roleR<io.milvus.grpc.SelectRoleResponse>
selectRole(SelectRoleParam requestParam)
Get all users who are added to the role.R<io.milvus.grpc.SelectUserResponse>
selectUser(SelectUserParam requestParam)
Get all roles the user has.void
setLogLevel(LogLevel level)
Set log level in runtime.R<io.milvus.grpc.ShowCollectionsResponse>
showCollections(ShowCollectionsParam requestParam)
Lists all collections or gets collection loading status.R<io.milvus.grpc.ShowPartitionsResponse>
showPartitions(ShowPartitionsParam requestParam)
Shows all partitions in the specified collection.R<RpcStatus>
updateCredential(UpdateCredentialParam requestParam)
Update credential using the given user and password.R<io.milvus.grpc.MutationResult>
upsert(UpsertParam requestParam)
Insert new entities into a specified collection, replace them if the entities already exist.com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>>
upsertAsync(UpsertParam requestParam)
Insert new entities into a specified collection asynchronously, replace them if the entities already exist.MilvusClient
withRetry(int retryTimes)
Number of retry attempts.MilvusClient
withRetryInterval(long interval, java.util.concurrent.TimeUnit timeUnit)
Time interval between retry attempts.MilvusClient
withTimeout(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
Timeout setting for rpc call.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.milvus.client.MilvusClient
close
-
-
-
-
Constructor Detail
-
MilvusMultiServiceClient
public MilvusMultiServiceClient(@NonNull @NonNull MultiConnectParam multiConnectParam)
Sets connect param for multi milvus clusters.- Parameters:
multiConnectParam
- multi server connect param
-
-
Method Detail
-
withTimeout
public MilvusClient withTimeout(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
Description copied from interface:MilvusClient
Timeout setting for rpc call.- Specified by:
withTimeout
in interfaceMilvusClient
- Parameters:
timeout
- set time waiting for a rpc call.timeoutUnit
- time unit
-
withRetry
public MilvusClient withRetry(int retryTimes)
Description copied from interface:MilvusClient
Number of retry attempts.- Specified by:
withRetry
in interfaceMilvusClient
- Parameters:
retryTimes
- number of retry attempts.
-
withRetryInterval
public MilvusClient withRetryInterval(long interval, java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:MilvusClient
Time interval between retry attempts. Default value is 500ms.- Specified by:
withRetryInterval
in interfaceMilvusClient
- Parameters:
interval
- time interval between retry attempts.timeUnit
- time unit
-
close
public void close(long maxWaitSeconds) throws java.lang.InterruptedException
Description copied from interface:MilvusClient
Disconnects from a Milvus server with configurable timeout.- Specified by:
close
in interfaceMilvusClient
- Parameters:
maxWaitSeconds
- timeout unit: second- Throws:
java.lang.InterruptedException
-
setLogLevel
public void setLogLevel(LogLevel level)
Description copied from interface:MilvusClient
Set log level in runtime.- Specified by:
setLogLevel
in interfaceMilvusClient
- Parameters:
level
-LogLevel
-
hasCollection
public R<java.lang.Boolean> hasCollection(HasCollectionParam requestParam)
Description copied from interface:MilvusClient
Checks if a collection exists.- Specified by:
hasCollection
in interfaceMilvusClient
- Parameters:
requestParam
-HasCollectionParam
- Returns:
- {status:result code, data: boolean, whether if has collection or not}
-
createDatabase
public R<RpcStatus> createDatabase(CreateDatabaseParam requestParam)
Description copied from interface:MilvusClient
Creates a database in Milvus.- Specified by:
createDatabase
in interfaceMilvusClient
- Parameters:
requestParam
-CreateDatabaseParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropDatabase
public R<RpcStatus> dropDatabase(DropDatabaseParam requestParam)
Description copied from interface:MilvusClient
Drops a database. Note that this method drops all data in the database.- Specified by:
dropDatabase
in interfaceMilvusClient
- Parameters:
requestParam
-DropDatabaseParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
listDatabases
public R<io.milvus.grpc.ListDatabasesResponse> listDatabases()
Description copied from interface:MilvusClient
List databases. Note that this method list all database in the cluster.- Specified by:
listDatabases
in interfaceMilvusClient
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
createCollection
public R<RpcStatus> createCollection(CreateCollectionParam requestParam)
Description copied from interface:MilvusClient
Creates a collection in Milvus.- Specified by:
createCollection
in interfaceMilvusClient
- Parameters:
requestParam
-CreateCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropCollection
public R<RpcStatus> dropCollection(DropCollectionParam requestParam)
Description copied from interface:MilvusClient
Drops a collection. Note that this method drops all data in the collection.- Specified by:
dropCollection
in interfaceMilvusClient
- Parameters:
requestParam
-DropCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
loadCollection
public R<RpcStatus> loadCollection(LoadCollectionParam requestParam)
Description copied from interface:MilvusClient
Loads a collection to memory before search or query.- Specified by:
loadCollection
in interfaceMilvusClient
- Parameters:
requestParam
-LoadCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
releaseCollection
public R<RpcStatus> releaseCollection(ReleaseCollectionParam requestParam)
Description copied from interface:MilvusClient
Releases a collection from memory to reduce memory usage. Note that you cannot search while the corresponding collection is released from memory.- Specified by:
releaseCollection
in interfaceMilvusClient
- Parameters:
requestParam
-ReleaseCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
renameCollection
public R<RpcStatus> renameCollection(RenameCollectionParam requestParam)
Description copied from interface:MilvusClient
rename a collection- Specified by:
renameCollection
in interfaceMilvusClient
- Parameters:
requestParam
-RenameCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
describeCollection
public R<io.milvus.grpc.DescribeCollectionResponse> describeCollection(DescribeCollectionParam requestParam)
Description copied from interface:MilvusClient
Shows the details of a collection, e.g. name, schema.- Specified by:
describeCollection
in interfaceMilvusClient
- Parameters:
requestParam
-DescribeCollectionParam
- Returns:
- {status:result code, data:DescribeCollectionResponse{schema,collectionID}}
-
getCollectionStatistics
public R<io.milvus.grpc.GetCollectionStatisticsResponse> getCollectionStatistics(GetCollectionStatisticsParam requestParam)
Description copied from interface:MilvusClient
Shows the statistics information of a collection.- Specified by:
getCollectionStatistics
in interfaceMilvusClient
- Parameters:
requestParam
-GetCollectionStatisticsParam
- Returns:
- {status:result code, data: GetCollectionStatisticsResponse{status,stats}}
-
showCollections
public R<io.milvus.grpc.ShowCollectionsResponse> showCollections(ShowCollectionsParam requestParam)
Description copied from interface:MilvusClient
Lists all collections or gets collection loading status.- Specified by:
showCollections
in interfaceMilvusClient
- Parameters:
requestParam
-ShowCollectionsParam
- Returns:
- {status:result code, data: ShowCollectionsResponse{status,collection_names,collection_ids,created_timestamps,created_utc_timestamps}}
-
alterCollection
public R<RpcStatus> alterCollection(AlterCollectionParam requestParam)
Description copied from interface:MilvusClient
Alter collection. Currently, only support setting collection TTL with key `collection.ttl.seconds`- Specified by:
alterCollection
in interfaceMilvusClient
- Parameters:
requestParam
-AlterCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
flush
public R<io.milvus.grpc.FlushResponse> flush(FlushParam requestParam)
Description copied from interface:MilvusClient
Flushes inserted data in buffer into storage.- Specified by:
flush
in interfaceMilvusClient
- Parameters:
requestParam
-FlushParam
- Returns:
- {status:result code,data: FlushResponse{flush segment ids}}
-
flushAll
public R<io.milvus.grpc.FlushAllResponse> flushAll(boolean syncFlushAll, long syncFlushAllWaitingInterval, long syncFlushAllTimeout)
Description copied from interface:MilvusClient
Flush all collections. All insertions, deletions, and upserts before `flushAll` will be synced.- Specified by:
flushAll
in interfaceMilvusClient
- Parameters:
syncFlushAll
- {flushAll synchronously or asynchronously}syncFlushAllWaitingInterval
- {wait intervel when flushAll synchronously}syncFlushAllTimeout
- {timeout when flushAll synchronously}- Returns:
- {status:result code,data: FlushAllResponse{flushAllTs}}
-
createPartition
public R<RpcStatus> createPartition(CreatePartitionParam requestParam)
Description copied from interface:MilvusClient
Creates a partition in the specified collection.- Specified by:
createPartition
in interfaceMilvusClient
- Parameters:
requestParam
-CreatePartitionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropPartition
public R<RpcStatus> dropPartition(DropPartitionParam requestParam)
Description copied from interface:MilvusClient
Drops a partition. Note that this method drops all data in this partition and the _default partition cannot be dropped.- Specified by:
dropPartition
in interfaceMilvusClient
- Parameters:
requestParam
-DropPartitionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
hasPartition
public R<java.lang.Boolean> hasPartition(HasPartitionParam requestParam)
Description copied from interface:MilvusClient
Checks if a partition exists in the specified collection.- Specified by:
hasPartition
in interfaceMilvusClient
- Parameters:
requestParam
-HasPartitionParam
- Returns:
- {status:result code, data: boolean, whether if has collection or not}
-
loadPartitions
public R<RpcStatus> loadPartitions(LoadPartitionsParam requestParam)
Description copied from interface:MilvusClient
Loads a partition into memory.- Specified by:
loadPartitions
in interfaceMilvusClient
- Parameters:
requestParam
-LoadPartitionsParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
releasePartitions
public R<RpcStatus> releasePartitions(ReleasePartitionsParam requestParam)
Description copied from interface:MilvusClient
Releases a partition from memory.- Specified by:
releasePartitions
in interfaceMilvusClient
- Parameters:
requestParam
-ReleasePartitionsParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
getPartitionStatistics
public R<io.milvus.grpc.GetPartitionStatisticsResponse> getPartitionStatistics(GetPartitionStatisticsParam requestParam)
Description copied from interface:MilvusClient
Shows the statistics information of a partition.- Specified by:
getPartitionStatistics
in interfaceMilvusClient
- Parameters:
requestParam
-GetPartitionStatisticsParam
- Returns:
- {status:result code,data:GetPartitionStatisticsResponse{status,stats}}
-
showPartitions
public R<io.milvus.grpc.ShowPartitionsResponse> showPartitions(ShowPartitionsParam requestParam)
Description copied from interface:MilvusClient
Shows all partitions in the specified collection.- Specified by:
showPartitions
in interfaceMilvusClient
- Parameters:
requestParam
-ShowPartitionsParam
- Returns:
- {status:result code, data:ShowPartitionsResponse{partition_names,partitionIDs,created_timestamps,created_utc_timestamps}}
-
createAlias
public R<RpcStatus> createAlias(CreateAliasParam requestParam)
Description copied from interface:MilvusClient
Creates an alias for a collection. Alias can be used in search or query to replace the collection name- Specified by:
createAlias
in interfaceMilvusClient
- Parameters:
requestParam
-CreateAliasParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropAlias
public R<RpcStatus> dropAlias(DropAliasParam requestParam)
Description copied from interface:MilvusClient
Drops an alias for the specified collection.- Specified by:
dropAlias
in interfaceMilvusClient
- Parameters:
requestParam
-DropAliasParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
alterAlias
public R<RpcStatus> alterAlias(AlterAliasParam requestParam)
Description copied from interface:MilvusClient
Alters alias from a collection to another.- Specified by:
alterAlias
in interfaceMilvusClient
- Parameters:
requestParam
-AlterAliasParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
createIndex
public R<RpcStatus> createIndex(CreateIndexParam requestParam)
Description copied from interface:MilvusClient
Creates an index on a vector field in the specified collection. Note that index building is an async progress.- Specified by:
createIndex
in interfaceMilvusClient
- Parameters:
requestParam
-CreateIndexParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropIndex
public R<RpcStatus> dropIndex(DropIndexParam requestParam)
Description copied from interface:MilvusClient
Drops the index on a vector field in the specified collection.- Specified by:
dropIndex
in interfaceMilvusClient
- Parameters:
requestParam
-DropIndexParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
describeIndex
public R<io.milvus.grpc.DescribeIndexResponse> describeIndex(DescribeIndexParam requestParam)
Description copied from interface:MilvusClient
Shows the information of the specified index. Current release of Milvus only supports showing latest built index.- Specified by:
describeIndex
in interfaceMilvusClient
- Parameters:
requestParam
-DescribeIndexParam
- Returns:
- {status:result code, data:DescribeIndexResponse{status,index_descriptions}}
-
getIndexState
public R<io.milvus.grpc.GetIndexStateResponse> getIndexState(GetIndexStateParam requestParam)
Description copied from interface:MilvusClient
Shows the index building state(in-progress/finished/failed), and the reason for failure (if any).- Specified by:
getIndexState
in interfaceMilvusClient
- Parameters:
requestParam
-GetIndexStateParam
- Returns:
- {status:result code, data:GetIndexStateResponse{status,state}}
-
getIndexBuildProgress
public R<io.milvus.grpc.GetIndexBuildProgressResponse> getIndexBuildProgress(GetIndexBuildProgressParam requestParam)
Description copied from interface:MilvusClient
Shows the index building progress, such as how many rows are indexed.- Specified by:
getIndexBuildProgress
in interfaceMilvusClient
- Parameters:
requestParam
-GetIndexBuildProgressParam
- Returns:
- {status:result code, data:GetIndexBuildProgressResponse{status,indexed_rows}}
-
insert
public R<io.milvus.grpc.MutationResult> insert(InsertParam requestParam)
Description copied from interface:MilvusClient
Inserts entities into a specified collection . Note that you don't need to input primary key field if auto_id is enabled.- Specified by:
insert
in interfaceMilvusClient
- Parameters:
requestParam
-InsertParam
- Returns:
- {status:result code, data: MutationResult{insert results}}
-
insertAsync
public com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>> insertAsync(InsertParam requestParam)
Description copied from interface:MilvusClient
Inserts entities into a specified collection asynchronously. Note that you don't need to input primary key field if auto_id is enabled.- Specified by:
insertAsync
in interfaceMilvusClient
- Parameters:
requestParam
-InsertParam
- Returns:
- a
ListenableFuture
object which holds the object {status:result code, data: MutationResult{insert results}}
-
upsert
public R<io.milvus.grpc.MutationResult> upsert(UpsertParam requestParam)
Description copied from interface:MilvusClient
Insert new entities into a specified collection, replace them if the entities already exist.- Specified by:
upsert
in interfaceMilvusClient
- Parameters:
requestParam
-UpsertParam
- Returns:
- {status:result code, data: MutationResult{insert results}}
-
upsertAsync
public com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>> upsertAsync(UpsertParam requestParam)
Description copied from interface:MilvusClient
Insert new entities into a specified collection asynchronously, replace them if the entities already exist.- Specified by:
upsertAsync
in interfaceMilvusClient
- Parameters:
requestParam
-UpsertParam
- Returns:
- a
ListenableFuture
object which holds the object {status:result code, data: MutationResult{insert results}}
-
delete
public R<io.milvus.grpc.MutationResult> delete(DeleteParam requestParam)
Description copied from interface:MilvusClient
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, ...]"- Specified by:
delete
in interfaceMilvusClient
- Parameters:
requestParam
-DeleteParam
- Returns:
- {status:result code, data: MutationResult{delete results}}
-
search
public R<io.milvus.grpc.SearchResults> search(SearchParam requestParam)
Description copied from interface:MilvusClient
Conducts ANN search on a vector field. Use expression to do filtering before search.- Specified by:
search
in interfaceMilvusClient
- Parameters:
requestParam
-SearchParam
- Returns:
- {status:result code, data: SearchResults{topK results}}
-
searchAsync
public com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>> searchAsync(SearchParam requestParam)
Description copied from interface:MilvusClient
Conducts ANN search on a vector field asynchronously. Use expression to do filtering before search.- Specified by:
searchAsync
in interfaceMilvusClient
- Parameters:
requestParam
-SearchParam
- Returns:
- a
ListenableFuture
object which holds the object {status:result code, data: SearchResults{topK results}}
-
query
public R<io.milvus.grpc.QueryResults> query(QueryParam requestParam)
Description copied from interface:MilvusClient
Queries entity(s) based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.- Specified by:
query
in interfaceMilvusClient
- Parameters:
requestParam
-QueryParam
- Returns:
- {status:result code,data: QueryResults{filter results}}
-
queryAsync
public com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.QueryResults>> queryAsync(QueryParam requestParam)
Description copied from interface:MilvusClient
Queries entity(s) asynchronously based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.- Specified by:
queryAsync
in interfaceMilvusClient
- Parameters:
requestParam
-QueryParam
- Returns:
- {status:result code,data: QueryResults{filter results}}
-
getMetrics
public R<io.milvus.grpc.GetMetricsResponse> getMetrics(GetMetricsParam requestParam)
Description copied from interface:MilvusClient
Gets the runtime metrics information of Milvus, returns the result in .json format.- Specified by:
getMetrics
in interfaceMilvusClient
- Parameters:
requestParam
-GetMetricsParam
- Returns:
- {status:result code, data:GetMetricsResponse{status,metrics}}
-
getFlushState
public R<io.milvus.grpc.GetFlushStateResponse> getFlushState(GetFlushStateParam requestParam)
Description copied from interface:MilvusClient
Get flush state of specified collection.- Specified by:
getFlushState
in interfaceMilvusClient
- Parameters:
requestParam
-GetFlushStateParam
- Returns:
- {status:result code, data:GetMetricsResponse{status,metrics}}
-
getFlushAllState
public R<io.milvus.grpc.GetFlushAllStateResponse> getFlushAllState(GetFlushAllStateParam requestParam)
Description copied from interface:MilvusClient
Get flush state of all segments.- Specified by:
getFlushAllState
in interfaceMilvusClient
- Parameters:
requestParam
-GetFlushAllStateParam
- Returns:
- {status:result code, data:GetMetricsResponse{status,metrics}}
-
getPersistentSegmentInfo
public R<io.milvus.grpc.GetPersistentSegmentInfoResponse> getPersistentSegmentInfo(GetPersistentSegmentInfoParam requestParam)
Description copied from interface:MilvusClient
Gets the information of persistent segments from data node, including row count, persistence state(growing or flushed), etc.- Specified by:
getPersistentSegmentInfo
in interfaceMilvusClient
- Parameters:
requestParam
-GetPersistentSegmentInfoParam
- Returns:
- {status:result code, data:GetPersistentSegmentInfoResponse{status,info}}
-
getQuerySegmentInfo
public R<io.milvus.grpc.GetQuerySegmentInfoResponse> getQuerySegmentInfo(GetQuerySegmentInfoParam requestParam)
Description copied from interface:MilvusClient
Gets the query information of segments in a collection from query node, including row count, memory usage size, index name, etc.- Specified by:
getQuerySegmentInfo
in interfaceMilvusClient
- Parameters:
requestParam
-GetQuerySegmentInfoParam
- Returns:
- {status:result code, data:GetQuerySegmentInfoResponse{status,info}}
-
getReplicas
public R<io.milvus.grpc.GetReplicasResponse> getReplicas(GetReplicasParam requestParam)
Description copied from interface:MilvusClient
Returns the collection's replica information- Specified by:
getReplicas
in interfaceMilvusClient
- Parameters:
requestParam
-GetReplicasParam
- Returns:
- {status:result code, data:GetReplicasResponse{status,info}}
-
loadBalance
public R<RpcStatus> loadBalance(LoadBalanceParam requestParam)
Description copied from interface:MilvusClient
Moves segment from a query node to another to keep the load balanced.- Specified by:
loadBalance
in interfaceMilvusClient
- Parameters:
requestParam
-LoadBalanceParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
getCompactionState
public R<io.milvus.grpc.GetCompactionStateResponse> getCompactionState(GetCompactionStateParam requestParam)
Description copied from interface:MilvusClient
Gets the compaction state by id.- Specified by:
getCompactionState
in interfaceMilvusClient
- Parameters:
requestParam
-GetCompactionStateParam
- Returns:
- {status:result code, data:GetCompactionStateResponse{status,info}}
-
manualCompact
public R<io.milvus.grpc.ManualCompactionResponse> manualCompact(ManualCompactParam requestParam)
Description copied from interface:MilvusClient
Performs a manual compaction.- Specified by:
manualCompact
in interfaceMilvusClient
- Parameters:
requestParam
-ManualCompactParam
- Returns:
- {status:result code, data:ManualCompactionResponse{status,info}}
-
getCompactionStateWithPlans
public R<io.milvus.grpc.GetCompactionPlansResponse> getCompactionStateWithPlans(GetCompactionPlansParam requestParam)
Description copied from interface:MilvusClient
Gets compaction state with its plan.- Specified by:
getCompactionStateWithPlans
in interfaceMilvusClient
- Parameters:
requestParam
-GetCompactionPlansParam
- Returns:
- {status:result code, data:GetCompactionPlansResponse{status,info}}
-
createCredential
public R<RpcStatus> createCredential(CreateCredentialParam requestParam)
Description copied from interface:MilvusClient
Create credential using the given user and password.- Specified by:
createCredential
in interfaceMilvusClient
- Parameters:
requestParam
-CreateCredentialParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
updateCredential
public R<RpcStatus> updateCredential(UpdateCredentialParam requestParam)
Description copied from interface:MilvusClient
Update credential using the given user and password. You must provide the original password to check if the operation is valid. Note: after this operation, client won't change the related header of this connection. So if you update credential for this connection, the connection may be invalid.- Specified by:
updateCredential
in interfaceMilvusClient
- Parameters:
requestParam
-UpdateCredentialParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
deleteCredential
public R<RpcStatus> deleteCredential(DeleteCredentialParam requestParam)
Description copied from interface:MilvusClient
Delete credential corresponding to the user.- Specified by:
deleteCredential
in interfaceMilvusClient
- Parameters:
requestParam
-DeleteCredentialParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
listCredUsers
public R<io.milvus.grpc.ListCredUsersResponse> listCredUsers(ListCredUsersParam requestParam)
Description copied from interface:MilvusClient
List all user names.- Specified by:
listCredUsers
in interfaceMilvusClient
- Parameters:
requestParam
-ListCredUsersParam
- Returns:
- {status:result code, data:ListCredUsersResponse{status,info}}
-
createRole
public R<RpcStatus> createRole(CreateRoleParam requestParam)
Description copied from interface:MilvusClient
It will success if the role isn't existed, otherwise fail.- Specified by:
createRole
in interfaceMilvusClient
- Parameters:
requestParam
-CreateRoleParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
dropRole
public R<RpcStatus> dropRole(DropRoleParam requestParam)
Description copied from interface:MilvusClient
It will success if the role is existed, otherwise fail.- Specified by:
dropRole
in interfaceMilvusClient
- Parameters:
requestParam
-DropRoleParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
addUserToRole
public R<RpcStatus> addUserToRole(AddUserToRoleParam requestParam)
Description copied from interface:MilvusClient
The user will get permissions that the role are allowed to perform operations.- Specified by:
addUserToRole
in interfaceMilvusClient
- Parameters:
requestParam
-AddUserToRoleParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
removeUserFromRole
public R<RpcStatus> removeUserFromRole(RemoveUserFromRoleParam requestParam)
Description copied from interface:MilvusClient
The user will remove permissions that the role are allowed to perform operations.- Specified by:
removeUserFromRole
in interfaceMilvusClient
- Parameters:
requestParam
-AddUserToRoleParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
selectRole
public R<io.milvus.grpc.SelectRoleResponse> selectRole(SelectRoleParam requestParam)
Description copied from interface:MilvusClient
Get all users who are added to the role.- Specified by:
selectRole
in interfaceMilvusClient
- Parameters:
requestParam
-SelectRoleParam
- Returns:
- {status:result code, data:SelectRoleResponse{status,info}}
-
selectUser
public R<io.milvus.grpc.SelectUserResponse> selectUser(SelectUserParam requestParam)
Description copied from interface:MilvusClient
Get all roles the user has.- Specified by:
selectUser
in interfaceMilvusClient
- Parameters:
requestParam
-SelectUserParam
- Returns:
- {status:result code, data:SelectUserResponse{status,info}}
-
grantRolePrivilege
public R<RpcStatus> grantRolePrivilege(GrantRolePrivilegeParam requestParam)
Description copied from interface:MilvusClient
Grant Role Privilege.- Specified by:
grantRolePrivilege
in interfaceMilvusClient
- Parameters:
requestParam
-GrantRolePrivilegeParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
revokeRolePrivilege
public R<RpcStatus> revokeRolePrivilege(RevokeRolePrivilegeParam requestParam)
Description copied from interface:MilvusClient
Revoke Role Privilege.- Specified by:
revokeRolePrivilege
in interfaceMilvusClient
- Parameters:
requestParam
-RevokeRolePrivilegeParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
selectGrantForRole
public R<io.milvus.grpc.SelectGrantResponse> selectGrantForRole(SelectGrantForRoleParam requestParam)
Description copied from interface:MilvusClient
List a grant info for the role and the specific object- Specified by:
selectGrantForRole
in interfaceMilvusClient
- Parameters:
requestParam
-SelectGrantForRoleParam
- Returns:
- {status:result code, data:SelectRoleResponse{status,info}}
-
selectGrantForRoleAndObject
public R<io.milvus.grpc.SelectGrantResponse> selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam)
Description copied from interface:MilvusClient
List a grant info for the role- Specified by:
selectGrantForRoleAndObject
in interfaceMilvusClient
- Parameters:
requestParam
-SelectGrantForRoleAndObjectParam
- Returns:
- {status:result code, data:SelectRoleResponse{status,info}}
-
bulkInsert
public R<io.milvus.grpc.ImportResponse> bulkInsert(BulkInsertParam requestParam)
Description copied from interface:MilvusClient
Import data from external files, currently support JSON format- Specified by:
bulkInsert
in interfaceMilvusClient
- Parameters:
requestParam
-BulkInsertParam
- Returns:
- {status:result code, data:ImportResponse{status,info}}
-
getBulkInsertState
public R<io.milvus.grpc.GetImportStateResponse> getBulkInsertState(GetBulkInsertStateParam requestParam)
Description copied from interface:MilvusClient
Get state of bulk insert task- Specified by:
getBulkInsertState
in interfaceMilvusClient
- Parameters:
requestParam
-GetBulkInsertStateParam
- Returns:
- {status:result code, data:GetImportStateResponse{status,info}}
-
listBulkInsertTasks
public R<io.milvus.grpc.ListImportTasksResponse> listBulkInsertTasks(ListBulkInsertTasksParam requestParam)
Description copied from interface:MilvusClient
List bulk insert tasks- Specified by:
listBulkInsertTasks
in interfaceMilvusClient
- Parameters:
requestParam
-ListBulkInsertTasksParam
- Returns:
- {status:result code, data:ListImportTasksResponse{status,info}}
-
checkHealth
public R<io.milvus.grpc.CheckHealthResponse> checkHealth()
Description copied from interface:MilvusClient
Check server health- Specified by:
checkHealth
in interfaceMilvusClient
- Returns:
- {status:result code, data:CheckHealthResponse{status,info}}
-
getVersion
public R<io.milvus.grpc.GetVersionResponse> getVersion()
Description copied from interface:MilvusClient
Get server version- Specified by:
getVersion
in interfaceMilvusClient
- Returns:
- {status:result code, data:GetVersionResponse{status,info}}
-
getLoadingProgress
public R<io.milvus.grpc.GetLoadingProgressResponse> getLoadingProgress(GetLoadingProgressParam requestParam)
Description copied from interface:MilvusClient
Get collection loading progress- Specified by:
getLoadingProgress
in interfaceMilvusClient
- Parameters:
requestParam
-GetLoadingProgressParam
- Returns:
- {status:result code, data:GetLoadingProgressResponse{status}}
-
getLoadState
public R<io.milvus.grpc.GetLoadStateResponse> getLoadState(GetLoadStateParam requestParam)
Description copied from interface:MilvusClient
Get collection loading state- Specified by:
getLoadState
in interfaceMilvusClient
- Parameters:
requestParam
-GetLoadStateParam
- Returns:
- {status:result code, data:GetLoadStateResponse{status}}
-
createCollection
public R<RpcStatus> createCollection(CreateSimpleCollectionParam requestParam)
Description copied from interface:MilvusClient
Creates a collection in Milvus.- Specified by:
createCollection
in interfaceMilvusClient
- Parameters:
requestParam
-CreateSimpleCollectionParam
- Returns:
- {status:result code, data:RpcStatus{msg: result message}}
-
listCollections
public R<ListCollectionsResponse> listCollections(ListCollectionsParam requestParam)
Description copied from interface:MilvusClient
Lists all collections- Specified by:
listCollections
in interfaceMilvusClient
- Parameters:
requestParam
-ListCollectionsParam
- Returns:
- {status:result code, data: ListCollectionsResponse{collection_names}}
-
insert
public R<InsertResponse> insert(InsertRowsParam requestParam)
Description copied from interface:MilvusClient
Inserts rows data into a specified collection . Note that you don't need to input primary key field if auto_id is enabled.- Specified by:
insert
in interfaceMilvusClient
- Parameters:
requestParam
-InsertRowsParam
- Returns:
- {status:result code, data: MutationResult{insert results}}
-
delete
public R<DeleteResponse> delete(DeleteIdsParam requestParam)
Description copied from interface:MilvusClient
Deletes entity(s) based on the value of primary key.- Specified by:
delete
in interfaceMilvusClient
- Parameters:
requestParam
-DeleteIdsParam
- Returns:
- {status:result code, data: MutationResult{delete results}}
-
get
public R<GetResponse> get(GetIdsParam requestParam)
Description copied from interface:MilvusClient
Get entity(s) based on the value of primary key.- Specified by:
get
in interfaceMilvusClient
- Parameters:
requestParam
-GetIdsParam
- Returns:
- {status:result code, data: QueryResults{query results}}
-
query
public R<QueryResponse> query(QuerySimpleParam requestParam)
Description copied from interface:MilvusClient
Queries entity(s) based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.- Specified by:
query
in interfaceMilvusClient
- Parameters:
requestParam
-QuerySimpleParam
- Returns:
- {status:result code,data: QueryResults{filter results}}
-
search
public R<SearchResponse> search(SearchSimpleParam requestParam)
Description copied from interface:MilvusClient
Conducts ANN search on a vector field. Use expression to do filtering before search.- Specified by:
search
in interfaceMilvusClient
- Parameters:
requestParam
-SearchSimpleParam
- Returns:
- {status:result code, data: SearchResults{topK results}}
-
-