Class QDrantHttpClientImpl
java.lang.Object
io.metaloom.qdrant.client.http.AbstractQDrantClient
io.metaloom.qdrant.client.http.impl.QDrantHttpClientImpl
- All Implemented Interfaces:
io.metaloom.qdrant.client.CommonSettings,ClientSettings,ClusterMethods,CollectionMethods,PointMethods,ServiceMethods,SnapshotMethods,QDrantHttpClient,AutoCloseable
Implementation for the
QDrantHttpClient-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class io.metaloom.qdrant.client.http.AbstractQDrantClient
connectTimeout, hostname, port, readTimeout, scheme, writeTimeout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QDrantHttpClientImpl.Builderbuilder()clearPayload(String collectionName, PointsClearPayloadRequest request, boolean wait) Remove all payload for specified points.voidclose()Close the client and release all resources.collectTelemetry(boolean anonymize) Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics.countPoints(String collectionName, PointCountRequest request) Count points which matches given filtering condition.createCollection(String collectionName, CollectionCreateRequest request) Create new collection with given parameters.createCollectionIndexField(String collectionName, CollectionCreateIndexFieldRequest request, boolean wait) Create index for field in collection.createCollectionSnapshot(String collectionName) Create new snapshot for a collection.Create new snapshot of the whole storage.deleteCollection(String collectionName, int timeout) Drop collection and all associated data.deleteCollectionIndexField(String collectionName, String fieldName, boolean wait) Delete field index for collection.deletePayload(String collectionName, PointDeletePayloadRequest request, boolean wait) Delete specified key payload for points.deletePoints(String collectionName, PointsDeleteRequest request, boolean wait) Delete points.downloadCollectionSnapshot(String collectionName, String snapshotName) Download specified snapshot from a collection as a file.downloadStorageSnapshot(String snapshotName) Download specified snapshot of the whole storage as a file.Get information about the current state and composition of the cluster.getCollectionClusterInfo(String collectionName) Get cluster information for a collection.Get lock options.okhttp3.OkHttpClientReturn the used OK HTTP client.Retrieve full information of single point by id.getPoints(String collectionName, PointsGetRequest request) Retrieve multiple points by specified IDs.voidinit()Get list name of all existing collections.listCollectionSnapshots(String collectionName) Get list of snapshots for a collectionGet list of snapshots of the whole storage.loadCollection(String collectionName) Get detailed information about specified existing collection.overwritePayload(String collectionName, PointOverwritePayloadRequest request, boolean wait) Replace full payload of points with new one.recommendBatchPoints(String collectionName, PointsRecommendBatchRequest request) Look for the points which are closer to stored positive examples and at the same time further to negative examples.recommendPoints(String collectionName, PointsRecommendRequest request) Look for the points which are closer to stored positive examples and at the same time further to negative examples.recoverSnapshot(String collectionName, SnapshotRecoverRequest request) Recover local collection data from a snapshot.removePeerFromCluster(String peerId, boolean force) Tries to remove peer from the cluster.scrollPoints(String collectionName, PointsScrollRequest request) Scroll request - paginate over all points which matches given filtering condition.searchBatchPoints(String collectionName, PointsSearchBatchRequest request) Retrieve by batch the closest points based on vector similarity and given filtering conditions.searchPoints(String collectionName, PointsSearchRequest request) Retrieve closest points based on vector similarity and given filtering conditions.setLockOptions(String errorMessage, boolean lockFlag) Set lock options.setPointPayload(String collectionName, PointSetPayloadRequest request, boolean wait) Set payload values for points.updateCollection(String collectionName, CollectionUpdateRequest request, int timeout) Update parameters of the existing collection.updateCollectionAliases(String collectionName, CollectionUpdateAliasesRequest request, int timeout) Update aliases of the collections.updateCollectionClusterSetup(String collectionName, CollectionUpdateClusterSetupRequest request) Update collection cluster setup.upsertPoints(String collectionName, PointsUpsertRequest request, boolean wait) Perform insert + updates on points.Methods inherited from class io.metaloom.qdrant.client.http.AbstractQDrantClient
getConnectTimeout, getHostname, getPort, getReadTimeout, getScheme, getWriteTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.metaloom.qdrant.client.http.method.PointMethods
getPoint, getPoint, getPoint
-
Field Details
-
log
public static final org.slf4j.Logger log
-
-
Constructor Details
-
QDrantHttpClientImpl
protected QDrantHttpClientImpl(String scheme, String hostname, int port, Duration connectTimeout, Duration readTimeout, Duration writeTimeout) Create a new client with a default timeout of 10s for all timeouts (connect, read and write).- Parameters:
scheme-hostname-port-connectTimeout-readTimeout-writeTimeout-
-
-
Method Details
-
builder
-
init
public void init() -
getOkHttpClient
public okhttp3.OkHttpClient getOkHttpClient()Return the used OK HTTP client.- Returns:
-
close
public void close()Description copied from interface:QDrantHttpClientClose the client and release all resources. -
getPoint
Description copied from interface:PointMethodsRetrieve full information of single point by id.- Returns:
-
getPoints
public QDrantClientRequest<PointsGetResponse> getPoints(String collectionName, PointsGetRequest request) Description copied from interface:PointMethodsRetrieve multiple points by specified IDs.- Returns:
-
upsertPoints
public QDrantClientRequest<UpdateResultResponse> upsertPoints(String collectionName, PointsUpsertRequest request, boolean wait) Description copied from interface:PointMethodsPerform insert + updates on points. If point with given ID already exists - it will be overwritten.- Returns:
-
deletePoints
public QDrantClientRequest<UpdateResultResponse> deletePoints(String collectionName, PointsDeleteRequest request, boolean wait) Description copied from interface:PointMethodsDelete points.- Returns:
-
setPointPayload
public QDrantClientRequest<UpdateResultResponse> setPointPayload(String collectionName, PointSetPayloadRequest request, boolean wait) Description copied from interface:PointMethodsSet payload values for points. This will merge the points payload and add new properties or update existing ones.- Returns:
-
overwritePayload
public QDrantClientRequest<UpdateResultResponse> overwritePayload(String collectionName, PointOverwritePayloadRequest request, boolean wait) Description copied from interface:PointMethodsReplace full payload of points with new one. This will overwrite the whole given payload with the new one. Existing properties will be remove.- Returns:
-
deletePayload
public QDrantClientRequest<UpdateResultResponse> deletePayload(String collectionName, PointDeletePayloadRequest request, boolean wait) Description copied from interface:PointMethodsDelete specified key payload for points. This will only delete the specified properties from the found payloads.- Returns:
-
clearPayload
public QDrantClientRequest<UpdateResultResponse> clearPayload(String collectionName, PointsClearPayloadRequest request, boolean wait) Description copied from interface:PointMethodsRemove all payload for specified points. Removes the whole payload from all selected points.- Returns:
-
scrollPoints
public QDrantClientRequest<PointsScrollResponse> scrollPoints(String collectionName, PointsScrollRequest request) Description copied from interface:PointMethodsScroll request - paginate over all points which matches given filtering condition.- Returns:
-
searchPoints
public QDrantClientRequest<PointsSearchResponse> searchPoints(String collectionName, PointsSearchRequest request) Description copied from interface:PointMethodsRetrieve closest points based on vector similarity and given filtering conditions.- Returns:
-
searchBatchPoints
public QDrantClientRequest<PointsSearchBatchResponse> searchBatchPoints(String collectionName, PointsSearchBatchRequest request) Description copied from interface:PointMethodsRetrieve by batch the closest points based on vector similarity and given filtering conditions.- Returns:
-
recommendPoints
public QDrantClientRequest<PointsRecommendResponse> recommendPoints(String collectionName, PointsRecommendRequest request) Description copied from interface:PointMethodsLook for the points which are closer to stored positive examples and at the same time further to negative examples.- Returns:
-
recommendBatchPoints
public QDrantClientRequest<PointsRecommendBatchResponse> recommendBatchPoints(String collectionName, PointsRecommendBatchRequest request) Description copied from interface:PointMethodsLook for the points which are closer to stored positive examples and at the same time further to negative examples.- Returns:
-
countPoints
public QDrantClientRequest<PointCountResponse> countPoints(String collectionName, PointCountRequest request) Description copied from interface:PointMethodsCount points which matches given filtering condition.- Returns:
-
getClusterStatusInfo
Description copied from interface:ClusterMethodsGet information about the current state and composition of the cluster.- Returns:
-
removePeerFromCluster
public QDrantClientRequest<GenericBooleanStatusResponse> removePeerFromCluster(String peerId, boolean force) Description copied from interface:ClusterMethodsTries to remove peer from the cluster. Will return an error if peer has shards on it.- Returns:
-
getCollectionClusterInfo
public QDrantClientRequest<CollectionClusterInfoResponse> getCollectionClusterInfo(String collectionName) Description copied from interface:ClusterMethodsGet cluster information for a collection.- Returns:
-
updateCollectionClusterSetup
public QDrantClientRequest<GenericBooleanStatusResponse> updateCollectionClusterSetup(String collectionName, CollectionUpdateClusterSetupRequest request) Description copied from interface:ClusterMethodsUpdate collection cluster setup.- Returns:
-
listCollectionSnapshots
Description copied from interface:SnapshotMethodsGet list of snapshots for a collection- Returns:
-
recoverSnapshot
public QDrantClientRequest<GenericBooleanStatusResponse> recoverSnapshot(String collectionName, SnapshotRecoverRequest request) Description copied from interface:SnapshotMethodsRecover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection.- Returns:
-
createCollectionSnapshot
Description copied from interface:SnapshotMethodsCreate new snapshot for a collection.- Returns:
-
downloadCollectionSnapshot
public QDrantClientRequest<QDrantBinaryResponse> downloadCollectionSnapshot(String collectionName, String snapshotName) Description copied from interface:SnapshotMethodsDownload specified snapshot from a collection as a file.- Returns:
-
listStorageSnapshots
Description copied from interface:SnapshotMethodsGet list of snapshots of the whole storage.- Returns:
-
createStorageSnapshot
Description copied from interface:SnapshotMethodsCreate new snapshot of the whole storage.- Returns:
-
downloadStorageSnapshot
Description copied from interface:SnapshotMethodsDownload specified snapshot of the whole storage as a file.- Returns:
-
collectTelemetry
Description copied from interface:ServiceMethodsCollect telemetry data including app info, system info, collections info, cluster info, configs and statistics.- Parameters:
anonymize- If true, anonymize result- Returns:
-
setLockOptions
public QDrantClientRequest<LockOptionResponse> setLockOptions(String errorMessage, boolean lockFlag) Description copied from interface:ServiceMethodsSet lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options.- Returns:
-
getLockOptions
Description copied from interface:ServiceMethodsGet lock options. If write is locked, all write operations and collection creation are forbidden.- Returns:
-
listCollections
Description copied from interface:CollectionMethodsGet list name of all existing collections.- Returns:
-
loadCollection
Description copied from interface:CollectionMethodsGet detailed information about specified existing collection.- Returns:
-
createCollection
public QDrantClientRequest<GenericBooleanStatusResponse> createCollection(String collectionName, CollectionCreateRequest request) Description copied from interface:CollectionMethodsCreate new collection with given parameters.- Returns:
-
updateCollection
public QDrantClientRequest<GenericBooleanStatusResponse> updateCollection(String collectionName, CollectionUpdateRequest request, int timeout) Description copied from interface:CollectionMethodsUpdate parameters of the existing collection.- Returns:
-
deleteCollection
public QDrantClientRequest<GenericBooleanStatusResponse> deleteCollection(String collectionName, int timeout) Description copied from interface:CollectionMethodsDrop collection and all associated data.- Returns:
-
updateCollectionAliases
public QDrantClientRequest<GenericBooleanStatusResponse> updateCollectionAliases(String collectionName, CollectionUpdateAliasesRequest request, int timeout) Description copied from interface:CollectionMethodsUpdate aliases of the collections.- Returns:
-
createCollectionIndexField
public QDrantClientRequest<CollectionIndexFieldResponse> createCollectionIndexField(String collectionName, CollectionCreateIndexFieldRequest request, boolean wait) Description copied from interface:CollectionMethodsCreate index for field in collection.- Returns:
-
deleteCollectionIndexField
public QDrantClientRequest<CollectionIndexFieldResponse> deleteCollectionIndexField(String collectionName, String fieldName, boolean wait) Description copied from interface:CollectionMethodsDelete field index for collection.- Returns:
-