blob: 54f30fad6c8b47a76ba54a0f6b2ed31a993199d5 [file] [log] [blame]
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.net.proto import ProtocolBuffer
import array
import dummy_thread as thread
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
_extension_runtime = True
_ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage
else:
_extension_runtime = False
_ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage
from google.appengine.api.api_base_pb import *
import google.appengine.api.api_base_pb
from google.appengine.datastore.action_pb import *
import google.appengine.datastore.action_pb
from google.appengine.datastore.entity_pb import *
import google.appengine.datastore.entity_pb
from google.appengine.datastore.snapshot_pb import *
import google.appengine.datastore.snapshot_pb
class InternalHeader(ProtocolBuffer.ProtocolMessage):
has_requesting_app_id_ = 0
requesting_app_id_ = ""
has_api_settings_ = 0
api_settings_ = ""
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def requesting_app_id(self): return self.requesting_app_id_
def set_requesting_app_id(self, x):
self.has_requesting_app_id_ = 1
self.requesting_app_id_ = x
def clear_requesting_app_id(self):
if self.has_requesting_app_id_:
self.has_requesting_app_id_ = 0
self.requesting_app_id_ = ""
def has_requesting_app_id(self): return self.has_requesting_app_id_
def api_settings(self): return self.api_settings_
def set_api_settings(self, x):
self.has_api_settings_ = 1
self.api_settings_ = x
def clear_api_settings(self):
if self.has_api_settings_:
self.has_api_settings_ = 0
self.api_settings_ = ""
def has_api_settings(self): return self.has_api_settings_
def MergeFrom(self, x):
assert x is not self
if (x.has_requesting_app_id()): self.set_requesting_app_id(x.requesting_app_id())
if (x.has_api_settings()): self.set_api_settings(x.api_settings())
def Equals(self, x):
if x is self: return 1
if self.has_requesting_app_id_ != x.has_requesting_app_id_: return 0
if self.has_requesting_app_id_ and self.requesting_app_id_ != x.requesting_app_id_: return 0
if self.has_api_settings_ != x.has_api_settings_: return 0
if self.has_api_settings_ and self.api_settings_ != x.api_settings_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
return initialized
def ByteSize(self):
n = 0
if (self.has_requesting_app_id_): n += 1 + self.lengthString(len(self.requesting_app_id_))
if (self.has_api_settings_): n += 1 + self.lengthString(len(self.api_settings_))
return n
def ByteSizePartial(self):
n = 0
if (self.has_requesting_app_id_): n += 1 + self.lengthString(len(self.requesting_app_id_))
if (self.has_api_settings_): n += 1 + self.lengthString(len(self.api_settings_))
return n
def Clear(self):
self.clear_requesting_app_id()
self.clear_api_settings()
def OutputUnchecked(self, out):
if (self.has_requesting_app_id_):
out.putVarInt32(18)
out.putPrefixedString(self.requesting_app_id_)
if (self.has_api_settings_):
out.putVarInt32(26)
out.putPrefixedString(self.api_settings_)
def OutputPartial(self, out):
if (self.has_requesting_app_id_):
out.putVarInt32(18)
out.putPrefixedString(self.requesting_app_id_)
if (self.has_api_settings_):
out.putVarInt32(26)
out.putPrefixedString(self.api_settings_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 18:
self.set_requesting_app_id(d.getPrefixedString())
continue
if tt == 26:
self.set_api_settings(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_requesting_app_id_: res+=prefix+("requesting_app_id: %s\n" % self.DebugFormatString(self.requesting_app_id_))
if self.has_api_settings_: res+=prefix+("api_settings: %s\n" % self.DebugFormatString(self.api_settings_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
krequesting_app_id = 2
kapi_settings = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
2: "requesting_app_id",
3: "api_settings",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting_datastore_v3.InternalHeader'
class Transaction(ProtocolBuffer.ProtocolMessage):
has_header_ = 0
header_ = None
has_handle_ = 0
handle_ = 0
has_app_ = 0
app_ = ""
has_mark_changes_ = 0
mark_changes_ = 0
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def header(self):
if self.header_ is None:
self.lazy_init_lock_.acquire()
try:
if self.header_ is None: self.header_ = InternalHeader()
finally:
self.lazy_init_lock_.release()
return self.header_
def mutable_header(self): self.has_header_ = 1; return self.header()
def clear_header(self):
if self.has_header_:
self.has_header_ = 0;
if self.header_ is not None: self.header_.Clear()
def has_header(self): return self.has_header_
def handle(self): return self.handle_
def set_handle(self, x):
self.has_handle_ = 1
self.handle_ = x
def clear_handle(self):
if self.has_handle_:
self.has_handle_ = 0
self.handle_ = 0
def has_handle(self): return self.has_handle_
def app(self): return self.app_
def set_app(self, x):
self.has_app_ = 1
self.app_ = x
def clear_app(self):
if self.has_app_:
self.has_app_ = 0
self.app_ = ""
def has_app(self): return self.has_app_
def mark_changes(self): return self.mark_changes_
def set_mark_changes(self, x):
self.has_mark_changes_ = 1
self.mark_changes_ = x
def clear_mark_changes(self):
if self.has_mark_changes_:
self.has_mark_changes_ = 0
self.mark_changes_ = 0
def has_mark_changes(self): return self.has_mark_changes_
def MergeFrom(self, x):
assert x is not self
if (x.has_header()): self.mutable_header().MergeFrom(x.header())
if (x.has_handle()): self.set_handle(x.handle())
if (x.has_app()): self.set_app(x.app())
if (x.has_mark_changes()): self.set_mark_changes(x.mark_changes())
def Equals(self, x):
if x is self: return 1
if self.has_header_ != x.has_header_: return 0
if self.has_header_ and self.header_ != x.header_: return 0
if self.has_handle_ != x.has_handle_: return 0
if self.has_handle_ and self.handle_ != x.handle_: return 0
if self.has_app_ != x.has_app_: return 0
if self.has_app_ and self.app_ != x.app_: return 0
if self.has_mark_changes_ != x.has_mark_changes_: return 0
if self.has_mark_changes_ and self.mark_changes_ != x.mark_changes_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (self.has_header_ and not self.header_.IsInitialized(debug_strs)): initialized = 0
if (not self.has_handle_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: handle not set.')
if (not self.has_app_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: app not set.')
return initialized
def ByteSize(self):
n = 0
if (self.has_header_): n += 1 + self.lengthString(self.header_.ByteSize())
n += self.lengthString(len(self.app_))
if (self.has_mark_changes_): n += 2
return n + 10
def ByteSizePartial(self):
n = 0
if (self.has_header_): n += 1 + self.lengthString(self.header_.ByteSizePartial())
if (self.has_handle_):
n += 9
if (self.has_app_):
n += 1
n += self.lengthString(len(self.app_))
if (self.has_mark_changes_): n += 2
return n
def Clear(self):
self.clear_header()
self.clear_handle()
self.clear_app()
self.clear_mark_changes()
def OutputUnchecked(self, out):
out.putVarInt32(9)
out.put64(self.handle_)
out.putVarInt32(18)
out.putPrefixedString(self.app_)
if (self.has_mark_changes_):
out.putVarInt32(24)
out.putBoolean(self.mark_changes_)
if (self.has_header_):
out.putVarInt32(34)
out.putVarInt32(self.header_.ByteSize())
self.header_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_handle_):
out.putVarInt32(9)
out.put64(self.handle_)
if (self.has_app_):
out.putVarInt32(18)
out.putPrefixedString(self.app_)
if (self.has_mark_changes_):
out.putVarInt32(24)
out.putBoolean(self.mark_changes_)
if (self.has_header_):
out.putVarInt32(34)
out.putVarInt32(self.header_.ByteSizePartial())
self.header_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 9:
self.set_handle(d.get64())
continue
if tt == 18:
self.set_app(d.getPrefixedString())
continue
if tt == 24:
self.set_mark_changes(d.getBoolean())
continue
if tt == 34:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_header().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_header_:
res+=prefix+"header <\n"
res+=self.header_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_handle_: res+=prefix+("handle: %s\n" % self.DebugFormatFixed64(self.handle_))
if self.has_app_: res+=prefix+("app: %s\n" % self.DebugFormatString(self.app_))
if self.has_mark_changes_: res+=prefix+("mark_changes: %s\n" % self.DebugFormatBool(self.mark_changes_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kheader = 4
khandle = 1
kapp = 2
kmark_changes = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "handle",
2: "app",
3: "mark_changes",
4: "header",
}, 4)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.DOUBLE,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.NUMERIC,
4: ProtocolBuffer.Encoder.STRING,
}, 4, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting_datastore_v3.Transaction'
class Query_Filter(ProtocolBuffer.ProtocolMessage):
LESS_THAN = 1
LESS_THAN_OR_EQUAL = 2
GREATER_THAN = 3
GREATER_THAN_OR_EQUAL = 4
EQUAL = 5
IN = 6
EXISTS = 7
_Operator_NAMES = {
1: "LESS_THAN",
2: "LESS_THAN_OR_EQUAL",
3: "GREATER_THAN",
4: "GREATER_THAN_OR_EQUAL",
5: "EQUAL",
6: "IN",
7: "EXISTS",
}
def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
Operator_Name = classmethod(Operator_Name)
has_op_ = 0
op_ = 0
def __init__(self, contents=None):
self.property_ = []
if contents is not None: self.MergeFromString(contents)
def op(self): return self.op_
def set_op(self, x):
self.has_op_ = 1
self.op_ = x
def clear_op(self):
if self.has_op_:
self.has_op_ = 0
self.op_ = 0
def has_op(self): return self.has_op_
def property_size(self): return len(self.property_)
def property_list(self): return self.property_
def property(self, i):
return self.property_[i]
def mutable_property(self, i):
return self.property_[i]
def add_property(self):
x = Property()
self.property_.append(x)
return x
def clear_property(self):
self.property_ = []
def MergeFrom(self, x):
assert x is not self
if (x.has_op()): self.set_op(x.op())
for i in xrange(x.property_size()): self.add_property().CopyFrom(x.property(i))
def Equals(self, x):
if x is self: return 1
if self.has_op_ != x.has_op_: return 0
if self.has_op_ and self.op_ != x.op_: return 0
if len(self.property_) != len(x.property_): return 0
for e1, e2 in zip(self.property_, x.property_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_op_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: op not set.')
for p in self.property_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += self.lengthVarInt64(self.op_)
n += 1 * len(self.property_)
for i in xrange(len(self.property_)): n += self.lengthString(self.property_[i].ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_op_):
n += 1
n += self.lengthVarInt64(self.op_)
n += 1 * len(self.property_)
for i in xrange(len(self.property_)): n += self.lengthString(self.property_[i].ByteSizePartial())
return n
def Clear(self):
self.clear_op()
self.clear_property()
def OutputUnchecked(self, out):
out.putVarInt32(48)
out.putVarInt32(self.op_)
for i in xrange(len(self.property_)):
out.putVarInt32(114)
out.putVarInt32(self.property_[i].ByteSize())
self.property_[i].OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_op_):
out.putVarInt32(48)
out.putVarInt32(self.op_)
for i in xrange(len(self.property_)):
out.putVarInt32(114)
out.putVarInt32(self.property_[i].ByteSizePartial())
self.property_[i].OutputPartial(out)
def TryMerge(self, d):
while 1:
tt = d.getVarInt32()
if tt == 36: break
if tt == 48:
self.set_op(d.getVarInt32())
continue
if tt == 114:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_property().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_op_: res+=prefix+("op: %s\n" % self.DebugFormatInt32(self.op_))
cnt=0
for e in self.property_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("property%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
return res
class Query_Order(ProtocolBuffer.ProtocolMessage):
ASCENDING = 1
DESCENDING = 2
_Direction_NAMES = {
1: "ASCENDING",
2: "DESCENDING",
}
def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "")
Direction_Name = classmethod(Direction_Name)
has_property_ = 0
property_ = ""
has_direction_ = 0
direction_ = 1
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def property(self): return self.property_
def set_property(self, x):
self.has_property_ = 1
self.property_ = x
def clear_property(self):
if self.has_property_:
self.has_property_ = 0
self.property_ = ""
def has_property(self): return self.has_property_
def direction(self): return self.direction_
def set_direction(self, x):
self.has_direction_ = 1
self.direction_ = x
def clear_direction(self):
if self.has_direction_:
self.has_direction_ = 0
self.direction_ = 1
def has_direction(self): return self.has_direction_
def MergeFrom(self, x):
assert x is not self
if (x.has_property()): self.set_property(x.property())
if (x.has_direction()): self.set_direction(x.direction())
def Equals(self, x):
if x is self: return 1
if self.has_property_ != x.has_property_: return 0
if self.has_property_ and self.property_ != x.property_: return 0
if self.has_direction_ != x.has_direction_: return 0
if self.has_direction_ and self.direction_ != x.direction_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_property_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: property not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(len(self.property_))
if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_property_):
n += 1
n += self.lengthString(len(self.property_))
if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
return n
def Clear(self):
self.clear_property()
self.clear_direction()
def OutputUnchecked(self, out):
out.putVarInt32(82)
out.putPrefixedString(self.property_)
if (self.has_direction_):
out.putVarInt32(88)
out.putVarInt32(self.direction_)
def OutputPartial(self, out):
if (self.has_property_):
out.putVarInt32(82)
out.putPrefixedString(self.property_)
if (self.has_direction_):
out.putVarInt32(88)
out.putVarInt32(self.direction_)
def TryMerge(self, d):
while 1:
tt = d.getVarInt32()
if tt == 76: break
if tt == 82:
self.set_property(d.getPrefixedString())
continue
if tt == 88:
self.set_direction(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_property_: res+=prefix+("property: %s\n" % self.DebugFormatString(self.property_))
if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_))
return res
class Query(ProtocolBuffer.ProtocolMessage):
ORDER_FIRST = 1
ANCESTOR_FIRST = 2
FILTER_FIRST = 3
_Hint_NAMES = {
1: "ORDER_FIRST",
2: "ANCESTOR_FIRST",
3: "FILTER_FIRST",
}
def Hint_Name(cls, x): return cls._Hint_NAMES.get(x, "")
Hint_Name = classmethod(Hint_Name)
has_header_ = 0
header_ = None
has_app_ = 0
app_ = ""
has_name_space_ = 0
name_space_ = ""
has_kind_ = 0
kind_ = ""
has_ancestor_ = 0
ancestor_ = None
has_search_query_ = 0
search_query_ = ""
has_hint_ = 0
hint_ = 0
has_count_ = 0
count_ = 0
has_offset_ = 0
offset_ = 0
has_limit_ = 0
limit_ = 0
has_compiled_cursor_ = 0
compiled_cursor_ = None
has_end_compiled_cursor_ = 0
end_compiled_cursor_ = None
has_require_perfect_plan_ = 0
require_perfect_plan_ = 0
has_keys_only_ = 0
keys_only_ = 0
has_transaction_ = 0
transaction_ = None
has_compile_ = 0
compile_ = 0
has_failover_ms_ = 0
failover_ms_ = 0
has_strong_ = 0
strong_ = 0
has_distinct_ = 0
distinct_ = 0
has_min_safe_time_seconds_ = 0
min_safe_time_seconds_ = 0
has_persist_offset_ = 0
persist_offset_ = 0
def __init__(self, contents=None):
self.filter_ = []
self.order_ = []
self.composite_index_ = []
self.property_name_ = []
self.group_by_property_name_ = []
self.safe_replica_name_ = []
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def header(self):
if self.header_ is None:
self.lazy_init_lock_.acquire()
try:
if self.header_ is None: self.header_ = InternalHeader()
finally:
self.lazy_init_lock_.release()
return self.header_
def mutable_header(self): self.has_header_ = 1; return self.header()
def clear_header(self):
if self.has_header_:
self.has_header_ = 0;
if self.header_ is not None: self.header_.Clear()
def has_header(self): return self.has_header_
def app(self): return self.app_
def set_app(self, x):
self.has_app_ = 1
self.app_ = x
def clear_app(self):
if self.has_app_:
self.has_app_ = 0
self.app_ = ""
def has_app(self): return self.has_app_
def name_space(self): return self.name_space_
def set_name_space(self, x):
self.has_name_space_ = 1
self.name_space_ = x
def clear_name_space(self):
if self.has_name_space_:
self.has_name_space_ = 0
self.name_space_ = ""
def has_name_space(self): return self.has_name_space_
def kind(self): return self.kind_
def set_kind(self, x):
self.has_kind_ = 1
self.kind_ = x
def clear_kind(self):
if self.has_kind_:
self.has_kind_ = 0
self.kind_ = ""
def has_kind(self): return self.has_kind_
def ancestor(self):
if self.ancestor_ is None:
self.lazy_init_lock_.acquire()
try:
if self.ancestor_ is None: self.ancestor_ = Reference()
finally:
self.lazy_init_lock_.release()
return self.ancestor_
def mutable_ancestor(self): self.has_ancestor_ = 1; return self.ancestor()
def clear_ancestor(self):
if self.has_ancestor_:
self.has_ancestor_ = 0;
if self.ancestor_ is not None: self.ancestor_.Clear()
def has_ancestor(self): return self.has_ancestor_
def filter_size(self): return len(self.filter_)
def filter_list(self): return self.filter_
def filter(self, i):
return self.filter_[i]
def mutable_filter(self, i):
return self.filter_[i]
def add_filter(self):
x = Query_Filter()
self.filter_.append(x)
return x
def clear_filter(self):
self.filter_ = []
def search_query(self): return self.search_query_
def set_search_query(self, x):
self.has_search_query_ = 1
self.search_query_ = x
def clear_search_query(self):
if self.has_search_query_:
self.has_search_query_ = 0
self.search_query_ = ""
def has_search_query(self): return self.has_search_query_
def order_size(self): return len(self.order_)
def order_list(self): return self.order_
def order(self, i):
return self.order_[i]
def mutable_order(self, i):
return self.order_[i]
def add_order(self):
x = Query_Order()
self.order_.append(x)
return x
def clear_order(self):
self.order_ = []
def hint(self): return self.hint_
def set_hint(self, x):
self.has_hint_ = 1
self.hint_ = x
def clear_hint(self):
if self.has_hint_:
self.has_hint_ = 0
self.hint_ = 0
def has_hint(self): return self.has_hint_
def count(self): return self.count_
def set_count(self, x):
self.has_count_ = 1
self.count_ = x
def clear_count(self):
if self.has_count_:
self.has_count_ = 0
self.count_ = 0
def has_count(self): return self.has_count_
def offset(self): return self.offset_
def set_offset(self, x):
self.has_offset_ = 1
self.offset_ = x
def clear_offset(self):
if self.has_offset_:
self.has_offset_ = 0
self.offset_ = 0
def has_offset(self): return self.has_offset_
def limit(self): return self.limit_
def set_limit(self, x):
self.has_limit_ = 1
self.limit_ = x
def clear_limit(self):
if self.has_limit_:
self.has_limit_ = 0
self.limit_ = 0
def has_limit(self): return self.has_limit_
def compiled_cursor(self):
if self.compiled_cursor_ is None:
self.lazy_init_lock_.acquire()
try:
if self.compiled_cursor_ is None: self.compiled_cursor_ = CompiledCursor()
finally:
self.lazy_init_lock_.release()
return self.compiled_cursor_
def mutable_compiled_cursor(self): self.has_compiled_cursor_ = 1; return self.compiled_cursor()
def clear_compiled_cursor(self):
if self.has_compiled_cursor_:
self.has_compiled_cursor_ = 0;
if self.compiled_cursor_ is not None: self.compiled_cursor_.Clear()
def has_compiled_cursor(self): return self.has_compiled_cursor_
def end_compiled_cursor(self):
if self.end_compiled_cursor_ is None:
self.lazy_init_lock_.acquire()
try:
if self.end_compiled_cursor_ is None: self.end_compiled_cursor_ = CompiledCursor()
finally:
self.lazy_init_lock_.release()
return self.end_compiled_cursor_
def mutable_end_compiled_cursor(self): self.has_end_compiled_cursor_ = 1; return self.end_compiled_cursor()
def clear_end_compiled_cursor(self):
if self.has_end_compiled_cursor_:
self.has_end_compiled_cursor_ = 0;
if self.end_compiled_cursor_ is not None: self.end_compiled_cursor_.Clear()
def has_end_compiled_cursor(self): return self.has_end_compiled_cursor_
def composite_index_size(self): return len(self.composite_index_)
def composite_index_list(self): return self.composite_index_
def composite_index(self, i):
return self.composite_index_[i]
def mutable_composite_index(self, i):
return self.composite_index_[i]
def add_composite_index(self):
x = CompositeIndex()
self.composite_index_.append(x)
return x
def clear_composite_index(self):
self.composite_index_ = []
def require_perfect_plan(self): return self.require_perfect_plan_
def set_require_perfect_plan(self, x):
self.has_require_perfect_plan_ = 1
self.require_perfect_plan_ = x
def clear_require_perfect_plan(self):
if self.has_require_perfect_plan_:
self.has_require_perfect_plan_ = 0
self.require_perfect_plan_ = 0
def has_require_perfect_plan(self): return self.has_require_perfect_plan_
def keys_only(self): return self.keys_only_
def set_keys_only(self, x):
self.has_keys_only_ = 1
self.keys_only_ = x
def clear_keys_only(self):
if self.has_keys_only_:
self.has_keys_only_ = 0
self.keys_only_ = 0
def has_keys_only(self): return self.has_keys_only_
def transaction(self):
if self.transaction_ is None:
self.lazy_init_lock_.acquire()
try:
if self.transaction_ is None: self.transaction_ = Transaction()
finally:
self.lazy_init_lock_.release()
return self.transaction_
def mutable_transaction(self): self.has_transaction_ = 1; return self.transaction()
def clear_transaction(self):
if self.has_transaction_:
self.has_transaction_ = 0;
if self.transaction_ is not None: self.transaction_.Clear()
def has_transaction(self): return self.has_transaction_
def compile(self): return self.compile_
def set_compile(self, x):
self.has_compile_ = 1
self.compile_ = x
def clear_compile(self):
if self.has_compile_:
self.has_compile_ = 0
self.compile_ = 0
def has_compile(self): return self.has_compile_
def failover_ms(self): return self.failover_ms_
def set_failover_ms(self, x):
self.has_failover_ms_ = 1
self.failover_ms_ = x
def clear_failover_ms(self):
if self.has_failover_ms_:
self.has_failover_ms_ = 0
self.failover_ms_ = 0
def has_failover_ms(self): return self.has_failover_ms_
def strong(self): return self.strong_
def set_strong(self, x):
self.has_strong_ = 1
self.strong_ = x
def clear_strong(self):
if self.has_strong_:
self.has_strong_ = 0
self.strong_ = 0
def has_strong(self): return self.has_strong_
def property_name_size(self): return len(self.property_name_)
def property_name_list(self): return self.property_name_
def property_name(self, i):
return self.property_name_[i]
def set_property_name(self, i, x):
self.property_name_[i] = x
def add_property_name(self, x):
self.property_name_.append(x)
def clear_property_name(self):
self.property_name_ = []
def group_by_property_name_size(self): return len(self.group_by_property_name_)
def group_by_property_name_list(self): return self.group_by_property_name_
def group_by_property_name(self, i):
return self.group_by_property_name_[i]
def set_group_by_property_name(self, i, x):
self.group_by_property_name_[i] = x
def add_group_by_property_name(self, x):
self.group_by_property_name_.append(x)
def clear_group_by_property_name(self):
self.group_by_property_name_ = []
def distinct(self): return self.distinct_
def set_distinct(self, x):
self.has_distinct_ = 1
self.distinct_ = x
def clear_distinct(self):
if self.has_distinct_:
self.has_distinct_ = 0
self.distinct_ = 0
def has_distinct(self): return self.has_distinct_
def min_safe_time_seconds(self): return self.min_safe_time_seconds_
def set_min_safe_time_seconds(self, x):
self.has_min_safe_time_seconds_ = 1
self.min_safe_time_seconds_ = x
def clear_min_safe_time_seconds(self):
if self.has_min_safe_time_seconds_:
self.has_min_safe_time_seconds_ = 0
self.min_safe_time_seconds_ = 0
def has_min_safe_time_seconds(self): return self.has_min_safe_time_seconds_
def safe_replica_name_size(self): return len(self.safe_replica_name_)
def safe_replica_name_list(self): return self.safe_replica_name_
def safe_replica_name(self, i):
return self.safe_replica_name_[i]
def set_safe_replica_name(self, i, x):
self.safe_replica_name_[i] = x
def add_safe_replica_name(self, x):
self.safe_replica_name_.append(x)
def clear_safe_replica_name(self):
self.safe_replica_name_ = []
def persist_offset(self): return self.persist_offset_
def set_persist_offset(self, x):
self.has_persist_offset_ = 1
self.persist_offset_ = x
def clear_persist_offset(self):
if self.has_persist_offset_:
self.has_persist_offset_ = 0
self.persist_offset_ = 0
def has_persist_offset(self): return self.has_persist_offset_
def MergeFrom(self, x):
assert x is not self
if (x.has_header()): self.mutable_header().MergeFrom(x.header())
if (x.has_app()): self.set_app(x.app())
if (x.has_name_space()): self.set_name_space(x.name_space())
if (x.has_kind()): self.set_kind(x.kind())
if (x.has_ancestor()): self.mutable_ancestor().MergeFrom(x.ancestor())
for i in xrange(x.filter_size()): self.add_filter().CopyFrom(x.filter(i))
if (x.has_search_query()): self.set_search_query(x.search_query())
for i in xrange(x.order_size()): self.add_order().CopyFrom(x.order(i))
if (x.has_hint()): self.set_hint(x.hint())
if (x.has_count()): self.set_count(x.count())
if (x.has_offset()): self.set_offset(x.offset())
if (x.has_limit()): self.set_limit(x.limit())
if (x.has_compiled_cursor()): self.mutable_compiled_cursor().MergeFrom(x.compiled_cursor())
if (x.has_end_compiled_cursor()): self.mutable_end_compiled_cursor().MergeFrom(x.end_compiled_cursor())
for i in xrange(x.composite_index_size()): self.add_composite_index().CopyFrom(x.composite_index(i))
if (x.has_require_perfect_plan()): self.set_require_perfect_plan(x.require_perfect_plan())
if (x.has_keys_only()): self.set_keys_only(x.keys_only())
if (x.has_transaction()): self.mutable_transaction().MergeFrom(x.transaction())
if (x.has_compile()): self.set_compile(x.compile())
if (x.has_failover_ms()): self.set_failover_ms(x.failover_ms())
if (x.has_strong()): self.set_strong(x.strong())
for i in xrange(x.property_name_size()): self.add_property_name(x.property_name(i))
for i in xrange(x.group_by_property_name_size()): self.add_group_by_property_name(x.group_by_property_name(i))
if (x.has_distinct()): self.set_distinct(x.distinct())
if (x.has_min_safe_time_seconds()): self.set_min_safe_time_seconds(x.min_safe_time_seconds())
for i in xrange(x.safe_replica_name_size()): self.add_safe_replica_name(x.safe_replica_name(i))
if (x.has_persist_offset()): self.set_persist_offset(x.persist_offset())
def Equals(self, x):
if x is self: return 1
if self.has_header_ != x.has_header_: return 0
if self.has_header_ and self.header_ != x.header_: return 0
if self.has_app_ != x.has_app_: return 0
if self.has_app_ and self.app_ != x.app_: return 0
if self.has_name_space_ != x.has_name_space_: return 0
if self.has_name_space_ and self.name_space_ != x.name_space_: return 0
if self.has_kind_ != x.has_kind_: return 0
if self.has_kind_ and self.kind_ != x.kind_: return 0
if self.has_ancestor_ != x.has_ancestor_: return 0
if self.has_ancestor_ and self.ancestor_ != x.ancestor_: return 0
if len(self.filter_) != len(x.filter_): return 0
for e1, e2 in zip(self.filter_, x.filter_):
if e1 != e2: return 0
if self.has_search_query_ != x.has_search_query_: return 0
if self.has_search_query_ and self.search_query_ != x.search_query_: return 0
if len(self.order_) != len(x.order_): return 0
for e1, e2 in zip(self.order_, x.order_):
if e1 != e2: return 0
if self.has_hint_ != x.has_hint_: return 0
if self.has_hint_ and self.hint_ != x.hint_: return 0
if self.has_count_ != x.has_count_: return 0
if self.has_count_ and self.count_ != x.count_: return 0
if self.has_offset_ != x.has_offset_: return 0
if self.has_offset_ and self.offset_ != x.offset_: return 0
if self.has_limit_ != x.has_limit_: return 0
if self.has_limit_ and self.limit_ != x.limit_: return 0
if self.has_compiled_cursor_ != x.has_compiled_cursor_: return 0
if self.has_compiled_cursor_ and self.compiled_cursor_ != x.compiled_cursor_: return 0
if self.has_end_compiled_cursor_ != x.has_end_compiled_cursor_: return 0
if self.has_end_compiled_cursor_ and self.end_compiled_cursor_ != x.end_compiled_cursor_: return 0
if len(self.composite_index_) != len(x.composite_index_): return 0
for e1, e2 in zip(self.composite_index_, x.composite_index_):
if e1 != e2: return 0
if self.has_require_perfect_plan_ != x.has_require_perfect_plan_: return 0
if self.has_require_perfect_plan_ and self.require_perfect_plan_ != x.require_perfect_plan_: return 0
if self.has_keys_only_ != x.has_keys_only_: return 0
if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0
if self.has_transaction_ != x.has_transaction_: return 0
if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
if self.has_compile_ != x.has_compile_: return 0
if self.has_compile_ and self.compile_ != x.compile_: return 0
if self.has_failover_ms_ != x.has_failover_ms_: return 0
if self.has_failover_ms_ and self.failover_ms_ != x.failover_ms_: return 0
if self.has_strong_ != x.has_strong_: return 0
if self.has_strong_ and self.strong_ != x.strong_: return 0
if len(self.property_name_) != len(x.property_name_): return 0
for e1, e2 in zip(self.property_name_, x.property_name_):
if e1 != e2: return 0
if len(self.group_by_property_name_) != len(x.group_by_property_name_): return 0
for e1, e2 in zip(self.group_by_property_name_, x.group_by_property_name_):
if e1 != e2: return 0
if self.has_distinct_ != x.has_distinct_: return 0
if self.has_distinct_ and self.distinct_ != x.distinct_: return 0
if self.has_min_safe_time_seconds_ != x.has_min_safe_time_seconds_: return 0
if self.has_min_safe_time_seconds_ and self.min_safe_time_seconds_ != x.min_safe_time_seconds_: return 0
if len(self.safe_replica_name_) != len(x.safe_replica_name_): return 0
for e1, e2 in zip(self.safe_replica_name_, x.safe_replica_name_):
if e1 != e2: return 0
if self.has_persist_offset_ != x.has_persist_offset_: return 0
if self.has_persist_offset_ and self.persist_offset_ != x.persist_offset_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (self.has_header_ and not self.header_.IsInitialized(debug_strs)): initialized = 0
if (not self.has_app_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: app not set.')
if (self.has_ancestor_ and not self.ancestor_.IsInitialized(debug_strs)): initialized = 0
for p in self.filter_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.order_:
if not p.IsInitialized(debug_strs): initialized=0
if (self.has_compiled_cursor_ and not self.compiled_cursor_.IsInitialized(debug_strs)): initialized = 0
if (self.has_end_compiled_cursor_ and not self.end_compiled_cursor_.IsInitialized(debug_strs)): initialized = 0
for p in self.composite_index_:
if not p.IsInitialized(debug_strs): initialized=0
if (self.has_transaction_ and not self.transaction_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
if (self.has_header_): n += 2 + self.lengthString(self.header_.ByteSize())
n += self.lengthString(len(self.app_))
if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_))
if (self.has_kind_): n += 1 + self.lengthString(len(self.kind_))
if (self.has_ancestor_): n += 2 + self.lengthString(self.ancestor_.ByteSize())
n += 2 * len(self.filter_)
for i in xrange(len(self.filter_)): n += self.filter_[i].ByteSize()
if (self.has_search_query_): n += 1 + self.lengthString(len(self.search_query_))
n += 2 * len(self.order_)
for i in xrange(len(self.order_)): n += self.order_[i].ByteSize()
if (self.has_hint_): n += 2 + self.lengthVarInt64(self.hint_)
if (self.has_count_): n += 2 + self.lengthVarInt64(self.count_)
if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
if (self.has_limit_): n += 2 + self.lengthVarInt64(self.limit_)
if (self.has_compiled_cursor_): n += 2 + self.lengthString(self.compiled_cursor_.ByteSize())
if (self.has_end_compiled_cursor_): n += 2 + self.lengthString(self.end_compiled_cursor_.ByteSize())
n += 2 * len(self.composite_index_)
for i in xrange(len(self.composite_index_)): n += self.lengthString(self.composite_index_[i].ByteSize())
if (self.has_require_perfect_plan_): n += 3
if (self.has_keys_only_): n += 3
if (self.has_transaction_): n += 2 + self.lengthString(self.transaction_.ByteSize())
if (self.has_compile_): n += 3
if (self.has_failover_ms_): n += 2 + self.lengthVarInt64(self.failover_ms_)
if (self.has_strong_): n += 3
n += 2 * len(self.property_name_)
for i in xrange(len(self.property_name_)): n += self.lengthString(len(self.property_name_[i]))
n += 2 * len(self.group_by_property_name_)
for i in xrange(len(self.group_by_property_name_)): n += self.lengthString(len(self.group_by_property_name_[i]))
if (self.has_distinct_): n += 3
if (self.has_min_safe_time_seconds_): n += 2 + self.lengthVarInt64(self.min_safe_time_seconds_)
n += 2 * len(self.safe_replica_name_)
for i in xrange(len(self.safe_replica_name_)): n += self.lengthString(len(self.safe_replica_name_[i]))
if (self.has_persist_offset_): n += 3
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_header_): n += 2 + self.lengthString(self.header_.ByteSizePartial())
if (self.has_app_):
n += 1
n += self.lengthString(len(self.app_))
if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_))
if (self.has_kind_): n += 1 + self.lengthString(len(self.kind_))
if (self.has_ancestor_): n += 2 + self.lengthString(self.ancestor_.ByteSizePartial())
n += 2 * len(self.filter_)
for i in xrange(len(self.filter_)): n += self.filter_[i].ByteSizePartial()
if (self.has_search_query_): n += 1 + self.lengthString(len(self.search_query_))
n += 2 * len(self.order_)
for i in xrange(len(self.order_)): n += self.order_[i].ByteSizePartial()
if (self.has_hint_): n += 2 + self.lengthVarInt64(self.hint_)
if (self.has_count_): n += 2 + self.lengthVarInt64(self.count_)
if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
if (self.has_limit_): n += 2 + self.lengthVarInt64(self.limit_)
if (self.has_compiled_cursor_): n += 2 + self.lengthString(self.compiled_cursor_.ByteSizePartial())
if (self.has_end_compiled_cursor_): n += 2 + self.lengthString(self.end_compiled_cursor_.ByteSizePartial())
n += 2 * len(self.composite_index_)
for i in xrange(len(self.composite_index_)): n += self.lengthString(self.composite_index_[i].ByteSizePartial())
if (self.has_require_perfect_plan_): n += 3
if (self.has_keys_only_): n += 3
if (self.has_transaction_): n += 2 + self.lengthString(self.transaction_.ByteSizePartial())
if (self.has_compile_): n += 3
if (self.has_failover_ms_): n += 2 + self.lengthVarInt64(self.failover_ms_)
if (self.has_strong_): n += 3
n += 2 * len(self.property_name_)
for i in xrange(len(self.property_name_)): n += self.lengthString(len(self.property_name_[i]))
n += 2 * len(self.group_by_property_name_)
for i in xrange(len(self.group_by_property_name_)): n += self.lengthString(len(self.group_by_property_name_[i]))
if (self.has_distinct_): n += 3
if (self.has_min_safe_time_seconds_): n += 2 + self.lengthVarInt64(self.min_safe_time_seconds_)
n += 2 * len(self.safe_replica_name_)
for i in xrange(len(self.safe_replica_name_)): n += self.lengthString(len(self.safe_replica_name_[i]))
if (self.has_persist_offset_): n += 3
return n
def Clear(self):
self.clear_header()
self.clear_app()
self.clear_name_space()
self.clear_kind()
self.clear_ancestor()
self.clear_filter()
self.clear_search_query()
self.clear_order()
self.clear_hint()
self.clear_count()
self.clear_offset()
self.clear_limit()
self.clear_compiled_cursor()
self.clear_end_compiled_cursor()
self.clear_composite_index()
self.clear_require_perfect_plan()
self.clear_keys_only()
self.clear_transaction()
self.clear_compile()
self.clear_failover_ms()
self.clear_strong()
self.clear_property_name()
self.clear_group_by_property_name()
self.clear_distinct()
self.clear_min_safe_time_seconds()
self.clear_safe_replica_name()
self.clear_persist_offset()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putPrefixedString(self.app_)
if (self.has_kind_):
out.putVarInt32(26)
out.putPrefixedString(self.kind_)
for i in xrange(len(self.filter_)):
out.putVarInt32(35)
self.filter_[i].OutputUnchecked(out)
out.putVarInt32(36)
if (self.has_search_query_):
out.putVarInt32(66)
out.putPrefixedString(self.search_query_)
for i in xrange(len(self.order_)):
out.putVarInt32(75)
self.order_[i].OutputUnchecked(out)
out.putVarInt32(76)
if (self.has_offset_):
out.putVarInt32(96)
out.putVarInt32(self.offset_)
if (self.has_limit_):
out.putVarInt32(128)
out.putVarInt32(self.limit_)
if (self.has_ancestor_):
out.putVarInt32(138)
out.putVarInt32(self.ancestor_.ByteSize())
self.ancestor_.OutputUnchecked(out)
if (self.has_hint_):
out.putVarInt32(144)
out.putVarInt32(self.hint_)
for i in xrange(len(self.composite_index_)):
out.putVarInt32(154)
out.putVarInt32(self.composite_index_[i].ByteSize())
self.composite_index_[i].OutputUnchecked(out)
if (self.has_require_perfect_plan_):
out.putVarInt32(160)
out.putBoolean(self.require_perfect_plan_)
if (self.has_keys_only_):
out.putVarInt32(168)
out.putBoolean(self.keys_only_)
if (self.has_transaction_):
out.putVarInt32(178)
out.putVarInt32(self.transaction_.ByteSize())
self.transaction_.OutputUnchecked(out)
if (self.has_count_):
out.putVarInt32(184)
out.putVarInt32(self.count_)
if (self.has_distinct_):
out.putVarInt32(192)
out.putBoolean(self.distinct_)
if (self.has_compile_):
out.putVarInt32(200)
out.putBoolean(self.compile_)
if (self.has_failover_ms_):
out.putVarInt32(208)
out.putVarInt64(self.failover_ms_)
if (self.has_name_space_):
out.putVarInt32(234)
out.putPrefixedString(self.name_space_)
if (self.has_compiled_cursor_):
out.putVarInt32(242)
out.putVarInt32(self.compiled_cursor_.ByteSize())
self.compiled_cursor_.OutputUnchecked(out)
if (self.has_end_compiled_cursor_):
out.putVarInt32(250)
out.putVarInt32(self.end_compiled_cursor_.ByteSize())
self.end_compiled_cursor_.OutputUnchecked(out)
if (self.has_strong_):
out.putVarInt32(256)
out.putBoolean(self.strong_)
for i in xrange(len(self.property_name_)):
out.putVarInt32(266)
out.putPrefixedString(self.property_name_[i])
for i in xrange(len(self.group_by_property_name_)):
out.putVarInt32(274)
out.putPrefixedString(self.group_by_property_name_[i])
if (self.has_min_safe_time_seconds_):
out.putVarInt32(280)
out.putVarInt64(self.min_safe_time_seconds_)
for i in xrange(len(self.safe_replica_name_)):
out.putVarInt32(290)
out.putPrefixedString(self.safe_replica_name_[i])
if (self.has_persist_offset_):
out.putVarInt32(296)
out.putBoolean(self.persist_offset_)
if (self.has_header_):
out.putVarInt32(314)
out.putVarInt32(self.header_.ByteSize())
self.header_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_app_):
out.putVarInt32(10)
out.putPrefixedString(self.app_)
if (self.has_kind_):
out.putVarInt32(26)
out.putPrefixedString(self.kind_)
for i in xrange(len(self.filter_)):
out.putVarInt32(35)
self.filter_[i].OutputPartial(out)
out.putVarInt32(36)
if (self.has_search_query_):
out.putVarInt32(66)
out.putPrefixedString(self.search_query_)
for i in xrange(len(self.order_)):
out.putVarInt32(75)
self.order_[i].OutputPartial(out)
out.putVarInt32(76)
if (self.has_offset_):
out.putVarInt32(96)
out.putVarInt32(self.offset_)
if (self.has_limit_):
out.putVarInt32(128)
out.putVarInt32(self.limit_)
if (self.has_ancestor_):
out.putVarInt32(138)
out.putVarInt32(self.ancestor_.ByteSizePartial())
self.ancestor_.OutputPartial(out)
if (self.has_hint_):
out.putVarInt32(144)
out.putVarInt32(self.hint_)
for i in xrange(len(self.composite_index_)):
out.putVarInt32(154)
out.putVarInt32(self.composite_index_[i].ByteSizePartial())
self.composite_index_[i].OutputPartial(out)
if (self.has_require_perfect_plan_):
out.putVarInt32(160)
out.putBoolean(self.require_perfect_plan_)
if (self.has_keys_only_):
out.putVarInt32(168)
out.putBoolean(self.keys_only_)
if (self.has_transaction_):
out.putVarInt32(178)
out.putVarInt32(self.transaction_.ByteSizePartial())
self.transaction_.OutputPartial(out)
if (self.has_count_):
out.putVarInt32(184)
out.putVarInt32(self.count_)
if (self.has_distinct_):
out.putVarInt32(192)
out.putBoolean(self.distinct_)
if (self.has_compile_):
out.putVarInt32(200)
out.putBoolean(self.compile_)
if (self.has_failover_ms_):
out.putVarInt32(208)
out.putVarInt64(self.failover_ms_)
if (self.has_name_space_):
out.putVarInt32(234)
out.putPrefixedString(self.name_space_)
if (self.has_compiled_cursor_):
out.putVarInt32(242)
out.putVarInt32(self.compiled_cursor_.ByteSizePartial())
self.compiled_cursor_.OutputPartial(out)
if (self.has_end_compiled_cursor_):
out.putVarInt32(250)
out.putVarInt32(self.end_compiled_cursor_.ByteSizePartial())
self.end_compiled_cursor_.OutputPartial(out)
if (self.has_strong_):
out.putVarInt32(256)
out.putBoolean(self.strong_)
for i in xrange(len(self.property_name_)):
out.putVarInt32(266)
out.putPrefixedString(self.property_name_[i])
for i in xrange(len(self.group_by_property_name_)):
out.putVarInt32(274)
out.putPrefixedString(self.group_by_property_name_[i])
if (self.has_min_safe_time_seconds_):
out.putVarInt32(280)
out.putVarInt64(self.min_safe_time_seconds_)
for i in xrange(len(self.safe_replica_name_)):
out.putVarInt32(290)
out.putPrefixedString(self.safe_replica_name_[i])
if (self.has_persist_offset_):
out.putVarInt32(296)
out.putBoolean(self.persist_offset_)
if (self.has_header_):
out.putVarInt32(314)
out.putVarInt32(self.header_.ByteSizePartial())
self.header_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.set_app(d.getPrefixedString())
continue
if tt == 26:
self.set_kind(d.getPrefixedString())
continue
if tt == 35:
self.add_filter().TryMerge(d)
continue
if tt == 66:
self.set_search_query(d.getPrefixedString())
continue
if tt == 75:
self.add_order().TryMerge(d)
continue
if tt == 96:
self.set_offset(d.getVarInt32())
continue
if tt == 128:
self.set_limit(d.getVarInt32())
continue
if tt == 138:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_ancestor().TryMerge(tmp)
continue
if tt == 144:
self.set_hint(d.getVarInt32())
continue
if tt == 154:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_composite_index().TryMerge(tmp)
continue
if tt == 160:
self.set_require_perfect_plan(d.getBoolean())
continue
if tt == 168:
self.set_keys_only(d.getBoolean())
continue
if tt == 178:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_transaction().TryMerge(tmp)
continue
if tt == 184:
self.set_count(d.getVarInt32())
continue
if tt == 192:
self.set_distinct(d.getBoolean())
continue
if tt == 200:
self.set_compile(d.getBoolean())
continue
if tt == 208:
self.set_failover_ms(d.getVarInt64())
continue
if tt == 234:
self.set_name_space(d.getPrefixedString())
continue
if tt == 242:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_compiled_cursor().TryMerge(tmp)
continue
if tt == 250:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_end_compiled_cursor().TryMerge(tmp)
continue
if tt == 256:
self.set_strong(d.getBoolean())
continue
if tt == 266:
self.add_property_name(d.getPrefixedString())
continue
if tt == 274:
self.add_group_by_property_name(d.getPrefixedString())
continue
if tt == 280:
self.set_min_safe_time_seconds(d.getVarInt64())
continue
if tt == 290:
self.add_safe_replica_name(d.getPrefixedString())
continue
if tt == 296:
self.set_persist_offset(d.getBoolean())
continue
if tt == 314:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_header().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_header_:
res+=prefix+"header <\n"
res+=self.header_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_app_: res+=prefix+("app: %s\n" % self.DebugFormatString(self.app_))
if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_))
if self.has_kind_: res+=prefix+("kind: %s\n" % self.DebugFormatString(self.kind_))
if self.has_ancestor_:
res+=prefix+"ancestor <\n"
res+=self.ancestor_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt=0
for e in self.filter_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("Filter%s {\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+"}\n"
cnt+=1
if self.has_search_query_: res+=prefix+("search_query: %s\n" % self.DebugFormatString(self.search_query_))
cnt=0
for e in self.order_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("Order%s {\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+"}\n"
cnt+=1
if self.has_hint_: res+=prefix+("hint: %s\n" % self.DebugFormatInt32(self.hint_))
if self.has_count_: res+=prefix+("count: %s\n" % self.DebugFormatInt32(self.count_))
if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_))
if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_))
if self.has_compiled_cursor_:
res+=prefix+"compiled_cursor <\n"
res+=self.compiled_cursor_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_end_compiled_cursor_:
res+=prefix+"end_compiled_cursor <\n"
res+=self.end_compiled_cursor_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt=0
for e in self.composite_index_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("composite_index%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_require_perfect_plan_: res+=prefix+("require_perfect_plan: %s\n" % self.DebugFormatBool(self.require_perfect_plan_))
if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_))
if self.has_transaction_:
res+=prefix+"transaction <\n"
res+=self.transaction_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_compile_: res+=prefix+("compile: %s\n" % self.DebugFormatBool(self.compile_))
if self.has_failover_ms_: res+=prefix+("failover_ms: %s\n" % self.DebugFormatInt64(self.failover_ms_))
if self.has_strong_: res+=prefix+("strong: %s\n" % self.DebugFormatBool(self.strong_))
cnt=0
for e in self.property_name_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("property_name%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
cnt=0
for e in self.group_by_property_name_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("group_by_property_name%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
if self.has_distinct_: res+=prefix+("distinct: %s\n" % self.DebugFormatBool(self.distinct_))
if self.has_min_safe_time_seconds_: res+=prefix+("min_safe_time_seconds: %s\n" % self.DebugFormatInt64(self.min_safe_time_seconds_))
cnt=0
for e in self.safe_replica_name_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("safe_replica_name%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
if self.has_persist_offset_: res+=prefix+("persist_offset: %s\n" % self.DebugFormatBool(self.persist_offset_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kheader = 39
kapp = 1
kname_space = 29
kkind = 3
kancestor = 17
kFilterGroup = 4
kFilterop = 6
kFilterproperty = 14
ksearch_query = 8
kOrderGroup = 9
kOrderproperty = 10
kOrderdirection = 11
khint = 18
kcount = 23
koffset = 12
klimit = 16
kcompiled_cursor = 30
kend_compiled_cursor = 31
kcomposite_index = 19
krequire_perfect_plan = 20
kkeys_only = 21
ktransaction = 22
kcompile = 25
kfailover_ms = 26
kstrong = 32
kproperty_name = 33
kgroup_by_property_name = 34
kdistinct = 24
kmin_safe_time_seconds = 35
ksafe_replica_name = 36
kpersist_offset = 37
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "app",
3: "kind",
4: "Filter",
6: "op",
8: "search_query",
9: "Order",
10: "property",
11: "direction",
12: "offset",
14: "property",
16: "limit",
17: "ancestor",
18: "hint",
19: "composite_index",
20: "require_perfect_plan",
21: "keys_only",
22: "transaction",
23: "count",
24: "distinct",
25: "compile",
26: "failover_ms",
29: "name_space",
30: "compiled_cursor",
31: "end_compiled_cursor",
32: "strong",
33: "property_name",
34: "group_by_property_name",
35: "min_safe_time_seconds",
36: "safe_replica_name",
37: "persist_offset",
39: "header",
}, 39)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.STARTGROUP,
6: ProtocolBuffer.Encoder.NUMERIC,
8: ProtocolBuffer.Encoder.STRING,
9: ProtocolBuffer.Encoder.STARTGROUP,
10: ProtocolBuffer.Encoder.STRING,
11: ProtocolBuffer.Encoder.NUMERIC,
12: ProtocolBuffer.Encoder.NUMERIC,
14: ProtocolBuffer.Encoder.STRING,
16: ProtocolBuffer.Encoder.NUMERIC,
17: ProtocolBuffer.Encoder.STRING,
18: ProtocolBuffer.Encoder.NUMERIC,
19: ProtocolBuffer.Encoder.STRING,
20: ProtocolBuffer.Encoder.NUMERIC,
21: ProtocolBuffer.Encoder.NUMERIC,
22: ProtocolBuffer.Encoder.STRING,
23: ProtocolBuffer.Encoder.NUMERIC,
24: ProtocolBuffer.Encoder.NUMERIC,
25: ProtocolBuffer.Encoder.NUMERIC,
26: ProtocolBuffer.Encoder.NUMERIC,
29: ProtocolBuffer.Encoder.STRING,
30: ProtocolBuffer.Encoder.STRING,
31: ProtocolBuffer.Encoder.STRING,
32: ProtocolBuffer.Encoder.NUMERIC,
33: ProtocolBuffer.Encoder.STRING,
34: ProtocolBuffer.Encoder.STRING,
35: ProtocolBuffer.Encoder.NUMERIC,
36: ProtocolBuffer.Encoder.STRING,
37: ProtocolBuffer.Encoder.NUMERIC,
39: ProtocolBuffer.Encoder.STRING,
}, 39, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting_datastore_v3.Query'
class CompiledQuery_PrimaryScan(ProtocolBuffer.ProtocolMessage):
has_index_name_ = 0
index_name_ = ""
has_start_key_ = 0
start_key_ = ""
has_start_inclusive_ = 0
start_inclusive_ = 0
has_end_key_ = 0
end_key_ = ""
has_end_inclusive_ = 0
end_inclusive_ = 0
has_end_unapplied_log_timestamp_us_ = 0
end_unapplied_log_timestamp_us_ = 0
def __init__(self, contents=None):
self.start_postfix_value_ = []
self.end_postfix_value_ = []
if contents is not None: self.MergeFromString(contents)
def index_name(self): return self.index_name_
def set_index_name(self, x):
self.has_index_name_ = 1
self.index_name_ = x
def clear_index_name(self):
if self.has_index_name_:
self.has_index_name_ = 0
self.index_name_ = ""
def has_index_name(self): return self.has_index_name_
def start_key(self): return self.start_key_
def set_start_key(self, x):
self.has_start_key_ = 1
self.start_key_ = x
def clear_start_key(self):
if self.has_start_key_:
self.has_start_key_ = 0
self.start_key_ = ""
def has_start_key(self): return self.has_start_key_
def start_inclusive(self): return self.start_inclusive_
def set_start_inclusive(self, x):
self.has_start_inclusive_ = 1
self.start_inclusive_ = x
def clear_start_inclusive(self):
if self.has_start_inclusive_:
self.has_start_inclusive_ = 0
self.start_inclusive_ = 0
def has_start_inclusive(self): return self.has_start_inclusive_
def end_key(self): return self.end_key_
def set_end_key(self, x):
self.has_end_key_ = 1
self.end_key_ = x
def clear_end_key(self):
if self.has_end_key_:
self.has_end_key_ = 0
self.end_key_ = ""
def has_end_key(self): return self.has_end_key_
def end_inclusive(self): return self.end_inclusive_
def set_end_inclusive(self, x):
self.has_end_inclusive_ = 1
self.end_inclusive_ = x
def clear_end_inclusive(self):
if self.has_end_inclusive_:
self.has_end_inclusive_ = 0
self.end_inclusive_ = 0
def has_end_inclusive(self): return self.has_end_inclusive_
def start_postfix_value_size(self): return len(self.start_postfix_value_)
def start_postfix_value_list(self): return self.start_postfix_value_
def start_postfix_value(self, i):
return self.start_postfix_value_[i]
def set_start_postfix_value(self, i, x):
self.start_postfix_value_[i] = x
def add_start_postfix_value(self, x):
self.start_postfix_value_.append(x)
def clear_start_postfix_value(self):
self.start_postfix_value_ = []
def end_postfix_value_size(self): return len(self.end_postfix_value_)
def end_postfix_value_list(self): return self.end_postfix_value_
def end_postfix_value(self, i):
return self.end_postfix_value_[i]
def set_end_postfix_value(self, i, x):
self.end_postfix_value_[i] = x
def add_end_postfix_value(self, x):
self.end_postfix_value_.append(x)
def clear_end_postfix_value(self):
self.end_postfix_value_ = []
def end_unapplied_log_timestamp_us(self): return self.end_unapplied_log_timestamp_us_
def set_end_unapplied_log_timestamp_us(self, x):
self.has_end_unapplied_log_timestamp_us_ = 1
self.end_unapplied_log_timestamp_us_ = x
def clear_end_unapplied_log_timestamp_us(self):
if self.has_end_unapplied_log_timestamp_us_:
self.has_end_unapplied_log_timestamp_us_ = 0
self.end_unapplied_log_timestamp_us_ = 0
def has_end_unapplied_log_timestamp_us(self): return self.has_end_unapplied_log_timestamp_us_
def MergeFrom(self, x):
assert x is not self
if (x.has_index_name()): self.set_index_name(x.index_name())
if (x.has_start_key()): self.set_start_key(x.start_key())
if (x.has_start_inclusive()): self.set_start_inclusive(x.start_inclusive())
if (x.has_end_key()): self.set_end_key(x.end_key())
if (x.has_end_inclusive()): self.set_end_inclusive(x.end_inclusive())
for i in xrange(x.start_postfix_value_size()): self.add_start_postfix_value(x.start_postfix_value(i))
for i in xrange(x.end_postfix_value_size()): self.add_end_postfix_value(x.end_postfix_value(i))
if (x.has_end_unapplied_log_timestamp_us()): self.set_end_unapplied_log_timestamp_us(x.end_unapplied_log_timestamp_us())
def Equals(self, x):
if x is self: return 1
if self.has_index_name_ != x.has_index_name_: return 0
if self.has_index_name_ and self.index_name_ != x.index_name_: return 0
if self.has_start_key_ != x.has_start_key_: return 0
if self.has_start_key_ and self.start_key_ != x.start_key_: return 0
if self.has_start_inclusive_ != x.has_start_inclusive_: return 0
if self.has_start_inclusive_ and self.start_inclusive_ != x.start_inclusive_: return 0
if self.has_end_key_ != x.has_end_key_: return 0
if self.has_end_key_ and self.end_key_ != x.end_key_: return 0
if self.has_end_inclusive_ != x.has_end_inclusive_: return 0
if self.has_end_inclusive_ and self.end_inclusive_ != x.end_inclusive_: return 0
if len(self.start_postfix_value_) != len(x.start_postfix_value_): return 0
for e1, e2 in zip(self.start_postfix_value_, x.start_postfix_value_):
if e1 != e2: return 0
if len(self.end_postfix_value_) != len(x.end_postfix_value_): return 0
for e1, e2 in zip(self.end_postfix_value_, x.end_postfix_value_):
if e1 != e2: return 0
if self.has_end_unapplied_log_timestamp_us_ != x.has_end_unapplied_log_timestamp_us_: return 0
if self.has_end_unapplied_log_timestamp_us_ and self.end_unapplied_log_timestamp_us_ != x.end_unapplied_log_timestamp_us_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
return initialized
def ByteSize(self):
n = 0
if (self.has_index_name_): n += 1 + self.lengthString(len(self.index_name_))
if (self.has_start_key_): n += 1 + self.lengthString(len(self.start_key_))
if (self.has_start_inclusive_): n += 2
if (self.has_end_key_): n += 1 + self.lengthString(len(self.end_key_))
if (self.has_end_inclusive_): n += 2
n += 2 * len(self.start_postfix_value_)
for i in xrange(len(self.start_postfix_value_)): n += self.lengthString(len(self.start_postfix_value_[i]))
n += 2 * len(self.end_postfix_value_)
for i in xrange(len(self.end_postfix_value_)): n += self.lengthString(len(self.end_postfix_value_[i]))
if (self.has_end_unapplied_log_timestamp_us_): n += 2 + self.lengthVarInt64(self.end_unapplied_log_timestamp_us_)
return n
def ByteSizePartial(self):
n = 0
if (self.has_index_name_): n += 1 + self.lengthString(len(self.index_name_))
if (self.has_start_key_): n += 1 + self.lengthString(len(self.start_key_))
if (self.has_start_inclusive_): n += 2
if (self.has_end_key_): n += 1 + self.lengthString(len(self.end_key_))
if (self.has_end_inclusive_): n += 2
n += 2 * len(self.start_postfix_value_)
for i in xrange(len(self.start_postfix_value_)): n += self.lengthString(len(self.start_postfix_value_[i]))
n += 2 * len(self.end_postfix_value_)
for i in xrange(len(self.end_postfix_value_)): n += self.lengthString(len(self.end_postfix_value_[i]))
if (self.has_end_unapplied_log_timestamp_us_): n += 2 + self.lengthVarInt64(self.end_unapplied_log_timestamp_us_)
return n
def Clear(self):
self.clear_index_name()
self.clear_start_key()
self.clear_start_inclusive()
self.clear_end_key()
self.clear_end_inclusive()
self.clear_start_postfix_value()
self.clear_end_postfix_value()
self.clear_end_unapplied_log_timestamp_us()
def OutputUnchecked(self, out):
if (self.has_index_name_):
out.putVarInt32(18)
out.putPrefixedString(self.index_name_)
if (self.has_start_key_):
out.putVarInt32(26)
out.putPrefixedString(self.start_key_)
if (self.has_start_inclusive_):
out.putVarInt32(32)
out.putBoolean(self.start_inclusive_)
if (self.has_end_key_):
out.putVarInt32(42)
out.putPrefixedString(self.end_key_)
if (self.has_end_inclusive_):
out.putVarInt32(48)
out.putBoolean(self.end_inclusive_)
if (self.has_end_unapplied_log_timestamp_us_):
out.putVarInt32(152)
out.putVarInt64(self.end_unapplied_log_timestamp_us_)
for i in xrange(len(self.start_postfix_value_)):
out.putVarInt32(178)
out.putPrefixedString(self.start_postfix_value_[i])
for i in xrange(len(self.end_postfix_value_)):
out.putVarInt32(186)
out.putPrefixedString(self.end_postfix_value_[i])
def OutputPartial(self, out):
if (self.has_index_name_):
out.putVarInt32(18)
out.putPrefixedString(self.index_name_)
if (self.has_start_key_):
out.putVarInt32(26)
out.putPrefixedString(self.start_key_)
if (self.has_start_inclusive_):
out.putVarInt32(32)
out.putBoolean(self.start_inclusive_)
if (self.has_end_key_):
out.putVarInt32(42)
out.putPrefixedString(self.end_key_)
if (self.has_end_inclusive_):
out.putVarInt32(48)
out.putBoolean(self.end_inclusive_)
if (self.has_end_unapplied_log_timestamp_us_):
out.putVarInt32(152)
out.putVarInt64(self.end_unapplied_log_timestamp_us_)
for i in xrange(len(self.start_postfix_value_)):
out.putVarInt32(178)
out.putPrefixedString(self.start_postfix_value_[i])
for i in xrange(len(self.end_postfix_value_)):
out.putVarInt32(186)
out.putPrefixedString(self.end_postfix_value_[i])
def TryMerge(self, d):
while 1:
tt = d.getVarInt32()
if tt == 12: break
if tt == 18:
self.set_index_name(d.getPrefixedString())
continue
if tt == 26:
self.set_start_key(d.getPrefixedString())
continue
if tt == 32:
self.set_start_inclusive(d.getBoolean())
continue
if tt == 42:
self.set_end_key(d.getPrefixedString())
continue
if tt == 48:
self.set_end_inclusive(d.getBoolean())
continue
if tt == 152:
self.set_end_unapplied_log_timestamp_us(d.getVarInt64())
continue
if tt == 178:
self.add_start_postfix_value(d.getPrefixedString())
continue
if tt == 186:
self.add_end_postfix_value(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_index_name_: res+=prefix+("index_name: %s\n" % self.DebugFormatString(self.index_name_))
if self.has_start_key_: res+=prefix+("start_key: %s\n" % self.DebugFormatString(self.start_key_))
if self.has_start_inclusive_: res+=prefix+("start_inclusive: %s\n" % self.DebugFormatBool(self.start_inclusive_))
if self.has_end_key_: res+=prefix+("end_key: %s\n" % self.DebugFormatString(self.end_key_))
if self.has_end_inclusive_: res+=prefix+("end_inclusive: %s\n" % self.DebugFormatBool(self.end_inclusive_))
cnt=0
for e in self.start_postfix_value_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("start_postfix_value%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
cnt=0
for e in self.end_postfix_value_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("end_postfix_value%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
if self.has_end_unapplied_log_timestamp_us_: res+=prefix+("end_unapplied_log_timestamp_us: %s\n" % self.DebugFormatInt64(self.end_unapplied_log_timestamp_us_))
return res
class CompiledQuery_MergeJoinScan(ProtocolBuffer.ProtocolMessage):
has_index_name_ = 0
index_name_ = ""
has_value_prefix_ = 0
value_prefix_ = 0
def __init__(self, contents=None):
self.prefix_value_ = []
if contents is not None: self.MergeFromString(contents)
def index_name(self): return self.index_name_
def set_index_name(self, x):
self.has_index_name_ = 1
self.index_name_ = x
def clear_index_name(self):
if self.has_index_name_:
self.has_index_name_ = 0
self.index_name_ = ""
def has_index_name(self): return self.has_index_name_
def prefix_value_size(self): return len(self.prefix_value_)
def prefix_value_list(self): return self.prefix_value_
def prefix_value(self, i):
return self.prefix_value_[i]
def set_prefix_value(self, i, x):
self.prefix_value_[i] = x
def add_prefix_value(self, x):
self.prefix_value_.append(x)
def clear_prefix_value(self):
self.prefix_value_ = []
def value_prefix(self): return self.value_prefix_
def set_value_prefix(self, x):
self.has_value_prefix_ = 1
self.value_prefix_ = x
def clear_value_prefix(self):
if self.has_value_prefix_:
self.has_value_prefix_ = 0
self.value_prefix_ = 0
def has_value_prefix(self): return self.has_value_prefix_
def MergeFrom(self, x):
assert x is not self
if (x.has_index_name()): self.set_index_name(x.index_name())
for i in xrange(x.prefix_value_size()): self.add_prefix_value(x.prefix_value(i))
if (x.has_value_prefix()): self.set_value_prefix(x.value_prefix())
def Equals(self, x):
if x is self: return 1
if self.has_index_name_ != x.has_index_name_: return 0
if self.has_index_name_ and self.index_name_ != x.index_name_: return 0
if len(self.prefix_value_) != len(x.prefix_value_): return 0
for e1, e2 in zip(self.prefix_value_, x.prefix_value_):
if e1 != e2: return 0
if self.has_value_prefix_ != x.has_value_prefix_: return 0
if self.has_value_prefix_ and self.value_prefix_ != x.value_prefix_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_index_name_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: index_name not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(len(self.index_name_))
n += 1 * len(self.prefix_value_)
for i in xrange(len(self.prefix_value_)): n += self.lengthString(len(self.prefix_value_[i]))
if (self.has_value_prefix_): n += 3
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_index_name_):
n += 1
n += self.lengthString(len(self.index_name_))
n += 1 * len(self.prefix_value_)
for i in xrange(len(self.prefix_value_)): n += self.lengthString(len(self.prefix_value_[i]))
if (self.has_value_prefix_): n += 3
return n
def Clear(self):
self.clear_index_name()
self.clear_prefix_value()
self.clear_value_prefix()
def OutputUnchecked(self, out):
out.putVarInt32(66)
out.putPrefixedString(self.index_name_)
for i in xrange(len(self.prefix_value_)):
out.putVarInt32(74)
out.putPrefixedString(self.prefix_value_[i])
if (self.has_value_prefix_):
out.putVarInt32(160)
out.putBoolean(self.value_prefix_)
def OutputPartial(self, out):
if (self.has_index_name_):
out.putVarInt32(66)
out.putPrefixedString(self.index_name_)
for i in xrange(len(self.prefix_value_)):
out.putVarInt32(74)
out.putPrefixedString(self.prefix_value_[i])
if (self.has_value_prefix_):
out.putVarInt32(160)
out.putBoolean(self.value_prefix_)
def TryMerge(self, d):
while 1:
tt = d.getVarInt32()
if tt == 60: break
if tt == 66:
self.set_index_name(d.getPrefixedString())
continue
if tt == 74:
self.add_prefix_value(d.getPrefixedString())
continue
if tt == 160:
self.set_value_prefix(d.getBoolean())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_index_name_: res+=prefix+("index_name: %s\n" % self.DebugFormatString(self.index_name_))
cnt=0
for e in self.prefix_value_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("prefix_value%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
if self.has_value_prefix_: res+=prefix+("value_prefix: %s\n" % self.DebugFormatBool(self.value_prefix_))
return res
class CompiledQuery_EntityFilter(ProtocolBuffer.ProtocolMessage):
has_distinct_ = 0
distinct_ = 0
has_kind_ = 0
kind_ = ""
has_ancestor_ = 0
ancestor_ = None
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def distinct(self): return self.distinct_
def set_distinct(self, x):
self.has_distinct_ = 1
self.distinct_ = x
def clear_distinct(self):
if self.has_distinct_:
self.has_distinct_ = 0
self.distinct_ = 0
def has_distinct(self): return self.has_distinct_
def kind(self): return self.kind_
def set_kind(self, x):
self.has_kind_ = 1
self.kind_ = x
def clear_kind(self):
if self.has_kind_:
self.has_kind_ = 0
self.kind_ = ""
def has_kind(self): return self.has_kind_
def ancestor(self):
if self.ancestor_ is None:
self.lazy_init_lock_.acquire()
try:
if self.ancestor_ is None: self.ancestor_ = Reference()
finally:
self.lazy_init_lock_.release()
return self.ancestor_
def mutable_ancestor(self): self.has_ancestor_ = 1; return self.ancestor()
def clear_ancestor(self):
if self.has_ancestor_:
self.has_ancestor_ = 0;
if self.ancestor_ is not None: self.ancestor_.Clear()
def has_ancestor(self): return self.has_ancestor_
def MergeFrom(self, x):
assert x is not self