From 1a6d4a400e76d69559abce212bd9a6bd5ae2dcab Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 10 Oct 2024 16:08:27 +0300 Subject: [PATCH] Add capnp definitions for object info. (#5337) Contributes towards SC-47920. --- TYPE: NO_HISTORY --- tiledb/sm/serialization/tiledb-rest.capnp | 12 ++ tiledb/sm/serialization/tiledb-rest.capnp.c++ | 98 +++++++++++++ tiledb/sm/serialization/tiledb-rest.capnp.h | 136 ++++++++++++++++++ 3 files changed, 246 insertions(+) diff --git a/tiledb/sm/serialization/tiledb-rest.capnp b/tiledb/sm/serialization/tiledb-rest.capnp index 168cba4cdf9..5d7830fdcee 100644 --- a/tiledb/sm/serialization/tiledb-rest.capnp +++ b/tiledb/sm/serialization/tiledb-rest.capnp @@ -1371,3 +1371,15 @@ struct NDRectangle { # SubarrayRanges is designed to hold multiple ranges per dimension, # For CurrentDomain's NDRectangle we only need one range per dimension. } + +enum ObjectType { + array @0; + group @1; +} + +struct ObjectInfoResponse { + # Contains information about a TileDB object. + + objectType @0 :ObjectType; + # The object's type (array or group). +} diff --git a/tiledb/sm/serialization/tiledb-rest.capnp.c++ b/tiledb/sm/serialization/tiledb-rest.capnp.c++ index bc5d31a2b56..4a488a5086c 100644 --- a/tiledb/sm/serialization/tiledb-rest.capnp.c++ +++ b/tiledb/sm/serialization/tiledb-rest.capnp.c++ @@ -10477,6 +10477,92 @@ const ::capnp::_::RawSchema s_ce64eabcdabb02b5 = { 1, 1, i_ce64eabcdabb02b5, nullptr, nullptr, { &s_ce64eabcdabb02b5, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE +static const ::capnp::_::AlignedData<26> b_f3bb391da5271019 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 25, 16, 39, 165, 29, 57, 187, 243, + 18, 0, 0, 0, 2, 0, 0, 0, + 127, 216, 135, 181, 36, 146, 125, 181, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 234, 0, 0, 0, + 33, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 108, 101, 100, 98, 45, 114, + 101, 115, 116, 46, 99, 97, 112, 110, + 112, 58, 79, 98, 106, 101, 99, 116, + 84, 121, 112, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 97, 114, 114, 97, 121, 0, 0, 0, + 103, 114, 111, 117, 112, 0, 0, 0, } +}; +::capnp::word const* const bp_f3bb391da5271019 = b_f3bb391da5271019.words; +#if !CAPNP_LITE +static const uint16_t m_f3bb391da5271019[] = {0, 1}; +const ::capnp::_::RawSchema s_f3bb391da5271019 = { + 0xf3bb391da5271019, b_f3bb391da5271019.words, 26, nullptr, m_f3bb391da5271019, + 0, 2, nullptr, nullptr, nullptr, { &s_f3bb391da5271019, nullptr, nullptr, 0, 0, nullptr }, false +}; +#endif // !CAPNP_LITE +CAPNP_DEFINE_ENUM(ObjectType_f3bb391da5271019, f3bb391da5271019); +static const ::capnp::_::AlignedData<35> b_87f0466598bb29be = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 190, 41, 187, 152, 101, 70, 240, 135, + 18, 0, 0, 0, 1, 0, 1, 0, + 127, 216, 135, 181, 36, 146, 125, 181, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 42, 1, 0, 0, + 37, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 116, 105, 108, 101, 100, 98, 45, 114, + 101, 115, 116, 46, 99, 97, 112, 110, + 112, 58, 79, 98, 106, 101, 99, 116, + 73, 110, 102, 111, 82, 101, 115, 112, + 111, 110, 115, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 1, 0, + 24, 0, 0, 0, 2, 0, 1, 0, + 111, 98, 106, 101, 99, 116, 84, 121, + 112, 101, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 25, 16, 39, 165, 29, 57, 187, 243, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_87f0466598bb29be = b_87f0466598bb29be.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_87f0466598bb29be[] = { + &s_f3bb391da5271019, +}; +static const uint16_t m_87f0466598bb29be[] = {0}; +static const uint16_t i_87f0466598bb29be[] = {0}; +const ::capnp::_::RawSchema s_87f0466598bb29be = { + 0x87f0466598bb29be, b_87f0466598bb29be.words, 35, d_87f0466598bb29be, m_87f0466598bb29be, + 1, 1, i_87f0466598bb29be, nullptr, nullptr, { &s_87f0466598bb29be, nullptr, nullptr, 0, 0, nullptr }, false +}; +#endif // !CAPNP_LITE } // namespace schemas } // namespace capnp @@ -11627,6 +11713,18 @@ constexpr ::capnp::_::RawSchema const* NDRectangle::_capnpPrivate::schema; #endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL #endif // !CAPNP_LITE +// ObjectInfoResponse +#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +constexpr uint16_t ObjectInfoResponse::_capnpPrivate::dataWordSize; +constexpr uint16_t ObjectInfoResponse::_capnpPrivate::pointerCount; +#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +#if !CAPNP_LITE +#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +constexpr ::capnp::Kind ObjectInfoResponse::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* ObjectInfoResponse::_capnpPrivate::schema; +#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +#endif // !CAPNP_LITE + } // namespace } // namespace diff --git a/tiledb/sm/serialization/tiledb-rest.capnp.h b/tiledb/sm/serialization/tiledb-rest.capnp.h index 518bab1543f..415d12bf0e7 100644 --- a/tiledb/sm/serialization/tiledb-rest.capnp.h +++ b/tiledb/sm/serialization/tiledb-rest.capnp.h @@ -116,6 +116,13 @@ CAPNP_DECLARE_SCHEMA(ca2d4d0bfe4ae5d9); CAPNP_DECLARE_SCHEMA(e193f1f45a9f102e); CAPNP_DECLARE_SCHEMA(fafb9c94c6b54ec9); CAPNP_DECLARE_SCHEMA(ce64eabcdabb02b5); +CAPNP_DECLARE_SCHEMA(f3bb391da5271019); +enum class ObjectType_f3bb391da5271019 : uint16_t { + ARRAY, + GROUP, +}; +CAPNP_DECLARE_ENUM(ObjectType, f3bb391da5271019); +CAPNP_DECLARE_SCHEMA(87f0466598bb29be); } // namespace schemas } // namespace capnp @@ -1833,6 +1840,25 @@ struct NDRectangle { }; }; +typedef ::capnp::schemas::ObjectType_f3bb391da5271019 ObjectType; + +struct ObjectInfoResponse { + ObjectInfoResponse() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(87f0466598bb29be, 1, 0) +#if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { + return &schema->defaultBrand; + } +#endif // !CAPNP_LITE + }; +}; + // ======================================================================================= class DomainArray::Reader { @@ -16119,6 +16145,99 @@ class NDRectangle::Pipeline { }; #endif // !CAPNP_LITE +class ObjectInfoResponse::Reader { + public: + typedef ObjectInfoResponse Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base) + : _reader(base) { + } + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline ::tiledb::sm::serialization::capnp::ObjectType getObjectType() const; + + private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class ObjectInfoResponse::Builder { + public: + typedef ObjectInfoResponse Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) { + } + inline explicit Builder(::capnp::_::StructBuilder base) + : _builder(base) { + } + inline operator Reader() const { + return Reader(_builder.asReader()); + } + inline Reader asReader() const { + return *this; + } + + inline ::capnp::MessageSize totalSize() const { + return asReader().totalSize(); + } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return asReader().toString(); + } +#endif // !CAPNP_LITE + + inline ::tiledb::sm::serialization::capnp::ObjectType getObjectType(); + inline void setObjectType( + ::tiledb::sm::serialization::capnp::ObjectType value); + + private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class ObjectInfoResponse::Pipeline { + public: + typedef ObjectInfoResponse Pipelines; + + inline Pipeline(decltype(nullptr)) + : _typeless(nullptr) { + } + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) { + } + + private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + // ======================================================================================= inline bool DomainArray::Reader::hasInt8() const { @@ -34214,6 +34333,23 @@ NDRectangle::Builder::disownNdranges() { ::capnp::POINTERS)); } +inline ::tiledb::sm::serialization::capnp::ObjectType +ObjectInfoResponse::Reader::getObjectType() const { + return _reader.getDataField<::tiledb::sm::serialization::capnp::ObjectType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} + +inline ::tiledb::sm::serialization::capnp::ObjectType +ObjectInfoResponse::Builder::getObjectType() { + return _builder.getDataField<::tiledb::sm::serialization::capnp::ObjectType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS); +} +inline void ObjectInfoResponse::Builder::setObjectType( + ::tiledb::sm::serialization::capnp::ObjectType value) { + _builder.setDataField<::tiledb::sm::serialization::capnp::ObjectType>( + ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); +} + } // namespace capnp } // namespace serialization } // namespace sm