Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bug 751654 - pin versions and manage thirdparty with requirements.txt…

… only
  • Loading branch information...
commit a2933c481f413df8860a138a854d8b8dff22f5a9 1 parent 9f3d35b
Robert Helmer authored May 04, 2012

Showing 46 changed files with 35 additions and 19,664 deletions. Show diff stats Hide diff stats

  1. 6  .gitmodules
  2. 31  Makefile
  3. 1  configman
  4. 0  contrib/__init__.py b/thirdparty/web/contrib/__init__.py
  5. 13  puppet/manifests/classes/socorro-base.pp
  6. 12  requirements.txt
  7. 5  requirements/dev.txt
  8. 11  requirements/prod.txt
  9. 1  thirdparty/.gitignore
  10. 10  thirdparty/README.txt
  11. 0  thirdparty/hbase/__init__.py
  12. 7,555  thirdparty/hbase/hbase.py
  13. 780  thirdparty/hbase/ttypes.py
  14. 33  thirdparty/thrift/TSCons.py
  15. 123  thirdparty/thrift/Thrift.py
  16. 20  thirdparty/thrift/__init__.py
  17. 259  thirdparty/thrift/protocol/TBinaryProtocol.py
  18. 205  thirdparty/thrift/protocol/TProtocol.py
  19. 20  thirdparty/thrift/protocol/__init__.py
  20. 63  thirdparty/thrift/server/THttpServer.py
  21. 310  thirdparty/thrift/server/TNonblockingServer.py
  22. 270  thirdparty/thrift/server/TServer.py
  23. 20  thirdparty/thrift/server/__init__.py
  24. 100  thirdparty/thrift/transport/THttpClient.py
  25. 149  thirdparty/thrift/transport/TSocket.py
  26. 326  thirdparty/thrift/transport/TTransport.py
  27. 181  thirdparty/thrift/transport/TTwisted.py
  28. 20  thirdparty/thrift/transport/__init__.py
  29. 34  thirdparty/web/__init__.py
  30. 670  thirdparty/web/application.py
  31. 236  thirdparty/web/browser.py
  32. 131  thirdparty/web/contrib/template.py
  33. 1,172  thirdparty/web/db.py
  34. 354  thirdparty/web/debugerror.py
  35. 369  thirdparty/web/form.py
  36. 150  thirdparty/web/http.py
  37. 250  thirdparty/web/httpserver.py
  38. 190  thirdparty/web/net.py
  39. 319  thirdparty/web/session.py
  40. 1,471  thirdparty/web/template.py
  41. 51  thirdparty/web/test.py
  42. 1,421  thirdparty/web/utils.py
  43. 382  thirdparty/web/webapi.py
  44. 115  thirdparty/web/webopenid.py
  45. 66  thirdparty/web/wsgi.py
  46. 1,794  thirdparty/web/wsgiserver/__init__.py
6  .gitmodules
... ...
@@ -1,6 +0,0 @@
1  
-[submodule "configman"]
2  
-	path = configman
3  
-	url = git://github.com/mozilla/configman.git
4  
-[submodule "SocorroSearchService"]
5  
-	path = SocorroSearchService
6  
-	url = git://github.com/mozilla/SocorroSearchService.git
31  Makefile
... ...
@@ -1,7 +1,7 @@
1 1
 PREFIX=/data/socorro
2 2
 ABS_PREFIX = $(shell readlink -f $(PREFIX))
3 3
 VIRTUALENV=$(CURDIR)/socorro-virtualenv
4  
-PYTHONPATH = ".:thirdparty"
  4
+PYTHONPATH = "."
5 5
 NOSE = $(VIRTUALENV)/bin/nosetests socorro -s --with-xunit
6 6
 SETUPDB = $(VIRTUALENV)/bin/python ./socorro/external/postgresql/setupdb_app.py
7 7
 COVEROPTS = --with-coverage --cover-package=socorro
@@ -9,7 +9,7 @@ COVERAGE = $(VIRTUALENV)/bin/coverage
9 9
 PYLINT = $(VIRTUALENV)/bin/pylint
10 10
 CITEXT="/usr/share/postgresql/9.0/contrib/citext.sql"
11 11
 
12  
-.PHONY: all test phpunit install reinstall install-socorro install-web virtualenv coverage lint clean minidump_stackwalk java_analysis
  12
+.PHONY: all test phpunit install reinstall install-socorro install-web virtualenv coverage lint clean minidump_stackwalk java_analysis thirdparty
13 13
 
14 14
 
15 15
 all:	test
@@ -25,10 +25,14 @@ test: setup-test phpunit
25 25
 phpunit:
26 26
 	phpunit webapp-php/tests/
27 27
 
28  
-install: java_analysis reinstall
  28
+thirdparty:
  29
+	# install production dependencies
  30
+	$(VIRTUALENV)/bin/pip install --use-mirrors --download-cache=pip-cache/ --ignore-installed --install-option="--prefix=`pwd`/thirdparty" --install-option="--install-lib=`pwd`/thirdparty" -r requirements/prod.txt
29 31
 
30  
-# this a dev-only option, `java_analysis` needs to be run at least once in the checkout (or after `make clean`)
31  
-reinstall: install-socorro install-web install-submodules virtualenv
  32
+install: java_analysis thirdparty reinstall
  33
+
  34
+# this a dev-only option, `make install` needs to be run at least once in the checkout (or after `make clean`)
  35
+reinstall: install-socorro install-web
32 36
 	# record current git revision in install dir
33 37
 	git rev-parse HEAD > $(PREFIX)/revision.txt
34 38
 	REV=`cat $(PREFIX)/revision.txt` && sed -ibak "s/CURRENT_SOCORRO_REVISION/$$REV/" $(PREFIX)/htdocs/application/config/revision.php
@@ -38,9 +42,9 @@ install-socorro:
38 42
 	# create base directories
39 43
 	mkdir -p $(PREFIX)/htdocs
40 44
 	mkdir -p $(PREFIX)/application
  45
+	# copy to install directory
41 46
 	rsync -a thirdparty $(PREFIX)
42  
-	rsync -a socorro-virtualenv/lib/python2.6/site-packages/ $(PREFIX)/thirdparty/
43  
-	rsync -a socorro $(PREFIX)/application
  47
+	rsync -a socorro $(PREFIX)/application 
44 48
 	rsync -a scripts $(PREFIX)/application
45 49
 	rsync -a tools $(PREFIX)/application
46 50
 	rsync -a sql $(PREFIX)/application
@@ -48,6 +52,7 @@ install-socorro:
48 52
 	rsync -a scripts/stackwalk.sh $(PREFIX)/stackwalk/bin/
49 53
 	rsync -a analysis/build/lib/socorro-analysis-job.jar $(PREFIX)/analysis/
50 54
 	rsync -a analysis/bin/modulelist.sh $(PREFIX)/analysis/
  55
+	# copy default config files
51 56
 	cd $(PREFIX)/application/scripts/config; for file in *.py.dist; do cp $$file `basename $$file .dist`; done
52 57
 
53 58
 install-web:
@@ -57,15 +62,9 @@ install-web:
57 62
 	cd $(PREFIX)/htdocs/application/config; for file in *.php-dist; do cp $$file `basename $$file -dist`; done
58 63
 	cd $(PREFIX)/htdocs; cp htaccess-dist .htaccess
59 64
 
60  
-install-submodules:
61  
-	# clone submodule dependencies
62  
-	git submodule update --init --recursive
63  
-	cd configman; python setup.py install --install-lib=$(ABS_PREFIX)/application
64  
-
65 65
 virtualenv:
66 66
 	virtualenv $(VIRTUALENV)
67  
-	$(VIRTUALENV)/bin/pip install -r requirements.txt
68  
-	cd configman; $(VIRTUALENV)/bin/python setup.py install
  67
+	$(VIRTUALENV)/bin/pip install --use-mirrors --download-cache=./pip-cache -r requirements/dev.txt
69 68
 
70 69
 coverage: setup-test phpunit
71 70
 	rm -f coverage.xml
@@ -77,8 +76,8 @@ lint:
77 76
 
78 77
 clean:
79 78
 	find ./socorro/ -type f -name "*.pyc" -exec rm {} \;
80  
-	find ./thirdparty/ -type f -name "*.pyc" -exec rm {} \;
81  
-	rm -rf ./google-breakpad/ ./builds/ ./breakpad/ ./stackwalk
  79
+	rm -rf ./thirdparty/*
  80
+	rm -rf ./google-breakpad/ ./builds/ ./breakpad/ ./stackwalk ./pip-cache
82 81
 	rm -rf ./breakpad.tar.gz
83 82
 	cd analysis && ant clean
84 83
 
1  configman
... ...
@@ -1 +0,0 @@
1  
-Subproject commit 3d74ae9084b53f021d723a8becaa119234a804bc
0  contrib/__init__.py b/thirdparty/web/contrib/__init__.py
No changes.
13  puppet/manifests/classes/socorro-base.pp
@@ -90,12 +90,6 @@
90 90
     }
91 91
 
92 92
     exec {
93  
-        '/usr/bin/pip install isodate':
94  
-            require => Package['python-pip'],
95  
-            creates => '/usr/local/lib/python2.6/dist-packages/isodate';
96  
-    }
97  
-
98  
-    exec {
99 93
         '/usr/bin/apt-get update && touch /tmp/apt-get-update':
100 94
             alias => 'apt-get-update',
101 95
             creates => '/tmp/apt-get-update';
@@ -103,8 +97,8 @@
103 97
 
104 98
     package {
105 99
         ['rsyslog', 'libcurl4-openssl-dev', 'libxslt1-dev', 'build-essential',
106  
-         'supervisor', 'ant', 'python-software-properties', 'python-pip',
107  
-         'curl', 'git-core', 'openjdk-6-jdk']:
  100
+         'supervisor', 'ant', 'python-software-properties', 'curl', 'git-core',
  101
+         'openjdk-6-jdk']:
108 102
             ensure => latest,
109 103
             require => Exec['apt-get-update'];
110 104
     }
@@ -168,8 +162,7 @@
168 162
 #                default => "puppet://$server/modules/socorro/prod/etc-logrotated/socorro",
169 163
 #                };
170 164
     package {
171  
-        ['python-psycopg2', 'python-simplejson', 'subversion', 'libpq-dev',
172  
-         'python-virtualenv', 'python-dev']:
  165
+        ['subversion', 'libpq-dev', 'python-virtualenv', 'python-dev']:
173 166
             ensure => latest,
174 167
             require => Exec['apt-get-update'];
175 168
     }
12  requirements.txt
... ...
@@ -1,12 +0,0 @@
1  
-nose
2  
-psycopg2
3  
-simplejson
4  
-coverage
5  
-web.py
6  
-pylint
7  
-poster
8  
-mock
9  
-lxml
10  
-isodate
11  
-configobj
12  
-statsd
5  requirements/dev.txt
... ...
@@ -0,0 +1,5 @@
  1
+-r prod.txt
  2
+coverage==3.5.2b1
  3
+nose==1.1.2
  4
+mock==0.8.0
  5
+poster==0.8.1
11  requirements/prod.txt
... ...
@@ -0,0 +1,11 @@
  1
+# configman moves too fast for pypi right now
  2
+git+git://github.com/mozilla/configman@3d74ae9#egg=configman
  3
+configobj==4.7.2
  4
+hbase-thrift==0.20.4
  5
+isodate==0.4.7
  6
+lxml==2.3.4
  7
+psycopg2==2.0.13
  8
+simplejson==2.5.0
  9
+statsd==0.5.0
  10
+thrift==0.8.0
  11
+web.py==0.36
1  thirdparty/.gitignore
... ...
@@ -0,0 +1 @@
  1
+*
10  thirdparty/README.txt
... ...
@@ -1,10 +0,0 @@
1  
-This thirdparty directory should only be used for libraries which we
2  
-cannot deploy and manage automatically. Another valid reason is machine
3  
-generated code.
4  
-
5  
-When a library is not longer released in a craptastic manner, we
6  
-should remove it from here and make it a deployment dependency.
7  
-
8  
-I'm looking at you Apache Incubation Thrift version 0.1
9  
-
10  
-*** DO NOT EDIT ANY SOURCE CODE UNDER  ***
0  thirdparty/hbase/__init__.py
No changes.
7,555  thirdparty/hbase/hbase.py
0 additions, 7555 deletions not shown
780  thirdparty/hbase/ttypes.py
... ...
@@ -1,780 +0,0 @@
1  
-#
2  
-# Autogenerated by Thrift
3  
-#
4  
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  
-#
6  
-
7  
-from thrift.Thrift import *
8  
-
9  
-from thrift.transport import TTransport
10  
-from thrift.protocol import TBinaryProtocol
11  
-try:
12  
-  from thrift.protocol import fastbinary
13  
-except:
14  
-  fastbinary = None
15  
-
16  
-
17  
-class TCell:
18  
-  """
19  
-  TCell - Used to transport a cell value (byte[]) and the timestamp it was
20  
-  stored with together as a result for get and getRow methods. This promotes
21  
-  the timestamp of a cell to a first-class value, making it easy to take
22  
-  note of temporal data. Cell is used all the way from HStore up to HTable.
23  
-
24  
-  Attributes:
25  
-   - value
26  
-   - timestamp
27  
-  """
28  
-
29  
-  thrift_spec = (
30  
-    None, # 0
31  
-    (1, TType.STRING, 'value', None, None, ), # 1
32  
-    (2, TType.I64, 'timestamp', None, None, ), # 2
33  
-  )
34  
-
35  
-  def __init__(self, value=None, timestamp=None,):
36  
-    self.value = value
37  
-    self.timestamp = timestamp
38  
-
39  
-  def read(self, iprot):
40  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
41  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
42  
-      return
43  
-    iprot.readStructBegin()
44  
-    while True:
45  
-      (fname, ftype, fid) = iprot.readFieldBegin()
46  
-      if ftype == TType.STOP:
47  
-        break
48  
-      if fid == 1:
49  
-        if ftype == TType.STRING:
50  
-          self.value = iprot.readString();
51  
-        else:
52  
-          iprot.skip(ftype)
53  
-      elif fid == 2:
54  
-        if ftype == TType.I64:
55  
-          self.timestamp = iprot.readI64();
56  
-        else:
57  
-          iprot.skip(ftype)
58  
-      else:
59  
-        iprot.skip(ftype)
60  
-      iprot.readFieldEnd()
61  
-    iprot.readStructEnd()
62  
-
63  
-  def write(self, oprot):
64  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
65  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
66  
-      return
67  
-    oprot.writeStructBegin('TCell')
68  
-    if self.value != None:
69  
-      oprot.writeFieldBegin('value', TType.STRING, 1)
70  
-      oprot.writeString(self.value)
71  
-      oprot.writeFieldEnd()
72  
-    if self.timestamp != None:
73  
-      oprot.writeFieldBegin('timestamp', TType.I64, 2)
74  
-      oprot.writeI64(self.timestamp)
75  
-      oprot.writeFieldEnd()
76  
-    oprot.writeFieldStop()
77  
-    oprot.writeStructEnd()
78  
-
79  
-  def __repr__(self):
80  
-    L = ['%s=%r' % (key, value)
81  
-      for key, value in self.__dict__.iteritems()]
82  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
83  
-
84  
-  def __eq__(self, other):
85  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
86  
-
87  
-  def __ne__(self, other):
88  
-    return not (self == other)
89  
-
90  
-class ColumnDescriptor:
91  
-  """
92  
-  An HColumnDescriptor contains information about a column family
93  
-  such as the number of versions, compression settings, etc. It is
94  
-  used as input when creating a table or adding a column.
95  
-
96  
-  Attributes:
97  
-   - name
98  
-   - maxVersions
99  
-   - compression
100  
-   - inMemory
101  
-   - bloomFilterType
102  
-   - bloomFilterVectorSize
103  
-   - bloomFilterNbHashes
104  
-   - blockCacheEnabled
105  
-   - timeToLive
106  
-  """
107  
-
108  
-  thrift_spec = (
109  
-    None, # 0
110  
-    (1, TType.STRING, 'name', None, None, ), # 1
111  
-    (2, TType.I32, 'maxVersions', None, 3, ), # 2
112  
-    (3, TType.STRING, 'compression', None, "NONE", ), # 3
113  
-    (4, TType.BOOL, 'inMemory', None, False, ), # 4
114  
-    (5, TType.STRING, 'bloomFilterType', None, "NONE", ), # 5
115  
-    (6, TType.I32, 'bloomFilterVectorSize', None, 0, ), # 6
116  
-    (7, TType.I32, 'bloomFilterNbHashes', None, 0, ), # 7
117  
-    (8, TType.BOOL, 'blockCacheEnabled', None, False, ), # 8
118  
-    (9, TType.I32, 'timeToLive', None, -1, ), # 9
119  
-  )
120  
-
121  
-  def __init__(self, name=None, maxVersions=thrift_spec[2][4], compression=thrift_spec[3][4], inMemory=thrift_spec[4][4], bloomFilterType=thrift_spec[5][4], bloomFilterVectorSize=thrift_spec[6][4], bloomFilterNbHashes=thrift_spec[7][4], blockCacheEnabled=thrift_spec[8][4], timeToLive=thrift_spec[9][4],):
122  
-    self.name = name
123  
-    self.maxVersions = maxVersions
124  
-    self.compression = compression
125  
-    self.inMemory = inMemory
126  
-    self.bloomFilterType = bloomFilterType
127  
-    self.bloomFilterVectorSize = bloomFilterVectorSize
128  
-    self.bloomFilterNbHashes = bloomFilterNbHashes
129  
-    self.blockCacheEnabled = blockCacheEnabled
130  
-    self.timeToLive = timeToLive
131  
-
132  
-  def read(self, iprot):
133  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
134  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
135  
-      return
136  
-    iprot.readStructBegin()
137  
-    while True:
138  
-      (fname, ftype, fid) = iprot.readFieldBegin()
139  
-      if ftype == TType.STOP:
140  
-        break
141  
-      if fid == 1:
142  
-        if ftype == TType.STRING:
143  
-          self.name = iprot.readString();
144  
-        else:
145  
-          iprot.skip(ftype)
146  
-      elif fid == 2:
147  
-        if ftype == TType.I32:
148  
-          self.maxVersions = iprot.readI32();
149  
-        else:
150  
-          iprot.skip(ftype)
151  
-      elif fid == 3:
152  
-        if ftype == TType.STRING:
153  
-          self.compression = iprot.readString();
154  
-        else:
155  
-          iprot.skip(ftype)
156  
-      elif fid == 4:
157  
-        if ftype == TType.BOOL:
158  
-          self.inMemory = iprot.readBool();
159  
-        else:
160  
-          iprot.skip(ftype)
161  
-      elif fid == 5:
162  
-        if ftype == TType.STRING:
163  
-          self.bloomFilterType = iprot.readString();
164  
-        else:
165  
-          iprot.skip(ftype)
166  
-      elif fid == 6:
167  
-        if ftype == TType.I32:
168  
-          self.bloomFilterVectorSize = iprot.readI32();
169  
-        else:
170  
-          iprot.skip(ftype)
171  
-      elif fid == 7:
172  
-        if ftype == TType.I32:
173  
-          self.bloomFilterNbHashes = iprot.readI32();
174  
-        else:
175  
-          iprot.skip(ftype)
176  
-      elif fid == 8:
177  
-        if ftype == TType.BOOL:
178  
-          self.blockCacheEnabled = iprot.readBool();
179  
-        else:
180  
-          iprot.skip(ftype)
181  
-      elif fid == 9:
182  
-        if ftype == TType.I32:
183  
-          self.timeToLive = iprot.readI32();
184  
-        else:
185  
-          iprot.skip(ftype)
186  
-      else:
187  
-        iprot.skip(ftype)
188  
-      iprot.readFieldEnd()
189  
-    iprot.readStructEnd()
190  
-
191  
-  def write(self, oprot):
192  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
193  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
194  
-      return
195  
-    oprot.writeStructBegin('ColumnDescriptor')
196  
-    if self.name != None:
197  
-      oprot.writeFieldBegin('name', TType.STRING, 1)
198  
-      oprot.writeString(self.name)
199  
-      oprot.writeFieldEnd()
200  
-    if self.maxVersions != None:
201  
-      oprot.writeFieldBegin('maxVersions', TType.I32, 2)
202  
-      oprot.writeI32(self.maxVersions)
203  
-      oprot.writeFieldEnd()
204  
-    if self.compression != None:
205  
-      oprot.writeFieldBegin('compression', TType.STRING, 3)
206  
-      oprot.writeString(self.compression)
207  
-      oprot.writeFieldEnd()
208  
-    if self.inMemory != None:
209  
-      oprot.writeFieldBegin('inMemory', TType.BOOL, 4)
210  
-      oprot.writeBool(self.inMemory)
211  
-      oprot.writeFieldEnd()
212  
-    if self.bloomFilterType != None:
213  
-      oprot.writeFieldBegin('bloomFilterType', TType.STRING, 5)
214  
-      oprot.writeString(self.bloomFilterType)
215  
-      oprot.writeFieldEnd()
216  
-    if self.bloomFilterVectorSize != None:
217  
-      oprot.writeFieldBegin('bloomFilterVectorSize', TType.I32, 6)
218  
-      oprot.writeI32(self.bloomFilterVectorSize)
219  
-      oprot.writeFieldEnd()
220  
-    if self.bloomFilterNbHashes != None:
221  
-      oprot.writeFieldBegin('bloomFilterNbHashes', TType.I32, 7)
222  
-      oprot.writeI32(self.bloomFilterNbHashes)
223  
-      oprot.writeFieldEnd()
224  
-    if self.blockCacheEnabled != None:
225  
-      oprot.writeFieldBegin('blockCacheEnabled', TType.BOOL, 8)
226  
-      oprot.writeBool(self.blockCacheEnabled)
227  
-      oprot.writeFieldEnd()
228  
-    if self.timeToLive != None:
229  
-      oprot.writeFieldBegin('timeToLive', TType.I32, 9)
230  
-      oprot.writeI32(self.timeToLive)
231  
-      oprot.writeFieldEnd()
232  
-    oprot.writeFieldStop()
233  
-    oprot.writeStructEnd()
234  
-
235  
-  def __repr__(self):
236  
-    L = ['%s=%r' % (key, value)
237  
-      for key, value in self.__dict__.iteritems()]
238  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
239  
-
240  
-  def __eq__(self, other):
241  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
242  
-
243  
-  def __ne__(self, other):
244  
-    return not (self == other)
245  
-
246  
-class TRegionInfo:
247  
-  """
248  
-  A TRegionInfo contains information about an HTable region.
249  
-
250  
-  Attributes:
251  
-   - startKey
252  
-   - endKey
253  
-   - id
254  
-   - name
255  
-   - version
256  
-  """
257  
-
258  
-  thrift_spec = (
259  
-    None, # 0
260  
-    (1, TType.STRING, 'startKey', None, None, ), # 1
261  
-    (2, TType.STRING, 'endKey', None, None, ), # 2
262  
-    (3, TType.I64, 'id', None, None, ), # 3
263  
-    (4, TType.STRING, 'name', None, None, ), # 4
264  
-    (5, TType.BYTE, 'version', None, None, ), # 5
265  
-  )
266  
-
267  
-  def __init__(self, startKey=None, endKey=None, id=None, name=None, version=None,):
268  
-    self.startKey = startKey
269  
-    self.endKey = endKey
270  
-    self.id = id
271  
-    self.name = name
272  
-    self.version = version
273  
-
274  
-  def read(self, iprot):
275  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
276  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
277  
-      return
278  
-    iprot.readStructBegin()
279  
-    while True:
280  
-      (fname, ftype, fid) = iprot.readFieldBegin()
281  
-      if ftype == TType.STOP:
282  
-        break
283  
-      if fid == 1:
284  
-        if ftype == TType.STRING:
285  
-          self.startKey = iprot.readString();
286  
-        else:
287  
-          iprot.skip(ftype)
288  
-      elif fid == 2:
289  
-        if ftype == TType.STRING:
290  
-          self.endKey = iprot.readString();
291  
-        else:
292  
-          iprot.skip(ftype)
293  
-      elif fid == 3:
294  
-        if ftype == TType.I64:
295  
-          self.id = iprot.readI64();
296  
-        else:
297  
-          iprot.skip(ftype)
298  
-      elif fid == 4:
299  
-        if ftype == TType.STRING:
300  
-          self.name = iprot.readString();
301  
-        else:
302  
-          iprot.skip(ftype)
303  
-      elif fid == 5:
304  
-        if ftype == TType.BYTE:
305  
-          self.version = iprot.readByte();
306  
-        else:
307  
-          iprot.skip(ftype)
308  
-      else:
309  
-        iprot.skip(ftype)
310  
-      iprot.readFieldEnd()
311  
-    iprot.readStructEnd()
312  
-
313  
-  def write(self, oprot):
314  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
315  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
316  
-      return
317  
-    oprot.writeStructBegin('TRegionInfo')
318  
-    if self.startKey != None:
319  
-      oprot.writeFieldBegin('startKey', TType.STRING, 1)
320  
-      oprot.writeString(self.startKey)
321  
-      oprot.writeFieldEnd()
322  
-    if self.endKey != None:
323  
-      oprot.writeFieldBegin('endKey', TType.STRING, 2)
324  
-      oprot.writeString(self.endKey)
325  
-      oprot.writeFieldEnd()
326  
-    if self.id != None:
327  
-      oprot.writeFieldBegin('id', TType.I64, 3)
328  
-      oprot.writeI64(self.id)
329  
-      oprot.writeFieldEnd()
330  
-    if self.name != None:
331  
-      oprot.writeFieldBegin('name', TType.STRING, 4)
332  
-      oprot.writeString(self.name)
333  
-      oprot.writeFieldEnd()
334  
-    if self.version != None:
335  
-      oprot.writeFieldBegin('version', TType.BYTE, 5)
336  
-      oprot.writeByte(self.version)
337  
-      oprot.writeFieldEnd()
338  
-    oprot.writeFieldStop()
339  
-    oprot.writeStructEnd()
340  
-
341  
-  def __repr__(self):
342  
-    L = ['%s=%r' % (key, value)
343  
-      for key, value in self.__dict__.iteritems()]
344  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
345  
-
346  
-  def __eq__(self, other):
347  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
348  
-
349  
-  def __ne__(self, other):
350  
-    return not (self == other)
351  
-
352  
-class Mutation:
353  
-  """
354  
-  A Mutation object is used to either update or delete a column-value.
355  
-
356  
-  Attributes:
357  
-   - isDelete
358  
-   - column
359  
-   - value
360  
-  """
361  
-
362  
-  thrift_spec = (
363  
-    None, # 0
364  
-    (1, TType.BOOL, 'isDelete', None, False, ), # 1
365  
-    (2, TType.STRING, 'column', None, None, ), # 2
366  
-    (3, TType.STRING, 'value', None, None, ), # 3
367  
-  )
368  
-
369  
-  def __init__(self, isDelete=thrift_spec[1][4], column=None, value=None,):
370  
-    self.isDelete = isDelete
371  
-    self.column = column
372  
-    self.value = value
373  
-
374  
-  def read(self, iprot):
375  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
376  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
377  
-      return
378  
-    iprot.readStructBegin()
379  
-    while True:
380  
-      (fname, ftype, fid) = iprot.readFieldBegin()
381  
-      if ftype == TType.STOP:
382  
-        break
383  
-      if fid == 1:
384  
-        if ftype == TType.BOOL:
385  
-          self.isDelete = iprot.readBool();
386  
-        else:
387  
-          iprot.skip(ftype)
388  
-      elif fid == 2:
389  
-        if ftype == TType.STRING:
390  
-          self.column = iprot.readString();
391  
-        else:
392  
-          iprot.skip(ftype)
393  
-      elif fid == 3:
394  
-        if ftype == TType.STRING:
395  
-          self.value = iprot.readString();
396  
-        else:
397  
-          iprot.skip(ftype)
398  
-      else:
399  
-        iprot.skip(ftype)
400  
-      iprot.readFieldEnd()
401  
-    iprot.readStructEnd()
402  
-
403  
-  def write(self, oprot):
404  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
405  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
406  
-      return
407  
-    oprot.writeStructBegin('Mutation')
408  
-    if self.isDelete != None:
409  
-      oprot.writeFieldBegin('isDelete', TType.BOOL, 1)
410  
-      oprot.writeBool(self.isDelete)
411  
-      oprot.writeFieldEnd()
412  
-    if self.column != None:
413  
-      oprot.writeFieldBegin('column', TType.STRING, 2)
414  
-      oprot.writeString(self.column)
415  
-      oprot.writeFieldEnd()
416  
-    if self.value != None:
417  
-      oprot.writeFieldBegin('value', TType.STRING, 3)
418  
-      oprot.writeString(self.value)
419  
-      oprot.writeFieldEnd()
420  
-    oprot.writeFieldStop()
421  
-    oprot.writeStructEnd()
422  
-
423  
-  def __repr__(self):
424  
-    L = ['%s=%r' % (key, value)
425  
-      for key, value in self.__dict__.iteritems()]
426  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
427  
-
428  
-  def __eq__(self, other):
429  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
430  
-
431  
-  def __ne__(self, other):
432  
-    return not (self == other)
433  
-
434  
-class BatchMutation:
435  
-  """
436  
-  A BatchMutation object is used to apply a number of Mutations to a single row.
437  
-
438  
-  Attributes:
439  
-   - row
440  
-   - mutations
441  
-  """
442  
-
443  
-  thrift_spec = (
444  
-    None, # 0
445  
-    (1, TType.STRING, 'row', None, None, ), # 1
446  
-    (2, TType.LIST, 'mutations', (TType.STRUCT,(Mutation, Mutation.thrift_spec)), None, ), # 2
447  
-  )
448  
-
449  
-  def __init__(self, row=None, mutations=None,):
450  
-    self.row = row
451  
-    self.mutations = mutations
452  
-
453  
-  def read(self, iprot):
454  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
455  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
456  
-      return
457  
-    iprot.readStructBegin()
458  
-    while True:
459  
-      (fname, ftype, fid) = iprot.readFieldBegin()
460  
-      if ftype == TType.STOP:
461  
-        break
462  
-      if fid == 1:
463  
-        if ftype == TType.STRING:
464  
-          self.row = iprot.readString();
465  
-        else:
466  
-          iprot.skip(ftype)
467  
-      elif fid == 2:
468  
-        if ftype == TType.LIST:
469  
-          self.mutations = []
470  
-          (_etype3, _size0) = iprot.readListBegin()
471  
-          for _i4 in xrange(_size0):
472  
-            _elem5 = Mutation()
473  
-            _elem5.read(iprot)
474  
-            self.mutations.append(_elem5)
475  
-          iprot.readListEnd()
476  
-        else:
477  
-          iprot.skip(ftype)
478  
-      else:
479  
-        iprot.skip(ftype)
480  
-      iprot.readFieldEnd()
481  
-    iprot.readStructEnd()
482  
-
483  
-  def write(self, oprot):
484  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
485  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
486  
-      return
487  
-    oprot.writeStructBegin('BatchMutation')
488  
-    if self.row != None:
489  
-      oprot.writeFieldBegin('row', TType.STRING, 1)
490  
-      oprot.writeString(self.row)
491  
-      oprot.writeFieldEnd()
492  
-    if self.mutations != None:
493  
-      oprot.writeFieldBegin('mutations', TType.LIST, 2)
494  
-      oprot.writeListBegin(TType.STRUCT, len(self.mutations))
495  
-      for iter6 in self.mutations:
496  
-        iter6.write(oprot)
497  
-      oprot.writeListEnd()
498  
-      oprot.writeFieldEnd()
499  
-    oprot.writeFieldStop()
500  
-    oprot.writeStructEnd()
501  
-
502  
-  def __repr__(self):
503  
-    L = ['%s=%r' % (key, value)
504  
-      for key, value in self.__dict__.iteritems()]
505  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
506  
-
507  
-  def __eq__(self, other):
508  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
509  
-
510  
-  def __ne__(self, other):
511  
-    return not (self == other)
512  
-
513  
-class TRowResult:
514  
-  """
515  
-  Holds row name and then a map of columns to cells.
516  
-
517  
-  Attributes:
518  
-   - row
519  
-   - columns
520  
-  """
521  
-
522  
-  thrift_spec = (
523  
-    None, # 0
524  
-    (1, TType.STRING, 'row', None, None, ), # 1
525  
-    (2, TType.MAP, 'columns', (TType.STRING,None,TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 2
526  
-  )
527  
-
528  
-  def __init__(self, row=None, columns=None,):
529  
-    self.row = row
530  
-    self.columns = columns
531  
-
532  
-  def read(self, iprot):
533  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
534  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
535  
-      return
536  
-    iprot.readStructBegin()
537  
-    while True:
538  
-      (fname, ftype, fid) = iprot.readFieldBegin()
539  
-      if ftype == TType.STOP:
540  
-        break
541  
-      if fid == 1:
542  
-        if ftype == TType.STRING:
543  
-          self.row = iprot.readString();
544  
-        else:
545  
-          iprot.skip(ftype)
546  
-      elif fid == 2:
547  
-        if ftype == TType.MAP:
548  
-          self.columns = {}
549  
-          (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin()
550  
-          for _i11 in xrange(_size7):
551  
-            _key12 = iprot.readString();
552  
-            _val13 = TCell()
553  
-            _val13.read(iprot)
554  
-            self.columns[_key12] = _val13
555  
-          iprot.readMapEnd()
556  
-        else:
557  
-          iprot.skip(ftype)
558  
-      else:
559  
-        iprot.skip(ftype)
560  
-      iprot.readFieldEnd()
561  
-    iprot.readStructEnd()
562  
-
563  
-  def write(self, oprot):
564  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
565  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
566  
-      return
567  
-    oprot.writeStructBegin('TRowResult')
568  
-    if self.row != None:
569  
-      oprot.writeFieldBegin('row', TType.STRING, 1)
570  
-      oprot.writeString(self.row)
571  
-      oprot.writeFieldEnd()
572  
-    if self.columns != None:
573  
-      oprot.writeFieldBegin('columns', TType.MAP, 2)
574  
-      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.columns))
575  
-      for kiter14,viter15 in self.columns.items():
576  
-        oprot.writeString(kiter14)
577  
-        viter15.write(oprot)
578  
-      oprot.writeMapEnd()
579  
-      oprot.writeFieldEnd()
580  
-    oprot.writeFieldStop()
581  
-    oprot.writeStructEnd()
582  
-
583  
-  def __repr__(self):
584  
-    L = ['%s=%r' % (key, value)
585  
-      for key, value in self.__dict__.iteritems()]
586  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
587  
-
588  
-  def __eq__(self, other):
589  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
590  
-
591  
-  def __ne__(self, other):
592  
-    return not (self == other)
593  
-
594  
-class IOError(Exception):
595  
-  """
596  
-  An IOError exception signals that an error occurred communicating
597  
-  to the Hbase master or an Hbase region server.  Also used to return
598  
-  more general Hbase error conditions.
599  
-
600  
-  Attributes:
601  
-   - message
602  
-  """
603  
-
604  
-  thrift_spec = (
605  
-    None, # 0
606  
-    (1, TType.STRING, 'message', None, None, ), # 1
607  
-  )
608  
-
609  
-  def __init__(self, message=None,):
610  
-    self.message = message
611  
-
612  
-  def read(self, iprot):
613  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
614  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
615  
-      return
616  
-    iprot.readStructBegin()
617  
-    while True:
618  
-      (fname, ftype, fid) = iprot.readFieldBegin()
619  
-      if ftype == TType.STOP:
620  
-        break
621  
-      if fid == 1:
622  
-        if ftype == TType.STRING:
623  
-          self.message = iprot.readString();
624  
-        else:
625  
-          iprot.skip(ftype)
626  
-      else:
627  
-        iprot.skip(ftype)
628  
-      iprot.readFieldEnd()
629  
-    iprot.readStructEnd()
630  
-
631  
-  def write(self, oprot):
632  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
633  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
634  
-      return
635  
-    oprot.writeStructBegin('IOError')
636  
-    if self.message != None:
637  
-      oprot.writeFieldBegin('message', TType.STRING, 1)
638  
-      oprot.writeString(self.message)
639  
-      oprot.writeFieldEnd()
640  
-    oprot.writeFieldStop()
641  
-    oprot.writeStructEnd()
642  
-
643  
-  def __str__(self):
644  
-    return repr(self)
645  
-
646  
-  def __repr__(self):
647  
-    L = ['%s=%r' % (key, value)
648  
-      for key, value in self.__dict__.iteritems()]
649  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
650  
-
651  
-  def __eq__(self, other):
652  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
653  
-
654  
-  def __ne__(self, other):
655  
-    return not (self == other)
656  
-
657  
-class IllegalArgument(Exception):
658  
-  """
659  
-  An IllegalArgument exception indicates an illegal or invalid
660  
-  argument was passed into a procedure.
661  
-
662  
-  Attributes:
663  
-   - message
664  
-  """
665  
-
666  
-  thrift_spec = (
667  
-    None, # 0
668  
-    (1, TType.STRING, 'message', None, None, ), # 1
669  
-  )
670  
-
671  
-  def __init__(self, message=None,):
672  
-    self.message = message
673  
-
674  
-  def read(self, iprot):
675  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
676  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
677  
-      return
678  
-    iprot.readStructBegin()
679  
-    while True:
680  
-      (fname, ftype, fid) = iprot.readFieldBegin()
681  
-      if ftype == TType.STOP:
682  
-        break
683  
-      if fid == 1:
684  
-        if ftype == TType.STRING:
685  
-          self.message = iprot.readString();
686  
-        else:
687  
-          iprot.skip(ftype)
688  
-      else:
689  
-        iprot.skip(ftype)
690  
-      iprot.readFieldEnd()
691  
-    iprot.readStructEnd()
692  
-
693  
-  def write(self, oprot):
694  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
695  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
696  
-      return
697  
-    oprot.writeStructBegin('IllegalArgument')
698  
-    if self.message != None:
699  
-      oprot.writeFieldBegin('message', TType.STRING, 1)
700  
-      oprot.writeString(self.message)
701  
-      oprot.writeFieldEnd()
702  
-    oprot.writeFieldStop()
703  
-    oprot.writeStructEnd()
704  
-
705  
-  def __str__(self):
706  
-    return repr(self)
707  
-
708  
-  def __repr__(self):
709  
-    L = ['%s=%r' % (key, value)
710  
-      for key, value in self.__dict__.iteritems()]
711  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
712  
-
713  
-  def __eq__(self, other):
714  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
715  
-
716  
-  def __ne__(self, other):
717  
-    return not (self == other)
718  
-
719  
-class AlreadyExists(Exception):
720  
-  """
721  
-  An AlreadyExists exceptions signals that a table with the specified
722  
-  name already exists
723  
-
724  
-  Attributes:
725  
-   - message
726  
-  """
727  
-
728  
-  thrift_spec = (
729  
-    None, # 0
730  
-    (1, TType.STRING, 'message', None, None, ), # 1
731  
-  )
732  
-
733  
-  def __init__(self, message=None,):
734  
-    self.message = message
735  
-
736  
-  def read(self, iprot):
737  
-    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
738  
-      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
739  
-      return
740  
-    iprot.readStructBegin()
741  
-    while True:
742  
-      (fname, ftype, fid) = iprot.readFieldBegin()
743  
-      if ftype == TType.STOP:
744  
-        break
745  
-      if fid == 1:
746  
-        if ftype == TType.STRING:
747  
-          self.message = iprot.readString();
748  
-        else:
749  
-          iprot.skip(ftype)
750  
-      else:
751  
-        iprot.skip(ftype)
752  
-      iprot.readFieldEnd()
753  
-    iprot.readStructEnd()
754  
-
755  
-  def write(self, oprot):
756  
-    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
757  
-      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
758  
-      return
759  
-    oprot.writeStructBegin('AlreadyExists')
760  
-    if self.message != None:
761  
-      oprot.writeFieldBegin('message', TType.STRING, 1)
762  
-      oprot.writeString(self.message)
763  
-      oprot.writeFieldEnd()
764  
-    oprot.writeFieldStop()
765  
-    oprot.writeStructEnd()
766  
-
767  
-  def __str__(self):
768  
-    return repr(self)
769  
-
770  
-  def __repr__(self):
771  
-    L = ['%s=%r' % (key, value)
772  
-      for key, value in self.__dict__.iteritems()]
773  
-    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
774  
-
775  
-  def __eq__(self, other):
776  
-    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
777  
-
778  
-  def __ne__(self, other):
779  
-    return not (self == other)
780  
-
33  thirdparty/thrift/TSCons.py
... ...
@@ -1,33 +0,0 @@
1  
-#
2  
-# Licensed to the Apache Software Foundation (ASF) under one
3  
-# or more contributor license agreements. See the NOTICE file
4  
-# distributed with this work for additional information
5  
-# regarding copyright ownership. The ASF licenses this file
6  
-# to you under the Apache License, Version 2.0 (the
7  
-# "License"); you may not use this file except in compliance
8  
-# with the License. You may obtain a copy of the License at
9  
-#
10  
-#   http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing,
13  
-# software distributed under the License is distributed on an
14  
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  
-# KIND, either express or implied. See the License for the
16  
-# specific language governing permissions and limitations
17  
-# under the License.
18  
-#
19  
-
20  
-from os import path
21  
-from SCons.Builder import Builder
22  
-
23  
-def scons_env(env, add=''):
24  
-  opath = path.dirname(path.abspath('$TARGET'))
25  
-  lstr = 'thrift --gen cpp -o ' + opath + ' ' + add + ' $SOURCE'
26  
-  cppbuild = Builder(action = lstr)
27  
-  env.Append(BUILDERS = {'ThriftCpp' : cppbuild})
28  
-
29  
-def gen_cpp(env, dir, file):
30  
-  scons_env(env)
31  
-  suffixes = ['_types.h', '_types.cpp']
32  
-  targets = map(lambda s: 'gen-cpp/' + file + s, suffixes)
33  
-  return env.ThriftCpp(targets, dir+file+'.thrift')
123  thirdparty/thrift/Thrift.py
... ...
@@ -1,123 +0,0 @@
1  
-#
2  
-# Licensed to the Apache Software Foundation (ASF) under one
3  
-# or more contributor license agreements. See the NOTICE file
4  
-# distributed with this work for additional information
5  
-# regarding copyright ownership. The ASF licenses this file
6  
-# to you under the Apache License, Version 2.0 (the
7  
-# "License"); you may not use this file except in compliance
8  
-# with the License. You may obtain a copy of the License at
9  
-#
10  
-#   http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing,
13  
-# software distributed under the License is distributed on an
14  
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  
-# KIND, either express or implied. See the License for the
16  
-# specific language governing permissions and limitations
17  
-# under the License.
18  
-#
19  
-
20  
-class TType:
21  
-  STOP   = 0
22  
-  VOID   = 1
23  
-  BOOL   = 2
24  
-  BYTE   = 3
25  
-  I08    = 3
26  
-  DOUBLE = 4
27  
-  I16    = 6
28  
-  I32    = 8
29  
-  I64    = 10
30  
-  STRING = 11
31  
-  UTF7   = 11
32  
-  STRUCT = 12
33  
-  MAP    = 13
34  
-  SET    = 14
35  
-  LIST   = 15
36  
-  UTF8   = 16
37  
-  UTF16  = 17
38  
-
39  
-class TMessageType:
40  
-  CALL  = 1
41  
-  REPLY = 2
42  
-  EXCEPTION = 3
43  
-  ONEWAY = 4
44  
-
45  
-class TProcessor:
46  
-
47  
-  """Base class for procsessor, which works on two streams."""
48  
-
49  
-  def process(iprot, oprot):
50  
-    pass
51  
-
52  
-class TException(Exception):
53  
-
54  
-  """Base class for all thrift exceptions."""
55  
-
56  
-  def __init__(self, message=None):
57  
-    Exception.__init__(self, message)
58  
-    self.message = message
59  
-
60  
-class TApplicationException(TException):
61  
-
62  
-  """Application level thrift exceptions."""
63  
-
64  
-  UNKNOWN = 0
65  
-  UNKNOWN_METHOD = 1
66  
-  INVALID_MESSAGE_TYPE = 2
67  
-  WRONG_METHOD_NAME = 3
68  
-  BAD_SEQUENCE_ID = 4
69  
-  MISSING_RESULT = 5
70  
-
71  
-  def __init__(self, type=UNKNOWN, message=None):
72  
-    TException.__init__(self, message)
73  
-    self.type = type
74  
-
75  
-  def __str__(self):
76  
-    if self.message:
77  
-      return self.message
78  
-    elif self.type == UNKNOWN_METHOD:
79  
-      return 'Unknown method'
80  
-    elif self.type == INVALID_MESSAGE_TYPE:
81  
-      return 'Invalid message type'
82  
-    elif self.type == WRONG_METHOD_NAME:
83  
-      return 'Wrong method name'
84  
-    elif self.type == BAD_SEQUENCE_ID:
85  
-      return 'Bad sequence ID'
86  
-    elif self.type == MISSING_RESULT:
87  
-      return 'Missing result'
88  
-    else:
89  
-      return 'Default (unknown) TApplicationException'
90  
-
91  
-  def read(self, iprot):
92  
-    iprot.readStructBegin()
93  
-    while True:
94  
-      (fname, ftype, fid) = iprot.readFieldBegin()
95  
-      if ftype == TType.STOP:
96  
-        break
97  
-      if fid == 1:
98  
-        if ftype == TType.STRING:
99  
-          self.message = iprot.readString();
100  
-        else:
101  
-          iprot.skip(ftype)
102  
-      elif fid == 2:
103  
-        if ftype == TType.I32:
104  
-          self.type = iprot.readI32();
105  
-        else:
106  
-          iprot.skip(ftype)
107  
-      else:
108  
-        iprot.skip(ftype)
109  
-      iprot.readFieldEnd()
110  
-    iprot.readStructEnd()
111  
-
112  
-  def write(self, oprot):
113  
-    oprot.writeStructBegin('TApplicationException')
114  
-    if self.message != None:
115  
-      oprot.writeFieldBegin('message', TType.STRING, 1)
116  
-      oprot.writeString(self.message)
117  
-      oprot.writeFieldEnd()
118  
-    if self.type != None:
119  
-      oprot.writeFieldBegin('type', TType.I32, 2)
120  
-      oprot.writeI32(self.type)
121  
-      oprot.writeFieldEnd()
122  
-    oprot.writeFieldStop()
123  
-    oprot.writeStructEnd()
20  thirdparty/thrift/__init__.py
... ...
@@ -1,20 +0,0 @@
1  
-#
2  
-# Licensed to the Apache Software Foundation (ASF) under one
3  
-# or more contributor license agreements. See the NOTICE file
4  
-# distributed with this work for additional information
5  
-# regarding copyright ownership. The ASF licenses this file
6  
-# to you under the Apache License, Version 2.0 (the
7  
-# "License"); you may not use this file except in compliance
8  
-# with the License. You may obtain a copy of the License at
9  
-#
10  
-#   http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing,
13  
-# software distributed under the License is distributed on an
14  
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  
-# KIND, either express or implied. See the License for the
16  
-# specific language governing permissions and limitations
17  
-# under the License.
18  
-#
19  
-
20  
-__all__ = ['Thrift', 'TSCons']
259  thirdparty/thrift/protocol/TBinaryProtocol.py
... ...
@@ -1,259 +0,0 @@
1  
-#
2  
-# Licensed to the Apache Software Foundation (ASF) under one