Skip to content

Commit

Permalink
chore: 1.7.0 proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Dec 7, 2023
1 parent 5c18145 commit f8eed5c
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 23 deletions.
4 changes: 4 additions & 0 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ public Collections.CollectionClusterInfoResponse getCollectionClusterInfo(String
return collectionsStub.collectionClusterInfo(request);
}

public Collections.CreateShardKeyResponse createShardKey(Collections.CreateShardKeyRequest request) {
return collectionsStub.createShardKey(request);
}

/**
* Updates the cluster setup for a collection.
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/qdrant/client/utils/PointUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/** Utility class for working with Points. */
Expand Down
88 changes: 84 additions & 4 deletions src/main/proto/collections.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";
package qdrant;

option csharp_namespace = "Qdrant.Client.Grpc";
option java_package = "io.qdrant.client.grpc";

message VectorParams {
Expand Down Expand Up @@ -39,6 +39,14 @@ message VectorsConfigDiff {
}
}

message SparseVectorParams {
optional SparseIndexConfig index = 1; // Configuration of sparse index
}

message SparseVectorConfig {
map<string, SparseVectorParams> map = 1;
}

message GetCollectionInfoRequest {
string collection_name = 1; // Name of the collection
}
Expand All @@ -65,6 +73,7 @@ enum Distance {
Cosine = 1;
Euclid = 2;
Dot = 3;
Manhattan = 4;
}

enum CollectionStatus {
Expand Down Expand Up @@ -132,6 +141,18 @@ message HnswConfigDiff {
optional uint64 payload_m = 6;
}

message SparseIndexConfig {
/*
Prefer a full scan search upto (excluding) this number of vectors.
Note: this is number of vectors, not KiloBytes.
*/
optional uint64 full_scan_threshold = 1;
/*
Store inverted index on disk. If set to false, the index will be stored in RAM.
*/
optional bool on_disk = 2;
}

message WalConfigDiff {
optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file
optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance
Expand Down Expand Up @@ -235,6 +256,11 @@ message QuantizationConfigDiff {
}
}

enum ShardingMethod {
Auto = 0; // Auto-sharding based on record ids
Custom = 1; // Shard by user-defined key
}

message CreateCollection {
string collection_name = 1; // Name of the collection
reserved 2; // Deprecated
Expand All @@ -250,6 +276,8 @@ message CreateCollection {
optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1
optional string init_from_collection = 13; // Specify name of the other collection to copy data from
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
optional ShardingMethod sharding_method = 15; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
}

message UpdateCollection {
Expand All @@ -260,6 +288,7 @@ message UpdateCollection {
optional HnswConfigDiff hnsw_config = 5; // New HNSW parameters for the collection index
optional VectorsConfigDiff vectors_config = 6; // New vector parameters
optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector
optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters
}

message DeleteCollection {
Expand All @@ -281,6 +310,8 @@ message CollectionParams {
optional uint32 replication_factor = 6; // Number of replicas of each shard that network tries to maintain
optional uint32 write_consistency_factor = 7; // How many replicas should apply the operation for us to consider it successful
optional uint32 read_fan_out_factor = 8; // Fan-out every read request to these many additional remote nodes (and return first available response)
optional ShardingMethod sharding_method = 9; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 10; // Configuration for sparse vectors
}

message CollectionParamsDiff {
Expand Down Expand Up @@ -328,14 +359,14 @@ message PayloadSchemaInfo {
message CollectionInfo {
CollectionStatus status = 1; // operating condition of the collection
OptimizerStatus optimizer_status = 2; // status of collection optimizers
uint64 vectors_count = 3; // number of vectors in the collection
optional uint64 vectors_count = 3; // Approximate number of vectors in the collection
uint64 segments_count = 4; // Number of independent segments
reserved 5; // Deprecated
reserved 6; // Deprecated
CollectionConfig config = 7; // Configuration
map<string, PayloadSchemaInfo> payload_schema = 8; // Collection data types
uint64 points_count = 9; // number of points in the collection
optional uint64 indexed_vectors_count = 10; // number of indexed vectors in the collection.
optional uint64 points_count = 9; // Approximate number of points in the collection
optional uint64 indexed_vectors_count = 10; // Approximate number of indexed vectors in the collection.
}

message ChangeAliases {
Expand Down Expand Up @@ -392,18 +423,28 @@ enum ReplicaState {
Partial = 2; // The shard is partially loaded and is currently receiving data from other shards
Initializing = 3; // Collection is being created
Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards
PartialSnapshot = 5; // Snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
}

message ShardKey {
oneof key {
string keyword = 1; // String key
uint64 number = 2; // Number key
}
}

message LocalShardInfo {
uint32 shard_id = 1; // Local shard id
uint64 points_count = 2; // Number of points in the shard
ReplicaState state = 3; // Is replica active
optional ShardKey shard_key = 4; // User-defined shard key
}

message RemoteShardInfo {
uint32 shard_id = 1; // Local shard id
uint64 peer_id = 2; // Remote peer id
ReplicaState state = 3; // Is replica active
optional ShardKey shard_key = 4; // User-defined shard key
}

message ShardTransferInfo {
Expand All @@ -425,24 +466,63 @@ message MoveShard {
uint32 shard_id = 1; // Local shard id
uint64 from_peer_id = 2;
uint64 to_peer_id = 3;
optional ShardTransferMethod method = 4;
}

enum ShardTransferMethod {
StreamRecords = 0;
Snapshot = 1;
}

message Replica {
uint32 shard_id = 1;
uint64 peer_id = 2;
}

message CreateShardKey {
ShardKey shard_key = 1; // User-defined shard key
optional uint32 shards_number = 2; // Number of shards to create per shard key
optional uint32 replication_factor = 3; // Number of replicas of each shard to create
repeated uint64 placement = 4; // List of peer ids, allowed to create shards. If empty - all peers are allowed
}

message DeleteShardKey {
ShardKey shard_key = 1; // Shard key to delete
}

message UpdateCollectionClusterSetupRequest {
string collection_name = 1; // Name of the collection
oneof operation {
MoveShard move_shard = 2;
MoveShard replicate_shard = 3;
MoveShard abort_transfer = 4;
Replica drop_replica = 5;
CreateShardKey create_shard_key = 7;
DeleteShardKey delete_shard_key = 8;
}
optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message UpdateCollectionClusterSetupResponse {
bool result = 1;
}

message CreateShardKeyRequest {
string collection_name = 1; // Name of the collection
CreateShardKey request = 2; // Request to create shard key
optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message DeleteShardKeyRequest {
string collection_name = 1; // Name of the collection
DeleteShardKey request = 2; // Request to delete shard key
optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message CreateShardKeyResponse {
bool result = 1;
}

message DeleteShardKeyResponse {
bool result = 1;
}
12 changes: 10 additions & 2 deletions src/main/proto/collections_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

import "collections.proto";

option java_package = "io.qdrant.client.grpc";

package qdrant;
option csharp_namespace = "Qdrant.Client.Grpc";
option java_package = "io.qdrant.client.grpc";

service Collections {
/*
Expand Down Expand Up @@ -47,4 +47,12 @@ service Collections {
Update cluster setup for a collection
*/
rpc UpdateCollectionClusterSetup (UpdateCollectionClusterSetupRequest) returns (UpdateCollectionClusterSetupResponse) {}
/*
Create shard key
*/
rpc CreateShardKey (CreateShardKeyRequest) returns (CreateShardKeyResponse) {}
/*
Delete shard key
*/
rpc DeleteShardKey (DeleteShardKeyRequest) returns (DeleteShardKeyResponse) {}
}
2 changes: 1 addition & 1 deletion src/main/proto/json_with_int.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
syntax = "proto3";

package qdrant;

option csharp_namespace = "Qdrant.Client.Grpc";
option java_package = "io.qdrant.client.grpc";

// `Struct` represents a structured data value, consisting of fields
Expand Down
Loading

0 comments on commit f8eed5c

Please sign in to comment.