com.aliyun.sdk.service.gpdb20160503.models.CreateVectorIndexRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-gpdb20160503 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.gpdb20160503.models;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
* {@link CreateVectorIndexRequest} extends {@link RequestModel}
*
* CreateVectorIndexRequest
*/
public class CreateVectorIndexRequest extends Request {
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Collection")
@com.aliyun.core.annotation.Validation(required = true)
private String collection;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DBInstanceId")
@com.aliyun.core.annotation.Validation(required = true)
private String DBInstanceId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Dimension")
@com.aliyun.core.annotation.Validation(required = true)
private Integer dimension;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ExternalStorage")
private Integer externalStorage;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("HnswM")
@com.aliyun.core.annotation.Validation(maximum = 1000, minimum = 1)
private Integer hnswM;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ManagerAccount")
@com.aliyun.core.annotation.Validation(required = true)
private String managerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ManagerAccountPassword")
@com.aliyun.core.annotation.Validation(required = true)
private String managerAccountPassword;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Metrics")
private String metrics;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Namespace")
private String namespace;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerId")
private Long ownerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("PqEnable")
private Integer pqEnable;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("RegionId")
@com.aliyun.core.annotation.Validation(required = true)
private String regionId;
private CreateVectorIndexRequest(Builder builder) {
super(builder);
this.collection = builder.collection;
this.DBInstanceId = builder.DBInstanceId;
this.dimension = builder.dimension;
this.externalStorage = builder.externalStorage;
this.hnswM = builder.hnswM;
this.managerAccount = builder.managerAccount;
this.managerAccountPassword = builder.managerAccountPassword;
this.metrics = builder.metrics;
this.namespace = builder.namespace;
this.ownerId = builder.ownerId;
this.pqEnable = builder.pqEnable;
this.regionId = builder.regionId;
}
public static Builder builder() {
return new Builder();
}
public static CreateVectorIndexRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return collection
*/
public String getCollection() {
return this.collection;
}
/**
* @return DBInstanceId
*/
public String getDBInstanceId() {
return this.DBInstanceId;
}
/**
* @return dimension
*/
public Integer getDimension() {
return this.dimension;
}
/**
* @return externalStorage
*/
public Integer getExternalStorage() {
return this.externalStorage;
}
/**
* @return hnswM
*/
public Integer getHnswM() {
return this.hnswM;
}
/**
* @return managerAccount
*/
public String getManagerAccount() {
return this.managerAccount;
}
/**
* @return managerAccountPassword
*/
public String getManagerAccountPassword() {
return this.managerAccountPassword;
}
/**
* @return metrics
*/
public String getMetrics() {
return this.metrics;
}
/**
* @return namespace
*/
public String getNamespace() {
return this.namespace;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return pqEnable
*/
public Integer getPqEnable() {
return this.pqEnable;
}
/**
* @return regionId
*/
public String getRegionId() {
return this.regionId;
}
public static final class Builder extends Request.Builder {
private String collection;
private String DBInstanceId;
private Integer dimension;
private Integer externalStorage;
private Integer hnswM;
private String managerAccount;
private String managerAccountPassword;
private String metrics;
private String namespace;
private Long ownerId;
private Integer pqEnable;
private String regionId;
private Builder() {
super();
}
private Builder(CreateVectorIndexRequest request) {
super(request);
this.collection = request.collection;
this.DBInstanceId = request.DBInstanceId;
this.dimension = request.dimension;
this.externalStorage = request.externalStorage;
this.hnswM = request.hnswM;
this.managerAccount = request.managerAccount;
this.managerAccountPassword = request.managerAccountPassword;
this.metrics = request.metrics;
this.namespace = request.namespace;
this.ownerId = request.ownerId;
this.pqEnable = request.pqEnable;
this.regionId = request.regionId;
}
/**
* Collection.
*/
public Builder collection(String collection) {
this.putQueryParameter("Collection", collection);
this.collection = collection;
return this;
}
/**
* DBInstanceId.
*/
public Builder DBInstanceId(String DBInstanceId) {
this.putQueryParameter("DBInstanceId", DBInstanceId);
this.DBInstanceId = DBInstanceId;
return this;
}
/**
* Dimension.
*/
public Builder dimension(Integer dimension) {
this.putQueryParameter("Dimension", dimension);
this.dimension = dimension;
return this;
}
/**
* Specifies whether to use the memory mapping technology to create HNSW indexes. Valid values: 0 and 1. Default value: 0. We recommend that you set the value to 1 in scenarios that require upload speed but not data deletion.
*
*
* * 0: uses segmented paging storage to create indexes. This method uses the shared buffer of PostgreSQL for caching and supports the delete and update operations.
*
* * 1: uses the memory mapping technology to create indexes. This method does not support the delete or update operation.
*/
public Builder externalStorage(Integer externalStorage) {
this.putQueryParameter("ExternalStorage", externalStorage);
this.externalStorage = externalStorage;
return this;
}
/**
* The maximum number of neighbors for the Hierarchical Navigable Small World (HNSW) algorithm. Valid values: 1 to 1000. In most cases, this parameter is automatically configured based on the value of the Dimension parameter. You do not need to configure this parameter.
*
*
* > We recommend that you configure this parameter based on the value of the Dimension parameter.
*
* * If you set Dimension to a value less than or equal to 384, set the value of HnswM to 16.
*
* * If you set Dimension to a value greater than 384 and less than or equal to 768, set the value of HnswM to 32.
*
* * If you set Dimension to a value greater than 768 and less than or equal to 1024, set the value of HnswM to 64.
*
* * If you set Dimension to a value greater than 1024, set the value of HnswM to 128.
*/
public Builder hnswM(Integer hnswM) {
this.putQueryParameter("HnswM", hnswM);
this.hnswM = hnswM;
return this;
}
/**
* ManagerAccount.
*/
public Builder managerAccount(String managerAccount) {
this.putQueryParameter("ManagerAccount", managerAccount);
this.managerAccount = managerAccount;
return this;
}
/**
* ManagerAccountPassword.
*/
public Builder managerAccountPassword(String managerAccountPassword) {
this.putQueryParameter("ManagerAccountPassword", managerAccountPassword);
this.managerAccountPassword = managerAccountPassword;
return this;
}
/**
* The method that is used to create vector indexes.Valid values:
*
*
* - l2: Euclidean distance.
*
* - ip: inner product distance.
*
* - cosine: cosine similarity.
*/
public Builder metrics(String metrics) {
this.putQueryParameter("Metrics", metrics);
this.metrics = metrics;
return this;
}
/**
* Namespace.
*/
public Builder namespace(String namespace) {
this.putQueryParameter("Namespace", namespace);
this.namespace = namespace;
return this;
}
/**
* OwnerId.
*/
public Builder ownerId(Long ownerId) {
this.putQueryParameter("OwnerId", ownerId);
this.ownerId = ownerId;
return this;
}
/**
* Specifies whether to enable the product quantization (PQ) feature for index acceleration. We recommend that you enable this feature for more than 500,000 rows of data. Valid values:
*
*
* * 0: no.
* * 1 (default): yes.
*/
public Builder pqEnable(Integer pqEnable) {
this.putQueryParameter("PqEnable", pqEnable);
this.pqEnable = pqEnable;
return this;
}
/**
* RegionId.
*/
public Builder regionId(String regionId) {
this.putQueryParameter("RegionId", regionId);
this.regionId = regionId;
return this;
}
@Override
public CreateVectorIndexRequest build() {
return new CreateVectorIndexRequest(this);
}
}
}