Skip to content

add bloomFilter to proto #10823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add bloomFilter to proto
  • Loading branch information
milaGGL committed Feb 15, 2023
commit 5f1f0f739b2d05b7f7d063e2084ffe35888446a1
608 changes: 608 additions & 0 deletions Firestore/Protos/cpp/google/firestore/v1/bloom_filter.pb.cc

Large diffs are not rendered by default.

574 changes: 574 additions & 0 deletions Firestore/Protos/cpp/google/firestore/v1/bloom_filter.pb.h

Large diffs are not rendered by default.

457 changes: 256 additions & 201 deletions Firestore/Protos/cpp/google/firestore/v1/firestore.pb.cc

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions Firestore/Protos/cpp/google/firestore/v1/firestore.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "google/firestore/v1/write.pb.h"
#include <google/protobuf/empty.pb.h>
#include <google/protobuf/timestamp.pb.h>
#include <google/protobuf/wrappers.pb.h>
#include "google/rpc/status.pb.h"
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
Expand Down Expand Up @@ -4830,13 +4831,29 @@ class Target :
// accessors -------------------------------------------------------

enum : int {
kExpectedCountFieldNumber = 12,
kTargetIdFieldNumber = 5,
kOnceFieldNumber = 6,
kQueryFieldNumber = 2,
kDocumentsFieldNumber = 3,
kResumeTokenFieldNumber = 4,
kReadTimeFieldNumber = 11,
};
// .google.protobuf.Int32Value expected_count = 12;
bool has_expected_count() const;
private:
bool _internal_has_expected_count() const;
public:
void clear_expected_count();
const PROTOBUF_NAMESPACE_ID::Int32Value& expected_count() const;
PROTOBUF_NAMESPACE_ID::Int32Value* release_expected_count();
PROTOBUF_NAMESPACE_ID::Int32Value* mutable_expected_count();
void set_allocated_expected_count(PROTOBUF_NAMESPACE_ID::Int32Value* expected_count);
private:
const PROTOBUF_NAMESPACE_ID::Int32Value& _internal_expected_count() const;
PROTOBUF_NAMESPACE_ID::Int32Value* _internal_mutable_expected_count();
public:

// int32 target_id = 5;
void clear_target_id();
::PROTOBUF_NAMESPACE_ID::int32 target_id() const;
Expand Down Expand Up @@ -4938,6 +4955,7 @@ class Target :
inline void clear_has_resume_type();

::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
PROTOBUF_NAMESPACE_ID::Int32Value* expected_count_;
::PROTOBUF_NAMESPACE_ID::int32 target_id_;
bool once_;
union TargetTypeUnion {
Expand Down Expand Up @@ -10599,6 +10617,61 @@ inline void Target::set_once(bool value) {
// @@protoc_insertion_point(field_set:google.firestore.v1.Target.once)
}

// .google.protobuf.Int32Value expected_count = 12;
inline bool Target::_internal_has_expected_count() const {
return this != internal_default_instance() && expected_count_ != nullptr;
}
inline bool Target::has_expected_count() const {
return _internal_has_expected_count();
}
inline const PROTOBUF_NAMESPACE_ID::Int32Value& Target::_internal_expected_count() const {
const PROTOBUF_NAMESPACE_ID::Int32Value* p = expected_count_;
return p != nullptr ? *p : *reinterpret_cast<const PROTOBUF_NAMESPACE_ID::Int32Value*>(
&PROTOBUF_NAMESPACE_ID::_Int32Value_default_instance_);
}
inline const PROTOBUF_NAMESPACE_ID::Int32Value& Target::expected_count() const {
// @@protoc_insertion_point(field_get:google.firestore.v1.Target.expected_count)
return _internal_expected_count();
}
inline PROTOBUF_NAMESPACE_ID::Int32Value* Target::release_expected_count() {
// @@protoc_insertion_point(field_release:google.firestore.v1.Target.expected_count)

PROTOBUF_NAMESPACE_ID::Int32Value* temp = expected_count_;
expected_count_ = nullptr;
return temp;
}
inline PROTOBUF_NAMESPACE_ID::Int32Value* Target::_internal_mutable_expected_count() {

if (expected_count_ == nullptr) {
auto* p = CreateMaybeMessage<PROTOBUF_NAMESPACE_ID::Int32Value>(GetArenaNoVirtual());
expected_count_ = p;
}
return expected_count_;
}
inline PROTOBUF_NAMESPACE_ID::Int32Value* Target::mutable_expected_count() {
// @@protoc_insertion_point(field_mutable:google.firestore.v1.Target.expected_count)
return _internal_mutable_expected_count();
}
inline void Target::set_allocated_expected_count(PROTOBUF_NAMESPACE_ID::Int32Value* expected_count) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == nullptr) {
delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(expected_count_);
}
if (expected_count) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(expected_count)->GetArena();
if (message_arena != submessage_arena) {
expected_count = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, expected_count, submessage_arena);
}

} else {

}
expected_count_ = expected_count;
// @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Target.expected_count)
}

inline bool Target::has_target_type() const {
return target_type_case() != TARGET_TYPE_NOT_SET;
}
Expand Down
85 changes: 71 additions & 14 deletions Firestore/Protos/cpp/google/firestore/v1/write.pb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fcommon_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DocumentMask_google_2ffirestore_2fv1_2fcommon_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fwrite_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DocumentTransform_google_2ffirestore_2fv1_2fwrite_2eproto;
Expand Down Expand Up @@ -171,8 +172,9 @@ static void InitDefaultsscc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite
::google::firestore::v1::ExistenceFilter::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite_2eproto}, {}};
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite_2eproto =
{{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite_2eproto}, {
&scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base,}};

static void InitDefaultsscc_info_Write_google_2ffirestore_2fv1_2fwrite_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
Expand Down Expand Up @@ -285,6 +287,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2ffirestore_2fv1_2fwrit
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::google::firestore::v1::ExistenceFilter, target_id_),
PROTOBUF_FIELD_OFFSET(::google::firestore::v1::ExistenceFilter, count_),
PROTOBUF_FIELD_OFFSET(::google::firestore::v1::ExistenceFilter, unchanged_names_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::google::firestore::v1::Write)},
Expand All @@ -310,7 +313,8 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] =

const char descriptor_table_protodef_google_2ffirestore_2fv1_2fwrite_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\037google/firestore/v1/write.proto\022\023googl"
"e.firestore.v1\032 google/firestore/v1/comm"
"e.firestore.v1\032&google/firestore/v1/bloo"
"m_filter.proto\032 google/firestore/v1/comm"
"on.proto\032\"google/firestore/v1/document.p"
"roto\032\037google/protobuf/timestamp.proto\"\355\002"
"\n\005Write\022/\n\006update\030\001 \001(\0132\035.google.firesto"
Expand Down Expand Up @@ -348,15 +352,18 @@ const char descriptor_table_protodef_google_2ffirestore_2fv1_2fwrite_2eproto[] P
"-\n\tread_time\030\004 \001(\0132\032.google.protobuf.Tim"
"estamp\"m\n\016DocumentRemove\022\020\n\010document\030\001 \001"
"(\t\022\032\n\022removed_target_ids\030\002 \003(\005\022-\n\tread_t"
"ime\030\004 \001(\0132\032.google.protobuf.Timestamp\"3\n"
"ime\030\004 \001(\0132\032.google.protobuf.Timestamp\"n\n"
"\017ExistenceFilter\022\021\n\ttarget_id\030\001 \001(\005\022\r\n\005c"
"ount\030\002 \001(\005B\256\001\n\027com.google.firestore.v1B\n"
"WriteProtoP\001Z<google.golang.org/genproto"
"/googleapis/firestore/v1;firestore\242\002\004GCF"
"S\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Goo"
"gle\\Cloud\\Firestore\\V1beta1b\006proto3"
"ount\030\002 \001(\005\0229\n\017unchanged_names\030\003 \001(\0132 .go"
"ogle.firestore.v1.BloomFilterB\256\001\n\027com.go"
"ogle.firestore.v1B\nWriteProtoP\001Z<google."
"golang.org/genproto/googleapis/firestore"
"/v1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Fire"
"store.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V"
"1beta1b\006proto3"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_deps[3] = {
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_deps[4] = {
&::descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto,
&::descriptor_table_google_2ffirestore_2fv1_2fcommon_2eproto,
&::descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto,
&::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
Expand All @@ -374,8 +381,8 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_goo
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_once;
static bool descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto = {
&descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_initialized, descriptor_table_protodef_google_2ffirestore_2fv1_2fwrite_2eproto, "google/firestore/v1/write.proto", 1835,
&descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_once, descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_sccs, descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_deps, 8, 3,
&descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_initialized, descriptor_table_protodef_google_2ffirestore_2fv1_2fwrite_2eproto, "google/firestore/v1/write.proto", 1934,
&descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_once, descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_sccs, descriptor_table_google_2ffirestore_2fv1_2fwrite_2eproto_deps, 8, 4,
schemas, file_default_instances, TableStruct_google_2ffirestore_2fv1_2fwrite_2eproto::offsets,
file_level_metadata_google_2ffirestore_2fv1_2fwrite_2eproto, 8, file_level_enum_descriptors_google_2ffirestore_2fv1_2fwrite_2eproto, file_level_service_descriptors_google_2ffirestore_2fv1_2fwrite_2eproto,
};
Expand Down Expand Up @@ -2838,11 +2845,24 @@ ::PROTOBUF_NAMESPACE_ID::Metadata DocumentRemove::GetMetadata() const {
// ===================================================================

void ExistenceFilter::InitAsDefaultInstance() {
::google::firestore::v1::_ExistenceFilter_default_instance_._instance.get_mutable()->unchanged_names_ = const_cast< ::google::firestore::v1::BloomFilter*>(
::google::firestore::v1::BloomFilter::internal_default_instance());
}
class ExistenceFilter::_Internal {
public:
static const ::google::firestore::v1::BloomFilter& unchanged_names(const ExistenceFilter* msg);
};

const ::google::firestore::v1::BloomFilter&
ExistenceFilter::_Internal::unchanged_names(const ExistenceFilter* msg) {
return *msg->unchanged_names_;
}
void ExistenceFilter::clear_unchanged_names() {
if (GetArenaNoVirtual() == nullptr && unchanged_names_ != nullptr) {
delete unchanged_names_;
}
unchanged_names_ = nullptr;
}
ExistenceFilter::ExistenceFilter()
: ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
SharedCtor();
Expand All @@ -2852,16 +2872,22 @@ ExistenceFilter::ExistenceFilter(const ExistenceFilter& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from._internal_has_unchanged_names()) {
unchanged_names_ = new ::google::firestore::v1::BloomFilter(*from.unchanged_names_);
} else {
unchanged_names_ = nullptr;
}
::memcpy(&target_id_, &from.target_id_,
static_cast<size_t>(reinterpret_cast<char*>(&count_) -
reinterpret_cast<char*>(&target_id_)) + sizeof(count_));
// @@protoc_insertion_point(copy_constructor:google.firestore.v1.ExistenceFilter)
}

void ExistenceFilter::SharedCtor() {
::memset(&target_id_, 0, static_cast<size_t>(
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ExistenceFilter_google_2ffirestore_2fv1_2fwrite_2eproto.base);
::memset(&unchanged_names_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&count_) -
reinterpret_cast<char*>(&target_id_)) + sizeof(count_));
reinterpret_cast<char*>(&unchanged_names_)) + sizeof(count_));
}

ExistenceFilter::~ExistenceFilter() {
Expand All @@ -2870,6 +2896,7 @@ ExistenceFilter::~ExistenceFilter() {
}

void ExistenceFilter::SharedDtor() {
if (this != internal_default_instance()) delete unchanged_names_;
}

void ExistenceFilter::SetCachedSize(int size) const {
Expand All @@ -2887,6 +2914,10 @@ void ExistenceFilter::Clear() {
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;

if (GetArenaNoVirtual() == nullptr && unchanged_names_ != nullptr) {
delete unchanged_names_;
}
unchanged_names_ = nullptr;
::memset(&target_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&count_) -
reinterpret_cast<char*>(&target_id_)) + sizeof(count_));
Expand Down Expand Up @@ -2914,6 +2945,13 @@ const char* ExistenceFilter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC
CHK_(ptr);
} else goto handle_unusual;
continue;
// .google.firestore.v1.BloomFilter unchanged_names = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_unchanged_names(), ptr);
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
Expand Down Expand Up @@ -2952,6 +2990,14 @@ ::PROTOBUF_NAMESPACE_ID::uint8* ExistenceFilter::_InternalSerialize(
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_count(), target);
}

// .google.firestore.v1.BloomFilter unchanged_names = 3;
if (this->has_unchanged_names()) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(
3, _Internal::unchanged_names(this), target, stream);
}

if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target, stream);
Expand All @@ -2968,6 +3014,13 @@ size_t ExistenceFilter::ByteSizeLong() const {
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;

// .google.firestore.v1.BloomFilter unchanged_names = 3;
if (this->has_unchanged_names()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*unchanged_names_);
}

// int32 target_id = 1;
if (this->target_id() != 0) {
total_size += 1 +
Expand Down Expand Up @@ -3013,6 +3066,9 @@ void ExistenceFilter::MergeFrom(const ExistenceFilter& from) {
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;

if (from.has_unchanged_names()) {
_internal_mutable_unchanged_names()->::google::firestore::v1::BloomFilter::MergeFrom(from._internal_unchanged_names());
}
if (from.target_id() != 0) {
_internal_set_target_id(from._internal_target_id());
}
Expand Down Expand Up @@ -3042,6 +3098,7 @@ bool ExistenceFilter::IsInitialized() const {
void ExistenceFilter::InternalSwap(ExistenceFilter* other) {
using std::swap;
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(unchanged_names_, other->unchanged_names_);
swap(target_id_, other->target_id_);
swap(count_, other->count_);
}
Expand Down
Loading