From 017138ae49b370a0cd460737e30662abb855851d Mon Sep 17 00:00:00 2001 From: Weili Gu <3451471+weiligu@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:11:46 -0700 Subject: [PATCH] [ENH] last compaction time (#1856) ## Description of changes https://linear.app/trychroma/issue/CHR-366/add-api-to-get-tenant-last-compaction-time Add functionalities to set and get tenants' last compaction time. ## Test plan - [ ] tenant_database_service_test.go - [ ] tenant_test.go --- chromadb/proto/chroma_pb2.py | 4 +- chromadb/proto/coordinator_pb2.py | 16 +- chromadb/proto/coordinator_pb2.pyi | 26 + chromadb/proto/coordinator_pb2_grpc.py | 849 +++++++++++------- chromadb/proto/logservice_pb2.py | 4 +- ...{20240309204515.sql => 20240309223050.sql} | 1 + go/migrations/atlas.sum | 4 +- go/pkg/coordinator/apis.go | 11 + .../grpc/tenant_database_service.go | 30 + .../grpc/tenant_database_service_test.go | 108 +++ go/pkg/metastore/catalog.go | 3 + go/pkg/metastore/coordinator/table_catalog.go | 20 +- go/pkg/metastore/db/dao/collection_test.go | 15 +- go/pkg/metastore/db/dao/tenant.go | 30 + go/pkg/metastore/db/dao/tenant_test.go | 101 +++ go/pkg/metastore/db/dbcore/core.go | 10 +- go/pkg/metastore/db/dbmodel/tenant.go | 13 +- go/pkg/model/tenant.go | 5 + go/pkg/proto/coordinatorpb/chroma.pb.go | 2 +- go/pkg/proto/coordinatorpb/coordinator.pb.go | 621 +++++++++---- .../coordinatorpb/coordinator_grpc.pb.go | 72 ++ go/pkg/proto/logservicepb/logservice.pb.go | 2 +- idl/chromadb/proto/coordinator.proto | 19 + 23 files changed, 1468 insertions(+), 498 deletions(-) rename go/migrations/{20240309204515.sql => 20240309223050.sql} (98%) create mode 100644 go/pkg/coordinator/grpc/tenant_database_service_test.go create mode 100644 go/pkg/metastore/db/dao/tenant_test.go diff --git a/chromadb/proto/chroma_pb2.py b/chromadb/proto/chroma_pb2.py index a12f8713439..48b64144192 100644 --- a/chromadb/proto/chroma_pb2.py +++ b/chromadb/proto/chroma_pb2.py @@ -13,14 +13,14 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x63hromadb/proto/chroma.proto\x12\x06\x63hroma\"&\n\x06Status\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"U\n\x06Vector\x12\x11\n\tdimension\x18\x01 \x01(\x05\x12\x0e\n\x06vector\x18\x02 \x01(\x0c\x12(\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x16.chroma.ScalarEncoding\"\xca\x01\n\x07Segment\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12#\n\x05scope\x18\x03 \x01(\x0e\x32\x14.chroma.SegmentScope\x12\x12\n\x05topic\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncollection\x18\x05 \x01(\tH\x01\x88\x01\x01\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x02\x88\x01\x01\x42\x08\n\x06_topicB\r\n\x0b_collectionB\x0b\n\t_metadata\"\xb9\x01\n\nCollection\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05topic\x18\x03 \x01(\t\x12-\n\x08metadata\x18\x04 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x88\x01\x01\x12\x16\n\tdimension\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x0e\n\x06tenant\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\tB\x0b\n\t_metadataB\x0c\n\n_dimension\"4\n\x08\x44\x61tabase\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\"\x16\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\"b\n\x13UpdateMetadataValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x03 \x01(\x01H\x00\x42\x07\n\x05value\"\x96\x01\n\x0eUpdateMetadata\x12\x36\n\x08metadata\x18\x01 \x03(\x0b\x32$.chroma.UpdateMetadata.MetadataEntry\x1aL\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.chroma.UpdateMetadataValue:\x02\x38\x01\"\xcc\x01\n\x15SubmitEmbeddingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12#\n\x06vector\x18\x02 \x01(\x0b\x32\x0e.chroma.VectorH\x00\x88\x01\x01\x12-\n\x08metadata\x18\x03 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x01\x88\x01\x01\x12$\n\toperation\x18\x04 \x01(\x0e\x32\x11.chroma.Operation\x12\x15\n\rcollection_id\x18\x05 \x01(\tB\t\n\x07_vectorB\x0b\n\t_metadata\"S\n\x15VectorEmbeddingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06seq_id\x18\x02 \x01(\x0c\x12\x1e\n\x06vector\x18\x03 \x01(\x0b\x32\x0e.chroma.Vector\"q\n\x11VectorQueryResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06seq_id\x18\x02 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x03 \x01(\x02\x12#\n\x06vector\x18\x04 \x01(\x0b\x32\x0e.chroma.VectorH\x00\x88\x01\x01\x42\t\n\x07_vector\"@\n\x12VectorQueryResults\x12*\n\x07results\x18\x01 \x03(\x0b\x32\x19.chroma.VectorQueryResult\"4\n\x11GetVectorsRequest\x12\x0b\n\x03ids\x18\x01 \x03(\t\x12\x12\n\nsegment_id\x18\x02 \x01(\t\"D\n\x12GetVectorsResponse\x12.\n\x07records\x18\x01 \x03(\x0b\x32\x1d.chroma.VectorEmbeddingRecord\"\x86\x01\n\x13QueryVectorsRequest\x12\x1f\n\x07vectors\x18\x01 \x03(\x0b\x32\x0e.chroma.Vector\x12\t\n\x01k\x18\x02 \x01(\x05\x12\x13\n\x0b\x61llowed_ids\x18\x03 \x03(\t\x12\x1a\n\x12include_embeddings\x18\x04 \x01(\x08\x12\x12\n\nsegment_id\x18\x05 \x01(\t\"C\n\x14QueryVectorsResponse\x12+\n\x07results\x18\x01 \x03(\x0b\x32\x1a.chroma.VectorQueryResults*8\n\tOperation\x12\x07\n\x03\x41\x44\x44\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06UPSERT\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03*(\n\x0eScalarEncoding\x12\x0b\n\x07\x46LOAT32\x10\x00\x12\t\n\x05INT32\x10\x01*(\n\x0cSegmentScope\x12\n\n\x06VECTOR\x10\x00\x12\x0c\n\x08METADATA\x10\x01\x32\xa2\x01\n\x0cVectorReader\x12\x45\n\nGetVectors\x12\x19.chroma.GetVectorsRequest\x1a\x1a.chroma.GetVectorsResponse\"\x00\x12K\n\x0cQueryVectors\x12\x1b.chroma.QueryVectorsRequest\x1a\x1c.chroma.QueryVectorsResponse\"\x00\x42\x43ZAgithub.com/chroma/chroma-coordinator/internal/proto/coordinatorpbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x63hromadb/proto/chroma.proto\x12\x06\x63hroma\"&\n\x06Status\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"U\n\x06Vector\x12\x11\n\tdimension\x18\x01 \x01(\x05\x12\x0e\n\x06vector\x18\x02 \x01(\x0c\x12(\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x16.chroma.ScalarEncoding\"\xca\x01\n\x07Segment\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12#\n\x05scope\x18\x03 \x01(\x0e\x32\x14.chroma.SegmentScope\x12\x12\n\x05topic\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncollection\x18\x05 \x01(\tH\x01\x88\x01\x01\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x02\x88\x01\x01\x42\x08\n\x06_topicB\r\n\x0b_collectionB\x0b\n\t_metadata\"\xb9\x01\n\nCollection\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05topic\x18\x03 \x01(\t\x12-\n\x08metadata\x18\x04 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x88\x01\x01\x12\x16\n\tdimension\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x0e\n\x06tenant\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\tB\x0b\n\t_metadataB\x0c\n\n_dimension\"4\n\x08\x44\x61tabase\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\"\x16\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\"b\n\x13UpdateMetadataValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x03 \x01(\x01H\x00\x42\x07\n\x05value\"\x96\x01\n\x0eUpdateMetadata\x12\x36\n\x08metadata\x18\x01 \x03(\x0b\x32$.chroma.UpdateMetadata.MetadataEntry\x1aL\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.chroma.UpdateMetadataValue:\x02\x38\x01\"\xcc\x01\n\x15SubmitEmbeddingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12#\n\x06vector\x18\x02 \x01(\x0b\x32\x0e.chroma.VectorH\x00\x88\x01\x01\x12-\n\x08metadata\x18\x03 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x01\x88\x01\x01\x12$\n\toperation\x18\x04 \x01(\x0e\x32\x11.chroma.Operation\x12\x15\n\rcollection_id\x18\x05 \x01(\tB\t\n\x07_vectorB\x0b\n\t_metadata\"S\n\x15VectorEmbeddingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06seq_id\x18\x02 \x01(\x0c\x12\x1e\n\x06vector\x18\x03 \x01(\x0b\x32\x0e.chroma.Vector\"q\n\x11VectorQueryResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06seq_id\x18\x02 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x03 \x01(\x02\x12#\n\x06vector\x18\x04 \x01(\x0b\x32\x0e.chroma.VectorH\x00\x88\x01\x01\x42\t\n\x07_vector\"@\n\x12VectorQueryResults\x12*\n\x07results\x18\x01 \x03(\x0b\x32\x19.chroma.VectorQueryResult\"4\n\x11GetVectorsRequest\x12\x0b\n\x03ids\x18\x01 \x03(\t\x12\x12\n\nsegment_id\x18\x02 \x01(\t\"D\n\x12GetVectorsResponse\x12.\n\x07records\x18\x01 \x03(\x0b\x32\x1d.chroma.VectorEmbeddingRecord\"\x86\x01\n\x13QueryVectorsRequest\x12\x1f\n\x07vectors\x18\x01 \x03(\x0b\x32\x0e.chroma.Vector\x12\t\n\x01k\x18\x02 \x01(\x05\x12\x13\n\x0b\x61llowed_ids\x18\x03 \x03(\t\x12\x1a\n\x12include_embeddings\x18\x04 \x01(\x08\x12\x12\n\nsegment_id\x18\x05 \x01(\t\"C\n\x14QueryVectorsResponse\x12+\n\x07results\x18\x01 \x03(\x0b\x32\x1a.chroma.VectorQueryResults*8\n\tOperation\x12\x07\n\x03\x41\x44\x44\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06UPSERT\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03*(\n\x0eScalarEncoding\x12\x0b\n\x07\x46LOAT32\x10\x00\x12\t\n\x05INT32\x10\x01*(\n\x0cSegmentScope\x12\n\n\x06VECTOR\x10\x00\x12\x0c\n\x08METADATA\x10\x01\x32\xa2\x01\n\x0cVectorReader\x12\x45\n\nGetVectors\x12\x19.chroma.GetVectorsRequest\x1a\x1a.chroma.GetVectorsResponse\"\x00\x12K\n\x0cQueryVectors\x12\x1b.chroma.QueryVectorsRequest\x1a\x1c.chroma.QueryVectorsResponse\"\x00\x42:Z8github.com/chroma-core/chroma/go/pkg/proto/coordinatorpbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chromadb.proto.chroma_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'ZAgithub.com/chroma/chroma-coordinator/internal/proto/coordinatorpb' + DESCRIPTOR._serialized_options = b'Z8github.com/chroma-core/chroma/go/pkg/proto/coordinatorpb' _UPDATEMETADATA_METADATAENTRY._options = None _UPDATEMETADATA_METADATAENTRY._serialized_options = b'8\001' _globals['_OPERATION']._serialized_start=1693 diff --git a/chromadb/proto/coordinator_pb2.py b/chromadb/proto/coordinator_pb2.py index d18ae05ada4..301c1c2f4f7 100644 --- a/chromadb/proto/coordinator_pb2.py +++ b/chromadb/proto/coordinator_pb2.py @@ -15,14 +15,14 @@ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n chromadb/proto/coordinator.proto\x12\x06\x63hroma\x1a\x1b\x63hromadb/proto/chroma.proto\x1a\x1bgoogle/protobuf/empty.proto\"A\n\x15\x43reateDatabaseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\"8\n\x16\x43reateDatabaseResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"2\n\x12GetDatabaseRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\"Y\n\x13GetDatabaseResponse\x12\"\n\x08\x64\x61tabase\x18\x01 \x01(\x0b\x32\x10.chroma.Database\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"#\n\x13\x43reateTenantRequest\x12\x0c\n\x04name\x18\x02 \x01(\t\"6\n\x14\x43reateTenantResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\" \n\x10GetTenantRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"S\n\x11GetTenantResponse\x12\x1e\n\x06tenant\x18\x01 \x01(\x0b\x32\x0e.chroma.Tenant\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"8\n\x14\x43reateSegmentRequest\x12 \n\x07segment\x18\x01 \x01(\x0b\x32\x0f.chroma.Segment\"7\n\x15\x43reateSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\"\n\x14\x44\x65leteSegmentRequest\x12\n\n\x02id\x18\x01 \x01(\t\"7\n\x15\x44\x65leteSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\xc2\x01\n\x12GetSegmentsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04type\x18\x02 \x01(\tH\x01\x88\x01\x01\x12(\n\x05scope\x18\x03 \x01(\x0e\x32\x14.chroma.SegmentScopeH\x02\x88\x01\x01\x12\x12\n\x05topic\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x17\n\ncollection\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_typeB\x08\n\x06_scopeB\x08\n\x06_topicB\r\n\x0b_collection\"X\n\x13GetSegmentsResponse\x12!\n\x08segments\x18\x01 \x03(\x0b\x32\x0f.chroma.Segment\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"\xfa\x01\n\x14UpdateSegmentRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x05topic\x18\x02 \x01(\tH\x00\x12\x15\n\x0breset_topic\x18\x03 \x01(\x08H\x00\x12\x14\n\ncollection\x18\x04 \x01(\tH\x01\x12\x1a\n\x10reset_collection\x18\x05 \x01(\x08H\x01\x12*\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x02\x12\x18\n\x0ereset_metadata\x18\x07 \x01(\x08H\x02\x42\x0e\n\x0ctopic_updateB\x13\n\x11\x63ollection_updateB\x11\n\x0fmetadata_update\"7\n\x15UpdateSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\xe5\x01\n\x17\x43reateCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12-\n\x08metadata\x18\x03 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x88\x01\x01\x12\x16\n\tdimension\x18\x04 \x01(\x05H\x01\x88\x01\x01\x12\x1a\n\rget_or_create\x18\x05 \x01(\x08H\x02\x88\x01\x01\x12\x0e\n\x06tenant\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\tB\x0b\n\t_metadataB\x0c\n\n_dimensionB\x10\n\x0e_get_or_create\"s\n\x18\x43reateCollectionResponse\x12&\n\ncollection\x18\x01 \x01(\x0b\x32\x12.chroma.Collection\x12\x0f\n\x07\x63reated\x18\x02 \x01(\x08\x12\x1e\n\x06status\x18\x03 \x01(\x0b\x32\x0e.chroma.Status\"G\n\x17\x44\x65leteCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x03 \x01(\t\":\n\x18\x44\x65leteCollectionResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\x8b\x01\n\x15GetCollectionsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04name\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05topic\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x0e\n\x06tenant\x18\x04 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x05 \x01(\tB\x05\n\x03_idB\x07\n\x05_nameB\x08\n\x06_topic\"a\n\x16GetCollectionsResponse\x12\'\n\x0b\x63ollections\x18\x01 \x03(\x0b\x32\x12.chroma.Collection\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"\xde\x01\n\x17UpdateCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\x05topic\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04name\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tdimension\x18\x04 \x01(\x05H\x03\x88\x01\x01\x12*\n\x08metadata\x18\x05 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x12\x18\n\x0ereset_metadata\x18\x06 \x01(\x08H\x00\x42\x11\n\x0fmetadata_updateB\x08\n\x06_topicB\x07\n\x05_nameB\x0c\n\n_dimension\":\n\x18UpdateCollectionResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"O\n\x0cNotification\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x15\n\rcollection_id\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\"4\n\x12ResetStateResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status2\x91\x08\n\x05SysDB\x12Q\n\x0e\x43reateDatabase\x12\x1d.chroma.CreateDatabaseRequest\x1a\x1e.chroma.CreateDatabaseResponse\"\x00\x12H\n\x0bGetDatabase\x12\x1a.chroma.GetDatabaseRequest\x1a\x1b.chroma.GetDatabaseResponse\"\x00\x12K\n\x0c\x43reateTenant\x12\x1b.chroma.CreateTenantRequest\x1a\x1c.chroma.CreateTenantResponse\"\x00\x12\x42\n\tGetTenant\x12\x18.chroma.GetTenantRequest\x1a\x19.chroma.GetTenantResponse\"\x00\x12N\n\rCreateSegment\x12\x1c.chroma.CreateSegmentRequest\x1a\x1d.chroma.CreateSegmentResponse\"\x00\x12N\n\rDeleteSegment\x12\x1c.chroma.DeleteSegmentRequest\x1a\x1d.chroma.DeleteSegmentResponse\"\x00\x12H\n\x0bGetSegments\x12\x1a.chroma.GetSegmentsRequest\x1a\x1b.chroma.GetSegmentsResponse\"\x00\x12N\n\rUpdateSegment\x12\x1c.chroma.UpdateSegmentRequest\x1a\x1d.chroma.UpdateSegmentResponse\"\x00\x12W\n\x10\x43reateCollection\x12\x1f.chroma.CreateCollectionRequest\x1a .chroma.CreateCollectionResponse\"\x00\x12W\n\x10\x44\x65leteCollection\x12\x1f.chroma.DeleteCollectionRequest\x1a .chroma.DeleteCollectionResponse\"\x00\x12Q\n\x0eGetCollections\x12\x1d.chroma.GetCollectionsRequest\x1a\x1e.chroma.GetCollectionsResponse\"\x00\x12W\n\x10UpdateCollection\x12\x1f.chroma.UpdateCollectionRequest\x1a .chroma.UpdateCollectionResponse\"\x00\x12\x42\n\nResetState\x12\x16.google.protobuf.Empty\x1a\x1a.chroma.ResetStateResponse\"\x00\x42\x43ZAgithub.com/chroma/chroma-coordinator/internal/proto/coordinatorpbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n chromadb/proto/coordinator.proto\x12\x06\x63hroma\x1a\x1b\x63hromadb/proto/chroma.proto\x1a\x1bgoogle/protobuf/empty.proto\"A\n\x15\x43reateDatabaseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\"8\n\x16\x43reateDatabaseResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"2\n\x12GetDatabaseRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\"Y\n\x13GetDatabaseResponse\x12\"\n\x08\x64\x61tabase\x18\x01 \x01(\x0b\x32\x10.chroma.Database\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"#\n\x13\x43reateTenantRequest\x12\x0c\n\x04name\x18\x02 \x01(\t\"6\n\x14\x43reateTenantResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\" \n\x10GetTenantRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"S\n\x11GetTenantResponse\x12\x1e\n\x06tenant\x18\x01 \x01(\x0b\x32\x0e.chroma.Tenant\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"8\n\x14\x43reateSegmentRequest\x12 \n\x07segment\x18\x01 \x01(\x0b\x32\x0f.chroma.Segment\"7\n\x15\x43reateSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\"\n\x14\x44\x65leteSegmentRequest\x12\n\n\x02id\x18\x01 \x01(\t\"7\n\x15\x44\x65leteSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\xc2\x01\n\x12GetSegmentsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04type\x18\x02 \x01(\tH\x01\x88\x01\x01\x12(\n\x05scope\x18\x03 \x01(\x0e\x32\x14.chroma.SegmentScopeH\x02\x88\x01\x01\x12\x12\n\x05topic\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x17\n\ncollection\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_typeB\x08\n\x06_scopeB\x08\n\x06_topicB\r\n\x0b_collection\"X\n\x13GetSegmentsResponse\x12!\n\x08segments\x18\x01 \x03(\x0b\x32\x0f.chroma.Segment\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"\xfa\x01\n\x14UpdateSegmentRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x05topic\x18\x02 \x01(\tH\x00\x12\x15\n\x0breset_topic\x18\x03 \x01(\x08H\x00\x12\x14\n\ncollection\x18\x04 \x01(\tH\x01\x12\x1a\n\x10reset_collection\x18\x05 \x01(\x08H\x01\x12*\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x02\x12\x18\n\x0ereset_metadata\x18\x07 \x01(\x08H\x02\x42\x0e\n\x0ctopic_updateB\x13\n\x11\x63ollection_updateB\x11\n\x0fmetadata_update\"7\n\x15UpdateSegmentResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\xe5\x01\n\x17\x43reateCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12-\n\x08metadata\x18\x03 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x88\x01\x01\x12\x16\n\tdimension\x18\x04 \x01(\x05H\x01\x88\x01\x01\x12\x1a\n\rget_or_create\x18\x05 \x01(\x08H\x02\x88\x01\x01\x12\x0e\n\x06tenant\x18\x06 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x07 \x01(\tB\x0b\n\t_metadataB\x0c\n\n_dimensionB\x10\n\x0e_get_or_create\"s\n\x18\x43reateCollectionResponse\x12&\n\ncollection\x18\x01 \x01(\x0b\x32\x12.chroma.Collection\x12\x0f\n\x07\x63reated\x18\x02 \x01(\x08\x12\x1e\n\x06status\x18\x03 \x01(\x0b\x32\x0e.chroma.Status\"G\n\x17\x44\x65leteCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x03 \x01(\t\":\n\x18\x44\x65leteCollectionResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"\x8b\x01\n\x15GetCollectionsRequest\x12\x0f\n\x02id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04name\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05topic\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x0e\n\x06tenant\x18\x04 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x05 \x01(\tB\x05\n\x03_idB\x07\n\x05_nameB\x08\n\x06_topic\"a\n\x16GetCollectionsResponse\x12\'\n\x0b\x63ollections\x18\x01 \x03(\x0b\x32\x12.chroma.Collection\x12\x1e\n\x06status\x18\x02 \x01(\x0b\x32\x0e.chroma.Status\"\xde\x01\n\x17UpdateCollectionRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\x05topic\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04name\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tdimension\x18\x04 \x01(\x05H\x03\x88\x01\x01\x12*\n\x08metadata\x18\x05 \x01(\x0b\x32\x16.chroma.UpdateMetadataH\x00\x12\x18\n\x0ereset_metadata\x18\x06 \x01(\x08H\x00\x42\x11\n\x0fmetadata_updateB\x08\n\x06_topicB\x07\n\x05_nameB\x0c\n\n_dimension\":\n\x18UpdateCollectionResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\"O\n\x0cNotification\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x15\n\rcollection_id\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\"4\n\x12ResetStateResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0b\x32\x0e.chroma.Status\":\n%GetLastCompactionTimeForTenantRequest\x12\x11\n\ttenant_id\x18\x01 \x03(\t\"K\n\x18TenantLastCompactionTime\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x1c\n\x14last_compaction_time\x18\x02 \x01(\x03\"o\n&GetLastCompactionTimeForTenantResponse\x12\x45\n\x1btenant_last_compaction_time\x18\x01 \x03(\x0b\x32 .chroma.TenantLastCompactionTime\"n\n%SetLastCompactionTimeForTenantRequest\x12\x45\n\x1btenant_last_compaction_time\x18\x01 \x01(\x0b\x32 .chroma.TenantLastCompactionTime2\x80\n\n\x05SysDB\x12Q\n\x0e\x43reateDatabase\x12\x1d.chroma.CreateDatabaseRequest\x1a\x1e.chroma.CreateDatabaseResponse\"\x00\x12H\n\x0bGetDatabase\x12\x1a.chroma.GetDatabaseRequest\x1a\x1b.chroma.GetDatabaseResponse\"\x00\x12K\n\x0c\x43reateTenant\x12\x1b.chroma.CreateTenantRequest\x1a\x1c.chroma.CreateTenantResponse\"\x00\x12\x42\n\tGetTenant\x12\x18.chroma.GetTenantRequest\x1a\x19.chroma.GetTenantResponse\"\x00\x12N\n\rCreateSegment\x12\x1c.chroma.CreateSegmentRequest\x1a\x1d.chroma.CreateSegmentResponse\"\x00\x12N\n\rDeleteSegment\x12\x1c.chroma.DeleteSegmentRequest\x1a\x1d.chroma.DeleteSegmentResponse\"\x00\x12H\n\x0bGetSegments\x12\x1a.chroma.GetSegmentsRequest\x1a\x1b.chroma.GetSegmentsResponse\"\x00\x12N\n\rUpdateSegment\x12\x1c.chroma.UpdateSegmentRequest\x1a\x1d.chroma.UpdateSegmentResponse\"\x00\x12W\n\x10\x43reateCollection\x12\x1f.chroma.CreateCollectionRequest\x1a .chroma.CreateCollectionResponse\"\x00\x12W\n\x10\x44\x65leteCollection\x12\x1f.chroma.DeleteCollectionRequest\x1a .chroma.DeleteCollectionResponse\"\x00\x12Q\n\x0eGetCollections\x12\x1d.chroma.GetCollectionsRequest\x1a\x1e.chroma.GetCollectionsResponse\"\x00\x12W\n\x10UpdateCollection\x12\x1f.chroma.UpdateCollectionRequest\x1a .chroma.UpdateCollectionResponse\"\x00\x12\x42\n\nResetState\x12\x16.google.protobuf.Empty\x1a\x1a.chroma.ResetStateResponse\"\x00\x12\x81\x01\n\x1eGetLastCompactionTimeForTenant\x12-.chroma.GetLastCompactionTimeForTenantRequest\x1a..chroma.GetLastCompactionTimeForTenantResponse\"\x00\x12i\n\x1eSetLastCompactionTimeForTenant\x12-.chroma.SetLastCompactionTimeForTenantRequest\x1a\x16.google.protobuf.Empty\"\x00\x42:Z8github.com/chroma-core/chroma/go/pkg/proto/coordinatorpbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chromadb.proto.coordinator_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'ZAgithub.com/chroma/chroma-coordinator/internal/proto/coordinatorpb' + DESCRIPTOR._serialized_options = b'Z8github.com/chroma-core/chroma/go/pkg/proto/coordinatorpb' _globals['_CREATEDATABASEREQUEST']._serialized_start=102 _globals['_CREATEDATABASEREQUEST']._serialized_end=167 _globals['_CREATEDATABASERESPONSE']._serialized_start=169 @@ -75,6 +75,14 @@ _globals['_NOTIFICATION']._serialized_end=2474 _globals['_RESETSTATERESPONSE']._serialized_start=2476 _globals['_RESETSTATERESPONSE']._serialized_end=2528 - _globals['_SYSDB']._serialized_start=2531 - _globals['_SYSDB']._serialized_end=3572 + _globals['_GETLASTCOMPACTIONTIMEFORTENANTREQUEST']._serialized_start=2530 + _globals['_GETLASTCOMPACTIONTIMEFORTENANTREQUEST']._serialized_end=2588 + _globals['_TENANTLASTCOMPACTIONTIME']._serialized_start=2590 + _globals['_TENANTLASTCOMPACTIONTIME']._serialized_end=2665 + _globals['_GETLASTCOMPACTIONTIMEFORTENANTRESPONSE']._serialized_start=2667 + _globals['_GETLASTCOMPACTIONTIMEFORTENANTRESPONSE']._serialized_end=2778 + _globals['_SETLASTCOMPACTIONTIMEFORTENANTREQUEST']._serialized_start=2780 + _globals['_SETLASTCOMPACTIONTIMEFORTENANTREQUEST']._serialized_end=2890 + _globals['_SYSDB']._serialized_start=2893 + _globals['_SYSDB']._serialized_end=4173 # @@protoc_insertion_point(module_scope) diff --git a/chromadb/proto/coordinator_pb2.pyi b/chromadb/proto/coordinator_pb2.pyi index 613d13c969a..185a41b901a 100644 --- a/chromadb/proto/coordinator_pb2.pyi +++ b/chromadb/proto/coordinator_pb2.pyi @@ -240,3 +240,29 @@ class ResetStateResponse(_message.Message): STATUS_FIELD_NUMBER: _ClassVar[int] status: _chroma_pb2.Status def __init__(self, status: _Optional[_Union[_chroma_pb2.Status, _Mapping]] = ...) -> None: ... + +class GetLastCompactionTimeForTenantRequest(_message.Message): + __slots__ = ["tenant_id"] + TENANT_ID_FIELD_NUMBER: _ClassVar[int] + tenant_id: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, tenant_id: _Optional[_Iterable[str]] = ...) -> None: ... + +class TenantLastCompactionTime(_message.Message): + __slots__ = ["tenant_id", "last_compaction_time"] + TENANT_ID_FIELD_NUMBER: _ClassVar[int] + LAST_COMPACTION_TIME_FIELD_NUMBER: _ClassVar[int] + tenant_id: str + last_compaction_time: int + def __init__(self, tenant_id: _Optional[str] = ..., last_compaction_time: _Optional[int] = ...) -> None: ... + +class GetLastCompactionTimeForTenantResponse(_message.Message): + __slots__ = ["tenant_last_compaction_time"] + TENANT_LAST_COMPACTION_TIME_FIELD_NUMBER: _ClassVar[int] + tenant_last_compaction_time: _containers.RepeatedCompositeFieldContainer[TenantLastCompactionTime] + def __init__(self, tenant_last_compaction_time: _Optional[_Iterable[_Union[TenantLastCompactionTime, _Mapping]]] = ...) -> None: ... + +class SetLastCompactionTimeForTenantRequest(_message.Message): + __slots__ = ["tenant_last_compaction_time"] + TENANT_LAST_COMPACTION_TIME_FIELD_NUMBER: _ClassVar[int] + tenant_last_compaction_time: TenantLastCompactionTime + def __init__(self, tenant_last_compaction_time: _Optional[_Union[TenantLastCompactionTime, _Mapping]] = ...) -> None: ... diff --git a/chromadb/proto/coordinator_pb2_grpc.py b/chromadb/proto/coordinator_pb2_grpc.py index 22f49d43e13..74bcba4c8d8 100644 --- a/chromadb/proto/coordinator_pb2_grpc.py +++ b/chromadb/proto/coordinator_pb2_grpc.py @@ -16,70 +16,80 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.CreateDatabase = channel.unary_unary( - '/chroma.SysDB/CreateDatabase', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseResponse.FromString, - ) + "/chroma.SysDB/CreateDatabase", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseResponse.FromString, + ) self.GetDatabase = channel.unary_unary( - '/chroma.SysDB/GetDatabase', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseResponse.FromString, - ) + "/chroma.SysDB/GetDatabase", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseResponse.FromString, + ) self.CreateTenant = channel.unary_unary( - '/chroma.SysDB/CreateTenant', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantResponse.FromString, - ) + "/chroma.SysDB/CreateTenant", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantResponse.FromString, + ) self.GetTenant = channel.unary_unary( - '/chroma.SysDB/GetTenant', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantResponse.FromString, - ) + "/chroma.SysDB/GetTenant", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantResponse.FromString, + ) self.CreateSegment = channel.unary_unary( - '/chroma.SysDB/CreateSegment', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentResponse.FromString, - ) + "/chroma.SysDB/CreateSegment", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentResponse.FromString, + ) self.DeleteSegment = channel.unary_unary( - '/chroma.SysDB/DeleteSegment', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentResponse.FromString, - ) + "/chroma.SysDB/DeleteSegment", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentResponse.FromString, + ) self.GetSegments = channel.unary_unary( - '/chroma.SysDB/GetSegments', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsResponse.FromString, - ) + "/chroma.SysDB/GetSegments", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsResponse.FromString, + ) self.UpdateSegment = channel.unary_unary( - '/chroma.SysDB/UpdateSegment', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentResponse.FromString, - ) + "/chroma.SysDB/UpdateSegment", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentResponse.FromString, + ) self.CreateCollection = channel.unary_unary( - '/chroma.SysDB/CreateCollection', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionResponse.FromString, - ) + "/chroma.SysDB/CreateCollection", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionResponse.FromString, + ) self.DeleteCollection = channel.unary_unary( - '/chroma.SysDB/DeleteCollection', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionResponse.FromString, - ) + "/chroma.SysDB/DeleteCollection", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionResponse.FromString, + ) self.GetCollections = channel.unary_unary( - '/chroma.SysDB/GetCollections', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsResponse.FromString, - ) + "/chroma.SysDB/GetCollections", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsResponse.FromString, + ) self.UpdateCollection = channel.unary_unary( - '/chroma.SysDB/UpdateCollection', - request_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionRequest.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionResponse.FromString, - ) + "/chroma.SysDB/UpdateCollection", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionResponse.FromString, + ) self.ResetState = channel.unary_unary( - '/chroma.SysDB/ResetState', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.ResetStateResponse.FromString, - ) + "/chroma.SysDB/ResetState", + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.ResetStateResponse.FromString, + ) + self.GetLastCompactionTimeForTenant = channel.unary_unary( + "/chroma.SysDB/GetLastCompactionTimeForTenant", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantRequest.SerializeToString, + response_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantResponse.FromString, + ) + self.SetLastCompactionTimeForTenant = channel.unary_unary( + "/chroma.SysDB/SetLastCompactionTimeForTenant", + request_serializer=chromadb_dot_proto_dot_coordinator__pb2.SetLastCompactionTimeForTenantRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) class SysDBServicer(object): @@ -88,376 +98,613 @@ class SysDBServicer(object): def CreateDatabase(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def GetDatabase(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def CreateTenant(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def GetTenant(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def CreateSegment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def DeleteSegment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def GetSegments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def UpdateSegment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def CreateCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def DeleteCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def GetCollections(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def UpdateCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def ResetState(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetLastCompactionTimeForTenant(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SetLastCompactionTimeForTenant(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def add_SysDBServicer_to_server(servicer, server): rpc_method_handlers = { - 'CreateDatabase': grpc.unary_unary_rpc_method_handler( - servicer.CreateDatabase, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseResponse.SerializeToString, - ), - 'GetDatabase': grpc.unary_unary_rpc_method_handler( - servicer.GetDatabase, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseResponse.SerializeToString, - ), - 'CreateTenant': grpc.unary_unary_rpc_method_handler( - servicer.CreateTenant, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantResponse.SerializeToString, - ), - 'GetTenant': grpc.unary_unary_rpc_method_handler( - servicer.GetTenant, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantResponse.SerializeToString, - ), - 'CreateSegment': grpc.unary_unary_rpc_method_handler( - servicer.CreateSegment, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentResponse.SerializeToString, - ), - 'DeleteSegment': grpc.unary_unary_rpc_method_handler( - servicer.DeleteSegment, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentResponse.SerializeToString, - ), - 'GetSegments': grpc.unary_unary_rpc_method_handler( - servicer.GetSegments, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsResponse.SerializeToString, - ), - 'UpdateSegment': grpc.unary_unary_rpc_method_handler( - servicer.UpdateSegment, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentResponse.SerializeToString, - ), - 'CreateCollection': grpc.unary_unary_rpc_method_handler( - servicer.CreateCollection, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionResponse.SerializeToString, - ), - 'DeleteCollection': grpc.unary_unary_rpc_method_handler( - servicer.DeleteCollection, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionResponse.SerializeToString, - ), - 'GetCollections': grpc.unary_unary_rpc_method_handler( - servicer.GetCollections, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsResponse.SerializeToString, - ), - 'UpdateCollection': grpc.unary_unary_rpc_method_handler( - servicer.UpdateCollection, - request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionRequest.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionResponse.SerializeToString, - ), - 'ResetState': grpc.unary_unary_rpc_method_handler( - servicer.ResetState, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=chromadb_dot_proto_dot_coordinator__pb2.ResetStateResponse.SerializeToString, - ), + "CreateDatabase": grpc.unary_unary_rpc_method_handler( + servicer.CreateDatabase, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseResponse.SerializeToString, + ), + "GetDatabase": grpc.unary_unary_rpc_method_handler( + servicer.GetDatabase, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseResponse.SerializeToString, + ), + "CreateTenant": grpc.unary_unary_rpc_method_handler( + servicer.CreateTenant, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateTenantResponse.SerializeToString, + ), + "GetTenant": grpc.unary_unary_rpc_method_handler( + servicer.GetTenant, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetTenantResponse.SerializeToString, + ), + "CreateSegment": grpc.unary_unary_rpc_method_handler( + servicer.CreateSegment, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentResponse.SerializeToString, + ), + "DeleteSegment": grpc.unary_unary_rpc_method_handler( + servicer.DeleteSegment, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentResponse.SerializeToString, + ), + "GetSegments": grpc.unary_unary_rpc_method_handler( + servicer.GetSegments, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsResponse.SerializeToString, + ), + "UpdateSegment": grpc.unary_unary_rpc_method_handler( + servicer.UpdateSegment, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentResponse.SerializeToString, + ), + "CreateCollection": grpc.unary_unary_rpc_method_handler( + servicer.CreateCollection, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionResponse.SerializeToString, + ), + "DeleteCollection": grpc.unary_unary_rpc_method_handler( + servicer.DeleteCollection, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionResponse.SerializeToString, + ), + "GetCollections": grpc.unary_unary_rpc_method_handler( + servicer.GetCollections, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsResponse.SerializeToString, + ), + "UpdateCollection": grpc.unary_unary_rpc_method_handler( + servicer.UpdateCollection, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionResponse.SerializeToString, + ), + "ResetState": grpc.unary_unary_rpc_method_handler( + servicer.ResetState, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.ResetStateResponse.SerializeToString, + ), + "GetLastCompactionTimeForTenant": grpc.unary_unary_rpc_method_handler( + servicer.GetLastCompactionTimeForTenant, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantRequest.FromString, + response_serializer=chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantResponse.SerializeToString, + ), + "SetLastCompactionTimeForTenant": grpc.unary_unary_rpc_method_handler( + servicer.SetLastCompactionTimeForTenant, + request_deserializer=chromadb_dot_proto_dot_coordinator__pb2.SetLastCompactionTimeForTenantRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'chroma.SysDB', rpc_method_handlers) + "chroma.SysDB", rpc_method_handlers + ) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. +# This class is part of an EXPERIMENTAL API. class SysDB(object): """Missing associated documentation comment in .proto file.""" @staticmethod - def CreateDatabase(request, + def CreateDatabase( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/CreateDatabase', + "/chroma.SysDB/CreateDatabase", chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.CreateDatabaseResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def GetDatabase(request, + def GetDatabase( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/GetDatabase', + "/chroma.SysDB/GetDatabase", chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.GetDatabaseResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def CreateTenant(request, + def CreateTenant( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/CreateTenant', + "/chroma.SysDB/CreateTenant", chromadb_dot_proto_dot_coordinator__pb2.CreateTenantRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.CreateTenantResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def GetTenant(request, + def GetTenant( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/GetTenant', + "/chroma.SysDB/GetTenant", chromadb_dot_proto_dot_coordinator__pb2.GetTenantRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.GetTenantResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def CreateSegment(request, + def CreateSegment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/CreateSegment', + "/chroma.SysDB/CreateSegment", chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.CreateSegmentResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def DeleteSegment(request, + def DeleteSegment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/DeleteSegment', + "/chroma.SysDB/DeleteSegment", chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.DeleteSegmentResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def GetSegments(request, + def GetSegments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/GetSegments', + "/chroma.SysDB/GetSegments", chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.GetSegmentsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def UpdateSegment(request, + def UpdateSegment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/UpdateSegment', + "/chroma.SysDB/UpdateSegment", chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.UpdateSegmentResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def CreateCollection(request, + def CreateCollection( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/CreateCollection', + "/chroma.SysDB/CreateCollection", chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.CreateCollectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def DeleteCollection(request, + def DeleteCollection( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/DeleteCollection', + "/chroma.SysDB/DeleteCollection", chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.DeleteCollectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def GetCollections(request, + def GetCollections( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/GetCollections', + "/chroma.SysDB/GetCollections", chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.GetCollectionsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def UpdateCollection(request, + def UpdateCollection( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/UpdateCollection', + "/chroma.SysDB/UpdateCollection", chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionRequest.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.UpdateCollectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def ResetState(request, + def ResetState( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/chroma.SysDB/ResetState', + "/chroma.SysDB/ResetState", google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, chromadb_dot_proto_dot_coordinator__pb2.ResetStateResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def GetLastCompactionTimeForTenant( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/chroma.SysDB/GetLastCompactionTimeForTenant", + chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantRequest.SerializeToString, + chromadb_dot_proto_dot_coordinator__pb2.GetLastCompactionTimeForTenantResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SetLastCompactionTimeForTenant( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/chroma.SysDB/SetLastCompactionTimeForTenant", + chromadb_dot_proto_dot_coordinator__pb2.SetLastCompactionTimeForTenantRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/chromadb/proto/logservice_pb2.py b/chromadb/proto/logservice_pb2.py index ee7ae5c3b05..5ce9b4c5dcd 100644 --- a/chromadb/proto/logservice_pb2.py +++ b/chromadb/proto/logservice_pb2.py @@ -16,7 +16,7 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1f\x63hromadb/proto/logservice.proto\x12\x06\x63hroma\x1a\x1b\x63hromadb/proto/chroma.proto"X\n\x0fPushLogsRequest\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12.\n\x07records\x18\x02 \x03(\x0b\x32\x1d.chroma.SubmitEmbeddingRecord"(\n\x10PushLogsResponse\x12\x14\n\x0crecord_count\x18\x01 \x01(\x05"S\n\x0fPullLogsRequest\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12\x15\n\rstart_from_id\x18\x02 \x01(\x03\x12\x12\n\nbatch_size\x18\x03 \x01(\x05"J\n\tRecordLog\x12\x0e\n\x06log_id\x18\x01 \x01(\x03\x12-\n\x06record\x18\x02 \x01(\x0b\x32\x1d.chroma.SubmitEmbeddingRecord"6\n\x10PullLogsResponse\x12"\n\x07records\x18\x01 \x03(\x0b\x32\x11.chroma.RecordLog"V\n\x0e\x43ollectionInfo\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12\x14\n\x0c\x66irst_log_id\x18\x02 \x01(\x03\x12\x17\n\x0f\x66irst_log_id_ts\x18\x03 \x01(\x03"&\n$GetAllCollectionInfoToCompactRequest"\\\n%GetAllCollectionInfoToCompactResponse\x12\x33\n\x13\x61ll_collection_info\x18\x01 \x03(\x0b\x32\x16.chroma.CollectionInfo2\x8e\x02\n\nLogService\x12?\n\x08PushLogs\x12\x17.chroma.PushLogsRequest\x1a\x18.chroma.PushLogsResponse"\x00\x12?\n\x08PullLogs\x12\x17.chroma.PullLogsRequest\x1a\x18.chroma.PullLogsResponse"\x00\x12~\n\x1dGetAllCollectionInfoToCompact\x12,.chroma.GetAllCollectionInfoToCompactRequest\x1a-.chroma.GetAllCollectionInfoToCompactResponse"\x00\x42\x42Z@github.com/chroma/chroma-coordinator/internal/proto/logservicepbb\x06proto3' + b'\n\x1f\x63hromadb/proto/logservice.proto\x12\x06\x63hroma\x1a\x1b\x63hromadb/proto/chroma.proto"X\n\x0fPushLogsRequest\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12.\n\x07records\x18\x02 \x03(\x0b\x32\x1d.chroma.SubmitEmbeddingRecord"(\n\x10PushLogsResponse\x12\x14\n\x0crecord_count\x18\x01 \x01(\x05"S\n\x0fPullLogsRequest\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12\x15\n\rstart_from_id\x18\x02 \x01(\x03\x12\x12\n\nbatch_size\x18\x03 \x01(\x05"J\n\tRecordLog\x12\x0e\n\x06log_id\x18\x01 \x01(\x03\x12-\n\x06record\x18\x02 \x01(\x0b\x32\x1d.chroma.SubmitEmbeddingRecord"6\n\x10PullLogsResponse\x12"\n\x07records\x18\x01 \x03(\x0b\x32\x11.chroma.RecordLog"V\n\x0e\x43ollectionInfo\x12\x15\n\rcollection_id\x18\x01 \x01(\t\x12\x14\n\x0c\x66irst_log_id\x18\x02 \x01(\x03\x12\x17\n\x0f\x66irst_log_id_ts\x18\x03 \x01(\x03"&\n$GetAllCollectionInfoToCompactRequest"\\\n%GetAllCollectionInfoToCompactResponse\x12\x33\n\x13\x61ll_collection_info\x18\x01 \x03(\x0b\x32\x16.chroma.CollectionInfo2\x8e\x02\n\nLogService\x12?\n\x08PushLogs\x12\x17.chroma.PushLogsRequest\x1a\x18.chroma.PushLogsResponse"\x00\x12?\n\x08PullLogs\x12\x17.chroma.PullLogsRequest\x1a\x18.chroma.PullLogsResponse"\x00\x12~\n\x1dGetAllCollectionInfoToCompact\x12,.chroma.GetAllCollectionInfoToCompactRequest\x1a-.chroma.GetAllCollectionInfoToCompactResponse"\x00\x42\x39Z7github.com/chroma-core/chroma/go/pkg/proto/logservicepbb\x06proto3' ) _globals = globals() @@ -27,7 +27,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = ( - b"Z@github.com/chroma/chroma-coordinator/internal/proto/logservicepb" + b"Z7github.com/chroma-core/chroma/go/pkg/proto/logservicepb" ) _globals["_PUSHLOGSREQUEST"]._serialized_start = 72 _globals["_PUSHLOGSREQUEST"]._serialized_end = 160 diff --git a/go/migrations/20240309204515.sql b/go/migrations/20240309223050.sql similarity index 98% rename from go/migrations/20240309204515.sql rename to go/migrations/20240309223050.sql index fc7c7b750e5..91cca57c953 100644 --- a/go/migrations/20240309204515.sql +++ b/go/migrations/20240309223050.sql @@ -87,5 +87,6 @@ CREATE TABLE "public"."tenants" ( "is_deleted" boolean NULL DEFAULT false, "created_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "last_compaction_time" bigint NOT NULL, PRIMARY KEY ("id") ); diff --git a/go/migrations/atlas.sum b/go/migrations/atlas.sum index fb19ed98c23..828fcfc446d 100644 --- a/go/migrations/atlas.sum +++ b/go/migrations/atlas.sum @@ -1,2 +1,2 @@ -h1:WLrpESM2vuMV9DGOf8J/NuVafe1kYbAGleeGi7/AlRY= -20240309204515.sql h1:bm3T/GBUuDJ6wY3mELiE+7IFg558SGtB+PhWPr8w4L4= +h1:w35hwPquwsvenxzG956rH1l7vvSoB2S6XNTGOz2C78w= +20240309223050.sql h1:N3DifBqpCQpbRHqCtOc9sr+Qaq7mZek5Zz59KoFAy8g= diff --git a/go/pkg/coordinator/apis.go b/go/pkg/coordinator/apis.go index 6b0ba673a33..c1e5e9f2231 100644 --- a/go/pkg/coordinator/apis.go +++ b/go/pkg/coordinator/apis.go @@ -3,6 +3,7 @@ package coordinator import ( "context" "github.com/chroma-core/chroma/go/pkg/common" + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbmodel" "github.com/chroma-core/chroma/go/pkg/model" "github.com/chroma-core/chroma/go/pkg/types" "github.com/pingcap/log" @@ -27,6 +28,8 @@ type ICoordinator interface { GetDatabase(ctx context.Context, getDatabase *model.GetDatabase) (*model.Database, error) CreateTenant(ctx context.Context, createTenant *model.CreateTenant) (*model.Tenant, error) GetTenant(ctx context.Context, getTenant *model.GetTenant) (*model.Tenant, error) + SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error + GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error) } func (s *Coordinator) ResetState(ctx context.Context) error { @@ -156,3 +159,11 @@ func verifySegmentMetadata(metadata *model.SegmentMetadata[model.SegmentMetadata } return nil } + +func (s *Coordinator) SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error { + return s.catalog.SetTenantLastCompactionTime(ctx, tenantID, lastCompactionTime) +} + +func (s *Coordinator) GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error) { + return s.catalog.GetTenantsLastCompactionTime(ctx, tenantIDs) +} diff --git a/go/pkg/coordinator/grpc/tenant_database_service.go b/go/pkg/coordinator/grpc/tenant_database_service.go index eee26c101a1..56c5f224218 100644 --- a/go/pkg/coordinator/grpc/tenant_database_service.go +++ b/go/pkg/coordinator/grpc/tenant_database_service.go @@ -2,6 +2,10 @@ package grpc import ( "context" + "github.com/chroma-core/chroma/go/pkg/grpcutils" + "github.com/pingcap/log" + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/emptypb" "github.com/chroma-core/chroma/go/pkg/common" "github.com/chroma-core/chroma/go/pkg/model" @@ -89,3 +93,29 @@ func (s *Server) GetTenant(ctx context.Context, req *coordinatorpb.GetTenantRequ res.Status = setResponseStatus(successCode) return res, nil } + +func (s *Server) SetLastCompactionTimeForTenant(ctx context.Context, req *coordinatorpb.SetLastCompactionTimeForTenantRequest) (*emptypb.Empty, error) { + err := s.coordinator.SetTenantLastCompactionTime(ctx, req.TenantLastCompactionTime.TenantId, req.TenantLastCompactionTime.LastCompactionTime) + if err != nil { + log.Error("error SetTenantLastCompactionTime", zap.Any("request", req.TenantLastCompactionTime), zap.Error(err)) + return nil, grpcutils.BuildInternalGrpcError("error SetTenantLastCompactionTime") + } + return &emptypb.Empty{}, nil +} + +func (s *Server) GetLastCompactionTimeForTenant(ctx context.Context, req *coordinatorpb.GetLastCompactionTimeForTenantRequest) (*coordinatorpb.GetLastCompactionTimeForTenantResponse, error) { + res := &coordinatorpb.GetLastCompactionTimeForTenantResponse{} + tenantIDs := req.TenantId + tenants, err := s.coordinator.GetTenantsLastCompactionTime(ctx, tenantIDs) + if err != nil { + log.Error("error GetLastCompactionTimeForTenant", zap.Any("tenantIDs", tenantIDs), zap.Error(err)) + return nil, grpcutils.BuildInternalGrpcError("error GetTenantsLastCompactionTime") + } + for _, tenant := range tenants { + res.TenantLastCompactionTime = append(res.TenantLastCompactionTime, &coordinatorpb.TenantLastCompactionTime{ + TenantId: tenant.ID, + LastCompactionTime: tenant.LastCompactionTime, + }) + } + return res, nil +} diff --git a/go/pkg/coordinator/grpc/tenant_database_service_test.go b/go/pkg/coordinator/grpc/tenant_database_service_test.go new file mode 100644 index 00000000000..153d721cc27 --- /dev/null +++ b/go/pkg/coordinator/grpc/tenant_database_service_test.go @@ -0,0 +1,108 @@ +package grpc + +import ( + "context" + "github.com/chroma-core/chroma/go/pkg/grpcutils" + "github.com/chroma-core/chroma/go/pkg/metastore/coordinator" + "github.com/chroma-core/chroma/go/pkg/metastore/db/dao" + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbcore" + "github.com/chroma-core/chroma/go/pkg/model" + "github.com/chroma-core/chroma/go/pkg/proto/coordinatorpb" + "github.com/chroma-core/chroma/go/pkg/types" + "github.com/pingcap/log" + "github.com/stretchr/testify/suite" + "google.golang.org/genproto/googleapis/rpc/code" + codes "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gorm.io/gorm" + "testing" + "time" +) + +type TenantDatabaseServiceTestSuite struct { + suite.Suite + catalog *coordinator.Catalog + db *gorm.DB + s *Server + t *testing.T + collectionId types.UniqueID +} + +func (suite *TenantDatabaseServiceTestSuite) SetupSuite() { + log.Info("setup suite") + suite.db = dbcore.ConfigDatabaseForTesting() + s, err := NewWithGrpcProvider(Config{ + AssignmentPolicy: "simple", + SystemCatalogProvider: "memory", + NotificationStoreProvider: "memory", + NotifierProvider: "memory", + Testing: true}, grpcutils.Default, suite.db) + if err != nil { + suite.t.Fatalf("error creating server: %v", err) + } + suite.s = s + txnImpl := dbcore.NewTxImpl() + metaDomain := dao.NewMetaDomain() + suite.catalog = coordinator.NewTableCatalogWithNotification(txnImpl, metaDomain, nil) +} + +func (suite *TenantDatabaseServiceTestSuite) SetupTest() { + log.Info("setup test") +} + +func (suite *TenantDatabaseServiceTestSuite) TearDownTest() { + log.Info("teardown test") + // TODO: clean up per test when delete is implemented for tenant + dbcore.ResetTestTables(suite.db) +} + +func (suite *TenantDatabaseServiceTestSuite) TestServer_TenantLastCompactionTime() { + log.Info("TestServer_TenantLastCompactionTime") + tenantId := "TestTenantLastCompactionTime" + request := &coordinatorpb.SetLastCompactionTimeForTenantRequest{ + TenantLastCompactionTime: &coordinatorpb.TenantLastCompactionTime{ + TenantId: tenantId, + LastCompactionTime: 0, + }, + } + _, err := suite.s.SetLastCompactionTimeForTenant(context.Background(), request) + suite.Equal(status.Error(codes.Code(code.Code_INTERNAL), "error SetTenantLastCompactionTime"), err) + + // create tenant + _, err = suite.catalog.CreateTenant(context.Background(), &model.CreateTenant{ + Name: tenantId, + Ts: time.Now().Unix(), + }, time.Now().Unix()) + if err != nil { + return + } + suite.NoError(err) + + _, err = suite.s.SetLastCompactionTimeForTenant(context.Background(), request) + suite.NoError(err) + tenants, err := suite.s.GetLastCompactionTimeForTenant(context.Background(), &coordinatorpb.GetLastCompactionTimeForTenantRequest{ + TenantId: []string{tenantId}, + }) + suite.NoError(err) + suite.Equal(1, len(tenants.TenantLastCompactionTime)) + suite.Equal(tenantId, tenants.TenantLastCompactionTime[0].TenantId) + suite.Equal(int64(0), tenants.TenantLastCompactionTime[0].LastCompactionTime) + + // update last compaction time + request.TenantLastCompactionTime.LastCompactionTime = 1 + _, err = suite.s.SetLastCompactionTimeForTenant(context.Background(), request) + suite.NoError(err) + tenants, err = suite.s.GetLastCompactionTimeForTenant(context.Background(), &coordinatorpb.GetLastCompactionTimeForTenantRequest{ + TenantId: []string{tenantId}, + }) + suite.NoError(err) + suite.Equal(1, len(tenants.TenantLastCompactionTime)) + suite.Equal(tenantId, tenants.TenantLastCompactionTime[0].TenantId) + suite.Equal(int64(1), tenants.TenantLastCompactionTime[0].LastCompactionTime) +} + +func TestTenantDatabaseServiceTestSuite(t *testing.T) { + testSuite := new(TenantDatabaseServiceTestSuite) + testSuite.t = t + suite.Run(t, testSuite) +} diff --git a/go/pkg/metastore/catalog.go b/go/pkg/metastore/catalog.go index 9919726d29d..52d6ac2ca35 100644 --- a/go/pkg/metastore/catalog.go +++ b/go/pkg/metastore/catalog.go @@ -2,6 +2,7 @@ package metastore import ( "context" + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbmodel" "github.com/chroma-core/chroma/go/pkg/model" "github.com/chroma-core/chroma/go/pkg/types" @@ -26,4 +27,6 @@ type Catalog interface { CreateTenant(ctx context.Context, createTenant *model.CreateTenant, ts types.Timestamp) (*model.Tenant, error) GetTenants(ctx context.Context, getTenant *model.GetTenant, ts types.Timestamp) (*model.Tenant, error) GetAllTenants(ctx context.Context, ts types.Timestamp) ([]*model.Tenant, error) + SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error + GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error) } diff --git a/go/pkg/metastore/coordinator/table_catalog.go b/go/pkg/metastore/coordinator/table_catalog.go index 22e792839fd..bed31c51532 100644 --- a/go/pkg/metastore/coordinator/table_catalog.go +++ b/go/pkg/metastore/coordinator/table_catalog.go @@ -10,6 +10,7 @@ import ( "github.com/chroma-core/chroma/go/pkg/types" "github.com/pingcap/log" "go.uber.org/zap" + "time" ) // The catalog backed by databases using GORM. @@ -63,6 +64,7 @@ func (tc *Catalog) ResetState(ctx context.Context) error { return err } + // TODO: default database and tenant should be pre-defined object err = tc.metaDomain.DatabaseDb(txCtx).Insert(&dbmodel.Database{ ID: types.NilUniqueID().String(), Name: common.DefaultDatabase, @@ -79,7 +81,8 @@ func (tc *Catalog) ResetState(ctx context.Context) error { return err } err = tc.metaDomain.TenantDb(txCtx).Insert(&dbmodel.Tenant{ - ID: common.DefaultTenant, + ID: common.DefaultTenant, + LastCompactionTime: time.Now().Unix(), }) if err != nil { log.Error("error inserting default tenant", zap.Error(err)) @@ -153,9 +156,11 @@ func (tc *Catalog) CreateTenant(ctx context.Context, createTenant *model.CreateT var result *model.Tenant err := tc.txImpl.Transaction(ctx, func(txCtx context.Context) error { + // TODO: createTenant has ts, don't need to pass in dbTenant := &dbmodel.Tenant{ - ID: createTenant.Name, - Ts: ts, + ID: createTenant.Name, + Ts: ts, + LastCompactionTime: time.Now().Unix(), } err := tc.metaDomain.TenantDb(txCtx).Insert(dbTenant) if err != nil { @@ -600,3 +605,12 @@ func (tc *Catalog) UpdateSegment(ctx context.Context, updateSegment *model.Updat log.Debug("segment updated", zap.Any("segment", result)) return result, nil } + +func (tc *Catalog) SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error { + return tc.metaDomain.TenantDb(ctx).UpdateTenantLastCompactionTime(tenantID, lastCompactionTime) +} + +func (tc *Catalog) GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error) { + tenants, err := tc.metaDomain.TenantDb(ctx).GetTenantsLastCompactionTime(tenantIDs) + return tenants, err +} diff --git a/go/pkg/metastore/db/dao/collection_test.go b/go/pkg/metastore/db/dao/collection_test.go index 7fe78c825e2..aa40eabf53a 100644 --- a/go/pkg/metastore/db/dao/collection_test.go +++ b/go/pkg/metastore/db/dao/collection_test.go @@ -1,10 +1,10 @@ package dao import ( - "testing" - + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbcore" "github.com/pingcap/log" "go.uber.org/zap" + "testing" "github.com/chroma-core/chroma/go/pkg/common" "github.com/chroma-core/chroma/go/pkg/metastore/db/dbmodel" @@ -19,16 +19,7 @@ func TestCollectionDb_GetCollections(t *testing.T) { assert.NoError(t, err) err = db.AutoMigrate(&dbmodel.Tenant{}, &dbmodel.Database{}, &dbmodel.Collection{}, &dbmodel.CollectionMetadata{}) - db.Model(&dbmodel.Tenant{}).Create(&dbmodel.Tenant{ - ID: common.DefaultTenant, - }) - - databaseID := types.NilUniqueID().String() - db.Model(&dbmodel.Database{}).Create(&dbmodel.Database{ - ID: databaseID, - Name: common.DefaultDatabase, - TenantID: common.DefaultTenant, - }) + databaseID := dbcore.CreateDefaultTenantAndDatabase(db) assert.NoError(t, err) name := "test_name" diff --git a/go/pkg/metastore/db/dao/tenant.go b/go/pkg/metastore/db/dao/tenant.go index 8901c020815..adc79c06dfa 100644 --- a/go/pkg/metastore/db/dao/tenant.go +++ b/go/pkg/metastore/db/dao/tenant.go @@ -8,6 +8,7 @@ import ( "github.com/pingcap/log" "go.uber.org/zap" "gorm.io/gorm" + "gorm.io/gorm/clause" ) type tenantDb struct { @@ -58,3 +59,32 @@ func (s *tenantDb) Insert(tenant *dbmodel.Tenant) error { } return nil } + +func (s *tenantDb) UpdateTenantLastCompactionTime(tenantID string, lastCompactionTime int64) error { + var tenants []dbmodel.Tenant + result := s.db.Model(&tenants). + Clauses(clause.Returning{Columns: []clause.Column{{Name: "id"}}}). + Where("id = ?", tenantID). + Update("last_compaction_time", lastCompactionTime) + + if result.Error != nil { + log.Error("UpdateTenantLastCompactionTime error", zap.Error(result.Error)) + return result.Error + } + if result.RowsAffected == 0 { + return common.ErrTenantNotFound + } + return nil +} + +func (s *tenantDb) GetTenantsLastCompactionTime(tenantIDs []string) ([]*dbmodel.Tenant, error) { + var tenants []*dbmodel.Tenant + + result := s.db.Select("id", "last_compaction_time").Find(&tenants, "id IN ?", tenantIDs) + if result.Error != nil { + log.Error("GetTenantsLastCompactionTime error", zap.Error(result.Error)) + return nil, result.Error + } + + return tenants, nil +} diff --git a/go/pkg/metastore/db/dao/tenant_test.go b/go/pkg/metastore/db/dao/tenant_test.go new file mode 100644 index 00000000000..5f4e658928a --- /dev/null +++ b/go/pkg/metastore/db/dao/tenant_test.go @@ -0,0 +1,101 @@ +package dao + +import ( + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbcore" + "github.com/chroma-core/chroma/go/pkg/metastore/db/dbmodel" + "github.com/pingcap/log" + "github.com/stretchr/testify/suite" + "gorm.io/gorm" + "strconv" + "testing" + "time" +) + +type TenantDbTestSuite struct { + suite.Suite + db *gorm.DB + Db *tenantDb + t *testing.T +} + +func (suite *TenantDbTestSuite) SetupSuite() { + log.Info("setup suite") + suite.db = dbcore.ConfigDatabaseForTesting() + dbcore.ResetTestTables(suite.db) + suite.Db = &tenantDb{ + db: suite.db, + } +} + +func (suite *TenantDbTestSuite) SetupTest() { + log.Info("setup test") +} + +func (suite *TenantDbTestSuite) TearDownTest() { + log.Info("teardown test") +} + +func (suite *TenantDbTestSuite) TestTenantDb_UpdateTenantLastCompactionTime() { + tenantId := "testUpdateTenantLastCompactionTime" + var tenant dbmodel.Tenant + suite.Db.Insert(&dbmodel.Tenant{ + ID: tenantId, + LastCompactionTime: 0, + }) + suite.db.First(&tenant, "id = ?", tenantId) + suite.Require().Equal(int64(0), tenant.LastCompactionTime) + + err := suite.Db.UpdateTenantLastCompactionTime(tenantId, 1) + suite.Require().NoError(err) + suite.db.First(&tenant, "id = ?", tenantId) + suite.Require().Equal(int64(1), tenant.LastCompactionTime) + + currentTime := time.Now().Unix() + err = suite.Db.UpdateTenantLastCompactionTime(tenantId, currentTime) + suite.Require().NoError(err) + suite.db.First(&tenant, "id = ?", tenantId) + suite.Require().Equal(currentTime, tenant.LastCompactionTime) + + suite.db.Delete(&tenant, "id = ?", tenantId) +} + +func (suite *TenantDbTestSuite) TestTenantDb_GetTenantsLastCompactionTime() { + tenantIds := make([]string, 0) + for i := 0; i < 10; i++ { + tenantId := "testGetTenantsLastCompactionTime" + strconv.Itoa(i) + suite.Db.Insert(&dbmodel.Tenant{ + ID: tenantId, + LastCompactionTime: int64(i), + }) + tenantIds = append(tenantIds, tenantId) + } + + tenants, err := suite.Db.GetTenantsLastCompactionTime(tenantIds) + suite.Require().NoError(err) + suite.Require().Len(tenants, 10) + for i, tenant := range tenants { + suite.Require().Equal(int64(i), tenant.LastCompactionTime) + } + + currentTime := time.Now().Unix() + for _, tenantId := range tenantIds { + err := suite.Db.UpdateTenantLastCompactionTime(tenantId, currentTime) + suite.Require().NoError(err) + } + tenants, err = suite.Db.GetTenantsLastCompactionTime(tenantIds) + suite.Require().NoError(err) + suite.Require().Len(tenants, 10) + for _, tenant := range tenants { + suite.Require().Equal(currentTime, tenant.LastCompactionTime) + } + + for _, tenantId := range tenantIds { + suite.db.Delete(&dbmodel.Tenant{}, "id = ?", tenantId) + } +} + +func TestTenantDbTestSuite(t *testing.T) { + testSuite := new(TenantDbTestSuite) + testSuite.t = t + suite.Run(t, testSuite) +} diff --git a/go/pkg/metastore/db/dbcore/core.go b/go/pkg/metastore/db/dbcore/core.go index 90a69003bdf..215b3375725 100644 --- a/go/pkg/metastore/db/dbcore/core.go +++ b/go/pkg/metastore/db/dbcore/core.go @@ -7,6 +7,7 @@ import ( "os" "reflect" "strconv" + "time" "github.com/chroma-core/chroma/go/pkg/common" "github.com/chroma-core/chroma/go/pkg/metastore/db/dbmodel" @@ -122,15 +123,18 @@ func ResetTestTables(db *gorm.DB) { CreateDefaultTenantAndDatabase(db) } -func CreateDefaultTenantAndDatabase(db *gorm.DB) { +func CreateDefaultTenantAndDatabase(db *gorm.DB) string { db.Model(&dbmodel.Tenant{}).Create(&dbmodel.Tenant{ - ID: common.DefaultTenant, + ID: common.DefaultTenant, + LastCompactionTime: time.Now().Unix(), }) + databaseId := types.NilUniqueID().String() db.Model(&dbmodel.Database{}).Create(&dbmodel.Database{ - ID: types.NilUniqueID().String(), + ID: databaseId, Name: common.DefaultDatabase, TenantID: common.DefaultTenant, }) + return databaseId } func CreateTestTables(db *gorm.DB) { diff --git a/go/pkg/metastore/db/dbmodel/tenant.go b/go/pkg/metastore/db/dbmodel/tenant.go index 5fcd48a9ec6..1db2a223f7b 100644 --- a/go/pkg/metastore/db/dbmodel/tenant.go +++ b/go/pkg/metastore/db/dbmodel/tenant.go @@ -7,11 +7,12 @@ import ( ) type Tenant struct { - ID string `gorm:"id;primaryKey;unique"` - Ts types.Timestamp `gorm:"ts;type:bigint;default:0"` - IsDeleted bool `gorm:"is_deleted;type:bool;default:false"` - CreatedAt time.Time `gorm:"created_at;type:timestamp;not null;default:current_timestamp"` - UpdatedAt time.Time `gorm:"updated_at;type:timestamp;not null;default:current_timestamp"` + ID string `gorm:"id;primaryKey;unique"` + Ts types.Timestamp `gorm:"ts;type:bigint;default:0"` + IsDeleted bool `gorm:"is_deleted;type:bool;default:false"` + CreatedAt time.Time `gorm:"created_at;type:timestamp;not null;default:current_timestamp"` + UpdatedAt time.Time `gorm:"updated_at;type:timestamp;not null;default:current_timestamp"` + LastCompactionTime int64 `gorm:"last_compaction_time;not null"` } func (v Tenant) TableName() string { @@ -24,4 +25,6 @@ type ITenantDb interface { GetTenants(tenantID string) ([]*Tenant, error) Insert(in *Tenant) error DeleteAll() error + UpdateTenantLastCompactionTime(tenantID string, lastCompactionTime int64) error + GetTenantsLastCompactionTime(tenantIDs []string) ([]*Tenant, error) } diff --git a/go/pkg/model/tenant.go b/go/pkg/model/tenant.go index f363f5a2720..ac7131eb81c 100644 --- a/go/pkg/model/tenant.go +++ b/go/pkg/model/tenant.go @@ -15,3 +15,8 @@ type GetTenant struct { Name string Ts types.Timestamp } + +type TenantLastCompactionTime struct { + ID string + Ts types.Timestamp +} diff --git a/go/pkg/proto/coordinatorpb/chroma.pb.go b/go/pkg/proto/coordinatorpb/chroma.pb.go index a864fe71fde..49b077e803a 100644 --- a/go/pkg/proto/coordinatorpb/chroma.pb.go +++ b/go/pkg/proto/coordinatorpb/chroma.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.32.0 // protoc v4.25.3 // source: chromadb/proto/chroma.proto diff --git a/go/pkg/proto/coordinatorpb/coordinator.pb.go b/go/pkg/proto/coordinatorpb/coordinator.pb.go index d7b6d7f9748..5ca8bce37d4 100644 --- a/go/pkg/proto/coordinatorpb/coordinator.pb.go +++ b/go/pkg/proto/coordinatorpb/coordinator.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.32.0 // protoc v4.25.3 // source: chromadb/proto/coordinator.proto @@ -1659,6 +1659,202 @@ func (x *ResetStateResponse) GetStatus() *Status { return nil } +type GetLastCompactionTimeForTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId []string `protobuf:"bytes,1,rep,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` +} + +func (x *GetLastCompactionTimeForTenantRequest) Reset() { + *x = GetLastCompactionTimeForTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLastCompactionTimeForTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLastCompactionTimeForTenantRequest) ProtoMessage() {} + +func (x *GetLastCompactionTimeForTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLastCompactionTimeForTenantRequest.ProtoReflect.Descriptor instead. +func (*GetLastCompactionTimeForTenantRequest) Descriptor() ([]byte, []int) { + return file_chromadb_proto_coordinator_proto_rawDescGZIP(), []int{26} +} + +func (x *GetLastCompactionTimeForTenantRequest) GetTenantId() []string { + if x != nil { + return x.TenantId + } + return nil +} + +type TenantLastCompactionTime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + LastCompactionTime int64 `protobuf:"varint,2,opt,name=last_compaction_time,json=lastCompactionTime,proto3" json:"last_compaction_time,omitempty"` +} + +func (x *TenantLastCompactionTime) Reset() { + *x = TenantLastCompactionTime{} + if protoimpl.UnsafeEnabled { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TenantLastCompactionTime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TenantLastCompactionTime) ProtoMessage() {} + +func (x *TenantLastCompactionTime) ProtoReflect() protoreflect.Message { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TenantLastCompactionTime.ProtoReflect.Descriptor instead. +func (*TenantLastCompactionTime) Descriptor() ([]byte, []int) { + return file_chromadb_proto_coordinator_proto_rawDescGZIP(), []int{27} +} + +func (x *TenantLastCompactionTime) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +func (x *TenantLastCompactionTime) GetLastCompactionTime() int64 { + if x != nil { + return x.LastCompactionTime + } + return 0 +} + +type GetLastCompactionTimeForTenantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantLastCompactionTime []*TenantLastCompactionTime `protobuf:"bytes,1,rep,name=tenant_last_compaction_time,json=tenantLastCompactionTime,proto3" json:"tenant_last_compaction_time,omitempty"` +} + +func (x *GetLastCompactionTimeForTenantResponse) Reset() { + *x = GetLastCompactionTimeForTenantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLastCompactionTimeForTenantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLastCompactionTimeForTenantResponse) ProtoMessage() {} + +func (x *GetLastCompactionTimeForTenantResponse) ProtoReflect() protoreflect.Message { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLastCompactionTimeForTenantResponse.ProtoReflect.Descriptor instead. +func (*GetLastCompactionTimeForTenantResponse) Descriptor() ([]byte, []int) { + return file_chromadb_proto_coordinator_proto_rawDescGZIP(), []int{28} +} + +func (x *GetLastCompactionTimeForTenantResponse) GetTenantLastCompactionTime() []*TenantLastCompactionTime { + if x != nil { + return x.TenantLastCompactionTime + } + return nil +} + +type SetLastCompactionTimeForTenantRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TenantLastCompactionTime *TenantLastCompactionTime `protobuf:"bytes,1,opt,name=tenant_last_compaction_time,json=tenantLastCompactionTime,proto3" json:"tenant_last_compaction_time,omitempty"` +} + +func (x *SetLastCompactionTimeForTenantRequest) Reset() { + *x = SetLastCompactionTimeForTenantRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetLastCompactionTimeForTenantRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetLastCompactionTimeForTenantRequest) ProtoMessage() {} + +func (x *SetLastCompactionTimeForTenantRequest) ProtoReflect() protoreflect.Message { + mi := &file_chromadb_proto_coordinator_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetLastCompactionTimeForTenantRequest.ProtoReflect.Descriptor instead. +func (*SetLastCompactionTimeForTenantRequest) Descriptor() ([]byte, []int) { + return file_chromadb_proto_coordinator_proto_rawDescGZIP(), []int{29} +} + +func (x *SetLastCompactionTimeForTenantRequest) GetTenantLastCompactionTime() *TenantLastCompactionTime { + if x != nil { + return x.TenantLastCompactionTime + } + return nil +} + var File_chromadb_proto_coordinator_proto protoreflect.FileDescriptor var file_chromadb_proto_coordinator_proto_rawDesc = []byte{ @@ -1853,77 +2049,120 @@ var file_chromadb_proto_coordinator_proto_rawDesc = []byte{ 0x3c, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x91, 0x08, - 0x0a, 0x05, 0x53, 0x79, 0x73, 0x44, 0x42, 0x12, 0x51, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, - 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, - 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, 0x65, - 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x63, 0x68, 0x72, 0x6f, - 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, - 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x18, - 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, - 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x4e, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x57, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x63, - 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, - 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x68, 0x72, 0x6f, - 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, - 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x68, 0x72, 0x6f, - 0x6d, 0x61, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x44, 0x0a, + 0x25, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x18, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4c, 0x61, 0x73, + 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x89, + 0x01, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x1b, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4c, 0x61, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, + 0x52, 0x18, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x25, 0x53, + 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x1b, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x72, 0x6f, + 0x6d, 0x61, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x18, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x80, 0x0a, 0x0a, 0x05, 0x53, 0x79, 0x73, 0x44, 0x42, 0x12, + 0x51, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x1a, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, + 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, + 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, + 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, + 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, + 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, + 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, + 0x61, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, + 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x63, 0x68, + 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x57, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x63, 0x68, + 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x68, 0x72, + 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x63, 0x68, + 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x81, 0x01, 0x0a, 0x1e, 0x47, 0x65, + 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x2d, 0x2e, 0x63, + 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x68, + 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, + 0x1e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, + 0x2d, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x46, 0x6f, + 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2d, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, + 0x6f, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1938,98 +2177,108 @@ func file_chromadb_proto_coordinator_proto_rawDescGZIP() []byte { return file_chromadb_proto_coordinator_proto_rawDescData } -var file_chromadb_proto_coordinator_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_chromadb_proto_coordinator_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_chromadb_proto_coordinator_proto_goTypes = []interface{}{ - (*CreateDatabaseRequest)(nil), // 0: chroma.CreateDatabaseRequest - (*CreateDatabaseResponse)(nil), // 1: chroma.CreateDatabaseResponse - (*GetDatabaseRequest)(nil), // 2: chroma.GetDatabaseRequest - (*GetDatabaseResponse)(nil), // 3: chroma.GetDatabaseResponse - (*CreateTenantRequest)(nil), // 4: chroma.CreateTenantRequest - (*CreateTenantResponse)(nil), // 5: chroma.CreateTenantResponse - (*GetTenantRequest)(nil), // 6: chroma.GetTenantRequest - (*GetTenantResponse)(nil), // 7: chroma.GetTenantResponse - (*CreateSegmentRequest)(nil), // 8: chroma.CreateSegmentRequest - (*CreateSegmentResponse)(nil), // 9: chroma.CreateSegmentResponse - (*DeleteSegmentRequest)(nil), // 10: chroma.DeleteSegmentRequest - (*DeleteSegmentResponse)(nil), // 11: chroma.DeleteSegmentResponse - (*GetSegmentsRequest)(nil), // 12: chroma.GetSegmentsRequest - (*GetSegmentsResponse)(nil), // 13: chroma.GetSegmentsResponse - (*UpdateSegmentRequest)(nil), // 14: chroma.UpdateSegmentRequest - (*UpdateSegmentResponse)(nil), // 15: chroma.UpdateSegmentResponse - (*CreateCollectionRequest)(nil), // 16: chroma.CreateCollectionRequest - (*CreateCollectionResponse)(nil), // 17: chroma.CreateCollectionResponse - (*DeleteCollectionRequest)(nil), // 18: chroma.DeleteCollectionRequest - (*DeleteCollectionResponse)(nil), // 19: chroma.DeleteCollectionResponse - (*GetCollectionsRequest)(nil), // 20: chroma.GetCollectionsRequest - (*GetCollectionsResponse)(nil), // 21: chroma.GetCollectionsResponse - (*UpdateCollectionRequest)(nil), // 22: chroma.UpdateCollectionRequest - (*UpdateCollectionResponse)(nil), // 23: chroma.UpdateCollectionResponse - (*Notification)(nil), // 24: chroma.Notification - (*ResetStateResponse)(nil), // 25: chroma.ResetStateResponse - (*Status)(nil), // 26: chroma.Status - (*Database)(nil), // 27: chroma.Database - (*Tenant)(nil), // 28: chroma.Tenant - (*Segment)(nil), // 29: chroma.Segment - (SegmentScope)(0), // 30: chroma.SegmentScope - (*UpdateMetadata)(nil), // 31: chroma.UpdateMetadata - (*Collection)(nil), // 32: chroma.Collection - (*emptypb.Empty)(nil), // 33: google.protobuf.Empty + (*CreateDatabaseRequest)(nil), // 0: chroma.CreateDatabaseRequest + (*CreateDatabaseResponse)(nil), // 1: chroma.CreateDatabaseResponse + (*GetDatabaseRequest)(nil), // 2: chroma.GetDatabaseRequest + (*GetDatabaseResponse)(nil), // 3: chroma.GetDatabaseResponse + (*CreateTenantRequest)(nil), // 4: chroma.CreateTenantRequest + (*CreateTenantResponse)(nil), // 5: chroma.CreateTenantResponse + (*GetTenantRequest)(nil), // 6: chroma.GetTenantRequest + (*GetTenantResponse)(nil), // 7: chroma.GetTenantResponse + (*CreateSegmentRequest)(nil), // 8: chroma.CreateSegmentRequest + (*CreateSegmentResponse)(nil), // 9: chroma.CreateSegmentResponse + (*DeleteSegmentRequest)(nil), // 10: chroma.DeleteSegmentRequest + (*DeleteSegmentResponse)(nil), // 11: chroma.DeleteSegmentResponse + (*GetSegmentsRequest)(nil), // 12: chroma.GetSegmentsRequest + (*GetSegmentsResponse)(nil), // 13: chroma.GetSegmentsResponse + (*UpdateSegmentRequest)(nil), // 14: chroma.UpdateSegmentRequest + (*UpdateSegmentResponse)(nil), // 15: chroma.UpdateSegmentResponse + (*CreateCollectionRequest)(nil), // 16: chroma.CreateCollectionRequest + (*CreateCollectionResponse)(nil), // 17: chroma.CreateCollectionResponse + (*DeleteCollectionRequest)(nil), // 18: chroma.DeleteCollectionRequest + (*DeleteCollectionResponse)(nil), // 19: chroma.DeleteCollectionResponse + (*GetCollectionsRequest)(nil), // 20: chroma.GetCollectionsRequest + (*GetCollectionsResponse)(nil), // 21: chroma.GetCollectionsResponse + (*UpdateCollectionRequest)(nil), // 22: chroma.UpdateCollectionRequest + (*UpdateCollectionResponse)(nil), // 23: chroma.UpdateCollectionResponse + (*Notification)(nil), // 24: chroma.Notification + (*ResetStateResponse)(nil), // 25: chroma.ResetStateResponse + (*GetLastCompactionTimeForTenantRequest)(nil), // 26: chroma.GetLastCompactionTimeForTenantRequest + (*TenantLastCompactionTime)(nil), // 27: chroma.TenantLastCompactionTime + (*GetLastCompactionTimeForTenantResponse)(nil), // 28: chroma.GetLastCompactionTimeForTenantResponse + (*SetLastCompactionTimeForTenantRequest)(nil), // 29: chroma.SetLastCompactionTimeForTenantRequest + (*Status)(nil), // 30: chroma.Status + (*Database)(nil), // 31: chroma.Database + (*Tenant)(nil), // 32: chroma.Tenant + (*Segment)(nil), // 33: chroma.Segment + (SegmentScope)(0), // 34: chroma.SegmentScope + (*UpdateMetadata)(nil), // 35: chroma.UpdateMetadata + (*Collection)(nil), // 36: chroma.Collection + (*emptypb.Empty)(nil), // 37: google.protobuf.Empty } var file_chromadb_proto_coordinator_proto_depIdxs = []int32{ - 26, // 0: chroma.CreateDatabaseResponse.status:type_name -> chroma.Status - 27, // 1: chroma.GetDatabaseResponse.database:type_name -> chroma.Database - 26, // 2: chroma.GetDatabaseResponse.status:type_name -> chroma.Status - 26, // 3: chroma.CreateTenantResponse.status:type_name -> chroma.Status - 28, // 4: chroma.GetTenantResponse.tenant:type_name -> chroma.Tenant - 26, // 5: chroma.GetTenantResponse.status:type_name -> chroma.Status - 29, // 6: chroma.CreateSegmentRequest.segment:type_name -> chroma.Segment - 26, // 7: chroma.CreateSegmentResponse.status:type_name -> chroma.Status - 26, // 8: chroma.DeleteSegmentResponse.status:type_name -> chroma.Status - 30, // 9: chroma.GetSegmentsRequest.scope:type_name -> chroma.SegmentScope - 29, // 10: chroma.GetSegmentsResponse.segments:type_name -> chroma.Segment - 26, // 11: chroma.GetSegmentsResponse.status:type_name -> chroma.Status - 31, // 12: chroma.UpdateSegmentRequest.metadata:type_name -> chroma.UpdateMetadata - 26, // 13: chroma.UpdateSegmentResponse.status:type_name -> chroma.Status - 31, // 14: chroma.CreateCollectionRequest.metadata:type_name -> chroma.UpdateMetadata - 32, // 15: chroma.CreateCollectionResponse.collection:type_name -> chroma.Collection - 26, // 16: chroma.CreateCollectionResponse.status:type_name -> chroma.Status - 26, // 17: chroma.DeleteCollectionResponse.status:type_name -> chroma.Status - 32, // 18: chroma.GetCollectionsResponse.collections:type_name -> chroma.Collection - 26, // 19: chroma.GetCollectionsResponse.status:type_name -> chroma.Status - 31, // 20: chroma.UpdateCollectionRequest.metadata:type_name -> chroma.UpdateMetadata - 26, // 21: chroma.UpdateCollectionResponse.status:type_name -> chroma.Status - 26, // 22: chroma.ResetStateResponse.status:type_name -> chroma.Status - 0, // 23: chroma.SysDB.CreateDatabase:input_type -> chroma.CreateDatabaseRequest - 2, // 24: chroma.SysDB.GetDatabase:input_type -> chroma.GetDatabaseRequest - 4, // 25: chroma.SysDB.CreateTenant:input_type -> chroma.CreateTenantRequest - 6, // 26: chroma.SysDB.GetTenant:input_type -> chroma.GetTenantRequest - 8, // 27: chroma.SysDB.CreateSegment:input_type -> chroma.CreateSegmentRequest - 10, // 28: chroma.SysDB.DeleteSegment:input_type -> chroma.DeleteSegmentRequest - 12, // 29: chroma.SysDB.GetSegments:input_type -> chroma.GetSegmentsRequest - 14, // 30: chroma.SysDB.UpdateSegment:input_type -> chroma.UpdateSegmentRequest - 16, // 31: chroma.SysDB.CreateCollection:input_type -> chroma.CreateCollectionRequest - 18, // 32: chroma.SysDB.DeleteCollection:input_type -> chroma.DeleteCollectionRequest - 20, // 33: chroma.SysDB.GetCollections:input_type -> chroma.GetCollectionsRequest - 22, // 34: chroma.SysDB.UpdateCollection:input_type -> chroma.UpdateCollectionRequest - 33, // 35: chroma.SysDB.ResetState:input_type -> google.protobuf.Empty - 1, // 36: chroma.SysDB.CreateDatabase:output_type -> chroma.CreateDatabaseResponse - 3, // 37: chroma.SysDB.GetDatabase:output_type -> chroma.GetDatabaseResponse - 5, // 38: chroma.SysDB.CreateTenant:output_type -> chroma.CreateTenantResponse - 7, // 39: chroma.SysDB.GetTenant:output_type -> chroma.GetTenantResponse - 9, // 40: chroma.SysDB.CreateSegment:output_type -> chroma.CreateSegmentResponse - 11, // 41: chroma.SysDB.DeleteSegment:output_type -> chroma.DeleteSegmentResponse - 13, // 42: chroma.SysDB.GetSegments:output_type -> chroma.GetSegmentsResponse - 15, // 43: chroma.SysDB.UpdateSegment:output_type -> chroma.UpdateSegmentResponse - 17, // 44: chroma.SysDB.CreateCollection:output_type -> chroma.CreateCollectionResponse - 19, // 45: chroma.SysDB.DeleteCollection:output_type -> chroma.DeleteCollectionResponse - 21, // 46: chroma.SysDB.GetCollections:output_type -> chroma.GetCollectionsResponse - 23, // 47: chroma.SysDB.UpdateCollection:output_type -> chroma.UpdateCollectionResponse - 25, // 48: chroma.SysDB.ResetState:output_type -> chroma.ResetStateResponse - 36, // [36:49] is the sub-list for method output_type - 23, // [23:36] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name + 30, // 0: chroma.CreateDatabaseResponse.status:type_name -> chroma.Status + 31, // 1: chroma.GetDatabaseResponse.database:type_name -> chroma.Database + 30, // 2: chroma.GetDatabaseResponse.status:type_name -> chroma.Status + 30, // 3: chroma.CreateTenantResponse.status:type_name -> chroma.Status + 32, // 4: chroma.GetTenantResponse.tenant:type_name -> chroma.Tenant + 30, // 5: chroma.GetTenantResponse.status:type_name -> chroma.Status + 33, // 6: chroma.CreateSegmentRequest.segment:type_name -> chroma.Segment + 30, // 7: chroma.CreateSegmentResponse.status:type_name -> chroma.Status + 30, // 8: chroma.DeleteSegmentResponse.status:type_name -> chroma.Status + 34, // 9: chroma.GetSegmentsRequest.scope:type_name -> chroma.SegmentScope + 33, // 10: chroma.GetSegmentsResponse.segments:type_name -> chroma.Segment + 30, // 11: chroma.GetSegmentsResponse.status:type_name -> chroma.Status + 35, // 12: chroma.UpdateSegmentRequest.metadata:type_name -> chroma.UpdateMetadata + 30, // 13: chroma.UpdateSegmentResponse.status:type_name -> chroma.Status + 35, // 14: chroma.CreateCollectionRequest.metadata:type_name -> chroma.UpdateMetadata + 36, // 15: chroma.CreateCollectionResponse.collection:type_name -> chroma.Collection + 30, // 16: chroma.CreateCollectionResponse.status:type_name -> chroma.Status + 30, // 17: chroma.DeleteCollectionResponse.status:type_name -> chroma.Status + 36, // 18: chroma.GetCollectionsResponse.collections:type_name -> chroma.Collection + 30, // 19: chroma.GetCollectionsResponse.status:type_name -> chroma.Status + 35, // 20: chroma.UpdateCollectionRequest.metadata:type_name -> chroma.UpdateMetadata + 30, // 21: chroma.UpdateCollectionResponse.status:type_name -> chroma.Status + 30, // 22: chroma.ResetStateResponse.status:type_name -> chroma.Status + 27, // 23: chroma.GetLastCompactionTimeForTenantResponse.tenant_last_compaction_time:type_name -> chroma.TenantLastCompactionTime + 27, // 24: chroma.SetLastCompactionTimeForTenantRequest.tenant_last_compaction_time:type_name -> chroma.TenantLastCompactionTime + 0, // 25: chroma.SysDB.CreateDatabase:input_type -> chroma.CreateDatabaseRequest + 2, // 26: chroma.SysDB.GetDatabase:input_type -> chroma.GetDatabaseRequest + 4, // 27: chroma.SysDB.CreateTenant:input_type -> chroma.CreateTenantRequest + 6, // 28: chroma.SysDB.GetTenant:input_type -> chroma.GetTenantRequest + 8, // 29: chroma.SysDB.CreateSegment:input_type -> chroma.CreateSegmentRequest + 10, // 30: chroma.SysDB.DeleteSegment:input_type -> chroma.DeleteSegmentRequest + 12, // 31: chroma.SysDB.GetSegments:input_type -> chroma.GetSegmentsRequest + 14, // 32: chroma.SysDB.UpdateSegment:input_type -> chroma.UpdateSegmentRequest + 16, // 33: chroma.SysDB.CreateCollection:input_type -> chroma.CreateCollectionRequest + 18, // 34: chroma.SysDB.DeleteCollection:input_type -> chroma.DeleteCollectionRequest + 20, // 35: chroma.SysDB.GetCollections:input_type -> chroma.GetCollectionsRequest + 22, // 36: chroma.SysDB.UpdateCollection:input_type -> chroma.UpdateCollectionRequest + 37, // 37: chroma.SysDB.ResetState:input_type -> google.protobuf.Empty + 26, // 38: chroma.SysDB.GetLastCompactionTimeForTenant:input_type -> chroma.GetLastCompactionTimeForTenantRequest + 29, // 39: chroma.SysDB.SetLastCompactionTimeForTenant:input_type -> chroma.SetLastCompactionTimeForTenantRequest + 1, // 40: chroma.SysDB.CreateDatabase:output_type -> chroma.CreateDatabaseResponse + 3, // 41: chroma.SysDB.GetDatabase:output_type -> chroma.GetDatabaseResponse + 5, // 42: chroma.SysDB.CreateTenant:output_type -> chroma.CreateTenantResponse + 7, // 43: chroma.SysDB.GetTenant:output_type -> chroma.GetTenantResponse + 9, // 44: chroma.SysDB.CreateSegment:output_type -> chroma.CreateSegmentResponse + 11, // 45: chroma.SysDB.DeleteSegment:output_type -> chroma.DeleteSegmentResponse + 13, // 46: chroma.SysDB.GetSegments:output_type -> chroma.GetSegmentsResponse + 15, // 47: chroma.SysDB.UpdateSegment:output_type -> chroma.UpdateSegmentResponse + 17, // 48: chroma.SysDB.CreateCollection:output_type -> chroma.CreateCollectionResponse + 19, // 49: chroma.SysDB.DeleteCollection:output_type -> chroma.DeleteCollectionResponse + 21, // 50: chroma.SysDB.GetCollections:output_type -> chroma.GetCollectionsResponse + 23, // 51: chroma.SysDB.UpdateCollection:output_type -> chroma.UpdateCollectionResponse + 25, // 52: chroma.SysDB.ResetState:output_type -> chroma.ResetStateResponse + 28, // 53: chroma.SysDB.GetLastCompactionTimeForTenant:output_type -> chroma.GetLastCompactionTimeForTenantResponse + 37, // 54: chroma.SysDB.SetLastCompactionTimeForTenant:output_type -> google.protobuf.Empty + 40, // [40:55] is the sub-list for method output_type + 25, // [25:40] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_chromadb_proto_coordinator_proto_init() } @@ -2351,6 +2600,54 @@ func file_chromadb_proto_coordinator_proto_init() { return nil } } + file_chromadb_proto_coordinator_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLastCompactionTimeForTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chromadb_proto_coordinator_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TenantLastCompactionTime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chromadb_proto_coordinator_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLastCompactionTimeForTenantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chromadb_proto_coordinator_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetLastCompactionTimeForTenantRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_chromadb_proto_coordinator_proto_msgTypes[12].OneofWrappers = []interface{}{} file_chromadb_proto_coordinator_proto_msgTypes[14].OneofWrappers = []interface{}{ @@ -2373,7 +2670,7 @@ func file_chromadb_proto_coordinator_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_chromadb_proto_coordinator_proto_rawDesc, NumEnums: 0, - NumMessages: 26, + NumMessages: 30, NumExtensions: 0, NumServices: 1, }, diff --git a/go/pkg/proto/coordinatorpb/coordinator_grpc.pb.go b/go/pkg/proto/coordinatorpb/coordinator_grpc.pb.go index 958d2e5e8ca..755d0190efd 100644 --- a/go/pkg/proto/coordinatorpb/coordinator_grpc.pb.go +++ b/go/pkg/proto/coordinatorpb/coordinator_grpc.pb.go @@ -36,6 +36,8 @@ type SysDBClient interface { GetCollections(ctx context.Context, in *GetCollectionsRequest, opts ...grpc.CallOption) (*GetCollectionsResponse, error) UpdateCollection(ctx context.Context, in *UpdateCollectionRequest, opts ...grpc.CallOption) (*UpdateCollectionResponse, error) ResetState(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResetStateResponse, error) + GetLastCompactionTimeForTenant(ctx context.Context, in *GetLastCompactionTimeForTenantRequest, opts ...grpc.CallOption) (*GetLastCompactionTimeForTenantResponse, error) + SetLastCompactionTimeForTenant(ctx context.Context, in *SetLastCompactionTimeForTenantRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type sysDBClient struct { @@ -163,6 +165,24 @@ func (c *sysDBClient) ResetState(ctx context.Context, in *emptypb.Empty, opts .. return out, nil } +func (c *sysDBClient) GetLastCompactionTimeForTenant(ctx context.Context, in *GetLastCompactionTimeForTenantRequest, opts ...grpc.CallOption) (*GetLastCompactionTimeForTenantResponse, error) { + out := new(GetLastCompactionTimeForTenantResponse) + err := c.cc.Invoke(ctx, "/chroma.SysDB/GetLastCompactionTimeForTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sysDBClient) SetLastCompactionTimeForTenant(ctx context.Context, in *SetLastCompactionTimeForTenantRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/chroma.SysDB/SetLastCompactionTimeForTenant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SysDBServer is the server API for SysDB service. // All implementations must embed UnimplementedSysDBServer // for forward compatibility @@ -180,6 +200,8 @@ type SysDBServer interface { GetCollections(context.Context, *GetCollectionsRequest) (*GetCollectionsResponse, error) UpdateCollection(context.Context, *UpdateCollectionRequest) (*UpdateCollectionResponse, error) ResetState(context.Context, *emptypb.Empty) (*ResetStateResponse, error) + GetLastCompactionTimeForTenant(context.Context, *GetLastCompactionTimeForTenantRequest) (*GetLastCompactionTimeForTenantResponse, error) + SetLastCompactionTimeForTenant(context.Context, *SetLastCompactionTimeForTenantRequest) (*emptypb.Empty, error) mustEmbedUnimplementedSysDBServer() } @@ -226,6 +248,12 @@ func (UnimplementedSysDBServer) UpdateCollection(context.Context, *UpdateCollect func (UnimplementedSysDBServer) ResetState(context.Context, *emptypb.Empty) (*ResetStateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ResetState not implemented") } +func (UnimplementedSysDBServer) GetLastCompactionTimeForTenant(context.Context, *GetLastCompactionTimeForTenantRequest) (*GetLastCompactionTimeForTenantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLastCompactionTimeForTenant not implemented") +} +func (UnimplementedSysDBServer) SetLastCompactionTimeForTenant(context.Context, *SetLastCompactionTimeForTenantRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetLastCompactionTimeForTenant not implemented") +} func (UnimplementedSysDBServer) mustEmbedUnimplementedSysDBServer() {} // UnsafeSysDBServer may be embedded to opt out of forward compatibility for this service. @@ -473,6 +501,42 @@ func _SysDB_ResetState_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _SysDB_GetLastCompactionTimeForTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLastCompactionTimeForTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SysDBServer).GetLastCompactionTimeForTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chroma.SysDB/GetLastCompactionTimeForTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SysDBServer).GetLastCompactionTimeForTenant(ctx, req.(*GetLastCompactionTimeForTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SysDB_SetLastCompactionTimeForTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLastCompactionTimeForTenantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SysDBServer).SetLastCompactionTimeForTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chroma.SysDB/SetLastCompactionTimeForTenant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SysDBServer).SetLastCompactionTimeForTenant(ctx, req.(*SetLastCompactionTimeForTenantRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SysDB_ServiceDesc is the grpc.ServiceDesc for SysDB service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -532,6 +596,14 @@ var SysDB_ServiceDesc = grpc.ServiceDesc{ MethodName: "ResetState", Handler: _SysDB_ResetState_Handler, }, + { + MethodName: "GetLastCompactionTimeForTenant", + Handler: _SysDB_GetLastCompactionTimeForTenant_Handler, + }, + { + MethodName: "SetLastCompactionTimeForTenant", + Handler: _SysDB_SetLastCompactionTimeForTenant_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "chromadb/proto/coordinator.proto", diff --git a/go/pkg/proto/logservicepb/logservice.pb.go b/go/pkg/proto/logservicepb/logservice.pb.go index 193ea4f1d82..491d57956d3 100644 --- a/go/pkg/proto/logservicepb/logservice.pb.go +++ b/go/pkg/proto/logservicepb/logservice.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.32.0 // protoc v4.25.3 // source: chromadb/proto/logservice.proto diff --git a/idl/chromadb/proto/coordinator.proto b/idl/chromadb/proto/coordinator.proto index 662b011a956..5e31b3273af 100644 --- a/idl/chromadb/proto/coordinator.proto +++ b/idl/chromadb/proto/coordinator.proto @@ -159,6 +159,23 @@ message ResetStateResponse { Status status = 1; } +message GetLastCompactionTimeForTenantRequest { + repeated string tenant_id = 1; +} + +message TenantLastCompactionTime { + string tenant_id = 1; + int64 last_compaction_time = 2; +} + +message GetLastCompactionTimeForTenantResponse { + repeated TenantLastCompactionTime tenant_last_compaction_time = 1; +} + +message SetLastCompactionTimeForTenantRequest { + TenantLastCompactionTime tenant_last_compaction_time = 1; +} + service SysDB { rpc CreateDatabase(CreateDatabaseRequest) returns (CreateDatabaseResponse) {} rpc GetDatabase(GetDatabaseRequest) returns (GetDatabaseResponse) {} @@ -173,4 +190,6 @@ service SysDB { rpc GetCollections(GetCollectionsRequest) returns (GetCollectionsResponse) {} rpc UpdateCollection(UpdateCollectionRequest) returns (UpdateCollectionResponse) {} rpc ResetState(google.protobuf.Empty) returns (ResetStateResponse) {} + rpc GetLastCompactionTimeForTenant(GetLastCompactionTimeForTenantRequest) returns (GetLastCompactionTimeForTenantResponse) {} + rpc SetLastCompactionTimeForTenant(SetLastCompactionTimeForTenantRequest) returns (google.protobuf.Empty) {} }