Package io.milvus.client
Class MilvusGrpcClient
- java.lang.Object
-
- io.milvus.client.MilvusGrpcClient
-
- All Implemented Interfaces:
MilvusClient
public class MilvusGrpcClient extends Object implements MilvusClient
Actual implementation of interfaceMilvusClient
-
-
Field Summary
-
Fields inherited from interface io.milvus.client.MilvusClient
clientVersion
-
-
Constructor Summary
Constructors Constructor Description MilvusGrpcClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Responseconnect(ConnectParam connectParam)Connects to Milvus serverResponsecreateIndex(CreateIndexParam createIndexParam)Creates index specified byindexParamResponsecreateTable(TableSchemaParam tableSchemaParam)Creates table specified bytableSchemaParamResponsedeleteByRange(DeleteByRangeParam deleteByRangeParam)Deletes vectors by date range, specified bydeleteByRangeParamDescribeIndexResponsedescribeIndex(TableParam tableParam)Describes table index specified bytableParamDescribeTableResponsedescribeTable(TableParam tableParam)Describes table specified bytableParamResponsedisconnect()Disconnects from Milvus serverResponsedropIndex(TableParam tableParam)Drops table index specified bytableParamResponsedropTable(TableParam tableParam)Drops the table specified bytableParamResponsegetServerStatus()Prints server statusResponsegetServerVersion()Prints server versionGetTableRowCountResponsegetTableRowCount(TableParam tableParam)Gets current row count of table specified bytableParamHasTableResponsehasTable(TableParam tableParam)Check whether the table specified bytableParamexistsInsertResponseinsert(InsertParam insertParam)Inserts data specified byinsertParambooleanisConnected()ResponsepreloadTable(TableParam tableParam)Pre-loads table to memorySearchResponsesearch(SearchParam searchParam)Searches vectors specified bysearchParamSearchResponsesearchInFiles(SearchInFilesParam searchInFilesParam)Searches vectors in specific files specified bysearchInFilesParamShowTablesResponseshowTables()Shows current tables-
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
getClientVersion
-
-
-
-
Method Detail
-
connect
public Response connect(ConnectParam connectParam) throws ConnectFailedException
Description copied from interface:MilvusClientConnects to Milvus server- Specified by:
connectin interfaceMilvusClient- Parameters:
connectParam- theConnectParamobjectexample usage:
ConnectParam connectParam = new ConnectParam.Builder() .withHost("localhost") .withPort("19530") .build();- Returns:
Response- Throws:
ConnectFailedException- if client failed to connect- See Also:
ConnectParam,Response,ConnectFailedException
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceMilvusClient- Returns:
trueif the client is connected to Milvus server
-
disconnect
public Response disconnect() throws InterruptedException
Description copied from interface:MilvusClientDisconnects from Milvus server- Specified by:
disconnectin interfaceMilvusClient- Returns:
Response- Throws:
InterruptedException- See Also:
Response
-
createTable
public Response createTable(@Nonnull TableSchemaParam tableSchemaParam)
Description copied from interface:MilvusClientCreates table specified bytableSchemaParam- Specified by:
createTablein interfaceMilvusClient- Parameters:
tableSchemaParam- theTableSchemaParamobjectexample usage:
TableSchema tableSchema = new TableSchema.Builder(tableName, dimension) .withIndexFileSize(1024) .withMetricType(MetricType.IP) .build(); TableSchemaParam tableSchemaParam = new TableSchemaParam.Builder(tableSchema) .withTimeout(timeout) .build();- Returns:
Response- See Also:
TableSchema,TableSchemaParam,MetricType,Response
-
hasTable
public HasTableResponse hasTable(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientCheck whether the table specified bytableParamexists- Specified by:
hasTablein interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
HasTableResponse- See Also:
TableParam,HasTableResponse,Response
-
dropTable
public Response dropTable(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientDrops the table specified bytableParam- Specified by:
dropTablein interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
Response- See Also:
TableParam,Response
-
createIndex
public Response createIndex(@Nonnull CreateIndexParam createIndexParam)
Description copied from interface:MilvusClientCreates index specified byindexParam- Specified by:
createIndexin interfaceMilvusClient- Parameters:
createIndexParam- theCreateIndexParamobjectexample usage:
Index index = new Index.Builder() .withIndexType(IndexType.IVF_SQ8) .withNList(16384) .build(); CreateIndexParam createIndexParam = new CreateIndexParam.Builder(tableName) .withIndex(index) .withTimeout(timeout) .build();- Returns:
Response- See Also:
Index,CreateIndexParam,IndexType,Response
-
insert
public InsertResponse insert(@Nonnull InsertParam insertParam)
Description copied from interface:MilvusClientInserts data specified byinsertParam- Specified by:
insertin interfaceMilvusClient- Parameters:
insertParam- theInsertParamobjectexample usage:
InsertParam insertParam = new InsertParam.Builder(tableName, vectors) .withVectorIds(vectorIds) .withTimeout(timeout) .build();- Returns:
InsertResponse- See Also:
InsertParam,InsertResponse,Response
-
search
public SearchResponse search(@Nonnull SearchParam searchParam)
Description copied from interface:MilvusClientSearches vectors specified bysearchParam- Specified by:
searchin interfaceMilvusClient- Parameters:
searchParam- theSearchParamobjectexample usage:
SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch) .withTopK(topK) .withNProbe(nProbe) .withDateRanges(dateRanges) .withTimeout(timeout) .build();- Returns:
SearchResponse- See Also:
SearchParam,DateRange,SearchResponse,SearchResponse.QueryResult,Response
-
searchInFiles
public SearchResponse searchInFiles(@Nonnull SearchInFilesParam searchInFilesParam)
Description copied from interface:MilvusClientSearches vectors in specific files specified bysearchInFilesParam- Specified by:
searchInFilesin interfaceMilvusClient- Parameters:
searchInFilesParam- theSearchInFilesParamobjectexample usage:
SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch) .withTopK(topK) .withNProbe(nProbe) .withDateRanges(dateRanges) .build(); SearchInFilesParam searchInFilesParam = new SearchInFilesParam.Builder(fileIds, searchParam) .withTimeout(timeout) .build();- Returns:
SearchResponse- See Also:
SearchInFilesParam,SearchParam,DateRange,SearchResponse,SearchResponse.QueryResult,Response
-
describeTable
public DescribeTableResponse describeTable(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientDescribes table specified bytableParam- Specified by:
describeTablein interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
DescribeTableResponse- See Also:
TableParam,DescribeTableResponse,Response
-
showTables
public ShowTablesResponse showTables()
Description copied from interface:MilvusClientShows current tables- Specified by:
showTablesin interfaceMilvusClient- Returns:
ShowTablesResponse- See Also:
ShowTablesResponse,Response
-
getTableRowCount
public GetTableRowCountResponse getTableRowCount(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientGets current row count of table specified bytableParam- Specified by:
getTableRowCountin interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
GetTableRowCountResponse- See Also:
GetTableRowCountResponse,Response
-
getServerStatus
public Response getServerStatus()
Description copied from interface:MilvusClientPrints server status- Specified by:
getServerStatusin interfaceMilvusClient- Returns:
Response- See Also:
Response
-
getServerVersion
public Response getServerVersion()
Description copied from interface:MilvusClientPrints server version- Specified by:
getServerVersionin interfaceMilvusClient- Returns:
Response- See Also:
Response
-
deleteByRange
public Response deleteByRange(@Nonnull DeleteByRangeParam deleteByRangeParam)
Description copied from interface:MilvusClientDeletes vectors by date range, specified bydeleteByRangeParam- Specified by:
deleteByRangein interfaceMilvusClient- Parameters:
deleteByRangeParam- theDeleteByRangeParamobjectexample usage:
DeleteByRangeParam deleteByRangeParam = new DeleteByRangeParam.Builder(dateRange, tableName) .withTimeout(timeout) .build();- Returns:
Response- See Also:
DeleteByRangeParam,DateRange,Response
-
preloadTable
public Response preloadTable(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientPre-loads table to memory- Specified by:
preloadTablein interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
Response- See Also:
TableParam,Response
-
describeIndex
public DescribeIndexResponse describeIndex(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientDescribes table index specified bytableParam- Specified by:
describeIndexin interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
DescribeIndexResponse- See Also:
TableParam,DescribeIndexResponse,Index,Response
-
dropIndex
public Response dropIndex(@Nonnull TableParam tableParam)
Description copied from interface:MilvusClientDrops table index specified bytableParam- Specified by:
dropIndexin interfaceMilvusClient- Parameters:
tableParam- theTableParamobjectexample usage:
TableParam tableParam = new TableParam.Builder(tableName) .withTimeout(timeout) .build();- Returns:
dropIndex- See Also:
TableParam,Response
-
-