milvus-logo
Star
0
Forks
0
Get Started

Class AbstractMilvusGrpcClient

  • java.lang.Object
    • io.milvus.client.AbstractMilvusGrpcClient
  • All Implemented Interfaces:
    MilvusClient
    Direct Known Subclasses:
    MilvusServiceClient

    public abstract class AbstractMilvusGrpcClient
    extends java.lang.Object
    implements MilvusClient
    • Constructor Detail

      • AbstractMilvusGrpcClient

        public AbstractMilvusGrpcClient()
    • Method Detail

      • blockingStub

        protected abstract io.milvus.grpc.MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub()
      • futureStub

        protected abstract io.milvus.grpc.MilvusServiceGrpc.MilvusServiceFutureStub futureStub()
      • clientIsReady

        protected abstract boolean clientIsReady()
      • hasCollection

        public R<java.lang.Boolean> hasCollection​(@NonNull
                                                  @NonNull HasCollectionParam requestParam)
        Description copied from interface: MilvusClient
        Checks if a collection exists.
        Specified by:
        hasCollection in interface MilvusClient
        Parameters:
        requestParam - HasCollectionParam
        Returns:
        {status:result code, data: boolean, whether if has collection or not}
      • createCollection

        public R<RpcStatus> createCollection​(@NonNull
                                             @NonNull CreateCollectionParam requestParam)
        Description copied from interface: MilvusClient
        Creates a collection in Milvus.
        Specified by:
        createCollection in interface MilvusClient
        Parameters:
        requestParam - CreateCollectionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • dropCollection

        public R<RpcStatus> dropCollection​(@NonNull
                                           @NonNull DropCollectionParam requestParam)
        Description copied from interface: MilvusClient
        Drops a collection. Note that this method drops all data in the collection.
        Specified by:
        dropCollection in interface MilvusClient
        Parameters:
        requestParam - DropCollectionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • loadCollection

        public R<RpcStatus> loadCollection​(@NonNull
                                           @NonNull LoadCollectionParam requestParam)
        Description copied from interface: MilvusClient
        Loads a collection to memory before search or query.
        Specified by:
        loadCollection in interface MilvusClient
        Parameters:
        requestParam - LoadCollectionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • releaseCollection

        public R<RpcStatus> releaseCollection​(@NonNull
                                              @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - ReleaseCollectionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • describeCollection

        public R<io.milvus.grpc.DescribeCollectionResponse> describeCollection​(@NonNull
                                                                               @NonNull DescribeCollectionParam requestParam)
        Description copied from interface: MilvusClient
        Shows the details of a collection, e.g. name, schema.
        Specified by:
        describeCollection in interface MilvusClient
        Parameters:
        requestParam - DescribeCollectionParam
        Returns:
        {status:result code, data:DescribeCollectionResponse{schema,collectionID}}
      • getCollectionStatistics

        public R<io.milvus.grpc.GetCollectionStatisticsResponse> getCollectionStatistics​(@NonNull
                                                                                         @NonNull GetCollectionStatisticsParam requestParam)
        Description copied from interface: MilvusClient
        Shows the statistics information of a collection.
        Specified by:
        getCollectionStatistics in interface MilvusClient
        Parameters:
        requestParam - GetCollectionStatisticsParam
        Returns:
        {status:result code, data: GetCollectionStatisticsResponse{status,stats}}
      • showCollections

        public R<io.milvus.grpc.ShowCollectionsResponse> showCollections​(@NonNull
                                                                         @NonNull ShowCollectionsParam requestParam)
        Description copied from interface: MilvusClient
        Lists all collections or gets collection loading status.
        Specified by:
        showCollections in interface MilvusClient
        Parameters:
        requestParam - ShowCollectionsParam
        Returns:
        {status:result code, data: ShowCollectionsResponse{status,collection_names,collection_ids,created_timestamps,created_utc_timestamps}}
      • createPartition

        public R<RpcStatus> createPartition​(@NonNull
                                            @NonNull CreatePartitionParam requestParam)
        Description copied from interface: MilvusClient
        Creates a partition in the specified collection.
        Specified by:
        createPartition in interface MilvusClient
        Parameters:
        requestParam - CreatePartitionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • dropPartition

        public R<RpcStatus> dropPartition​(@NonNull
                                          @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - DropPartitionParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • hasPartition

        public R<java.lang.Boolean> hasPartition​(@NonNull
                                                 @NonNull HasPartitionParam requestParam)
        Description copied from interface: MilvusClient
        Checks if a partition exists in the specified collection.
        Specified by:
        hasPartition in interface MilvusClient
        Parameters:
        requestParam - HasPartitionParam
        Returns:
        {status:result code, data: boolean, whether if has collection or not}
      • loadPartitions

        public R<RpcStatus> loadPartitions​(@NonNull
                                           @NonNull LoadPartitionsParam requestParam)
        Description copied from interface: MilvusClient
        Loads a partition into memory.
        Specified by:
        loadPartitions in interface MilvusClient
        Parameters:
        requestParam - LoadPartitionsParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • releasePartitions

        public R<RpcStatus> releasePartitions​(@NonNull
                                              @NonNull ReleasePartitionsParam requestParam)
        Description copied from interface: MilvusClient
        Releases a partition from memory.
        Specified by:
        releasePartitions in interface MilvusClient
        Parameters:
        requestParam - ReleasePartitionsParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • getPartitionStatistics

        public R<io.milvus.grpc.GetPartitionStatisticsResponse> getPartitionStatistics​(@NonNull
                                                                                       @NonNull GetPartitionStatisticsParam requestParam)
        Description copied from interface: MilvusClient
        Shows the statistics information of a partition.
        Specified by:
        getPartitionStatistics in interface MilvusClient
        Parameters:
        requestParam - GetPartitionStatisticsParam
        Returns:
        {status:result code,data:GetPartitionStatisticsResponse{status,stats}}
      • showPartitions

        public R<io.milvus.grpc.ShowPartitionsResponse> showPartitions​(@NonNull
                                                                       @NonNull ShowPartitionsParam requestParam)
        Description copied from interface: MilvusClient
        Shows all partitions in the specified collection.
        Specified by:
        showPartitions in interface MilvusClient
        Parameters:
        requestParam - ShowPartitionsParam
        Returns:
        {status:result code, data:ShowPartitionsResponse{partition_names,partitionIDs,created_timestamps,created_utc_timestamps}}
      • createAlias

        public R<RpcStatus> createAlias​(@NonNull
                                        @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - CreateAliasParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • dropAlias

        public R<RpcStatus> dropAlias​(@NonNull
                                      @NonNull DropAliasParam requestParam)
        Description copied from interface: MilvusClient
        Drops an alias for the specified collection.
        Specified by:
        dropAlias in interface MilvusClient
        Parameters:
        requestParam - DropAliasParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • alterAlias

        public R<RpcStatus> alterAlias​(@NonNull
                                       @NonNull AlterAliasParam requestParam)
        Description copied from interface: MilvusClient
        Alters alias from a collection to another.
        Specified by:
        alterAlias in interface MilvusClient
        Parameters:
        requestParam - AlterAliasParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • createIndex

        public R<RpcStatus> createIndex​(@NonNull
                                        @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - CreateIndexParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • dropIndex

        public R<RpcStatus> dropIndex​(@NonNull
                                      @NonNull DropIndexParam requestParam)
        Description copied from interface: MilvusClient
        Drops the index on a vector field in the specified collection.
        Specified by:
        dropIndex in interface MilvusClient
        Parameters:
        requestParam - DropIndexParam
        Returns:
        {status:result code, data:RpcStatus{msg: result message}}
      • describeIndex

        public R<io.milvus.grpc.DescribeIndexResponse> describeIndex​(@NonNull
                                                                     @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - DescribeIndexParam
        Returns:
        {status:result code, data:DescribeIndexResponse{status,index_descriptions}}
      • getIndexState

        public R<io.milvus.grpc.GetIndexStateResponse> getIndexState​(@NonNull
                                                                     @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - GetIndexStateParam
        Returns:
        {status:result code, data:GetIndexStateResponse{status,state}}
      • getIndexBuildProgress

        public R<io.milvus.grpc.GetIndexBuildProgressResponse> getIndexBuildProgress​(@NonNull
                                                                                     @NonNull GetIndexBuildProgressParam requestParam)
        Description copied from interface: MilvusClient
        Shows the index building progress, such as how many rows are indexed.
        Specified by:
        getIndexBuildProgress in interface MilvusClient
        Parameters:
        requestParam - GetIndexBuildProgressParam
        Returns:
        {status:result code, data:GetIndexBuildProgressResponse{status,indexed_rows}}
      • delete

        public R<io.milvus.grpc.MutationResult> delete​(@NonNull
                                                       @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - DeleteParam
        Returns:
        {status:result code, data: MutationResult{delete results}}
      • insert

        public R<io.milvus.grpc.MutationResult> insert​(@NonNull
                                                       @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - InsertParam
        Returns:
        {status:result code, data: MutationResult{insert results}}
      • search

        public R<io.milvus.grpc.SearchResults> search​(@NonNull
                                                      @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - SearchParam
        Returns:
        {status:result code, data: SearchResults{topK results}}
      • query

        public R<io.milvus.grpc.QueryResults> query​(@NonNull
                                                    @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - QueryParam
        Returns:
        {status:result code,data: QueryResults{filter results}}
      • calcDistance

        public R<io.milvus.grpc.CalcDistanceResults> calcDistance​(@NonNull
                                                                  @NonNull CalcDistanceParam requestParam)
        Description copied from interface: MilvusClient
        Calculates the distance between the specified vectors.
        Specified by:
        calcDistance in interface MilvusClient
        Parameters:
        requestParam - CalcDistanceParam
        Returns:
        {status:result code, data: CalcDistanceResults{distances}}
      • getMetrics

        public R<io.milvus.grpc.GetMetricsResponse> getMetrics​(@NonNull
                                                               @NonNull GetMetricsParam requestParam)
        Description copied from interface: MilvusClient
        Gets the runtime metrics information of Milvus, returns the result in .json format.
        Specified by:
        getMetrics in interface MilvusClient
        Parameters:
        requestParam - GetMetricsParam
        Returns:
        {status:result code, data:GetMetricsResponse{status,metrics}}
      • getFlushState

        public R<io.milvus.grpc.GetFlushStateResponse> getFlushState​(@NonNull
                                                                     @NonNull GetFlushStateParam requestParam)
        Description copied from interface: MilvusClient
        Get flush state of specified segments.
        Specified by:
        getFlushState in interface MilvusClient
        Parameters:
        requestParam - GetFlushStateParam
        Returns:
        {status:result code, data:GetMetricsResponse{status,metrics}}
      • getPersistentSegmentInfo

        public R<io.milvus.grpc.GetPersistentSegmentInfoResponse> getPersistentSegmentInfo​(@NonNull
                                                                                           @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - GetPersistentSegmentInfoParam
        Returns:
        {status:result code, data:GetPersistentSegmentInfoResponse{status,info}}
      • getQuerySegmentInfo

        public R<io.milvus.grpc.GetQuerySegmentInfoResponse> getQuerySegmentInfo​(@NonNull
                                                                                 @NonNull 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 interface MilvusClient
        Parameters:
        requestParam - GetQuerySegmentInfoParam
        Returns:
        {status:result code, data:GetQuerySegmentInfoResponse{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 interface MilvusClient
        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 interface MilvusClient
        Parameters:
        requestParam - GetCompactionStateParam
        Returns:
        {status:result code, data:GetCompactionStateResponse{status,info}}
      • manualCompaction

        public R<io.milvus.grpc.ManualCompactionResponse> manualCompaction​(ManualCompactionParam requestParam)
        Description copied from interface: MilvusClient
        Performs a manual compaction.
        Specified by:
        manualCompaction in interface MilvusClient
        Parameters:
        requestParam - ManualCompactionParam
        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 interface MilvusClient
        Parameters:
        requestParam - GetCompactionPlansParam
        Returns:
        {status:result code, data:GetCompactionPlansResponse{status,info}}