changeset 2864 | 2e0b0af889be |
parent 2413 | d0b7dac5325c |
2862:27971a13089f | 2864:2e0b0af889be |
---|---|
23 unusednames=printElemNumber,debug_strs no-special""" |
23 unusednames=printElemNumber,debug_strs no-special""" |
24 |
24 |
25 from google.appengine.api.api_base_pb import Integer64Proto; |
25 from google.appengine.api.api_base_pb import Integer64Proto; |
26 from google.appengine.api.api_base_pb import StringProto; |
26 from google.appengine.api.api_base_pb import StringProto; |
27 from google.appengine.api.api_base_pb import VoidProto; |
27 from google.appengine.api.api_base_pb import VoidProto; |
28 from google.appengine.datastore.action_pb import Action |
|
28 from google.appengine.datastore.entity_pb import CompositeIndex |
29 from google.appengine.datastore.entity_pb import CompositeIndex |
29 from google.appengine.datastore.entity_pb import EntityProto |
30 from google.appengine.datastore.entity_pb import EntityProto |
30 from google.appengine.datastore.entity_pb import Index |
31 from google.appengine.datastore.entity_pb import Index |
31 from google.appengine.datastore.entity_pb import Property |
32 from google.appengine.datastore.entity_pb import Property |
33 from google.appengine.datastore.entity_pb import Path |
|
32 from google.appengine.datastore.entity_pb import Reference |
34 from google.appengine.datastore.entity_pb import Reference |
33 class Transaction(ProtocolBuffer.ProtocolMessage): |
35 class Transaction(ProtocolBuffer.ProtocolMessage): |
34 has_handle_ = 0 |
36 has_handle_ = 0 |
35 handle_ = 0 |
37 handle_ = 0 |
36 |
38 |
93 def __str__(self, prefix="", printElemNumber=0): |
95 def __str__(self, prefix="", printElemNumber=0): |
94 res="" |
96 res="" |
95 if self.has_handle_: res+=prefix+("handle: %s\n" % self.DebugFormatFixed64(self.handle_)) |
97 if self.has_handle_: res+=prefix+("handle: %s\n" % self.DebugFormatFixed64(self.handle_)) |
96 return res |
98 return res |
97 |
99 |
100 |
|
101 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
102 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
103 |
|
98 khandle = 1 |
104 khandle = 1 |
99 |
105 |
100 _TEXT = ( |
106 _TEXT = _BuildTagLookupTable({ |
101 "ErrorCode", |
107 0: "ErrorCode", |
102 "handle", |
108 1: "handle", |
103 ) |
109 }, 1) |
104 |
110 |
105 _TYPES = ( |
111 _TYPES = _BuildTagLookupTable({ |
106 ProtocolBuffer.Encoder.NUMERIC, |
112 0: ProtocolBuffer.Encoder.NUMERIC, |
107 ProtocolBuffer.Encoder.DOUBLE, |
113 1: ProtocolBuffer.Encoder.DOUBLE, |
108 |
114 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
109 ) |
|
110 |
115 |
111 _STYLE = """""" |
116 _STYLE = """""" |
112 _STYLE_CONTENT_TYPE = """""" |
117 _STYLE_CONTENT_TYPE = """""" |
113 class Query_Filter(ProtocolBuffer.ProtocolMessage): |
118 class Query_Filter(ProtocolBuffer.ProtocolMessage): |
114 |
119 |
372 ancestor_ = None |
377 ancestor_ = None |
373 has_search_query_ = 0 |
378 has_search_query_ = 0 |
374 search_query_ = "" |
379 search_query_ = "" |
375 has_hint_ = 0 |
380 has_hint_ = 0 |
376 hint_ = 0 |
381 hint_ = 0 |
382 has_count_ = 0 |
|
383 count_ = 0 |
|
377 has_offset_ = 0 |
384 has_offset_ = 0 |
378 offset_ = 0 |
385 offset_ = 0 |
379 has_limit_ = 0 |
386 has_limit_ = 0 |
380 limit_ = 0 |
387 limit_ = 0 |
381 has_require_perfect_plan_ = 0 |
388 has_require_perfect_plan_ = 0 |
382 require_perfect_plan_ = 0 |
389 require_perfect_plan_ = 0 |
383 has_keys_only_ = 0 |
390 has_keys_only_ = 0 |
384 keys_only_ = 0 |
391 keys_only_ = 0 |
385 has_transaction_ = 0 |
392 has_transaction_ = 0 |
386 transaction_ = None |
393 transaction_ = None |
394 has_distinct_ = 0 |
|
395 distinct_ = 0 |
|
396 has_compile_ = 0 |
|
397 compile_ = 0 |
|
387 |
398 |
388 def __init__(self, contents=None): |
399 def __init__(self, contents=None): |
389 self.filter_ = [] |
400 self.filter_ = [] |
390 self.order_ = [] |
401 self.order_ = [] |
391 self.composite_index_ = [] |
402 self.composite_index_ = [] |
492 self.has_hint_ = 0 |
503 self.has_hint_ = 0 |
493 self.hint_ = 0 |
504 self.hint_ = 0 |
494 |
505 |
495 def has_hint(self): return self.has_hint_ |
506 def has_hint(self): return self.has_hint_ |
496 |
507 |
508 def count(self): return self.count_ |
|
509 |
|
510 def set_count(self, x): |
|
511 self.has_count_ = 1 |
|
512 self.count_ = x |
|
513 |
|
514 def clear_count(self): |
|
515 if self.has_count_: |
|
516 self.has_count_ = 0 |
|
517 self.count_ = 0 |
|
518 |
|
519 def has_count(self): return self.has_count_ |
|
520 |
|
497 def offset(self): return self.offset_ |
521 def offset(self): return self.offset_ |
498 |
522 |
499 def set_offset(self, x): |
523 def set_offset(self, x): |
500 self.has_offset_ = 1 |
524 self.has_offset_ = 1 |
501 self.offset_ = x |
525 self.offset_ = x |
577 if self.has_transaction_: |
601 if self.has_transaction_: |
578 self.has_transaction_ = 0; |
602 self.has_transaction_ = 0; |
579 if self.transaction_ is not None: self.transaction_.Clear() |
603 if self.transaction_ is not None: self.transaction_.Clear() |
580 |
604 |
581 def has_transaction(self): return self.has_transaction_ |
605 def has_transaction(self): return self.has_transaction_ |
606 |
|
607 def distinct(self): return self.distinct_ |
|
608 |
|
609 def set_distinct(self, x): |
|
610 self.has_distinct_ = 1 |
|
611 self.distinct_ = x |
|
612 |
|
613 def clear_distinct(self): |
|
614 if self.has_distinct_: |
|
615 self.has_distinct_ = 0 |
|
616 self.distinct_ = 0 |
|
617 |
|
618 def has_distinct(self): return self.has_distinct_ |
|
619 |
|
620 def compile(self): return self.compile_ |
|
621 |
|
622 def set_compile(self, x): |
|
623 self.has_compile_ = 1 |
|
624 self.compile_ = x |
|
625 |
|
626 def clear_compile(self): |
|
627 if self.has_compile_: |
|
628 self.has_compile_ = 0 |
|
629 self.compile_ = 0 |
|
630 |
|
631 def has_compile(self): return self.has_compile_ |
|
582 |
632 |
583 |
633 |
584 def MergeFrom(self, x): |
634 def MergeFrom(self, x): |
585 assert x is not self |
635 assert x is not self |
586 if (x.has_app()): self.set_app(x.app()) |
636 if (x.has_app()): self.set_app(x.app()) |
588 if (x.has_ancestor()): self.mutable_ancestor().MergeFrom(x.ancestor()) |
638 if (x.has_ancestor()): self.mutable_ancestor().MergeFrom(x.ancestor()) |
589 for i in xrange(x.filter_size()): self.add_filter().CopyFrom(x.filter(i)) |
639 for i in xrange(x.filter_size()): self.add_filter().CopyFrom(x.filter(i)) |
590 if (x.has_search_query()): self.set_search_query(x.search_query()) |
640 if (x.has_search_query()): self.set_search_query(x.search_query()) |
591 for i in xrange(x.order_size()): self.add_order().CopyFrom(x.order(i)) |
641 for i in xrange(x.order_size()): self.add_order().CopyFrom(x.order(i)) |
592 if (x.has_hint()): self.set_hint(x.hint()) |
642 if (x.has_hint()): self.set_hint(x.hint()) |
643 if (x.has_count()): self.set_count(x.count()) |
|
593 if (x.has_offset()): self.set_offset(x.offset()) |
644 if (x.has_offset()): self.set_offset(x.offset()) |
594 if (x.has_limit()): self.set_limit(x.limit()) |
645 if (x.has_limit()): self.set_limit(x.limit()) |
595 for i in xrange(x.composite_index_size()): self.add_composite_index().CopyFrom(x.composite_index(i)) |
646 for i in xrange(x.composite_index_size()): self.add_composite_index().CopyFrom(x.composite_index(i)) |
596 if (x.has_require_perfect_plan()): self.set_require_perfect_plan(x.require_perfect_plan()) |
647 if (x.has_require_perfect_plan()): self.set_require_perfect_plan(x.require_perfect_plan()) |
597 if (x.has_keys_only()): self.set_keys_only(x.keys_only()) |
648 if (x.has_keys_only()): self.set_keys_only(x.keys_only()) |
598 if (x.has_transaction()): self.mutable_transaction().MergeFrom(x.transaction()) |
649 if (x.has_transaction()): self.mutable_transaction().MergeFrom(x.transaction()) |
650 if (x.has_distinct()): self.set_distinct(x.distinct()) |
|
651 if (x.has_compile()): self.set_compile(x.compile()) |
|
599 |
652 |
600 def Equals(self, x): |
653 def Equals(self, x): |
601 if x is self: return 1 |
654 if x is self: return 1 |
602 if self.has_app_ != x.has_app_: return 0 |
655 if self.has_app_ != x.has_app_: return 0 |
603 if self.has_app_ and self.app_ != x.app_: return 0 |
656 if self.has_app_ and self.app_ != x.app_: return 0 |
613 if len(self.order_) != len(x.order_): return 0 |
666 if len(self.order_) != len(x.order_): return 0 |
614 for e1, e2 in zip(self.order_, x.order_): |
667 for e1, e2 in zip(self.order_, x.order_): |
615 if e1 != e2: return 0 |
668 if e1 != e2: return 0 |
616 if self.has_hint_ != x.has_hint_: return 0 |
669 if self.has_hint_ != x.has_hint_: return 0 |
617 if self.has_hint_ and self.hint_ != x.hint_: return 0 |
670 if self.has_hint_ and self.hint_ != x.hint_: return 0 |
671 if self.has_count_ != x.has_count_: return 0 |
|
672 if self.has_count_ and self.count_ != x.count_: return 0 |
|
618 if self.has_offset_ != x.has_offset_: return 0 |
673 if self.has_offset_ != x.has_offset_: return 0 |
619 if self.has_offset_ and self.offset_ != x.offset_: return 0 |
674 if self.has_offset_ and self.offset_ != x.offset_: return 0 |
620 if self.has_limit_ != x.has_limit_: return 0 |
675 if self.has_limit_ != x.has_limit_: return 0 |
621 if self.has_limit_ and self.limit_ != x.limit_: return 0 |
676 if self.has_limit_ and self.limit_ != x.limit_: return 0 |
622 if len(self.composite_index_) != len(x.composite_index_): return 0 |
677 if len(self.composite_index_) != len(x.composite_index_): return 0 |
626 if self.has_require_perfect_plan_ and self.require_perfect_plan_ != x.require_perfect_plan_: return 0 |
681 if self.has_require_perfect_plan_ and self.require_perfect_plan_ != x.require_perfect_plan_: return 0 |
627 if self.has_keys_only_ != x.has_keys_only_: return 0 |
682 if self.has_keys_only_ != x.has_keys_only_: return 0 |
628 if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0 |
683 if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0 |
629 if self.has_transaction_ != x.has_transaction_: return 0 |
684 if self.has_transaction_ != x.has_transaction_: return 0 |
630 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0 |
685 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0 |
686 if self.has_distinct_ != x.has_distinct_: return 0 |
|
687 if self.has_distinct_ and self.distinct_ != x.distinct_: return 0 |
|
688 if self.has_compile_ != x.has_compile_: return 0 |
|
689 if self.has_compile_ and self.compile_ != x.compile_: return 0 |
|
631 return 1 |
690 return 1 |
632 |
691 |
633 def IsInitialized(self, debug_strs=None): |
692 def IsInitialized(self, debug_strs=None): |
634 initialized = 1 |
693 initialized = 1 |
635 if (not self.has_app_): |
694 if (not self.has_app_): |
655 for i in xrange(len(self.filter_)): n += self.filter_[i].ByteSize() |
714 for i in xrange(len(self.filter_)): n += self.filter_[i].ByteSize() |
656 if (self.has_search_query_): n += 1 + self.lengthString(len(self.search_query_)) |
715 if (self.has_search_query_): n += 1 + self.lengthString(len(self.search_query_)) |
657 n += 2 * len(self.order_) |
716 n += 2 * len(self.order_) |
658 for i in xrange(len(self.order_)): n += self.order_[i].ByteSize() |
717 for i in xrange(len(self.order_)): n += self.order_[i].ByteSize() |
659 if (self.has_hint_): n += 2 + self.lengthVarInt64(self.hint_) |
718 if (self.has_hint_): n += 2 + self.lengthVarInt64(self.hint_) |
719 if (self.has_count_): n += 2 + self.lengthVarInt64(self.count_) |
|
660 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_) |
720 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_) |
661 if (self.has_limit_): n += 2 + self.lengthVarInt64(self.limit_) |
721 if (self.has_limit_): n += 2 + self.lengthVarInt64(self.limit_) |
662 n += 2 * len(self.composite_index_) |
722 n += 2 * len(self.composite_index_) |
663 for i in xrange(len(self.composite_index_)): n += self.lengthString(self.composite_index_[i].ByteSize()) |
723 for i in xrange(len(self.composite_index_)): n += self.lengthString(self.composite_index_[i].ByteSize()) |
664 if (self.has_require_perfect_plan_): n += 3 |
724 if (self.has_require_perfect_plan_): n += 3 |
665 if (self.has_keys_only_): n += 3 |
725 if (self.has_keys_only_): n += 3 |
666 if (self.has_transaction_): n += 2 + self.lengthString(self.transaction_.ByteSize()) |
726 if (self.has_transaction_): n += 2 + self.lengthString(self.transaction_.ByteSize()) |
727 if (self.has_distinct_): n += 3 |
|
728 if (self.has_compile_): n += 3 |
|
667 return n + 1 |
729 return n + 1 |
668 |
730 |
669 def Clear(self): |
731 def Clear(self): |
670 self.clear_app() |
732 self.clear_app() |
671 self.clear_kind() |
733 self.clear_kind() |
672 self.clear_ancestor() |
734 self.clear_ancestor() |
673 self.clear_filter() |
735 self.clear_filter() |
674 self.clear_search_query() |
736 self.clear_search_query() |
675 self.clear_order() |
737 self.clear_order() |
676 self.clear_hint() |
738 self.clear_hint() |
739 self.clear_count() |
|
677 self.clear_offset() |
740 self.clear_offset() |
678 self.clear_limit() |
741 self.clear_limit() |
679 self.clear_composite_index() |
742 self.clear_composite_index() |
680 self.clear_require_perfect_plan() |
743 self.clear_require_perfect_plan() |
681 self.clear_keys_only() |
744 self.clear_keys_only() |
682 self.clear_transaction() |
745 self.clear_transaction() |
746 self.clear_distinct() |
|
747 self.clear_compile() |
|
683 |
748 |
684 def OutputUnchecked(self, out): |
749 def OutputUnchecked(self, out): |
685 out.putVarInt32(10) |
750 out.putVarInt32(10) |
686 out.putPrefixedString(self.app_) |
751 out.putPrefixedString(self.app_) |
687 if (self.has_kind_): |
752 if (self.has_kind_): |
723 out.putBoolean(self.keys_only_) |
788 out.putBoolean(self.keys_only_) |
724 if (self.has_transaction_): |
789 if (self.has_transaction_): |
725 out.putVarInt32(178) |
790 out.putVarInt32(178) |
726 out.putVarInt32(self.transaction_.ByteSize()) |
791 out.putVarInt32(self.transaction_.ByteSize()) |
727 self.transaction_.OutputUnchecked(out) |
792 self.transaction_.OutputUnchecked(out) |
793 if (self.has_count_): |
|
794 out.putVarInt32(184) |
|
795 out.putVarInt32(self.count_) |
|
796 if (self.has_distinct_): |
|
797 out.putVarInt32(192) |
|
798 out.putBoolean(self.distinct_) |
|
799 if (self.has_compile_): |
|
800 out.putVarInt32(200) |
|
801 out.putBoolean(self.compile_) |
|
728 |
802 |
729 def TryMerge(self, d): |
803 def TryMerge(self, d): |
730 while d.avail() > 0: |
804 while d.avail() > 0: |
731 tt = d.getVarInt32() |
805 tt = d.getVarInt32() |
732 if tt == 10: |
806 if tt == 10: |
774 if tt == 178: |
848 if tt == 178: |
775 length = d.getVarInt32() |
849 length = d.getVarInt32() |
776 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
850 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
777 d.skip(length) |
851 d.skip(length) |
778 self.mutable_transaction().TryMerge(tmp) |
852 self.mutable_transaction().TryMerge(tmp) |
853 continue |
|
854 if tt == 184: |
|
855 self.set_count(d.getVarInt32()) |
|
856 continue |
|
857 if tt == 192: |
|
858 self.set_distinct(d.getBoolean()) |
|
859 continue |
|
860 if tt == 200: |
|
861 self.set_compile(d.getBoolean()) |
|
779 continue |
862 continue |
780 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
863 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
781 d.skipData(tt) |
864 d.skipData(tt) |
782 |
865 |
783 |
866 |
805 res+=prefix+("Order%s {\n" % elm) |
888 res+=prefix+("Order%s {\n" % elm) |
806 res+=e.__str__(prefix + " ", printElemNumber) |
889 res+=e.__str__(prefix + " ", printElemNumber) |
807 res+=prefix+"}\n" |
890 res+=prefix+"}\n" |
808 cnt+=1 |
891 cnt+=1 |
809 if self.has_hint_: res+=prefix+("hint: %s\n" % self.DebugFormatInt32(self.hint_)) |
892 if self.has_hint_: res+=prefix+("hint: %s\n" % self.DebugFormatInt32(self.hint_)) |
893 if self.has_count_: res+=prefix+("count: %s\n" % self.DebugFormatInt32(self.count_)) |
|
810 if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_)) |
894 if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_)) |
811 if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_)) |
895 if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_)) |
812 cnt=0 |
896 cnt=0 |
813 for e in self.composite_index_: |
897 for e in self.composite_index_: |
814 elm="" |
898 elm="" |
821 if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_)) |
905 if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_)) |
822 if self.has_transaction_: |
906 if self.has_transaction_: |
823 res+=prefix+"transaction <\n" |
907 res+=prefix+"transaction <\n" |
824 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
908 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
825 res+=prefix+">\n" |
909 res+=prefix+">\n" |
910 if self.has_distinct_: res+=prefix+("distinct: %s\n" % self.DebugFormatBool(self.distinct_)) |
|
911 if self.has_compile_: res+=prefix+("compile: %s\n" % self.DebugFormatBool(self.compile_)) |
|
826 return res |
912 return res |
913 |
|
914 |
|
915 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
916 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
827 |
917 |
828 kapp = 1 |
918 kapp = 1 |
829 kkind = 3 |
919 kkind = 3 |
830 kancestor = 17 |
920 kancestor = 17 |
831 kFilterGroup = 4 |
921 kFilterGroup = 4 |
834 ksearch_query = 8 |
924 ksearch_query = 8 |
835 kOrderGroup = 9 |
925 kOrderGroup = 9 |
836 kOrderproperty = 10 |
926 kOrderproperty = 10 |
837 kOrderdirection = 11 |
927 kOrderdirection = 11 |
838 khint = 18 |
928 khint = 18 |
929 kcount = 23 |
|
839 koffset = 12 |
930 koffset = 12 |
840 klimit = 16 |
931 klimit = 16 |
841 kcomposite_index = 19 |
932 kcomposite_index = 19 |
842 krequire_perfect_plan = 20 |
933 krequire_perfect_plan = 20 |
843 kkeys_only = 21 |
934 kkeys_only = 21 |
844 ktransaction = 22 |
935 ktransaction = 22 |
845 |
936 kdistinct = 24 |
846 _TEXT = ( |
937 kcompile = 25 |
847 "ErrorCode", |
938 |
848 "app", |
939 _TEXT = _BuildTagLookupTable({ |
849 None, |
940 0: "ErrorCode", |
850 "kind", |
941 1: "app", |
851 "Filter", |
942 3: "kind", |
852 None, |
943 4: "Filter", |
853 "op", |
944 6: "op", |
854 None, |
945 8: "search_query", |
855 "search_query", |
946 9: "Order", |
856 "Order", |
947 10: "property", |
857 "property", |
948 11: "direction", |
858 "direction", |
949 12: "offset", |
859 "offset", |
950 14: "property", |
860 None, |
951 16: "limit", |
861 "property", |
952 17: "ancestor", |
862 None, |
953 18: "hint", |
863 "limit", |
954 19: "composite_index", |
864 "ancestor", |
955 20: "require_perfect_plan", |
865 "hint", |
956 21: "keys_only", |
866 "composite_index", |
957 22: "transaction", |
867 "require_perfect_plan", |
958 23: "count", |
868 "keys_only", |
959 24: "distinct", |
869 "transaction", |
960 25: "compile", |
870 ) |
961 }, 25) |
871 |
962 |
872 _TYPES = ( |
963 _TYPES = _BuildTagLookupTable({ |
873 ProtocolBuffer.Encoder.NUMERIC, |
964 0: ProtocolBuffer.Encoder.NUMERIC, |
874 ProtocolBuffer.Encoder.STRING, |
965 1: ProtocolBuffer.Encoder.STRING, |
875 |
966 3: ProtocolBuffer.Encoder.STRING, |
876 ProtocolBuffer.Encoder.MAX_TYPE, |
967 4: ProtocolBuffer.Encoder.STARTGROUP, |
877 |
968 6: ProtocolBuffer.Encoder.NUMERIC, |
878 ProtocolBuffer.Encoder.STRING, |
969 8: ProtocolBuffer.Encoder.STRING, |
879 |
970 9: ProtocolBuffer.Encoder.STARTGROUP, |
880 ProtocolBuffer.Encoder.STARTGROUP, |
971 10: ProtocolBuffer.Encoder.STRING, |
881 |
972 11: ProtocolBuffer.Encoder.NUMERIC, |
882 ProtocolBuffer.Encoder.MAX_TYPE, |
973 12: ProtocolBuffer.Encoder.NUMERIC, |
883 |
974 14: ProtocolBuffer.Encoder.STRING, |
884 ProtocolBuffer.Encoder.NUMERIC, |
975 16: ProtocolBuffer.Encoder.NUMERIC, |
885 |
976 17: ProtocolBuffer.Encoder.STRING, |
886 ProtocolBuffer.Encoder.MAX_TYPE, |
977 18: ProtocolBuffer.Encoder.NUMERIC, |
887 |
978 19: ProtocolBuffer.Encoder.STRING, |
888 ProtocolBuffer.Encoder.STRING, |
979 20: ProtocolBuffer.Encoder.NUMERIC, |
889 |
980 21: ProtocolBuffer.Encoder.NUMERIC, |
890 ProtocolBuffer.Encoder.STARTGROUP, |
981 22: ProtocolBuffer.Encoder.STRING, |
891 |
982 23: ProtocolBuffer.Encoder.NUMERIC, |
892 ProtocolBuffer.Encoder.STRING, |
983 24: ProtocolBuffer.Encoder.NUMERIC, |
893 |
984 25: ProtocolBuffer.Encoder.NUMERIC, |
894 ProtocolBuffer.Encoder.NUMERIC, |
985 }, 25, ProtocolBuffer.Encoder.MAX_TYPE) |
895 |
986 |
896 ProtocolBuffer.Encoder.NUMERIC, |
987 _STYLE = """""" |
897 |
988 _STYLE_CONTENT_TYPE = """""" |
898 ProtocolBuffer.Encoder.MAX_TYPE, |
989 class CompiledQuery_PrimaryScan(ProtocolBuffer.ProtocolMessage): |
899 |
990 has_index_name_ = 0 |
900 ProtocolBuffer.Encoder.STRING, |
991 index_name_ = "" |
901 |
992 has_start_key_ = 0 |
902 ProtocolBuffer.Encoder.MAX_TYPE, |
993 start_key_ = "" |
903 |
994 has_start_inclusive_ = 0 |
904 ProtocolBuffer.Encoder.NUMERIC, |
995 start_inclusive_ = 0 |
905 |
996 has_end_key_ = 0 |
906 ProtocolBuffer.Encoder.STRING, |
997 end_key_ = "" |
907 |
998 has_end_inclusive_ = 0 |
908 ProtocolBuffer.Encoder.NUMERIC, |
999 end_inclusive_ = 0 |
909 |
1000 |
910 ProtocolBuffer.Encoder.STRING, |
1001 def __init__(self, contents=None): |
911 |
1002 if contents is not None: self.MergeFromString(contents) |
912 ProtocolBuffer.Encoder.NUMERIC, |
1003 |
913 |
1004 def index_name(self): return self.index_name_ |
914 ProtocolBuffer.Encoder.NUMERIC, |
1005 |
915 |
1006 def set_index_name(self, x): |
916 ProtocolBuffer.Encoder.STRING, |
1007 self.has_index_name_ = 1 |
917 |
1008 self.index_name_ = x |
918 ) |
1009 |
1010 def clear_index_name(self): |
|
1011 if self.has_index_name_: |
|
1012 self.has_index_name_ = 0 |
|
1013 self.index_name_ = "" |
|
1014 |
|
1015 def has_index_name(self): return self.has_index_name_ |
|
1016 |
|
1017 def start_key(self): return self.start_key_ |
|
1018 |
|
1019 def set_start_key(self, x): |
|
1020 self.has_start_key_ = 1 |
|
1021 self.start_key_ = x |
|
1022 |
|
1023 def clear_start_key(self): |
|
1024 if self.has_start_key_: |
|
1025 self.has_start_key_ = 0 |
|
1026 self.start_key_ = "" |
|
1027 |
|
1028 def has_start_key(self): return self.has_start_key_ |
|
1029 |
|
1030 def start_inclusive(self): return self.start_inclusive_ |
|
1031 |
|
1032 def set_start_inclusive(self, x): |
|
1033 self.has_start_inclusive_ = 1 |
|
1034 self.start_inclusive_ = x |
|
1035 |
|
1036 def clear_start_inclusive(self): |
|
1037 if self.has_start_inclusive_: |
|
1038 self.has_start_inclusive_ = 0 |
|
1039 self.start_inclusive_ = 0 |
|
1040 |
|
1041 def has_start_inclusive(self): return self.has_start_inclusive_ |
|
1042 |
|
1043 def end_key(self): return self.end_key_ |
|
1044 |
|
1045 def set_end_key(self, x): |
|
1046 self.has_end_key_ = 1 |
|
1047 self.end_key_ = x |
|
1048 |
|
1049 def clear_end_key(self): |
|
1050 if self.has_end_key_: |
|
1051 self.has_end_key_ = 0 |
|
1052 self.end_key_ = "" |
|
1053 |
|
1054 def has_end_key(self): return self.has_end_key_ |
|
1055 |
|
1056 def end_inclusive(self): return self.end_inclusive_ |
|
1057 |
|
1058 def set_end_inclusive(self, x): |
|
1059 self.has_end_inclusive_ = 1 |
|
1060 self.end_inclusive_ = x |
|
1061 |
|
1062 def clear_end_inclusive(self): |
|
1063 if self.has_end_inclusive_: |
|
1064 self.has_end_inclusive_ = 0 |
|
1065 self.end_inclusive_ = 0 |
|
1066 |
|
1067 def has_end_inclusive(self): return self.has_end_inclusive_ |
|
1068 |
|
1069 |
|
1070 def MergeFrom(self, x): |
|
1071 assert x is not self |
|
1072 if (x.has_index_name()): self.set_index_name(x.index_name()) |
|
1073 if (x.has_start_key()): self.set_start_key(x.start_key()) |
|
1074 if (x.has_start_inclusive()): self.set_start_inclusive(x.start_inclusive()) |
|
1075 if (x.has_end_key()): self.set_end_key(x.end_key()) |
|
1076 if (x.has_end_inclusive()): self.set_end_inclusive(x.end_inclusive()) |
|
1077 |
|
1078 def Equals(self, x): |
|
1079 if x is self: return 1 |
|
1080 if self.has_index_name_ != x.has_index_name_: return 0 |
|
1081 if self.has_index_name_ and self.index_name_ != x.index_name_: return 0 |
|
1082 if self.has_start_key_ != x.has_start_key_: return 0 |
|
1083 if self.has_start_key_ and self.start_key_ != x.start_key_: return 0 |
|
1084 if self.has_start_inclusive_ != x.has_start_inclusive_: return 0 |
|
1085 if self.has_start_inclusive_ and self.start_inclusive_ != x.start_inclusive_: return 0 |
|
1086 if self.has_end_key_ != x.has_end_key_: return 0 |
|
1087 if self.has_end_key_ and self.end_key_ != x.end_key_: return 0 |
|
1088 if self.has_end_inclusive_ != x.has_end_inclusive_: return 0 |
|
1089 if self.has_end_inclusive_ and self.end_inclusive_ != x.end_inclusive_: return 0 |
|
1090 return 1 |
|
1091 |
|
1092 def IsInitialized(self, debug_strs=None): |
|
1093 initialized = 1 |
|
1094 return initialized |
|
1095 |
|
1096 def ByteSize(self): |
|
1097 n = 0 |
|
1098 if (self.has_index_name_): n += 1 + self.lengthString(len(self.index_name_)) |
|
1099 if (self.has_start_key_): n += 1 + self.lengthString(len(self.start_key_)) |
|
1100 if (self.has_start_inclusive_): n += 2 |
|
1101 if (self.has_end_key_): n += 1 + self.lengthString(len(self.end_key_)) |
|
1102 if (self.has_end_inclusive_): n += 2 |
|
1103 return n + 0 |
|
1104 |
|
1105 def Clear(self): |
|
1106 self.clear_index_name() |
|
1107 self.clear_start_key() |
|
1108 self.clear_start_inclusive() |
|
1109 self.clear_end_key() |
|
1110 self.clear_end_inclusive() |
|
1111 |
|
1112 def OutputUnchecked(self, out): |
|
1113 if (self.has_index_name_): |
|
1114 out.putVarInt32(18) |
|
1115 out.putPrefixedString(self.index_name_) |
|
1116 if (self.has_start_key_): |
|
1117 out.putVarInt32(26) |
|
1118 out.putPrefixedString(self.start_key_) |
|
1119 if (self.has_start_inclusive_): |
|
1120 out.putVarInt32(32) |
|
1121 out.putBoolean(self.start_inclusive_) |
|
1122 if (self.has_end_key_): |
|
1123 out.putVarInt32(42) |
|
1124 out.putPrefixedString(self.end_key_) |
|
1125 if (self.has_end_inclusive_): |
|
1126 out.putVarInt32(48) |
|
1127 out.putBoolean(self.end_inclusive_) |
|
1128 |
|
1129 def TryMerge(self, d): |
|
1130 while 1: |
|
1131 tt = d.getVarInt32() |
|
1132 if tt == 12: break |
|
1133 if tt == 18: |
|
1134 self.set_index_name(d.getPrefixedString()) |
|
1135 continue |
|
1136 if tt == 26: |
|
1137 self.set_start_key(d.getPrefixedString()) |
|
1138 continue |
|
1139 if tt == 32: |
|
1140 self.set_start_inclusive(d.getBoolean()) |
|
1141 continue |
|
1142 if tt == 42: |
|
1143 self.set_end_key(d.getPrefixedString()) |
|
1144 continue |
|
1145 if tt == 48: |
|
1146 self.set_end_inclusive(d.getBoolean()) |
|
1147 continue |
|
1148 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1149 d.skipData(tt) |
|
1150 |
|
1151 |
|
1152 def __str__(self, prefix="", printElemNumber=0): |
|
1153 res="" |
|
1154 if self.has_index_name_: res+=prefix+("index_name: %s\n" % self.DebugFormatString(self.index_name_)) |
|
1155 if self.has_start_key_: res+=prefix+("start_key: %s\n" % self.DebugFormatString(self.start_key_)) |
|
1156 if self.has_start_inclusive_: res+=prefix+("start_inclusive: %s\n" % self.DebugFormatBool(self.start_inclusive_)) |
|
1157 if self.has_end_key_: res+=prefix+("end_key: %s\n" % self.DebugFormatString(self.end_key_)) |
|
1158 if self.has_end_inclusive_: res+=prefix+("end_inclusive: %s\n" % self.DebugFormatBool(self.end_inclusive_)) |
|
1159 return res |
|
1160 |
|
1161 class CompiledQuery_MergeJoinScan(ProtocolBuffer.ProtocolMessage): |
|
1162 has_index_name_ = 0 |
|
1163 index_name_ = "" |
|
1164 |
|
1165 def __init__(self, contents=None): |
|
1166 self.prefix_value_ = [] |
|
1167 if contents is not None: self.MergeFromString(contents) |
|
1168 |
|
1169 def index_name(self): return self.index_name_ |
|
1170 |
|
1171 def set_index_name(self, x): |
|
1172 self.has_index_name_ = 1 |
|
1173 self.index_name_ = x |
|
1174 |
|
1175 def clear_index_name(self): |
|
1176 if self.has_index_name_: |
|
1177 self.has_index_name_ = 0 |
|
1178 self.index_name_ = "" |
|
1179 |
|
1180 def has_index_name(self): return self.has_index_name_ |
|
1181 |
|
1182 def prefix_value_size(self): return len(self.prefix_value_) |
|
1183 def prefix_value_list(self): return self.prefix_value_ |
|
1184 |
|
1185 def prefix_value(self, i): |
|
1186 return self.prefix_value_[i] |
|
1187 |
|
1188 def set_prefix_value(self, i, x): |
|
1189 self.prefix_value_[i] = x |
|
1190 |
|
1191 def add_prefix_value(self, x): |
|
1192 self.prefix_value_.append(x) |
|
1193 |
|
1194 def clear_prefix_value(self): |
|
1195 self.prefix_value_ = [] |
|
1196 |
|
1197 |
|
1198 def MergeFrom(self, x): |
|
1199 assert x is not self |
|
1200 if (x.has_index_name()): self.set_index_name(x.index_name()) |
|
1201 for i in xrange(x.prefix_value_size()): self.add_prefix_value(x.prefix_value(i)) |
|
1202 |
|
1203 def Equals(self, x): |
|
1204 if x is self: return 1 |
|
1205 if self.has_index_name_ != x.has_index_name_: return 0 |
|
1206 if self.has_index_name_ and self.index_name_ != x.index_name_: return 0 |
|
1207 if len(self.prefix_value_) != len(x.prefix_value_): return 0 |
|
1208 for e1, e2 in zip(self.prefix_value_, x.prefix_value_): |
|
1209 if e1 != e2: return 0 |
|
1210 return 1 |
|
1211 |
|
1212 def IsInitialized(self, debug_strs=None): |
|
1213 initialized = 1 |
|
1214 if (not self.has_index_name_): |
|
1215 initialized = 0 |
|
1216 if debug_strs is not None: |
|
1217 debug_strs.append('Required field: index_name not set.') |
|
1218 return initialized |
|
1219 |
|
1220 def ByteSize(self): |
|
1221 n = 0 |
|
1222 n += self.lengthString(len(self.index_name_)) |
|
1223 n += 1 * len(self.prefix_value_) |
|
1224 for i in xrange(len(self.prefix_value_)): n += self.lengthString(len(self.prefix_value_[i])) |
|
1225 return n + 1 |
|
1226 |
|
1227 def Clear(self): |
|
1228 self.clear_index_name() |
|
1229 self.clear_prefix_value() |
|
1230 |
|
1231 def OutputUnchecked(self, out): |
|
1232 out.putVarInt32(66) |
|
1233 out.putPrefixedString(self.index_name_) |
|
1234 for i in xrange(len(self.prefix_value_)): |
|
1235 out.putVarInt32(74) |
|
1236 out.putPrefixedString(self.prefix_value_[i]) |
|
1237 |
|
1238 def TryMerge(self, d): |
|
1239 while 1: |
|
1240 tt = d.getVarInt32() |
|
1241 if tt == 60: break |
|
1242 if tt == 66: |
|
1243 self.set_index_name(d.getPrefixedString()) |
|
1244 continue |
|
1245 if tt == 74: |
|
1246 self.add_prefix_value(d.getPrefixedString()) |
|
1247 continue |
|
1248 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1249 d.skipData(tt) |
|
1250 |
|
1251 |
|
1252 def __str__(self, prefix="", printElemNumber=0): |
|
1253 res="" |
|
1254 if self.has_index_name_: res+=prefix+("index_name: %s\n" % self.DebugFormatString(self.index_name_)) |
|
1255 cnt=0 |
|
1256 for e in self.prefix_value_: |
|
1257 elm="" |
|
1258 if printElemNumber: elm="(%d)" % cnt |
|
1259 res+=prefix+("prefix_value%s: %s\n" % (elm, self.DebugFormatString(e))) |
|
1260 cnt+=1 |
|
1261 return res |
|
1262 |
|
1263 class CompiledQuery_EntityFilter(ProtocolBuffer.ProtocolMessage): |
|
1264 has_distinct_ = 0 |
|
1265 distinct_ = 0 |
|
1266 has_offset_ = 0 |
|
1267 offset_ = 0 |
|
1268 has_limit_ = 0 |
|
1269 limit_ = 0 |
|
1270 has_kind_ = 0 |
|
1271 kind_ = "" |
|
1272 has_ancestor_ = 0 |
|
1273 ancestor_ = None |
|
1274 |
|
1275 def __init__(self, contents=None): |
|
1276 self.lazy_init_lock_ = thread.allocate_lock() |
|
1277 if contents is not None: self.MergeFromString(contents) |
|
1278 |
|
1279 def distinct(self): return self.distinct_ |
|
1280 |
|
1281 def set_distinct(self, x): |
|
1282 self.has_distinct_ = 1 |
|
1283 self.distinct_ = x |
|
1284 |
|
1285 def clear_distinct(self): |
|
1286 if self.has_distinct_: |
|
1287 self.has_distinct_ = 0 |
|
1288 self.distinct_ = 0 |
|
1289 |
|
1290 def has_distinct(self): return self.has_distinct_ |
|
1291 |
|
1292 def offset(self): return self.offset_ |
|
1293 |
|
1294 def set_offset(self, x): |
|
1295 self.has_offset_ = 1 |
|
1296 self.offset_ = x |
|
1297 |
|
1298 def clear_offset(self): |
|
1299 if self.has_offset_: |
|
1300 self.has_offset_ = 0 |
|
1301 self.offset_ = 0 |
|
1302 |
|
1303 def has_offset(self): return self.has_offset_ |
|
1304 |
|
1305 def limit(self): return self.limit_ |
|
1306 |
|
1307 def set_limit(self, x): |
|
1308 self.has_limit_ = 1 |
|
1309 self.limit_ = x |
|
1310 |
|
1311 def clear_limit(self): |
|
1312 if self.has_limit_: |
|
1313 self.has_limit_ = 0 |
|
1314 self.limit_ = 0 |
|
1315 |
|
1316 def has_limit(self): return self.has_limit_ |
|
1317 |
|
1318 def kind(self): return self.kind_ |
|
1319 |
|
1320 def set_kind(self, x): |
|
1321 self.has_kind_ = 1 |
|
1322 self.kind_ = x |
|
1323 |
|
1324 def clear_kind(self): |
|
1325 if self.has_kind_: |
|
1326 self.has_kind_ = 0 |
|
1327 self.kind_ = "" |
|
1328 |
|
1329 def has_kind(self): return self.has_kind_ |
|
1330 |
|
1331 def ancestor(self): |
|
1332 if self.ancestor_ is None: |
|
1333 self.lazy_init_lock_.acquire() |
|
1334 try: |
|
1335 if self.ancestor_ is None: self.ancestor_ = Reference() |
|
1336 finally: |
|
1337 self.lazy_init_lock_.release() |
|
1338 return self.ancestor_ |
|
1339 |
|
1340 def mutable_ancestor(self): self.has_ancestor_ = 1; return self.ancestor() |
|
1341 |
|
1342 def clear_ancestor(self): |
|
1343 if self.has_ancestor_: |
|
1344 self.has_ancestor_ = 0; |
|
1345 if self.ancestor_ is not None: self.ancestor_.Clear() |
|
1346 |
|
1347 def has_ancestor(self): return self.has_ancestor_ |
|
1348 |
|
1349 |
|
1350 def MergeFrom(self, x): |
|
1351 assert x is not self |
|
1352 if (x.has_distinct()): self.set_distinct(x.distinct()) |
|
1353 if (x.has_offset()): self.set_offset(x.offset()) |
|
1354 if (x.has_limit()): self.set_limit(x.limit()) |
|
1355 if (x.has_kind()): self.set_kind(x.kind()) |
|
1356 if (x.has_ancestor()): self.mutable_ancestor().MergeFrom(x.ancestor()) |
|
1357 |
|
1358 def Equals(self, x): |
|
1359 if x is self: return 1 |
|
1360 if self.has_distinct_ != x.has_distinct_: return 0 |
|
1361 if self.has_distinct_ and self.distinct_ != x.distinct_: return 0 |
|
1362 if self.has_offset_ != x.has_offset_: return 0 |
|
1363 if self.has_offset_ and self.offset_ != x.offset_: return 0 |
|
1364 if self.has_limit_ != x.has_limit_: return 0 |
|
1365 if self.has_limit_ and self.limit_ != x.limit_: return 0 |
|
1366 if self.has_kind_ != x.has_kind_: return 0 |
|
1367 if self.has_kind_ and self.kind_ != x.kind_: return 0 |
|
1368 if self.has_ancestor_ != x.has_ancestor_: return 0 |
|
1369 if self.has_ancestor_ and self.ancestor_ != x.ancestor_: return 0 |
|
1370 return 1 |
|
1371 |
|
1372 def IsInitialized(self, debug_strs=None): |
|
1373 initialized = 1 |
|
1374 if (self.has_ancestor_ and not self.ancestor_.IsInitialized(debug_strs)): initialized = 0 |
|
1375 return initialized |
|
1376 |
|
1377 def ByteSize(self): |
|
1378 n = 0 |
|
1379 if (self.has_distinct_): n += 2 |
|
1380 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_) |
|
1381 if (self.has_limit_): n += 2 + self.lengthVarInt64(self.limit_) |
|
1382 if (self.has_kind_): n += 2 + self.lengthString(len(self.kind_)) |
|
1383 if (self.has_ancestor_): n += 2 + self.lengthString(self.ancestor_.ByteSize()) |
|
1384 return n + 0 |
|
1385 |
|
1386 def Clear(self): |
|
1387 self.clear_distinct() |
|
1388 self.clear_offset() |
|
1389 self.clear_limit() |
|
1390 self.clear_kind() |
|
1391 self.clear_ancestor() |
|
1392 |
|
1393 def OutputUnchecked(self, out): |
|
1394 if (self.has_distinct_): |
|
1395 out.putVarInt32(112) |
|
1396 out.putBoolean(self.distinct_) |
|
1397 if (self.has_offset_): |
|
1398 out.putVarInt32(120) |
|
1399 out.putVarInt32(self.offset_) |
|
1400 if (self.has_limit_): |
|
1401 out.putVarInt32(128) |
|
1402 out.putVarInt32(self.limit_) |
|
1403 if (self.has_kind_): |
|
1404 out.putVarInt32(138) |
|
1405 out.putPrefixedString(self.kind_) |
|
1406 if (self.has_ancestor_): |
|
1407 out.putVarInt32(146) |
|
1408 out.putVarInt32(self.ancestor_.ByteSize()) |
|
1409 self.ancestor_.OutputUnchecked(out) |
|
1410 |
|
1411 def TryMerge(self, d): |
|
1412 while 1: |
|
1413 tt = d.getVarInt32() |
|
1414 if tt == 108: break |
|
1415 if tt == 112: |
|
1416 self.set_distinct(d.getBoolean()) |
|
1417 continue |
|
1418 if tt == 120: |
|
1419 self.set_offset(d.getVarInt32()) |
|
1420 continue |
|
1421 if tt == 128: |
|
1422 self.set_limit(d.getVarInt32()) |
|
1423 continue |
|
1424 if tt == 138: |
|
1425 self.set_kind(d.getPrefixedString()) |
|
1426 continue |
|
1427 if tt == 146: |
|
1428 length = d.getVarInt32() |
|
1429 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
1430 d.skip(length) |
|
1431 self.mutable_ancestor().TryMerge(tmp) |
|
1432 continue |
|
1433 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1434 d.skipData(tt) |
|
1435 |
|
1436 |
|
1437 def __str__(self, prefix="", printElemNumber=0): |
|
1438 res="" |
|
1439 if self.has_distinct_: res+=prefix+("distinct: %s\n" % self.DebugFormatBool(self.distinct_)) |
|
1440 if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_)) |
|
1441 if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_)) |
|
1442 if self.has_kind_: res+=prefix+("kind: %s\n" % self.DebugFormatString(self.kind_)) |
|
1443 if self.has_ancestor_: |
|
1444 res+=prefix+"ancestor <\n" |
|
1445 res+=self.ancestor_.__str__(prefix + " ", printElemNumber) |
|
1446 res+=prefix+">\n" |
|
1447 return res |
|
1448 |
|
1449 class CompiledQuery(ProtocolBuffer.ProtocolMessage): |
|
1450 has_primaryscan_ = 0 |
|
1451 has_offset_ = 0 |
|
1452 offset_ = 0 |
|
1453 has_limit_ = 0 |
|
1454 limit_ = 0 |
|
1455 has_keys_only_ = 0 |
|
1456 keys_only_ = 0 |
|
1457 has_entityfilter_ = 0 |
|
1458 entityfilter_ = None |
|
1459 |
|
1460 def __init__(self, contents=None): |
|
1461 self.primaryscan_ = CompiledQuery_PrimaryScan() |
|
1462 self.mergejoinscan_ = [] |
|
1463 self.lazy_init_lock_ = thread.allocate_lock() |
|
1464 if contents is not None: self.MergeFromString(contents) |
|
1465 |
|
1466 def primaryscan(self): return self.primaryscan_ |
|
1467 |
|
1468 def mutable_primaryscan(self): self.has_primaryscan_ = 1; return self.primaryscan_ |
|
1469 |
|
1470 def clear_primaryscan(self):self.has_primaryscan_ = 0; self.primaryscan_.Clear() |
|
1471 |
|
1472 def has_primaryscan(self): return self.has_primaryscan_ |
|
1473 |
|
1474 def mergejoinscan_size(self): return len(self.mergejoinscan_) |
|
1475 def mergejoinscan_list(self): return self.mergejoinscan_ |
|
1476 |
|
1477 def mergejoinscan(self, i): |
|
1478 return self.mergejoinscan_[i] |
|
1479 |
|
1480 def mutable_mergejoinscan(self, i): |
|
1481 return self.mergejoinscan_[i] |
|
1482 |
|
1483 def add_mergejoinscan(self): |
|
1484 x = CompiledQuery_MergeJoinScan() |
|
1485 self.mergejoinscan_.append(x) |
|
1486 return x |
|
1487 |
|
1488 def clear_mergejoinscan(self): |
|
1489 self.mergejoinscan_ = [] |
|
1490 def offset(self): return self.offset_ |
|
1491 |
|
1492 def set_offset(self, x): |
|
1493 self.has_offset_ = 1 |
|
1494 self.offset_ = x |
|
1495 |
|
1496 def clear_offset(self): |
|
1497 if self.has_offset_: |
|
1498 self.has_offset_ = 0 |
|
1499 self.offset_ = 0 |
|
1500 |
|
1501 def has_offset(self): return self.has_offset_ |
|
1502 |
|
1503 def limit(self): return self.limit_ |
|
1504 |
|
1505 def set_limit(self, x): |
|
1506 self.has_limit_ = 1 |
|
1507 self.limit_ = x |
|
1508 |
|
1509 def clear_limit(self): |
|
1510 if self.has_limit_: |
|
1511 self.has_limit_ = 0 |
|
1512 self.limit_ = 0 |
|
1513 |
|
1514 def has_limit(self): return self.has_limit_ |
|
1515 |
|
1516 def keys_only(self): return self.keys_only_ |
|
1517 |
|
1518 def set_keys_only(self, x): |
|
1519 self.has_keys_only_ = 1 |
|
1520 self.keys_only_ = x |
|
1521 |
|
1522 def clear_keys_only(self): |
|
1523 if self.has_keys_only_: |
|
1524 self.has_keys_only_ = 0 |
|
1525 self.keys_only_ = 0 |
|
1526 |
|
1527 def has_keys_only(self): return self.has_keys_only_ |
|
1528 |
|
1529 def entityfilter(self): |
|
1530 if self.entityfilter_ is None: |
|
1531 self.lazy_init_lock_.acquire() |
|
1532 try: |
|
1533 if self.entityfilter_ is None: self.entityfilter_ = CompiledQuery_EntityFilter() |
|
1534 finally: |
|
1535 self.lazy_init_lock_.release() |
|
1536 return self.entityfilter_ |
|
1537 |
|
1538 def mutable_entityfilter(self): self.has_entityfilter_ = 1; return self.entityfilter() |
|
1539 |
|
1540 def clear_entityfilter(self): |
|
1541 if self.has_entityfilter_: |
|
1542 self.has_entityfilter_ = 0; |
|
1543 if self.entityfilter_ is not None: self.entityfilter_.Clear() |
|
1544 |
|
1545 def has_entityfilter(self): return self.has_entityfilter_ |
|
1546 |
|
1547 |
|
1548 def MergeFrom(self, x): |
|
1549 assert x is not self |
|
1550 if (x.has_primaryscan()): self.mutable_primaryscan().MergeFrom(x.primaryscan()) |
|
1551 for i in xrange(x.mergejoinscan_size()): self.add_mergejoinscan().CopyFrom(x.mergejoinscan(i)) |
|
1552 if (x.has_offset()): self.set_offset(x.offset()) |
|
1553 if (x.has_limit()): self.set_limit(x.limit()) |
|
1554 if (x.has_keys_only()): self.set_keys_only(x.keys_only()) |
|
1555 if (x.has_entityfilter()): self.mutable_entityfilter().MergeFrom(x.entityfilter()) |
|
1556 |
|
1557 def Equals(self, x): |
|
1558 if x is self: return 1 |
|
1559 if self.has_primaryscan_ != x.has_primaryscan_: return 0 |
|
1560 if self.has_primaryscan_ and self.primaryscan_ != x.primaryscan_: return 0 |
|
1561 if len(self.mergejoinscan_) != len(x.mergejoinscan_): return 0 |
|
1562 for e1, e2 in zip(self.mergejoinscan_, x.mergejoinscan_): |
|
1563 if e1 != e2: return 0 |
|
1564 if self.has_offset_ != x.has_offset_: return 0 |
|
1565 if self.has_offset_ and self.offset_ != x.offset_: return 0 |
|
1566 if self.has_limit_ != x.has_limit_: return 0 |
|
1567 if self.has_limit_ and self.limit_ != x.limit_: return 0 |
|
1568 if self.has_keys_only_ != x.has_keys_only_: return 0 |
|
1569 if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0 |
|
1570 if self.has_entityfilter_ != x.has_entityfilter_: return 0 |
|
1571 if self.has_entityfilter_ and self.entityfilter_ != x.entityfilter_: return 0 |
|
1572 return 1 |
|
1573 |
|
1574 def IsInitialized(self, debug_strs=None): |
|
1575 initialized = 1 |
|
1576 if (not self.has_primaryscan_): |
|
1577 initialized = 0 |
|
1578 if debug_strs is not None: |
|
1579 debug_strs.append('Required field: primaryscan not set.') |
|
1580 elif not self.primaryscan_.IsInitialized(debug_strs): initialized = 0 |
|
1581 for p in self.mergejoinscan_: |
|
1582 if not p.IsInitialized(debug_strs): initialized=0 |
|
1583 if (not self.has_keys_only_): |
|
1584 initialized = 0 |
|
1585 if debug_strs is not None: |
|
1586 debug_strs.append('Required field: keys_only not set.') |
|
1587 if (self.has_entityfilter_ and not self.entityfilter_.IsInitialized(debug_strs)): initialized = 0 |
|
1588 return initialized |
|
1589 |
|
1590 def ByteSize(self): |
|
1591 n = 0 |
|
1592 n += self.primaryscan_.ByteSize() |
|
1593 n += 2 * len(self.mergejoinscan_) |
|
1594 for i in xrange(len(self.mergejoinscan_)): n += self.mergejoinscan_[i].ByteSize() |
|
1595 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_) |
|
1596 if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_) |
|
1597 if (self.has_entityfilter_): n += 2 + self.entityfilter_.ByteSize() |
|
1598 return n + 4 |
|
1599 |
|
1600 def Clear(self): |
|
1601 self.clear_primaryscan() |
|
1602 self.clear_mergejoinscan() |
|
1603 self.clear_offset() |
|
1604 self.clear_limit() |
|
1605 self.clear_keys_only() |
|
1606 self.clear_entityfilter() |
|
1607 |
|
1608 def OutputUnchecked(self, out): |
|
1609 out.putVarInt32(11) |
|
1610 self.primaryscan_.OutputUnchecked(out) |
|
1611 out.putVarInt32(12) |
|
1612 for i in xrange(len(self.mergejoinscan_)): |
|
1613 out.putVarInt32(59) |
|
1614 self.mergejoinscan_[i].OutputUnchecked(out) |
|
1615 out.putVarInt32(60) |
|
1616 if (self.has_offset_): |
|
1617 out.putVarInt32(80) |
|
1618 out.putVarInt32(self.offset_) |
|
1619 if (self.has_limit_): |
|
1620 out.putVarInt32(88) |
|
1621 out.putVarInt32(self.limit_) |
|
1622 out.putVarInt32(96) |
|
1623 out.putBoolean(self.keys_only_) |
|
1624 if (self.has_entityfilter_): |
|
1625 out.putVarInt32(107) |
|
1626 self.entityfilter_.OutputUnchecked(out) |
|
1627 out.putVarInt32(108) |
|
1628 |
|
1629 def TryMerge(self, d): |
|
1630 while d.avail() > 0: |
|
1631 tt = d.getVarInt32() |
|
1632 if tt == 11: |
|
1633 self.mutable_primaryscan().TryMerge(d) |
|
1634 continue |
|
1635 if tt == 59: |
|
1636 self.add_mergejoinscan().TryMerge(d) |
|
1637 continue |
|
1638 if tt == 80: |
|
1639 self.set_offset(d.getVarInt32()) |
|
1640 continue |
|
1641 if tt == 88: |
|
1642 self.set_limit(d.getVarInt32()) |
|
1643 continue |
|
1644 if tt == 96: |
|
1645 self.set_keys_only(d.getBoolean()) |
|
1646 continue |
|
1647 if tt == 107: |
|
1648 self.mutable_entityfilter().TryMerge(d) |
|
1649 continue |
|
1650 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1651 d.skipData(tt) |
|
1652 |
|
1653 |
|
1654 def __str__(self, prefix="", printElemNumber=0): |
|
1655 res="" |
|
1656 if self.has_primaryscan_: |
|
1657 res+=prefix+"PrimaryScan {\n" |
|
1658 res+=self.primaryscan_.__str__(prefix + " ", printElemNumber) |
|
1659 res+=prefix+"}\n" |
|
1660 cnt=0 |
|
1661 for e in self.mergejoinscan_: |
|
1662 elm="" |
|
1663 if printElemNumber: elm="(%d)" % cnt |
|
1664 res+=prefix+("MergeJoinScan%s {\n" % elm) |
|
1665 res+=e.__str__(prefix + " ", printElemNumber) |
|
1666 res+=prefix+"}\n" |
|
1667 cnt+=1 |
|
1668 if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_)) |
|
1669 if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_)) |
|
1670 if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_)) |
|
1671 if self.has_entityfilter_: |
|
1672 res+=prefix+"EntityFilter {\n" |
|
1673 res+=self.entityfilter_.__str__(prefix + " ", printElemNumber) |
|
1674 res+=prefix+"}\n" |
|
1675 return res |
|
1676 |
|
1677 |
|
1678 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
1679 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
1680 |
|
1681 kPrimaryScanGroup = 1 |
|
1682 kPrimaryScanindex_name = 2 |
|
1683 kPrimaryScanstart_key = 3 |
|
1684 kPrimaryScanstart_inclusive = 4 |
|
1685 kPrimaryScanend_key = 5 |
|
1686 kPrimaryScanend_inclusive = 6 |
|
1687 kMergeJoinScanGroup = 7 |
|
1688 kMergeJoinScanindex_name = 8 |
|
1689 kMergeJoinScanprefix_value = 9 |
|
1690 koffset = 10 |
|
1691 klimit = 11 |
|
1692 kkeys_only = 12 |
|
1693 kEntityFilterGroup = 13 |
|
1694 kEntityFilterdistinct = 14 |
|
1695 kEntityFilteroffset = 15 |
|
1696 kEntityFilterlimit = 16 |
|
1697 kEntityFilterkind = 17 |
|
1698 kEntityFilterancestor = 18 |
|
1699 |
|
1700 _TEXT = _BuildTagLookupTable({ |
|
1701 0: "ErrorCode", |
|
1702 1: "PrimaryScan", |
|
1703 2: "index_name", |
|
1704 3: "start_key", |
|
1705 4: "start_inclusive", |
|
1706 5: "end_key", |
|
1707 6: "end_inclusive", |
|
1708 7: "MergeJoinScan", |
|
1709 8: "index_name", |
|
1710 9: "prefix_value", |
|
1711 10: "offset", |
|
1712 11: "limit", |
|
1713 12: "keys_only", |
|
1714 13: "EntityFilter", |
|
1715 14: "distinct", |
|
1716 15: "offset", |
|
1717 16: "limit", |
|
1718 17: "kind", |
|
1719 18: "ancestor", |
|
1720 }, 18) |
|
1721 |
|
1722 _TYPES = _BuildTagLookupTable({ |
|
1723 0: ProtocolBuffer.Encoder.NUMERIC, |
|
1724 1: ProtocolBuffer.Encoder.STARTGROUP, |
|
1725 2: ProtocolBuffer.Encoder.STRING, |
|
1726 3: ProtocolBuffer.Encoder.STRING, |
|
1727 4: ProtocolBuffer.Encoder.NUMERIC, |
|
1728 5: ProtocolBuffer.Encoder.STRING, |
|
1729 6: ProtocolBuffer.Encoder.NUMERIC, |
|
1730 7: ProtocolBuffer.Encoder.STARTGROUP, |
|
1731 8: ProtocolBuffer.Encoder.STRING, |
|
1732 9: ProtocolBuffer.Encoder.STRING, |
|
1733 10: ProtocolBuffer.Encoder.NUMERIC, |
|
1734 11: ProtocolBuffer.Encoder.NUMERIC, |
|
1735 12: ProtocolBuffer.Encoder.NUMERIC, |
|
1736 13: ProtocolBuffer.Encoder.STARTGROUP, |
|
1737 14: ProtocolBuffer.Encoder.NUMERIC, |
|
1738 15: ProtocolBuffer.Encoder.NUMERIC, |
|
1739 16: ProtocolBuffer.Encoder.NUMERIC, |
|
1740 17: ProtocolBuffer.Encoder.STRING, |
|
1741 18: ProtocolBuffer.Encoder.STRING, |
|
1742 }, 18, ProtocolBuffer.Encoder.MAX_TYPE) |
|
1743 |
|
1744 _STYLE = """""" |
|
1745 _STYLE_CONTENT_TYPE = """""" |
|
1746 class RunCompiledQueryRequest(ProtocolBuffer.ProtocolMessage): |
|
1747 has_compiled_query_ = 0 |
|
1748 has_original_query_ = 0 |
|
1749 original_query_ = None |
|
1750 has_count_ = 0 |
|
1751 count_ = 0 |
|
1752 |
|
1753 def __init__(self, contents=None): |
|
1754 self.compiled_query_ = CompiledQuery() |
|
1755 self.lazy_init_lock_ = thread.allocate_lock() |
|
1756 if contents is not None: self.MergeFromString(contents) |
|
1757 |
|
1758 def compiled_query(self): return self.compiled_query_ |
|
1759 |
|
1760 def mutable_compiled_query(self): self.has_compiled_query_ = 1; return self.compiled_query_ |
|
1761 |
|
1762 def clear_compiled_query(self):self.has_compiled_query_ = 0; self.compiled_query_.Clear() |
|
1763 |
|
1764 def has_compiled_query(self): return self.has_compiled_query_ |
|
1765 |
|
1766 def original_query(self): |
|
1767 if self.original_query_ is None: |
|
1768 self.lazy_init_lock_.acquire() |
|
1769 try: |
|
1770 if self.original_query_ is None: self.original_query_ = Query() |
|
1771 finally: |
|
1772 self.lazy_init_lock_.release() |
|
1773 return self.original_query_ |
|
1774 |
|
1775 def mutable_original_query(self): self.has_original_query_ = 1; return self.original_query() |
|
1776 |
|
1777 def clear_original_query(self): |
|
1778 if self.has_original_query_: |
|
1779 self.has_original_query_ = 0; |
|
1780 if self.original_query_ is not None: self.original_query_.Clear() |
|
1781 |
|
1782 def has_original_query(self): return self.has_original_query_ |
|
1783 |
|
1784 def count(self): return self.count_ |
|
1785 |
|
1786 def set_count(self, x): |
|
1787 self.has_count_ = 1 |
|
1788 self.count_ = x |
|
1789 |
|
1790 def clear_count(self): |
|
1791 if self.has_count_: |
|
1792 self.has_count_ = 0 |
|
1793 self.count_ = 0 |
|
1794 |
|
1795 def has_count(self): return self.has_count_ |
|
1796 |
|
1797 |
|
1798 def MergeFrom(self, x): |
|
1799 assert x is not self |
|
1800 if (x.has_compiled_query()): self.mutable_compiled_query().MergeFrom(x.compiled_query()) |
|
1801 if (x.has_original_query()): self.mutable_original_query().MergeFrom(x.original_query()) |
|
1802 if (x.has_count()): self.set_count(x.count()) |
|
1803 |
|
1804 def Equals(self, x): |
|
1805 if x is self: return 1 |
|
1806 if self.has_compiled_query_ != x.has_compiled_query_: return 0 |
|
1807 if self.has_compiled_query_ and self.compiled_query_ != x.compiled_query_: return 0 |
|
1808 if self.has_original_query_ != x.has_original_query_: return 0 |
|
1809 if self.has_original_query_ and self.original_query_ != x.original_query_: return 0 |
|
1810 if self.has_count_ != x.has_count_: return 0 |
|
1811 if self.has_count_ and self.count_ != x.count_: return 0 |
|
1812 return 1 |
|
1813 |
|
1814 def IsInitialized(self, debug_strs=None): |
|
1815 initialized = 1 |
|
1816 if (not self.has_compiled_query_): |
|
1817 initialized = 0 |
|
1818 if debug_strs is not None: |
|
1819 debug_strs.append('Required field: compiled_query not set.') |
|
1820 elif not self.compiled_query_.IsInitialized(debug_strs): initialized = 0 |
|
1821 if (self.has_original_query_ and not self.original_query_.IsInitialized(debug_strs)): initialized = 0 |
|
1822 return initialized |
|
1823 |
|
1824 def ByteSize(self): |
|
1825 n = 0 |
|
1826 n += self.lengthString(self.compiled_query_.ByteSize()) |
|
1827 if (self.has_original_query_): n += 1 + self.lengthString(self.original_query_.ByteSize()) |
|
1828 if (self.has_count_): n += 1 + self.lengthVarInt64(self.count_) |
|
1829 return n + 1 |
|
1830 |
|
1831 def Clear(self): |
|
1832 self.clear_compiled_query() |
|
1833 self.clear_original_query() |
|
1834 self.clear_count() |
|
1835 |
|
1836 def OutputUnchecked(self, out): |
|
1837 out.putVarInt32(10) |
|
1838 out.putVarInt32(self.compiled_query_.ByteSize()) |
|
1839 self.compiled_query_.OutputUnchecked(out) |
|
1840 if (self.has_original_query_): |
|
1841 out.putVarInt32(18) |
|
1842 out.putVarInt32(self.original_query_.ByteSize()) |
|
1843 self.original_query_.OutputUnchecked(out) |
|
1844 if (self.has_count_): |
|
1845 out.putVarInt32(24) |
|
1846 out.putVarInt32(self.count_) |
|
1847 |
|
1848 def TryMerge(self, d): |
|
1849 while d.avail() > 0: |
|
1850 tt = d.getVarInt32() |
|
1851 if tt == 10: |
|
1852 length = d.getVarInt32() |
|
1853 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
1854 d.skip(length) |
|
1855 self.mutable_compiled_query().TryMerge(tmp) |
|
1856 continue |
|
1857 if tt == 18: |
|
1858 length = d.getVarInt32() |
|
1859 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
1860 d.skip(length) |
|
1861 self.mutable_original_query().TryMerge(tmp) |
|
1862 continue |
|
1863 if tt == 24: |
|
1864 self.set_count(d.getVarInt32()) |
|
1865 continue |
|
1866 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
1867 d.skipData(tt) |
|
1868 |
|
1869 |
|
1870 def __str__(self, prefix="", printElemNumber=0): |
|
1871 res="" |
|
1872 if self.has_compiled_query_: |
|
1873 res+=prefix+"compiled_query <\n" |
|
1874 res+=self.compiled_query_.__str__(prefix + " ", printElemNumber) |
|
1875 res+=prefix+">\n" |
|
1876 if self.has_original_query_: |
|
1877 res+=prefix+"original_query <\n" |
|
1878 res+=self.original_query_.__str__(prefix + " ", printElemNumber) |
|
1879 res+=prefix+">\n" |
|
1880 if self.has_count_: res+=prefix+("count: %s\n" % self.DebugFormatInt32(self.count_)) |
|
1881 return res |
|
1882 |
|
1883 |
|
1884 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
1885 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
1886 |
|
1887 kcompiled_query = 1 |
|
1888 koriginal_query = 2 |
|
1889 kcount = 3 |
|
1890 |
|
1891 _TEXT = _BuildTagLookupTable({ |
|
1892 0: "ErrorCode", |
|
1893 1: "compiled_query", |
|
1894 2: "original_query", |
|
1895 3: "count", |
|
1896 }, 3) |
|
1897 |
|
1898 _TYPES = _BuildTagLookupTable({ |
|
1899 0: ProtocolBuffer.Encoder.NUMERIC, |
|
1900 1: ProtocolBuffer.Encoder.STRING, |
|
1901 2: ProtocolBuffer.Encoder.STRING, |
|
1902 3: ProtocolBuffer.Encoder.NUMERIC, |
|
1903 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
|
919 |
1904 |
920 _STYLE = """""" |
1905 _STYLE = """""" |
921 _STYLE_CONTENT_TYPE = """""" |
1906 _STYLE_CONTENT_TYPE = """""" |
922 class QueryExplanation(ProtocolBuffer.ProtocolMessage): |
1907 class QueryExplanation(ProtocolBuffer.ProtocolMessage): |
923 has_native_ancestor_ = 0 |
1908 has_native_ancestor_ = 0 |
1078 cnt+=1 |
2063 cnt+=1 |
1079 if self.has_native_offset_: res+=prefix+("native_offset: %s\n" % self.DebugFormatInt32(self.native_offset_)) |
2064 if self.has_native_offset_: res+=prefix+("native_offset: %s\n" % self.DebugFormatInt32(self.native_offset_)) |
1080 if self.has_native_limit_: res+=prefix+("native_limit: %s\n" % self.DebugFormatInt32(self.native_limit_)) |
2065 if self.has_native_limit_: res+=prefix+("native_limit: %s\n" % self.DebugFormatInt32(self.native_limit_)) |
1081 return res |
2066 return res |
1082 |
2067 |
2068 |
|
2069 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2070 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2071 |
|
1083 knative_ancestor = 1 |
2072 knative_ancestor = 1 |
1084 knative_index = 2 |
2073 knative_index = 2 |
1085 knative_offset = 3 |
2074 knative_offset = 3 |
1086 knative_limit = 4 |
2075 knative_limit = 4 |
1087 |
2076 |
1088 _TEXT = ( |
2077 _TEXT = _BuildTagLookupTable({ |
1089 "ErrorCode", |
2078 0: "ErrorCode", |
1090 "native_ancestor", |
2079 1: "native_ancestor", |
1091 "native_index", |
2080 2: "native_index", |
1092 "native_offset", |
2081 3: "native_offset", |
1093 "native_limit", |
2082 4: "native_limit", |
1094 ) |
2083 }, 4) |
1095 |
2084 |
1096 _TYPES = ( |
2085 _TYPES = _BuildTagLookupTable({ |
1097 ProtocolBuffer.Encoder.NUMERIC, |
2086 0: ProtocolBuffer.Encoder.NUMERIC, |
1098 ProtocolBuffer.Encoder.NUMERIC, |
2087 1: ProtocolBuffer.Encoder.NUMERIC, |
1099 |
2088 2: ProtocolBuffer.Encoder.STRING, |
1100 ProtocolBuffer.Encoder.STRING, |
2089 3: ProtocolBuffer.Encoder.NUMERIC, |
1101 |
2090 4: ProtocolBuffer.Encoder.NUMERIC, |
1102 ProtocolBuffer.Encoder.NUMERIC, |
2091 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) |
1103 |
|
1104 ProtocolBuffer.Encoder.NUMERIC, |
|
1105 |
|
1106 ) |
|
1107 |
2092 |
1108 _STYLE = """""" |
2093 _STYLE = """""" |
1109 _STYLE_CONTENT_TYPE = """""" |
2094 _STYLE_CONTENT_TYPE = """""" |
1110 class Cursor(ProtocolBuffer.ProtocolMessage): |
2095 class Cursor(ProtocolBuffer.ProtocolMessage): |
1111 has_cursor_ = 0 |
2096 has_cursor_ = 0 |
1170 def __str__(self, prefix="", printElemNumber=0): |
2155 def __str__(self, prefix="", printElemNumber=0): |
1171 res="" |
2156 res="" |
1172 if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatFixed64(self.cursor_)) |
2157 if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatFixed64(self.cursor_)) |
1173 return res |
2158 return res |
1174 |
2159 |
2160 |
|
2161 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2162 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2163 |
|
1175 kcursor = 1 |
2164 kcursor = 1 |
1176 |
2165 |
1177 _TEXT = ( |
2166 _TEXT = _BuildTagLookupTable({ |
1178 "ErrorCode", |
2167 0: "ErrorCode", |
1179 "cursor", |
2168 1: "cursor", |
1180 ) |
2169 }, 1) |
1181 |
2170 |
1182 _TYPES = ( |
2171 _TYPES = _BuildTagLookupTable({ |
1183 ProtocolBuffer.Encoder.NUMERIC, |
2172 0: ProtocolBuffer.Encoder.NUMERIC, |
1184 ProtocolBuffer.Encoder.DOUBLE, |
2173 1: ProtocolBuffer.Encoder.DOUBLE, |
1185 |
2174 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
1186 ) |
|
1187 |
2175 |
1188 _STYLE = """""" |
2176 _STYLE = """""" |
1189 _STYLE_CONTENT_TYPE = """""" |
2177 _STYLE_CONTENT_TYPE = """""" |
1190 class Error(ProtocolBuffer.ProtocolMessage): |
2178 class Error(ProtocolBuffer.ProtocolMessage): |
1191 |
2179 |
1192 BAD_REQUEST = 1 |
2180 BAD_REQUEST = 1 |
1193 CONCURRENT_TRANSACTION = 2 |
2181 CONCURRENT_TRANSACTION = 2 |
1194 INTERNAL_ERROR = 3 |
2182 INTERNAL_ERROR = 3 |
1195 NEED_INDEX = 4 |
2183 NEED_INDEX = 4 |
1196 TIMEOUT = 5 |
2184 TIMEOUT = 5 |
2185 PERMISSION_DENIED = 6 |
|
1197 |
2186 |
1198 _ErrorCode_NAMES = { |
2187 _ErrorCode_NAMES = { |
1199 1: "BAD_REQUEST", |
2188 1: "BAD_REQUEST", |
1200 2: "CONCURRENT_TRANSACTION", |
2189 2: "CONCURRENT_TRANSACTION", |
1201 3: "INTERNAL_ERROR", |
2190 3: "INTERNAL_ERROR", |
1202 4: "NEED_INDEX", |
2191 4: "NEED_INDEX", |
1203 5: "TIMEOUT", |
2192 5: "TIMEOUT", |
2193 6: "PERMISSION_DENIED", |
|
1204 } |
2194 } |
1205 |
2195 |
1206 def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "") |
2196 def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "") |
1207 ErrorCode_Name = classmethod(ErrorCode_Name) |
2197 ErrorCode_Name = classmethod(ErrorCode_Name) |
1208 |
2198 |
1243 def __str__(self, prefix="", printElemNumber=0): |
2233 def __str__(self, prefix="", printElemNumber=0): |
1244 res="" |
2234 res="" |
1245 return res |
2235 return res |
1246 |
2236 |
1247 |
2237 |
1248 _TEXT = ( |
2238 def _BuildTagLookupTable(sparse, maxtag, default=None): |
1249 "ErrorCode", |
2239 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
1250 ) |
2240 |
1251 |
2241 |
1252 _TYPES = ( |
2242 _TEXT = _BuildTagLookupTable({ |
1253 ProtocolBuffer.Encoder.NUMERIC, |
2243 0: "ErrorCode", |
1254 ) |
2244 }, 0) |
2245 |
|
2246 _TYPES = _BuildTagLookupTable({ |
|
2247 0: ProtocolBuffer.Encoder.NUMERIC, |
|
2248 }, 0, ProtocolBuffer.Encoder.MAX_TYPE) |
|
1255 |
2249 |
1256 _STYLE = """""" |
2250 _STYLE = """""" |
1257 _STYLE_CONTENT_TYPE = """""" |
2251 _STYLE_CONTENT_TYPE = """""" |
1258 class Cost(ProtocolBuffer.ProtocolMessage): |
2252 class Cost(ProtocolBuffer.ProtocolMessage): |
1259 has_index_writes_ = 0 |
2253 has_index_writes_ = 0 |
1397 if self.has_index_write_bytes_: res+=prefix+("index_write_bytes: %s\n" % self.DebugFormatInt32(self.index_write_bytes_)) |
2391 if self.has_index_write_bytes_: res+=prefix+("index_write_bytes: %s\n" % self.DebugFormatInt32(self.index_write_bytes_)) |
1398 if self.has_entity_writes_: res+=prefix+("entity_writes: %s\n" % self.DebugFormatInt32(self.entity_writes_)) |
2392 if self.has_entity_writes_: res+=prefix+("entity_writes: %s\n" % self.DebugFormatInt32(self.entity_writes_)) |
1399 if self.has_entity_write_bytes_: res+=prefix+("entity_write_bytes: %s\n" % self.DebugFormatInt32(self.entity_write_bytes_)) |
2393 if self.has_entity_write_bytes_: res+=prefix+("entity_write_bytes: %s\n" % self.DebugFormatInt32(self.entity_write_bytes_)) |
1400 return res |
2394 return res |
1401 |
2395 |
2396 |
|
2397 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2398 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2399 |
|
1402 kindex_writes = 1 |
2400 kindex_writes = 1 |
1403 kindex_write_bytes = 2 |
2401 kindex_write_bytes = 2 |
1404 kentity_writes = 3 |
2402 kentity_writes = 3 |
1405 kentity_write_bytes = 4 |
2403 kentity_write_bytes = 4 |
1406 |
2404 |
1407 _TEXT = ( |
2405 _TEXT = _BuildTagLookupTable({ |
1408 "ErrorCode", |
2406 0: "ErrorCode", |
1409 "index_writes", |
2407 1: "index_writes", |
1410 "index_write_bytes", |
2408 2: "index_write_bytes", |
1411 "entity_writes", |
2409 3: "entity_writes", |
1412 "entity_write_bytes", |
2410 4: "entity_write_bytes", |
1413 ) |
2411 }, 4) |
1414 |
2412 |
1415 _TYPES = ( |
2413 _TYPES = _BuildTagLookupTable({ |
1416 ProtocolBuffer.Encoder.NUMERIC, |
2414 0: ProtocolBuffer.Encoder.NUMERIC, |
1417 ProtocolBuffer.Encoder.NUMERIC, |
2415 1: ProtocolBuffer.Encoder.NUMERIC, |
1418 |
2416 2: ProtocolBuffer.Encoder.NUMERIC, |
1419 ProtocolBuffer.Encoder.NUMERIC, |
2417 3: ProtocolBuffer.Encoder.NUMERIC, |
1420 |
2418 4: ProtocolBuffer.Encoder.NUMERIC, |
1421 ProtocolBuffer.Encoder.NUMERIC, |
2419 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) |
1422 |
|
1423 ProtocolBuffer.Encoder.NUMERIC, |
|
1424 |
|
1425 ) |
|
1426 |
2420 |
1427 _STYLE = """""" |
2421 _STYLE = """""" |
1428 _STYLE_CONTENT_TYPE = """""" |
2422 _STYLE_CONTENT_TYPE = """""" |
1429 class GetRequest(ProtocolBuffer.ProtocolMessage): |
2423 class GetRequest(ProtocolBuffer.ProtocolMessage): |
1430 has_transaction_ = 0 |
2424 has_transaction_ = 0 |
1545 res+=prefix+"transaction <\n" |
2539 res+=prefix+"transaction <\n" |
1546 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
2540 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
1547 res+=prefix+">\n" |
2541 res+=prefix+">\n" |
1548 return res |
2542 return res |
1549 |
2543 |
2544 |
|
2545 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2546 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2547 |
|
1550 kkey = 1 |
2548 kkey = 1 |
1551 ktransaction = 2 |
2549 ktransaction = 2 |
1552 |
2550 |
1553 _TEXT = ( |
2551 _TEXT = _BuildTagLookupTable({ |
1554 "ErrorCode", |
2552 0: "ErrorCode", |
1555 "key", |
2553 1: "key", |
1556 "transaction", |
2554 2: "transaction", |
1557 ) |
2555 }, 2) |
1558 |
2556 |
1559 _TYPES = ( |
2557 _TYPES = _BuildTagLookupTable({ |
1560 ProtocolBuffer.Encoder.NUMERIC, |
2558 0: ProtocolBuffer.Encoder.NUMERIC, |
1561 ProtocolBuffer.Encoder.STRING, |
2559 1: ProtocolBuffer.Encoder.STRING, |
1562 |
2560 2: ProtocolBuffer.Encoder.STRING, |
1563 ProtocolBuffer.Encoder.STRING, |
2561 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
1564 |
|
1565 ) |
|
1566 |
2562 |
1567 _STYLE = """""" |
2563 _STYLE = """""" |
1568 _STYLE_CONTENT_TYPE = """""" |
2564 _STYLE_CONTENT_TYPE = """""" |
1569 class GetResponse_Entity(ProtocolBuffer.ProtocolMessage): |
2565 class GetResponse_Entity(ProtocolBuffer.ProtocolMessage): |
1570 has_entity_ = 0 |
2566 has_entity_ = 0 |
1719 res+=e.__str__(prefix + " ", printElemNumber) |
2715 res+=e.__str__(prefix + " ", printElemNumber) |
1720 res+=prefix+"}\n" |
2716 res+=prefix+"}\n" |
1721 cnt+=1 |
2717 cnt+=1 |
1722 return res |
2718 return res |
1723 |
2719 |
2720 |
|
2721 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2722 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2723 |
|
1724 kEntityGroup = 1 |
2724 kEntityGroup = 1 |
1725 kEntityentity = 2 |
2725 kEntityentity = 2 |
1726 |
2726 |
1727 _TEXT = ( |
2727 _TEXT = _BuildTagLookupTable({ |
1728 "ErrorCode", |
2728 0: "ErrorCode", |
1729 "Entity", |
2729 1: "Entity", |
1730 "entity", |
2730 2: "entity", |
1731 ) |
2731 }, 2) |
1732 |
2732 |
1733 _TYPES = ( |
2733 _TYPES = _BuildTagLookupTable({ |
1734 ProtocolBuffer.Encoder.NUMERIC, |
2734 0: ProtocolBuffer.Encoder.NUMERIC, |
1735 ProtocolBuffer.Encoder.STARTGROUP, |
2735 1: ProtocolBuffer.Encoder.STARTGROUP, |
1736 |
2736 2: ProtocolBuffer.Encoder.STRING, |
1737 ProtocolBuffer.Encoder.STRING, |
2737 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
1738 |
|
1739 ) |
|
1740 |
2738 |
1741 _STYLE = """""" |
2739 _STYLE = """""" |
1742 _STYLE_CONTENT_TYPE = """""" |
2740 _STYLE_CONTENT_TYPE = """""" |
1743 class PutRequest(ProtocolBuffer.ProtocolMessage): |
2741 class PutRequest(ProtocolBuffer.ProtocolMessage): |
1744 has_transaction_ = 0 |
2742 has_transaction_ = 0 |
1930 res+=prefix+">\n" |
2928 res+=prefix+">\n" |
1931 cnt+=1 |
2929 cnt+=1 |
1932 if self.has_trusted_: res+=prefix+("trusted: %s\n" % self.DebugFormatBool(self.trusted_)) |
2930 if self.has_trusted_: res+=prefix+("trusted: %s\n" % self.DebugFormatBool(self.trusted_)) |
1933 return res |
2931 return res |
1934 |
2932 |
2933 |
|
2934 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
2935 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2936 |
|
1935 kentity = 1 |
2937 kentity = 1 |
1936 ktransaction = 2 |
2938 ktransaction = 2 |
1937 kcomposite_index = 3 |
2939 kcomposite_index = 3 |
1938 ktrusted = 4 |
2940 ktrusted = 4 |
1939 |
2941 |
1940 _TEXT = ( |
2942 _TEXT = _BuildTagLookupTable({ |
1941 "ErrorCode", |
2943 0: "ErrorCode", |
1942 "entity", |
2944 1: "entity", |
1943 "transaction", |
2945 2: "transaction", |
1944 "composite_index", |
2946 3: "composite_index", |
1945 "trusted", |
2947 4: "trusted", |
1946 ) |
2948 }, 4) |
1947 |
2949 |
1948 _TYPES = ( |
2950 _TYPES = _BuildTagLookupTable({ |
1949 ProtocolBuffer.Encoder.NUMERIC, |
2951 0: ProtocolBuffer.Encoder.NUMERIC, |
1950 ProtocolBuffer.Encoder.STRING, |
2952 1: ProtocolBuffer.Encoder.STRING, |
1951 |
2953 2: ProtocolBuffer.Encoder.STRING, |
1952 ProtocolBuffer.Encoder.STRING, |
2954 3: ProtocolBuffer.Encoder.STRING, |
1953 |
2955 4: ProtocolBuffer.Encoder.NUMERIC, |
1954 ProtocolBuffer.Encoder.STRING, |
2956 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) |
1955 |
|
1956 ProtocolBuffer.Encoder.NUMERIC, |
|
1957 |
|
1958 ) |
|
1959 |
2957 |
1960 _STYLE = """""" |
2958 _STYLE = """""" |
1961 _STYLE_CONTENT_TYPE = """""" |
2959 _STYLE_CONTENT_TYPE = """""" |
1962 class PutResponse(ProtocolBuffer.ProtocolMessage): |
2960 class PutResponse(ProtocolBuffer.ProtocolMessage): |
1963 has_cost_ = 0 |
2961 has_cost_ = 0 |
2078 res+=prefix+"cost <\n" |
3076 res+=prefix+"cost <\n" |
2079 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
3077 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
2080 res+=prefix+">\n" |
3078 res+=prefix+">\n" |
2081 return res |
3079 return res |
2082 |
3080 |
3081 |
|
3082 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3083 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
3084 |
|
2083 kkey = 1 |
3085 kkey = 1 |
2084 kcost = 2 |
3086 kcost = 2 |
2085 |
3087 |
2086 _TEXT = ( |
3088 _TEXT = _BuildTagLookupTable({ |
2087 "ErrorCode", |
3089 0: "ErrorCode", |
2088 "key", |
3090 1: "key", |
2089 "cost", |
3091 2: "cost", |
2090 ) |
3092 }, 2) |
2091 |
3093 |
2092 _TYPES = ( |
3094 _TYPES = _BuildTagLookupTable({ |
2093 ProtocolBuffer.Encoder.NUMERIC, |
3095 0: ProtocolBuffer.Encoder.NUMERIC, |
2094 ProtocolBuffer.Encoder.STRING, |
3096 1: ProtocolBuffer.Encoder.STRING, |
2095 |
3097 2: ProtocolBuffer.Encoder.STRING, |
2096 ProtocolBuffer.Encoder.STRING, |
3098 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
2097 |
|
2098 ) |
|
2099 |
3099 |
2100 _STYLE = """""" |
3100 _STYLE = """""" |
2101 _STYLE_CONTENT_TYPE = """""" |
3101 _STYLE_CONTENT_TYPE = """""" |
2102 class DeleteRequest(ProtocolBuffer.ProtocolMessage): |
3102 class DeleteRequest(ProtocolBuffer.ProtocolMessage): |
2103 has_transaction_ = 0 |
3103 has_transaction_ = 0 |
2245 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
3245 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
2246 res+=prefix+">\n" |
3246 res+=prefix+">\n" |
2247 if self.has_trusted_: res+=prefix+("trusted: %s\n" % self.DebugFormatBool(self.trusted_)) |
3247 if self.has_trusted_: res+=prefix+("trusted: %s\n" % self.DebugFormatBool(self.trusted_)) |
2248 return res |
3248 return res |
2249 |
3249 |
3250 |
|
3251 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3252 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
3253 |
|
2250 kkey = 6 |
3254 kkey = 6 |
2251 ktransaction = 5 |
3255 ktransaction = 5 |
2252 ktrusted = 4 |
3256 ktrusted = 4 |
2253 |
3257 |
2254 _TEXT = ( |
3258 _TEXT = _BuildTagLookupTable({ |
2255 "ErrorCode", |
3259 0: "ErrorCode", |
2256 None, |
3260 4: "trusted", |
2257 None, |
3261 5: "transaction", |
2258 None, |
3262 6: "key", |
2259 "trusted", |
3263 }, 6) |
2260 "transaction", |
3264 |
2261 "key", |
3265 _TYPES = _BuildTagLookupTable({ |
2262 ) |
3266 0: ProtocolBuffer.Encoder.NUMERIC, |
2263 |
3267 4: ProtocolBuffer.Encoder.NUMERIC, |
2264 _TYPES = ( |
3268 5: ProtocolBuffer.Encoder.STRING, |
2265 ProtocolBuffer.Encoder.NUMERIC, |
3269 6: ProtocolBuffer.Encoder.STRING, |
2266 ProtocolBuffer.Encoder.MAX_TYPE, |
3270 }, 6, ProtocolBuffer.Encoder.MAX_TYPE) |
2267 |
|
2268 ProtocolBuffer.Encoder.MAX_TYPE, |
|
2269 |
|
2270 ProtocolBuffer.Encoder.MAX_TYPE, |
|
2271 |
|
2272 ProtocolBuffer.Encoder.NUMERIC, |
|
2273 |
|
2274 ProtocolBuffer.Encoder.STRING, |
|
2275 |
|
2276 ProtocolBuffer.Encoder.STRING, |
|
2277 |
|
2278 ) |
|
2279 |
3271 |
2280 _STYLE = """""" |
3272 _STYLE = """""" |
2281 _STYLE_CONTENT_TYPE = """""" |
3273 _STYLE_CONTENT_TYPE = """""" |
2282 class DeleteResponse(ProtocolBuffer.ProtocolMessage): |
3274 class DeleteResponse(ProtocolBuffer.ProtocolMessage): |
2283 has_cost_ = 0 |
3275 has_cost_ = 0 |
2354 res+=prefix+"cost <\n" |
3346 res+=prefix+"cost <\n" |
2355 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
3347 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
2356 res+=prefix+">\n" |
3348 res+=prefix+">\n" |
2357 return res |
3349 return res |
2358 |
3350 |
3351 |
|
3352 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3353 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
3354 |
|
2359 kcost = 1 |
3355 kcost = 1 |
2360 |
3356 |
2361 _TEXT = ( |
3357 _TEXT = _BuildTagLookupTable({ |
2362 "ErrorCode", |
3358 0: "ErrorCode", |
2363 "cost", |
3359 1: "cost", |
2364 ) |
3360 }, 1) |
2365 |
3361 |
2366 _TYPES = ( |
3362 _TYPES = _BuildTagLookupTable({ |
2367 ProtocolBuffer.Encoder.NUMERIC, |
3363 0: ProtocolBuffer.Encoder.NUMERIC, |
2368 ProtocolBuffer.Encoder.STRING, |
3364 1: ProtocolBuffer.Encoder.STRING, |
2369 |
3365 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
2370 ) |
|
2371 |
3366 |
2372 _STYLE = """""" |
3367 _STYLE = """""" |
2373 _STYLE_CONTENT_TYPE = """""" |
3368 _STYLE_CONTENT_TYPE = """""" |
2374 class NextRequest(ProtocolBuffer.ProtocolMessage): |
3369 class NextRequest(ProtocolBuffer.ProtocolMessage): |
2375 has_cursor_ = 0 |
3370 has_cursor_ = 0 |
2376 has_count_ = 0 |
3371 has_count_ = 0 |
2377 count_ = 1 |
3372 count_ = 0 |
3373 has_compile_ = 0 |
|
3374 compile_ = 0 |
|
2378 |
3375 |
2379 def __init__(self, contents=None): |
3376 def __init__(self, contents=None): |
2380 self.cursor_ = Cursor() |
3377 self.cursor_ = Cursor() |
2381 if contents is not None: self.MergeFromString(contents) |
3378 if contents is not None: self.MergeFromString(contents) |
2382 |
3379 |
2395 self.count_ = x |
3392 self.count_ = x |
2396 |
3393 |
2397 def clear_count(self): |
3394 def clear_count(self): |
2398 if self.has_count_: |
3395 if self.has_count_: |
2399 self.has_count_ = 0 |
3396 self.has_count_ = 0 |
2400 self.count_ = 1 |
3397 self.count_ = 0 |
2401 |
3398 |
2402 def has_count(self): return self.has_count_ |
3399 def has_count(self): return self.has_count_ |
3400 |
|
3401 def compile(self): return self.compile_ |
|
3402 |
|
3403 def set_compile(self, x): |
|
3404 self.has_compile_ = 1 |
|
3405 self.compile_ = x |
|
3406 |
|
3407 def clear_compile(self): |
|
3408 if self.has_compile_: |
|
3409 self.has_compile_ = 0 |
|
3410 self.compile_ = 0 |
|
3411 |
|
3412 def has_compile(self): return self.has_compile_ |
|
2403 |
3413 |
2404 |
3414 |
2405 def MergeFrom(self, x): |
3415 def MergeFrom(self, x): |
2406 assert x is not self |
3416 assert x is not self |
2407 if (x.has_cursor()): self.mutable_cursor().MergeFrom(x.cursor()) |
3417 if (x.has_cursor()): self.mutable_cursor().MergeFrom(x.cursor()) |
2408 if (x.has_count()): self.set_count(x.count()) |
3418 if (x.has_count()): self.set_count(x.count()) |
3419 if (x.has_compile()): self.set_compile(x.compile()) |
|
2409 |
3420 |
2410 def Equals(self, x): |
3421 def Equals(self, x): |
2411 if x is self: return 1 |
3422 if x is self: return 1 |
2412 if self.has_cursor_ != x.has_cursor_: return 0 |
3423 if self.has_cursor_ != x.has_cursor_: return 0 |
2413 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0 |
3424 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0 |
2414 if self.has_count_ != x.has_count_: return 0 |
3425 if self.has_count_ != x.has_count_: return 0 |
2415 if self.has_count_ and self.count_ != x.count_: return 0 |
3426 if self.has_count_ and self.count_ != x.count_: return 0 |
3427 if self.has_compile_ != x.has_compile_: return 0 |
|
3428 if self.has_compile_ and self.compile_ != x.compile_: return 0 |
|
2416 return 1 |
3429 return 1 |
2417 |
3430 |
2418 def IsInitialized(self, debug_strs=None): |
3431 def IsInitialized(self, debug_strs=None): |
2419 initialized = 1 |
3432 initialized = 1 |
2420 if (not self.has_cursor_): |
3433 if (not self.has_cursor_): |
2426 |
3439 |
2427 def ByteSize(self): |
3440 def ByteSize(self): |
2428 n = 0 |
3441 n = 0 |
2429 n += self.lengthString(self.cursor_.ByteSize()) |
3442 n += self.lengthString(self.cursor_.ByteSize()) |
2430 if (self.has_count_): n += 1 + self.lengthVarInt64(self.count_) |
3443 if (self.has_count_): n += 1 + self.lengthVarInt64(self.count_) |
3444 if (self.has_compile_): n += 2 |
|
2431 return n + 1 |
3445 return n + 1 |
2432 |
3446 |
2433 def Clear(self): |
3447 def Clear(self): |
2434 self.clear_cursor() |
3448 self.clear_cursor() |
2435 self.clear_count() |
3449 self.clear_count() |
3450 self.clear_compile() |
|
2436 |
3451 |
2437 def OutputUnchecked(self, out): |
3452 def OutputUnchecked(self, out): |
2438 out.putVarInt32(10) |
3453 out.putVarInt32(10) |
2439 out.putVarInt32(self.cursor_.ByteSize()) |
3454 out.putVarInt32(self.cursor_.ByteSize()) |
2440 self.cursor_.OutputUnchecked(out) |
3455 self.cursor_.OutputUnchecked(out) |
2441 if (self.has_count_): |
3456 if (self.has_count_): |
2442 out.putVarInt32(16) |
3457 out.putVarInt32(16) |
2443 out.putVarInt32(self.count_) |
3458 out.putVarInt32(self.count_) |
3459 if (self.has_compile_): |
|
3460 out.putVarInt32(24) |
|
3461 out.putBoolean(self.compile_) |
|
2444 |
3462 |
2445 def TryMerge(self, d): |
3463 def TryMerge(self, d): |
2446 while d.avail() > 0: |
3464 while d.avail() > 0: |
2447 tt = d.getVarInt32() |
3465 tt = d.getVarInt32() |
2448 if tt == 10: |
3466 if tt == 10: |
2452 self.mutable_cursor().TryMerge(tmp) |
3470 self.mutable_cursor().TryMerge(tmp) |
2453 continue |
3471 continue |
2454 if tt == 16: |
3472 if tt == 16: |
2455 self.set_count(d.getVarInt32()) |
3473 self.set_count(d.getVarInt32()) |
2456 continue |
3474 continue |
3475 if tt == 24: |
|
3476 self.set_compile(d.getBoolean()) |
|
3477 continue |
|
2457 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
3478 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
2458 d.skipData(tt) |
3479 d.skipData(tt) |
2459 |
3480 |
2460 |
3481 |
2461 def __str__(self, prefix="", printElemNumber=0): |
3482 def __str__(self, prefix="", printElemNumber=0): |
2463 if self.has_cursor_: |
3484 if self.has_cursor_: |
2464 res+=prefix+"cursor <\n" |
3485 res+=prefix+"cursor <\n" |
2465 res+=self.cursor_.__str__(prefix + " ", printElemNumber) |
3486 res+=self.cursor_.__str__(prefix + " ", printElemNumber) |
2466 res+=prefix+">\n" |
3487 res+=prefix+">\n" |
2467 if self.has_count_: res+=prefix+("count: %s\n" % self.DebugFormatInt32(self.count_)) |
3488 if self.has_count_: res+=prefix+("count: %s\n" % self.DebugFormatInt32(self.count_)) |
3489 if self.has_compile_: res+=prefix+("compile: %s\n" % self.DebugFormatBool(self.compile_)) |
|
2468 return res |
3490 return res |
3491 |
|
3492 |
|
3493 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3494 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2469 |
3495 |
2470 kcursor = 1 |
3496 kcursor = 1 |
2471 kcount = 2 |
3497 kcount = 2 |
2472 |
3498 kcompile = 3 |
2473 _TEXT = ( |
3499 |
2474 "ErrorCode", |
3500 _TEXT = _BuildTagLookupTable({ |
2475 "cursor", |
3501 0: "ErrorCode", |
2476 "count", |
3502 1: "cursor", |
2477 ) |
3503 2: "count", |
2478 |
3504 3: "compile", |
2479 _TYPES = ( |
3505 }, 3) |
2480 ProtocolBuffer.Encoder.NUMERIC, |
3506 |
2481 ProtocolBuffer.Encoder.STRING, |
3507 _TYPES = _BuildTagLookupTable({ |
2482 |
3508 0: ProtocolBuffer.Encoder.NUMERIC, |
2483 ProtocolBuffer.Encoder.NUMERIC, |
3509 1: ProtocolBuffer.Encoder.STRING, |
2484 |
3510 2: ProtocolBuffer.Encoder.NUMERIC, |
2485 ) |
3511 3: ProtocolBuffer.Encoder.NUMERIC, |
3512 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2486 |
3513 |
2487 _STYLE = """""" |
3514 _STYLE = """""" |
2488 _STYLE_CONTENT_TYPE = """""" |
3515 _STYLE_CONTENT_TYPE = """""" |
2489 class QueryResult(ProtocolBuffer.ProtocolMessage): |
3516 class QueryResult(ProtocolBuffer.ProtocolMessage): |
2490 has_cursor_ = 0 |
3517 has_cursor_ = 0 |
2491 cursor_ = None |
3518 cursor_ = None |
2492 has_more_results_ = 0 |
3519 has_more_results_ = 0 |
2493 more_results_ = 0 |
3520 more_results_ = 0 |
2494 has_keys_only_ = 0 |
3521 has_keys_only_ = 0 |
2495 keys_only_ = 0 |
3522 keys_only_ = 0 |
3523 has_compiled_query_ = 0 |
|
3524 compiled_query_ = None |
|
2496 |
3525 |
2497 def __init__(self, contents=None): |
3526 def __init__(self, contents=None): |
2498 self.result_ = [] |
3527 self.result_ = [] |
2499 self.lazy_init_lock_ = thread.allocate_lock() |
3528 self.lazy_init_lock_ = thread.allocate_lock() |
2500 if contents is not None: self.MergeFromString(contents) |
3529 if contents is not None: self.MergeFromString(contents) |
2557 self.has_keys_only_ = 0 |
3586 self.has_keys_only_ = 0 |
2558 self.keys_only_ = 0 |
3587 self.keys_only_ = 0 |
2559 |
3588 |
2560 def has_keys_only(self): return self.has_keys_only_ |
3589 def has_keys_only(self): return self.has_keys_only_ |
2561 |
3590 |
3591 def compiled_query(self): |
|
3592 if self.compiled_query_ is None: |
|
3593 self.lazy_init_lock_.acquire() |
|
3594 try: |
|
3595 if self.compiled_query_ is None: self.compiled_query_ = CompiledQuery() |
|
3596 finally: |
|
3597 self.lazy_init_lock_.release() |
|
3598 return self.compiled_query_ |
|
3599 |
|
3600 def mutable_compiled_query(self): self.has_compiled_query_ = 1; return self.compiled_query() |
|
3601 |
|
3602 def clear_compiled_query(self): |
|
3603 if self.has_compiled_query_: |
|
3604 self.has_compiled_query_ = 0; |
|
3605 if self.compiled_query_ is not None: self.compiled_query_.Clear() |
|
3606 |
|
3607 def has_compiled_query(self): return self.has_compiled_query_ |
|
3608 |
|
2562 |
3609 |
2563 def MergeFrom(self, x): |
3610 def MergeFrom(self, x): |
2564 assert x is not self |
3611 assert x is not self |
2565 if (x.has_cursor()): self.mutable_cursor().MergeFrom(x.cursor()) |
3612 if (x.has_cursor()): self.mutable_cursor().MergeFrom(x.cursor()) |
2566 for i in xrange(x.result_size()): self.add_result().CopyFrom(x.result(i)) |
3613 for i in xrange(x.result_size()): self.add_result().CopyFrom(x.result(i)) |
2567 if (x.has_more_results()): self.set_more_results(x.more_results()) |
3614 if (x.has_more_results()): self.set_more_results(x.more_results()) |
2568 if (x.has_keys_only()): self.set_keys_only(x.keys_only()) |
3615 if (x.has_keys_only()): self.set_keys_only(x.keys_only()) |
3616 if (x.has_compiled_query()): self.mutable_compiled_query().MergeFrom(x.compiled_query()) |
|
2569 |
3617 |
2570 def Equals(self, x): |
3618 def Equals(self, x): |
2571 if x is self: return 1 |
3619 if x is self: return 1 |
2572 if self.has_cursor_ != x.has_cursor_: return 0 |
3620 if self.has_cursor_ != x.has_cursor_: return 0 |
2573 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0 |
3621 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0 |
2576 if e1 != e2: return 0 |
3624 if e1 != e2: return 0 |
2577 if self.has_more_results_ != x.has_more_results_: return 0 |
3625 if self.has_more_results_ != x.has_more_results_: return 0 |
2578 if self.has_more_results_ and self.more_results_ != x.more_results_: return 0 |
3626 if self.has_more_results_ and self.more_results_ != x.more_results_: return 0 |
2579 if self.has_keys_only_ != x.has_keys_only_: return 0 |
3627 if self.has_keys_only_ != x.has_keys_only_: return 0 |
2580 if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0 |
3628 if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0 |
3629 if self.has_compiled_query_ != x.has_compiled_query_: return 0 |
|
3630 if self.has_compiled_query_ and self.compiled_query_ != x.compiled_query_: return 0 |
|
2581 return 1 |
3631 return 1 |
2582 |
3632 |
2583 def IsInitialized(self, debug_strs=None): |
3633 def IsInitialized(self, debug_strs=None): |
2584 initialized = 1 |
3634 initialized = 1 |
2585 if (self.has_cursor_ and not self.cursor_.IsInitialized(debug_strs)): initialized = 0 |
3635 if (self.has_cursor_ and not self.cursor_.IsInitialized(debug_strs)): initialized = 0 |
2587 if not p.IsInitialized(debug_strs): initialized=0 |
3637 if not p.IsInitialized(debug_strs): initialized=0 |
2588 if (not self.has_more_results_): |
3638 if (not self.has_more_results_): |
2589 initialized = 0 |
3639 initialized = 0 |
2590 if debug_strs is not None: |
3640 if debug_strs is not None: |
2591 debug_strs.append('Required field: more_results not set.') |
3641 debug_strs.append('Required field: more_results not set.') |
3642 if (self.has_compiled_query_ and not self.compiled_query_.IsInitialized(debug_strs)): initialized = 0 |
|
2592 return initialized |
3643 return initialized |
2593 |
3644 |
2594 def ByteSize(self): |
3645 def ByteSize(self): |
2595 n = 0 |
3646 n = 0 |
2596 if (self.has_cursor_): n += 1 + self.lengthString(self.cursor_.ByteSize()) |
3647 if (self.has_cursor_): n += 1 + self.lengthString(self.cursor_.ByteSize()) |
2597 n += 1 * len(self.result_) |
3648 n += 1 * len(self.result_) |
2598 for i in xrange(len(self.result_)): n += self.lengthString(self.result_[i].ByteSize()) |
3649 for i in xrange(len(self.result_)): n += self.lengthString(self.result_[i].ByteSize()) |
2599 if (self.has_keys_only_): n += 2 |
3650 if (self.has_keys_only_): n += 2 |
3651 if (self.has_compiled_query_): n += 1 + self.lengthString(self.compiled_query_.ByteSize()) |
|
2600 return n + 2 |
3652 return n + 2 |
2601 |
3653 |
2602 def Clear(self): |
3654 def Clear(self): |
2603 self.clear_cursor() |
3655 self.clear_cursor() |
2604 self.clear_result() |
3656 self.clear_result() |
2605 self.clear_more_results() |
3657 self.clear_more_results() |
2606 self.clear_keys_only() |
3658 self.clear_keys_only() |
3659 self.clear_compiled_query() |
|
2607 |
3660 |
2608 def OutputUnchecked(self, out): |
3661 def OutputUnchecked(self, out): |
2609 if (self.has_cursor_): |
3662 if (self.has_cursor_): |
2610 out.putVarInt32(10) |
3663 out.putVarInt32(10) |
2611 out.putVarInt32(self.cursor_.ByteSize()) |
3664 out.putVarInt32(self.cursor_.ByteSize()) |
2617 out.putVarInt32(24) |
3670 out.putVarInt32(24) |
2618 out.putBoolean(self.more_results_) |
3671 out.putBoolean(self.more_results_) |
2619 if (self.has_keys_only_): |
3672 if (self.has_keys_only_): |
2620 out.putVarInt32(32) |
3673 out.putVarInt32(32) |
2621 out.putBoolean(self.keys_only_) |
3674 out.putBoolean(self.keys_only_) |
3675 if (self.has_compiled_query_): |
|
3676 out.putVarInt32(42) |
|
3677 out.putVarInt32(self.compiled_query_.ByteSize()) |
|
3678 self.compiled_query_.OutputUnchecked(out) |
|
2622 |
3679 |
2623 def TryMerge(self, d): |
3680 def TryMerge(self, d): |
2624 while d.avail() > 0: |
3681 while d.avail() > 0: |
2625 tt = d.getVarInt32() |
3682 tt = d.getVarInt32() |
2626 if tt == 10: |
3683 if tt == 10: |
2638 if tt == 24: |
3695 if tt == 24: |
2639 self.set_more_results(d.getBoolean()) |
3696 self.set_more_results(d.getBoolean()) |
2640 continue |
3697 continue |
2641 if tt == 32: |
3698 if tt == 32: |
2642 self.set_keys_only(d.getBoolean()) |
3699 self.set_keys_only(d.getBoolean()) |
3700 continue |
|
3701 if tt == 42: |
|
3702 length = d.getVarInt32() |
|
3703 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
3704 d.skip(length) |
|
3705 self.mutable_compiled_query().TryMerge(tmp) |
|
2643 continue |
3706 continue |
2644 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
3707 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
2645 d.skipData(tt) |
3708 d.skipData(tt) |
2646 |
3709 |
2647 |
3710 |
2659 res+=e.__str__(prefix + " ", printElemNumber) |
3722 res+=e.__str__(prefix + " ", printElemNumber) |
2660 res+=prefix+">\n" |
3723 res+=prefix+">\n" |
2661 cnt+=1 |
3724 cnt+=1 |
2662 if self.has_more_results_: res+=prefix+("more_results: %s\n" % self.DebugFormatBool(self.more_results_)) |
3725 if self.has_more_results_: res+=prefix+("more_results: %s\n" % self.DebugFormatBool(self.more_results_)) |
2663 if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_)) |
3726 if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_)) |
3727 if self.has_compiled_query_: |
|
3728 res+=prefix+"compiled_query <\n" |
|
3729 res+=self.compiled_query_.__str__(prefix + " ", printElemNumber) |
|
3730 res+=prefix+">\n" |
|
2664 return res |
3731 return res |
3732 |
|
3733 |
|
3734 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3735 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
2665 |
3736 |
2666 kcursor = 1 |
3737 kcursor = 1 |
2667 kresult = 2 |
3738 kresult = 2 |
2668 kmore_results = 3 |
3739 kmore_results = 3 |
2669 kkeys_only = 4 |
3740 kkeys_only = 4 |
2670 |
3741 kcompiled_query = 5 |
2671 _TEXT = ( |
3742 |
2672 "ErrorCode", |
3743 _TEXT = _BuildTagLookupTable({ |
2673 "cursor", |
3744 0: "ErrorCode", |
2674 "result", |
3745 1: "cursor", |
2675 "more_results", |
3746 2: "result", |
2676 "keys_only", |
3747 3: "more_results", |
2677 ) |
3748 4: "keys_only", |
2678 |
3749 5: "compiled_query", |
2679 _TYPES = ( |
3750 }, 5) |
2680 ProtocolBuffer.Encoder.NUMERIC, |
3751 |
2681 ProtocolBuffer.Encoder.STRING, |
3752 _TYPES = _BuildTagLookupTable({ |
2682 |
3753 0: ProtocolBuffer.Encoder.NUMERIC, |
2683 ProtocolBuffer.Encoder.STRING, |
3754 1: ProtocolBuffer.Encoder.STRING, |
2684 |
3755 2: ProtocolBuffer.Encoder.STRING, |
2685 ProtocolBuffer.Encoder.NUMERIC, |
3756 3: ProtocolBuffer.Encoder.NUMERIC, |
2686 |
3757 4: ProtocolBuffer.Encoder.NUMERIC, |
2687 ProtocolBuffer.Encoder.NUMERIC, |
3758 5: ProtocolBuffer.Encoder.STRING, |
2688 |
3759 }, 5, ProtocolBuffer.Encoder.MAX_TYPE) |
2689 ) |
3760 |
3761 _STYLE = """""" |
|
3762 _STYLE_CONTENT_TYPE = """""" |
|
3763 class GetSchemaRequest(ProtocolBuffer.ProtocolMessage): |
|
3764 has_app_ = 0 |
|
3765 app_ = "" |
|
3766 has_start_kind_ = 0 |
|
3767 start_kind_ = "" |
|
3768 has_end_kind_ = 0 |
|
3769 end_kind_ = "" |
|
3770 has_properties_ = 0 |
|
3771 properties_ = 1 |
|
3772 |
|
3773 def __init__(self, contents=None): |
|
3774 if contents is not None: self.MergeFromString(contents) |
|
3775 |
|
3776 def app(self): return self.app_ |
|
3777 |
|
3778 def set_app(self, x): |
|
3779 self.has_app_ = 1 |
|
3780 self.app_ = x |
|
3781 |
|
3782 def clear_app(self): |
|
3783 if self.has_app_: |
|
3784 self.has_app_ = 0 |
|
3785 self.app_ = "" |
|
3786 |
|
3787 def has_app(self): return self.has_app_ |
|
3788 |
|
3789 def start_kind(self): return self.start_kind_ |
|
3790 |
|
3791 def set_start_kind(self, x): |
|
3792 self.has_start_kind_ = 1 |
|
3793 self.start_kind_ = x |
|
3794 |
|
3795 def clear_start_kind(self): |
|
3796 if self.has_start_kind_: |
|
3797 self.has_start_kind_ = 0 |
|
3798 self.start_kind_ = "" |
|
3799 |
|
3800 def has_start_kind(self): return self.has_start_kind_ |
|
3801 |
|
3802 def end_kind(self): return self.end_kind_ |
|
3803 |
|
3804 def set_end_kind(self, x): |
|
3805 self.has_end_kind_ = 1 |
|
3806 self.end_kind_ = x |
|
3807 |
|
3808 def clear_end_kind(self): |
|
3809 if self.has_end_kind_: |
|
3810 self.has_end_kind_ = 0 |
|
3811 self.end_kind_ = "" |
|
3812 |
|
3813 def has_end_kind(self): return self.has_end_kind_ |
|
3814 |
|
3815 def properties(self): return self.properties_ |
|
3816 |
|
3817 def set_properties(self, x): |
|
3818 self.has_properties_ = 1 |
|
3819 self.properties_ = x |
|
3820 |
|
3821 def clear_properties(self): |
|
3822 if self.has_properties_: |
|
3823 self.has_properties_ = 0 |
|
3824 self.properties_ = 1 |
|
3825 |
|
3826 def has_properties(self): return self.has_properties_ |
|
3827 |
|
3828 |
|
3829 def MergeFrom(self, x): |
|
3830 assert x is not self |
|
3831 if (x.has_app()): self.set_app(x.app()) |
|
3832 if (x.has_start_kind()): self.set_start_kind(x.start_kind()) |
|
3833 if (x.has_end_kind()): self.set_end_kind(x.end_kind()) |
|
3834 if (x.has_properties()): self.set_properties(x.properties()) |
|
3835 |
|
3836 def Equals(self, x): |
|
3837 if x is self: return 1 |
|
3838 if self.has_app_ != x.has_app_: return 0 |
|
3839 if self.has_app_ and self.app_ != x.app_: return 0 |
|
3840 if self.has_start_kind_ != x.has_start_kind_: return 0 |
|
3841 if self.has_start_kind_ and self.start_kind_ != x.start_kind_: return 0 |
|
3842 if self.has_end_kind_ != x.has_end_kind_: return 0 |
|
3843 if self.has_end_kind_ and self.end_kind_ != x.end_kind_: return 0 |
|
3844 if self.has_properties_ != x.has_properties_: return 0 |
|
3845 if self.has_properties_ and self.properties_ != x.properties_: return 0 |
|
3846 return 1 |
|
3847 |
|
3848 def IsInitialized(self, debug_strs=None): |
|
3849 initialized = 1 |
|
3850 if (not self.has_app_): |
|
3851 initialized = 0 |
|
3852 if debug_strs is not None: |
|
3853 debug_strs.append('Required field: app not set.') |
|
3854 return initialized |
|
3855 |
|
3856 def ByteSize(self): |
|
3857 n = 0 |
|
3858 n += self.lengthString(len(self.app_)) |
|
3859 if (self.has_start_kind_): n += 1 + self.lengthString(len(self.start_kind_)) |
|
3860 if (self.has_end_kind_): n += 1 + self.lengthString(len(self.end_kind_)) |
|
3861 if (self.has_properties_): n += 2 |
|
3862 return n + 1 |
|
3863 |
|
3864 def Clear(self): |
|
3865 self.clear_app() |
|
3866 self.clear_start_kind() |
|
3867 self.clear_end_kind() |
|
3868 self.clear_properties() |
|
3869 |
|
3870 def OutputUnchecked(self, out): |
|
3871 out.putVarInt32(10) |
|
3872 out.putPrefixedString(self.app_) |
|
3873 if (self.has_start_kind_): |
|
3874 out.putVarInt32(18) |
|
3875 out.putPrefixedString(self.start_kind_) |
|
3876 if (self.has_end_kind_): |
|
3877 out.putVarInt32(26) |
|
3878 out.putPrefixedString(self.end_kind_) |
|
3879 if (self.has_properties_): |
|
3880 out.putVarInt32(32) |
|
3881 out.putBoolean(self.properties_) |
|
3882 |
|
3883 def TryMerge(self, d): |
|
3884 while d.avail() > 0: |
|
3885 tt = d.getVarInt32() |
|
3886 if tt == 10: |
|
3887 self.set_app(d.getPrefixedString()) |
|
3888 continue |
|
3889 if tt == 18: |
|
3890 self.set_start_kind(d.getPrefixedString()) |
|
3891 continue |
|
3892 if tt == 26: |
|
3893 self.set_end_kind(d.getPrefixedString()) |
|
3894 continue |
|
3895 if tt == 32: |
|
3896 self.set_properties(d.getBoolean()) |
|
3897 continue |
|
3898 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
3899 d.skipData(tt) |
|
3900 |
|
3901 |
|
3902 def __str__(self, prefix="", printElemNumber=0): |
|
3903 res="" |
|
3904 if self.has_app_: res+=prefix+("app: %s\n" % self.DebugFormatString(self.app_)) |
|
3905 if self.has_start_kind_: res+=prefix+("start_kind: %s\n" % self.DebugFormatString(self.start_kind_)) |
|
3906 if self.has_end_kind_: res+=prefix+("end_kind: %s\n" % self.DebugFormatString(self.end_kind_)) |
|
3907 if self.has_properties_: res+=prefix+("properties: %s\n" % self.DebugFormatBool(self.properties_)) |
|
3908 return res |
|
3909 |
|
3910 |
|
3911 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
3912 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
3913 |
|
3914 kapp = 1 |
|
3915 kstart_kind = 2 |
|
3916 kend_kind = 3 |
|
3917 kproperties = 4 |
|
3918 |
|
3919 _TEXT = _BuildTagLookupTable({ |
|
3920 0: "ErrorCode", |
|
3921 1: "app", |
|
3922 2: "start_kind", |
|
3923 3: "end_kind", |
|
3924 4: "properties", |
|
3925 }, 4) |
|
3926 |
|
3927 _TYPES = _BuildTagLookupTable({ |
|
3928 0: ProtocolBuffer.Encoder.NUMERIC, |
|
3929 1: ProtocolBuffer.Encoder.STRING, |
|
3930 2: ProtocolBuffer.Encoder.STRING, |
|
3931 3: ProtocolBuffer.Encoder.STRING, |
|
3932 4: ProtocolBuffer.Encoder.NUMERIC, |
|
3933 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2690 |
3934 |
2691 _STYLE = """""" |
3935 _STYLE = """""" |
2692 _STYLE_CONTENT_TYPE = """""" |
3936 _STYLE_CONTENT_TYPE = """""" |
2693 class Schema(ProtocolBuffer.ProtocolMessage): |
3937 class Schema(ProtocolBuffer.ProtocolMessage): |
3938 has_more_results_ = 0 |
|
3939 more_results_ = 0 |
|
2694 |
3940 |
2695 def __init__(self, contents=None): |
3941 def __init__(self, contents=None): |
2696 self.kind_ = [] |
3942 self.kind_ = [] |
2697 if contents is not None: self.MergeFromString(contents) |
3943 if contents is not None: self.MergeFromString(contents) |
2698 |
3944 |
2710 self.kind_.append(x) |
3956 self.kind_.append(x) |
2711 return x |
3957 return x |
2712 |
3958 |
2713 def clear_kind(self): |
3959 def clear_kind(self): |
2714 self.kind_ = [] |
3960 self.kind_ = [] |
3961 def more_results(self): return self.more_results_ |
|
3962 |
|
3963 def set_more_results(self, x): |
|
3964 self.has_more_results_ = 1 |
|
3965 self.more_results_ = x |
|
3966 |
|
3967 def clear_more_results(self): |
|
3968 if self.has_more_results_: |
|
3969 self.has_more_results_ = 0 |
|
3970 self.more_results_ = 0 |
|
3971 |
|
3972 def has_more_results(self): return self.has_more_results_ |
|
3973 |
|
2715 |
3974 |
2716 def MergeFrom(self, x): |
3975 def MergeFrom(self, x): |
2717 assert x is not self |
3976 assert x is not self |
2718 for i in xrange(x.kind_size()): self.add_kind().CopyFrom(x.kind(i)) |
3977 for i in xrange(x.kind_size()): self.add_kind().CopyFrom(x.kind(i)) |
3978 if (x.has_more_results()): self.set_more_results(x.more_results()) |
|
2719 |
3979 |
2720 def Equals(self, x): |
3980 def Equals(self, x): |
2721 if x is self: return 1 |
3981 if x is self: return 1 |
2722 if len(self.kind_) != len(x.kind_): return 0 |
3982 if len(self.kind_) != len(x.kind_): return 0 |
2723 for e1, e2 in zip(self.kind_, x.kind_): |
3983 for e1, e2 in zip(self.kind_, x.kind_): |
2724 if e1 != e2: return 0 |
3984 if e1 != e2: return 0 |
3985 if self.has_more_results_ != x.has_more_results_: return 0 |
|
3986 if self.has_more_results_ and self.more_results_ != x.more_results_: return 0 |
|
2725 return 1 |
3987 return 1 |
2726 |
3988 |
2727 def IsInitialized(self, debug_strs=None): |
3989 def IsInitialized(self, debug_strs=None): |
2728 initialized = 1 |
3990 initialized = 1 |
2729 for p in self.kind_: |
3991 for p in self.kind_: |
2732 |
3994 |
2733 def ByteSize(self): |
3995 def ByteSize(self): |
2734 n = 0 |
3996 n = 0 |
2735 n += 1 * len(self.kind_) |
3997 n += 1 * len(self.kind_) |
2736 for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSize()) |
3998 for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSize()) |
3999 if (self.has_more_results_): n += 2 |
|
2737 return n + 0 |
4000 return n + 0 |
2738 |
4001 |
2739 def Clear(self): |
4002 def Clear(self): |
2740 self.clear_kind() |
4003 self.clear_kind() |
4004 self.clear_more_results() |
|
2741 |
4005 |
2742 def OutputUnchecked(self, out): |
4006 def OutputUnchecked(self, out): |
2743 for i in xrange(len(self.kind_)): |
4007 for i in xrange(len(self.kind_)): |
2744 out.putVarInt32(10) |
4008 out.putVarInt32(10) |
2745 out.putVarInt32(self.kind_[i].ByteSize()) |
4009 out.putVarInt32(self.kind_[i].ByteSize()) |
2746 self.kind_[i].OutputUnchecked(out) |
4010 self.kind_[i].OutputUnchecked(out) |
4011 if (self.has_more_results_): |
|
4012 out.putVarInt32(16) |
|
4013 out.putBoolean(self.more_results_) |
|
2747 |
4014 |
2748 def TryMerge(self, d): |
4015 def TryMerge(self, d): |
2749 while d.avail() > 0: |
4016 while d.avail() > 0: |
2750 tt = d.getVarInt32() |
4017 tt = d.getVarInt32() |
2751 if tt == 10: |
4018 if tt == 10: |
2752 length = d.getVarInt32() |
4019 length = d.getVarInt32() |
2753 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
4020 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
2754 d.skip(length) |
4021 d.skip(length) |
2755 self.add_kind().TryMerge(tmp) |
4022 self.add_kind().TryMerge(tmp) |
4023 continue |
|
4024 if tt == 16: |
|
4025 self.set_more_results(d.getBoolean()) |
|
2756 continue |
4026 continue |
2757 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
4027 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
2758 d.skipData(tt) |
4028 d.skipData(tt) |
2759 |
4029 |
2760 |
4030 |
2766 if printElemNumber: elm="(%d)" % cnt |
4036 if printElemNumber: elm="(%d)" % cnt |
2767 res+=prefix+("kind%s <\n" % elm) |
4037 res+=prefix+("kind%s <\n" % elm) |
2768 res+=e.__str__(prefix + " ", printElemNumber) |
4038 res+=e.__str__(prefix + " ", printElemNumber) |
2769 res+=prefix+">\n" |
4039 res+=prefix+">\n" |
2770 cnt+=1 |
4040 cnt+=1 |
4041 if self.has_more_results_: res+=prefix+("more_results: %s\n" % self.DebugFormatBool(self.more_results_)) |
|
2771 return res |
4042 return res |
2772 |
4043 |
4044 |
|
4045 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4046 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4047 |
|
2773 kkind = 1 |
4048 kkind = 1 |
2774 |
4049 kmore_results = 2 |
2775 _TEXT = ( |
4050 |
2776 "ErrorCode", |
4051 _TEXT = _BuildTagLookupTable({ |
2777 "kind", |
4052 0: "ErrorCode", |
2778 ) |
4053 1: "kind", |
2779 |
4054 2: "more_results", |
2780 _TYPES = ( |
4055 }, 2) |
2781 ProtocolBuffer.Encoder.NUMERIC, |
4056 |
2782 ProtocolBuffer.Encoder.STRING, |
4057 _TYPES = _BuildTagLookupTable({ |
2783 |
4058 0: ProtocolBuffer.Encoder.NUMERIC, |
2784 ) |
4059 1: ProtocolBuffer.Encoder.STRING, |
4060 2: ProtocolBuffer.Encoder.NUMERIC, |
|
4061 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
|
4062 |
|
4063 _STYLE = """""" |
|
4064 _STYLE_CONTENT_TYPE = """""" |
|
4065 class AllocateIdsRequest(ProtocolBuffer.ProtocolMessage): |
|
4066 has_model_key_ = 0 |
|
4067 has_size_ = 0 |
|
4068 size_ = 0 |
|
4069 |
|
4070 def __init__(self, contents=None): |
|
4071 self.model_key_ = Reference() |
|
4072 if contents is not None: self.MergeFromString(contents) |
|
4073 |
|
4074 def model_key(self): return self.model_key_ |
|
4075 |
|
4076 def mutable_model_key(self): self.has_model_key_ = 1; return self.model_key_ |
|
4077 |
|
4078 def clear_model_key(self):self.has_model_key_ = 0; self.model_key_.Clear() |
|
4079 |
|
4080 def has_model_key(self): return self.has_model_key_ |
|
4081 |
|
4082 def size(self): return self.size_ |
|
4083 |
|
4084 def set_size(self, x): |
|
4085 self.has_size_ = 1 |
|
4086 self.size_ = x |
|
4087 |
|
4088 def clear_size(self): |
|
4089 if self.has_size_: |
|
4090 self.has_size_ = 0 |
|
4091 self.size_ = 0 |
|
4092 |
|
4093 def has_size(self): return self.has_size_ |
|
4094 |
|
4095 |
|
4096 def MergeFrom(self, x): |
|
4097 assert x is not self |
|
4098 if (x.has_model_key()): self.mutable_model_key().MergeFrom(x.model_key()) |
|
4099 if (x.has_size()): self.set_size(x.size()) |
|
4100 |
|
4101 def Equals(self, x): |
|
4102 if x is self: return 1 |
|
4103 if self.has_model_key_ != x.has_model_key_: return 0 |
|
4104 if self.has_model_key_ and self.model_key_ != x.model_key_: return 0 |
|
4105 if self.has_size_ != x.has_size_: return 0 |
|
4106 if self.has_size_ and self.size_ != x.size_: return 0 |
|
4107 return 1 |
|
4108 |
|
4109 def IsInitialized(self, debug_strs=None): |
|
4110 initialized = 1 |
|
4111 if (not self.has_model_key_): |
|
4112 initialized = 0 |
|
4113 if debug_strs is not None: |
|
4114 debug_strs.append('Required field: model_key not set.') |
|
4115 elif not self.model_key_.IsInitialized(debug_strs): initialized = 0 |
|
4116 if (not self.has_size_): |
|
4117 initialized = 0 |
|
4118 if debug_strs is not None: |
|
4119 debug_strs.append('Required field: size not set.') |
|
4120 return initialized |
|
4121 |
|
4122 def ByteSize(self): |
|
4123 n = 0 |
|
4124 n += self.lengthString(self.model_key_.ByteSize()) |
|
4125 n += self.lengthVarInt64(self.size_) |
|
4126 return n + 2 |
|
4127 |
|
4128 def Clear(self): |
|
4129 self.clear_model_key() |
|
4130 self.clear_size() |
|
4131 |
|
4132 def OutputUnchecked(self, out): |
|
4133 out.putVarInt32(10) |
|
4134 out.putVarInt32(self.model_key_.ByteSize()) |
|
4135 self.model_key_.OutputUnchecked(out) |
|
4136 out.putVarInt32(16) |
|
4137 out.putVarInt64(self.size_) |
|
4138 |
|
4139 def TryMerge(self, d): |
|
4140 while d.avail() > 0: |
|
4141 tt = d.getVarInt32() |
|
4142 if tt == 10: |
|
4143 length = d.getVarInt32() |
|
4144 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
4145 d.skip(length) |
|
4146 self.mutable_model_key().TryMerge(tmp) |
|
4147 continue |
|
4148 if tt == 16: |
|
4149 self.set_size(d.getVarInt64()) |
|
4150 continue |
|
4151 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
4152 d.skipData(tt) |
|
4153 |
|
4154 |
|
4155 def __str__(self, prefix="", printElemNumber=0): |
|
4156 res="" |
|
4157 if self.has_model_key_: |
|
4158 res+=prefix+"model_key <\n" |
|
4159 res+=self.model_key_.__str__(prefix + " ", printElemNumber) |
|
4160 res+=prefix+">\n" |
|
4161 if self.has_size_: res+=prefix+("size: %s\n" % self.DebugFormatInt64(self.size_)) |
|
4162 return res |
|
4163 |
|
4164 |
|
4165 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4166 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4167 |
|
4168 kmodel_key = 1 |
|
4169 ksize = 2 |
|
4170 |
|
4171 _TEXT = _BuildTagLookupTable({ |
|
4172 0: "ErrorCode", |
|
4173 1: "model_key", |
|
4174 2: "size", |
|
4175 }, 2) |
|
4176 |
|
4177 _TYPES = _BuildTagLookupTable({ |
|
4178 0: ProtocolBuffer.Encoder.NUMERIC, |
|
4179 1: ProtocolBuffer.Encoder.STRING, |
|
4180 2: ProtocolBuffer.Encoder.NUMERIC, |
|
4181 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
|
4182 |
|
4183 _STYLE = """""" |
|
4184 _STYLE_CONTENT_TYPE = """""" |
|
4185 class AllocateIdsResponse(ProtocolBuffer.ProtocolMessage): |
|
4186 has_start_ = 0 |
|
4187 start_ = 0 |
|
4188 has_end_ = 0 |
|
4189 end_ = 0 |
|
4190 |
|
4191 def __init__(self, contents=None): |
|
4192 if contents is not None: self.MergeFromString(contents) |
|
4193 |
|
4194 def start(self): return self.start_ |
|
4195 |
|
4196 def set_start(self, x): |
|
4197 self.has_start_ = 1 |
|
4198 self.start_ = x |
|
4199 |
|
4200 def clear_start(self): |
|
4201 if self.has_start_: |
|
4202 self.has_start_ = 0 |
|
4203 self.start_ = 0 |
|
4204 |
|
4205 def has_start(self): return self.has_start_ |
|
4206 |
|
4207 def end(self): return self.end_ |
|
4208 |
|
4209 def set_end(self, x): |
|
4210 self.has_end_ = 1 |
|
4211 self.end_ = x |
|
4212 |
|
4213 def clear_end(self): |
|
4214 if self.has_end_: |
|
4215 self.has_end_ = 0 |
|
4216 self.end_ = 0 |
|
4217 |
|
4218 def has_end(self): return self.has_end_ |
|
4219 |
|
4220 |
|
4221 def MergeFrom(self, x): |
|
4222 assert x is not self |
|
4223 if (x.has_start()): self.set_start(x.start()) |
|
4224 if (x.has_end()): self.set_end(x.end()) |
|
4225 |
|
4226 def Equals(self, x): |
|
4227 if x is self: return 1 |
|
4228 if self.has_start_ != x.has_start_: return 0 |
|
4229 if self.has_start_ and self.start_ != x.start_: return 0 |
|
4230 if self.has_end_ != x.has_end_: return 0 |
|
4231 if self.has_end_ and self.end_ != x.end_: return 0 |
|
4232 return 1 |
|
4233 |
|
4234 def IsInitialized(self, debug_strs=None): |
|
4235 initialized = 1 |
|
4236 if (not self.has_start_): |
|
4237 initialized = 0 |
|
4238 if debug_strs is not None: |
|
4239 debug_strs.append('Required field: start not set.') |
|
4240 if (not self.has_end_): |
|
4241 initialized = 0 |
|
4242 if debug_strs is not None: |
|
4243 debug_strs.append('Required field: end not set.') |
|
4244 return initialized |
|
4245 |
|
4246 def ByteSize(self): |
|
4247 n = 0 |
|
4248 n += self.lengthVarInt64(self.start_) |
|
4249 n += self.lengthVarInt64(self.end_) |
|
4250 return n + 2 |
|
4251 |
|
4252 def Clear(self): |
|
4253 self.clear_start() |
|
4254 self.clear_end() |
|
4255 |
|
4256 def OutputUnchecked(self, out): |
|
4257 out.putVarInt32(8) |
|
4258 out.putVarInt64(self.start_) |
|
4259 out.putVarInt32(16) |
|
4260 out.putVarInt64(self.end_) |
|
4261 |
|
4262 def TryMerge(self, d): |
|
4263 while d.avail() > 0: |
|
4264 tt = d.getVarInt32() |
|
4265 if tt == 8: |
|
4266 self.set_start(d.getVarInt64()) |
|
4267 continue |
|
4268 if tt == 16: |
|
4269 self.set_end(d.getVarInt64()) |
|
4270 continue |
|
4271 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
4272 d.skipData(tt) |
|
4273 |
|
4274 |
|
4275 def __str__(self, prefix="", printElemNumber=0): |
|
4276 res="" |
|
4277 if self.has_start_: res+=prefix+("start: %s\n" % self.DebugFormatInt64(self.start_)) |
|
4278 if self.has_end_: res+=prefix+("end: %s\n" % self.DebugFormatInt64(self.end_)) |
|
4279 return res |
|
4280 |
|
4281 |
|
4282 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4283 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4284 |
|
4285 kstart = 1 |
|
4286 kend = 2 |
|
4287 |
|
4288 _TEXT = _BuildTagLookupTable({ |
|
4289 0: "ErrorCode", |
|
4290 1: "start", |
|
4291 2: "end", |
|
4292 }, 2) |
|
4293 |
|
4294 _TYPES = _BuildTagLookupTable({ |
|
4295 0: ProtocolBuffer.Encoder.NUMERIC, |
|
4296 1: ProtocolBuffer.Encoder.NUMERIC, |
|
4297 2: ProtocolBuffer.Encoder.NUMERIC, |
|
4298 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2785 |
4299 |
2786 _STYLE = """""" |
4300 _STYLE = """""" |
2787 _STYLE_CONTENT_TYPE = """""" |
4301 _STYLE_CONTENT_TYPE = """""" |
2788 class CompositeIndices(ProtocolBuffer.ProtocolMessage): |
4302 class CompositeIndices(ProtocolBuffer.ProtocolMessage): |
2789 |
4303 |
2863 res+=e.__str__(prefix + " ", printElemNumber) |
4377 res+=e.__str__(prefix + " ", printElemNumber) |
2864 res+=prefix+">\n" |
4378 res+=prefix+">\n" |
2865 cnt+=1 |
4379 cnt+=1 |
2866 return res |
4380 return res |
2867 |
4381 |
4382 |
|
4383 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4384 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4385 |
|
2868 kindex = 1 |
4386 kindex = 1 |
2869 |
4387 |
2870 _TEXT = ( |
4388 _TEXT = _BuildTagLookupTable({ |
2871 "ErrorCode", |
4389 0: "ErrorCode", |
2872 "index", |
4390 1: "index", |
2873 ) |
4391 }, 1) |
2874 |
4392 |
2875 _TYPES = ( |
4393 _TYPES = _BuildTagLookupTable({ |
2876 ProtocolBuffer.Encoder.NUMERIC, |
4394 0: ProtocolBuffer.Encoder.NUMERIC, |
2877 ProtocolBuffer.Encoder.STRING, |
4395 1: ProtocolBuffer.Encoder.STRING, |
2878 |
4396 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
2879 ) |
4397 |
4398 _STYLE = """""" |
|
4399 _STYLE_CONTENT_TYPE = """""" |
|
4400 class ActionRequest(ProtocolBuffer.ProtocolMessage): |
|
4401 has_transaction_ = 0 |
|
4402 has_action_ = 0 |
|
4403 |
|
4404 def __init__(self, contents=None): |
|
4405 self.transaction_ = Transaction() |
|
4406 self.action_ = Action() |
|
4407 if contents is not None: self.MergeFromString(contents) |
|
4408 |
|
4409 def transaction(self): return self.transaction_ |
|
4410 |
|
4411 def mutable_transaction(self): self.has_transaction_ = 1; return self.transaction_ |
|
4412 |
|
4413 def clear_transaction(self):self.has_transaction_ = 0; self.transaction_.Clear() |
|
4414 |
|
4415 def has_transaction(self): return self.has_transaction_ |
|
4416 |
|
4417 def action(self): return self.action_ |
|
4418 |
|
4419 def mutable_action(self): self.has_action_ = 1; return self.action_ |
|
4420 |
|
4421 def clear_action(self):self.has_action_ = 0; self.action_.Clear() |
|
4422 |
|
4423 def has_action(self): return self.has_action_ |
|
4424 |
|
4425 |
|
4426 def MergeFrom(self, x): |
|
4427 assert x is not self |
|
4428 if (x.has_transaction()): self.mutable_transaction().MergeFrom(x.transaction()) |
|
4429 if (x.has_action()): self.mutable_action().MergeFrom(x.action()) |
|
4430 |
|
4431 def Equals(self, x): |
|
4432 if x is self: return 1 |
|
4433 if self.has_transaction_ != x.has_transaction_: return 0 |
|
4434 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0 |
|
4435 if self.has_action_ != x.has_action_: return 0 |
|
4436 if self.has_action_ and self.action_ != x.action_: return 0 |
|
4437 return 1 |
|
4438 |
|
4439 def IsInitialized(self, debug_strs=None): |
|
4440 initialized = 1 |
|
4441 if (not self.has_transaction_): |
|
4442 initialized = 0 |
|
4443 if debug_strs is not None: |
|
4444 debug_strs.append('Required field: transaction not set.') |
|
4445 elif not self.transaction_.IsInitialized(debug_strs): initialized = 0 |
|
4446 if (not self.has_action_): |
|
4447 initialized = 0 |
|
4448 if debug_strs is not None: |
|
4449 debug_strs.append('Required field: action not set.') |
|
4450 elif not self.action_.IsInitialized(debug_strs): initialized = 0 |
|
4451 return initialized |
|
4452 |
|
4453 def ByteSize(self): |
|
4454 n = 0 |
|
4455 n += self.lengthString(self.transaction_.ByteSize()) |
|
4456 n += self.lengthString(self.action_.ByteSize()) |
|
4457 return n + 2 |
|
4458 |
|
4459 def Clear(self): |
|
4460 self.clear_transaction() |
|
4461 self.clear_action() |
|
4462 |
|
4463 def OutputUnchecked(self, out): |
|
4464 out.putVarInt32(10) |
|
4465 out.putVarInt32(self.transaction_.ByteSize()) |
|
4466 self.transaction_.OutputUnchecked(out) |
|
4467 out.putVarInt32(18) |
|
4468 out.putVarInt32(self.action_.ByteSize()) |
|
4469 self.action_.OutputUnchecked(out) |
|
4470 |
|
4471 def TryMerge(self, d): |
|
4472 while d.avail() > 0: |
|
4473 tt = d.getVarInt32() |
|
4474 if tt == 10: |
|
4475 length = d.getVarInt32() |
|
4476 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
4477 d.skip(length) |
|
4478 self.mutable_transaction().TryMerge(tmp) |
|
4479 continue |
|
4480 if tt == 18: |
|
4481 length = d.getVarInt32() |
|
4482 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) |
|
4483 d.skip(length) |
|
4484 self.mutable_action().TryMerge(tmp) |
|
4485 continue |
|
4486 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
4487 d.skipData(tt) |
|
4488 |
|
4489 |
|
4490 def __str__(self, prefix="", printElemNumber=0): |
|
4491 res="" |
|
4492 if self.has_transaction_: |
|
4493 res+=prefix+"transaction <\n" |
|
4494 res+=self.transaction_.__str__(prefix + " ", printElemNumber) |
|
4495 res+=prefix+">\n" |
|
4496 if self.has_action_: |
|
4497 res+=prefix+"action <\n" |
|
4498 res+=self.action_.__str__(prefix + " ", printElemNumber) |
|
4499 res+=prefix+">\n" |
|
4500 return res |
|
4501 |
|
4502 |
|
4503 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4504 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4505 |
|
4506 ktransaction = 1 |
|
4507 kaction = 2 |
|
4508 |
|
4509 _TEXT = _BuildTagLookupTable({ |
|
4510 0: "ErrorCode", |
|
4511 1: "transaction", |
|
4512 2: "action", |
|
4513 }, 2) |
|
4514 |
|
4515 _TYPES = _BuildTagLookupTable({ |
|
4516 0: ProtocolBuffer.Encoder.NUMERIC, |
|
4517 1: ProtocolBuffer.Encoder.STRING, |
|
4518 2: ProtocolBuffer.Encoder.STRING, |
|
4519 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
|
4520 |
|
4521 _STYLE = """""" |
|
4522 _STYLE_CONTENT_TYPE = """""" |
|
4523 class ActionResponse(ProtocolBuffer.ProtocolMessage): |
|
4524 |
|
4525 def __init__(self, contents=None): |
|
4526 pass |
|
4527 if contents is not None: self.MergeFromString(contents) |
|
4528 |
|
4529 |
|
4530 def MergeFrom(self, x): |
|
4531 assert x is not self |
|
4532 |
|
4533 def Equals(self, x): |
|
4534 if x is self: return 1 |
|
4535 return 1 |
|
4536 |
|
4537 def IsInitialized(self, debug_strs=None): |
|
4538 initialized = 1 |
|
4539 return initialized |
|
4540 |
|
4541 def ByteSize(self): |
|
4542 n = 0 |
|
4543 return n + 0 |
|
4544 |
|
4545 def Clear(self): |
|
4546 pass |
|
4547 |
|
4548 def OutputUnchecked(self, out): |
|
4549 pass |
|
4550 |
|
4551 def TryMerge(self, d): |
|
4552 while d.avail() > 0: |
|
4553 tt = d.getVarInt32() |
|
4554 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
4555 d.skipData(tt) |
|
4556 |
|
4557 |
|
4558 def __str__(self, prefix="", printElemNumber=0): |
|
4559 res="" |
|
4560 return res |
|
4561 |
|
4562 |
|
4563 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4564 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4565 |
|
4566 |
|
4567 _TEXT = _BuildTagLookupTable({ |
|
4568 0: "ErrorCode", |
|
4569 }, 0) |
|
4570 |
|
4571 _TYPES = _BuildTagLookupTable({ |
|
4572 0: ProtocolBuffer.Encoder.NUMERIC, |
|
4573 }, 0, ProtocolBuffer.Encoder.MAX_TYPE) |
|
2880 |
4574 |
2881 _STYLE = """""" |
4575 _STYLE = """""" |
2882 _STYLE_CONTENT_TYPE = """""" |
4576 _STYLE_CONTENT_TYPE = """""" |
2883 class CommitResponse(ProtocolBuffer.ProtocolMessage): |
4577 class CommitResponse(ProtocolBuffer.ProtocolMessage): |
2884 has_cost_ = 0 |
4578 has_cost_ = 0 |
2955 res+=prefix+"cost <\n" |
4649 res+=prefix+"cost <\n" |
2956 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
4650 res+=self.cost_.__str__(prefix + " ", printElemNumber) |
2957 res+=prefix+">\n" |
4651 res+=prefix+">\n" |
2958 return res |
4652 return res |
2959 |
4653 |
4654 |
|
4655 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
4656 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
4657 |
|
2960 kcost = 1 |
4658 kcost = 1 |
2961 |
4659 |
2962 _TEXT = ( |
4660 _TEXT = _BuildTagLookupTable({ |
2963 "ErrorCode", |
4661 0: "ErrorCode", |
2964 "cost", |
4662 1: "cost", |
2965 ) |
4663 }, 1) |
2966 |
4664 |
2967 _TYPES = ( |
4665 _TYPES = _BuildTagLookupTable({ |
2968 ProtocolBuffer.Encoder.NUMERIC, |
4666 0: ProtocolBuffer.Encoder.NUMERIC, |
2969 ProtocolBuffer.Encoder.STRING, |
4667 1: ProtocolBuffer.Encoder.STRING, |
2970 |
4668 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
2971 ) |
|
2972 |
4669 |
2973 _STYLE = """""" |
4670 _STYLE = """""" |
2974 _STYLE_CONTENT_TYPE = """""" |
4671 _STYLE_CONTENT_TYPE = """""" |
2975 |
4672 |
2976 __all__ = ['Transaction','Query','Query_Filter','Query_Order','QueryExplanation','Cursor','Error','Cost','GetRequest','GetResponse','GetResponse_Entity','PutRequest','PutResponse','DeleteRequest','DeleteResponse','NextRequest','QueryResult','Schema','CompositeIndices','CommitResponse'] |
4673 __all__ = ['Transaction','Query','Query_Filter','Query_Order','CompiledQuery','CompiledQuery_PrimaryScan','CompiledQuery_MergeJoinScan','CompiledQuery_EntityFilter','RunCompiledQueryRequest','QueryExplanation','Cursor','Error','Cost','GetRequest','GetResponse','GetResponse_Entity','PutRequest','PutResponse','DeleteRequest','DeleteResponse','NextRequest','QueryResult','GetSchemaRequest','Schema','AllocateIdsRequest','AllocateIdsResponse','CompositeIndices','ActionRequest','ActionResponse','CommitResponse'] |