Permalink
Browse files

added cassandra and agitmemnon libraries

  • Loading branch information...
1 parent e800424 commit c3ba14cfa2bb9221986084a623f2b114a6ccbb0e @schacon committed Aug 7, 2009
Showing with 4,741 additions and 0 deletions.
  1. +85 −0 dulwich/agitmemnon.py
  2. +3,750 −0 dulwich/cassandra/Cassandra.py
  3. +1 −0 dulwich/cassandra/__init__.py
  4. +9 −0 dulwich/cassandra/constants.py
  5. +896 −0 dulwich/cassandra/ttypes.py
View
85 dulwich/agitmemnon.py
@@ -0,0 +1,85 @@
+"""Cassandra Agitmemnon Client and Daemon Backend"""
+
+import sys
+import pprint
+from urlparse import urlparse
+
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+from cassandra import Cassandra
+from cassandra.ttypes import *
+
+from dulwich.server import (
+ Backend,
+ )
+
+class Agitmemnon:
+
+ def __init__(self):
+ host = '127.0.0.1'
+ port = 9160
+ self.keyspace = 'Agitmemnon'
+
+ socket = TSocket.TSocket(host, port)
+ transport = TTransport.TBufferedTransport(socket)
+ protocol = TBinaryProtocol.TBinaryProtocol(transport)
+ self.client = Cassandra.Client(protocol)
+ transport.open()
+
+ def get(self, column, key, count=100, consistency_level=1):
+ start = ''
+ finish = ''
+ is_ascending = True
+ result = self.client.get_slice(self.keyspace, key, ColumnParent(column),
+ start, finish, is_ascending,
+ count, consistency_level)
+ return result
+
+ def get_super(self, column, key, count=100, consistency_level=1):
+ start = ''
+ finish = ''
+ is_ascending = True
+ result = self.client.get_slice_super(self.keyspace, key, column,
+ start, finish, is_ascending,
+ count, consistency_level)
+ return result
+
+
+ def get_object(self, sha):
+ return self.get('Objects', sha)
+
+
+ def fetch_objects(self, determine_wants, graph_walker, progress):
+ """
+ Yield the objects required for a list of commits.
+
+ :param progress: is a callback to send progress messages to the client
+ """
+ print 'fetch'
+
+ def get_refs(self):
+ """Get dictionary with all refs."""
+ ret = {}
+ refs = a.get_super('Repositories', 'fuzed')
+ ret['HEAD'] = 'refs/heads/master' # TODO: fix this
+ for x in refs:
+ for col in x.columns:
+ if len(col.value) == 40:
+ ret['refs/' + x.name + '/' + col.name] = col.value
+ return ret
+
+class AgitmemnonBackend(Backend):
+
+ def __init__(self):
+ self.repo = Agitmemnon()
+ self.fetch_objects = self.repo.fetch_objects
+ self.get_refs = self.repo.get_refs
+
+
+a = Agitmemnon()
+print a.get_refs()
+
+#print a.get_object('7486f4075d2b9307d02e3905c69e28e456a51a32')
View
3,750 dulwich/cassandra/Cassandra.py
3,750 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 dulwich/cassandra/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'Cassandra']
View
9 dulwich/cassandra/constants.py
@@ -0,0 +1,9 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+
View
896 dulwich/cassandra/ttypes.py
@@ -0,0 +1,896 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class ConsistencyLevel:
+ ZERO = 0
+ ONE = 1
+ QUORUM = 2
+ ALL = 3
+
+class Column:
+ """
+ Attributes:
+ - name
+ - value
+ - timestamp
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.STRING, 'value', None, None, ), # 2
+ (3, TType.I64, 'timestamp', None, None, ), # 3
+ )
+
+ def __init__(self, name=None, value=None, timestamp=None,):
+ self.name = name
+ self.value = value
+ self.timestamp = timestamp
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.value = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I64:
+ self.timestamp = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Column')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.value != None:
+ oprot.writeFieldBegin('value', TType.STRING, 2)
+ oprot.writeString(self.value)
+ oprot.writeFieldEnd()
+ if self.timestamp != None:
+ oprot.writeFieldBegin('timestamp', TType.I64, 3)
+ oprot.writeI64(self.timestamp)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class BatchMutation:
+ """
+ Attributes:
+ - key
+ - cfmap
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.MAP, 'cfmap', (TType.STRING,None,TType.LIST,(TType.STRUCT,(Column, Column.thrift_spec))), None, ), # 2
+ )
+
+ def __init__(self, key=None, cfmap=None,):
+ self.key = key
+ self.cfmap = cfmap
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.MAP:
+ self.cfmap = {}
+ (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
+ for _i4 in xrange(_size0):
+ _key5 = iprot.readString();
+ _val6 = []
+ (_etype10, _size7) = iprot.readListBegin()
+ for _i11 in xrange(_size7):
+ _elem12 = Column()
+ _elem12.read(iprot)
+ _val6.append(_elem12)
+ iprot.readListEnd()
+ self.cfmap[_key5] = _val6
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('BatchMutation')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.cfmap != None:
+ oprot.writeFieldBegin('cfmap', TType.MAP, 2)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.cfmap))
+ for kiter13,viter14 in self.cfmap.items():
+ oprot.writeString(kiter13)
+ oprot.writeListBegin(TType.STRUCT, len(viter14))
+ for iter15 in viter14:
+ iter15.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SuperColumn:
+ """
+ Attributes:
+ - name
+ - columns
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.LIST, 'columns', (TType.STRUCT,(Column, Column.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, name=None, columns=None,):
+ self.name = name
+ self.columns = columns
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.columns = []
+ (_etype19, _size16) = iprot.readListBegin()
+ for _i20 in xrange(_size16):
+ _elem21 = Column()
+ _elem21.read(iprot)
+ self.columns.append(_elem21)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SuperColumn')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.columns != None:
+ oprot.writeFieldBegin('columns', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.columns))
+ for iter22 in self.columns:
+ iter22.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class BatchMutationSuper:
+ """
+ Attributes:
+ - key
+ - cfmap
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.MAP, 'cfmap', (TType.STRING,None,TType.LIST,(TType.STRUCT,(SuperColumn, SuperColumn.thrift_spec))), None, ), # 2
+ )
+
+ def __init__(self, key=None, cfmap=None,):
+ self.key = key
+ self.cfmap = cfmap
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.MAP:
+ self.cfmap = {}
+ (_ktype24, _vtype25, _size23 ) = iprot.readMapBegin()
+ for _i27 in xrange(_size23):
+ _key28 = iprot.readString();
+ _val29 = []
+ (_etype33, _size30) = iprot.readListBegin()
+ for _i34 in xrange(_size30):
+ _elem35 = SuperColumn()
+ _elem35.read(iprot)
+ _val29.append(_elem35)
+ iprot.readListEnd()
+ self.cfmap[_key28] = _val29
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('BatchMutationSuper')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.cfmap != None:
+ oprot.writeFieldBegin('cfmap', TType.MAP, 2)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.cfmap))
+ for kiter36,viter37 in self.cfmap.items():
+ oprot.writeString(kiter36)
+ oprot.writeListBegin(TType.STRUCT, len(viter37))
+ for iter38 in viter37:
+ iter38.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CqlResult:
+ """
+ Attributes:
+ - error_code
+ - error_txt
+ - result_set
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'error_code', None, None, ), # 1
+ (2, TType.STRING, 'error_txt', None, None, ), # 2
+ (3, TType.LIST, 'result_set', (TType.MAP,(TType.STRING,None,TType.STRING,None)), None, ), # 3
+ )
+
+ def __init__(self, error_code=None, error_txt=None, result_set=None,):
+ self.error_code = error_code
+ self.error_txt = error_txt
+ self.result_set = result_set
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.error_code = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.error_txt = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.LIST:
+ self.result_set = []
+ (_etype42, _size39) = iprot.readListBegin()
+ for _i43 in xrange(_size39):
+ _elem44 = {}
+ (_ktype46, _vtype47, _size45 ) = iprot.readMapBegin()
+ for _i49 in xrange(_size45):
+ _key50 = iprot.readString();
+ _val51 = iprot.readString();
+ _elem44[_key50] = _val51
+ iprot.readMapEnd()
+ self.result_set.append(_elem44)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CqlResult')
+ if self.error_code != None:
+ oprot.writeFieldBegin('error_code', TType.I32, 1)
+ oprot.writeI32(self.error_code)
+ oprot.writeFieldEnd()
+ if self.error_txt != None:
+ oprot.writeFieldBegin('error_txt', TType.STRING, 2)
+ oprot.writeString(self.error_txt)
+ oprot.writeFieldEnd()
+ if self.result_set != None:
+ oprot.writeFieldBegin('result_set', TType.LIST, 3)
+ oprot.writeListBegin(TType.MAP, len(self.result_set))
+ for iter52 in self.result_set:
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter52))
+ for kiter53,viter54 in iter52.items():
+ oprot.writeString(kiter53)
+ oprot.writeString(viter54)
+ oprot.writeMapEnd()
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class NotFoundException(Exception):
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('NotFoundException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class InvalidRequestException(Exception):
+ """
+ Attributes:
+ - why
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'why', None, None, ), # 1
+ )
+
+ def __init__(self, why=None,):
+ self.why = why
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.why = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('InvalidRequestException')
+ if self.why != None:
+ oprot.writeFieldBegin('why', TType.STRING, 1)
+ oprot.writeString(self.why)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class UnavailableException(Exception):
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('UnavailableException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnParent:
+ """
+ Attributes:
+ - column_family
+ - super_column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ )
+
+ def __init__(self, column_family=None, super_column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnParent')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnPath:
+ """
+ Attributes:
+ - column_family
+ - super_column
+ - column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ (5, TType.STRING, 'column', None, None, ), # 5
+ )
+
+ def __init__(self, column_family=None, super_column=None, column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+ self.column = column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnPath')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRING, 5)
+ oprot.writeString(self.column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SuperColumnPath:
+ """
+ Attributes:
+ - column_family
+ - super_column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ )
+
+ def __init__(self, column_family=None, super_column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SuperColumnPath')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnPathOrParent:
+ """
+ Attributes:
+ - column_family
+ - super_column
+ - column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ (5, TType.STRING, 'column', None, None, ), # 5
+ )
+
+ def __init__(self, column_family=None, super_column=None, column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+ self.column = column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnPathOrParent')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRING, 5)
+ oprot.writeString(self.column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+

0 comments on commit c3ba14c

Please sign in to comment.