Commits

Adam Lindsay committed f580943

Cleanup README, delete now unnecessary code, regenerate a slimmer gen-py/diststore/ttypes.py

  • Participants
  • Parent commits 13fa662

Comments (0)

Files changed (3)

 Example usage, in different terminal windows:
   python location.py
   
-  python location.py localhost:9900 9901
+  python location.py --host localhost:9900 --port 9901
   
-  python location.py localhost:9901 9902
+  python location.py -h localhost:9901 -p 9902
   
 ... etc. ...
 
 
 == diststore ==
 
-Diststore is an example of an application that can be layered atop the 
-thrifty-p2p location service. It's a toy distributed key-value store,
-like all the kids are doing these days. It makes no attempt to optimize
-for large scales, so don't get too excited about deploying this anywhere
-real. 
+Diststore is an example of an application that can be layered atop the
+thrifty-p2p location service. It's a toy version of a distributed key-value
+store, like all the cool kids are doing these days. It makes no attempt to
+optimize for large scales, so don't get too excited about deploying this in
+production. Rather, it's provided for instruction and testing.
 
 Although diststore.thrift uses locator.thrift for a lot of its interfaces,
 the implementation overloads some of the base methods as an illustration 

File gen-py/diststore/ttypes.py

   fastbinary = None
 
 
-class StarterPackage(object):
-  """
-  Attributes:
-   - nodes
-   - store
-  """
-
-  thrift_spec = (
-    None, # 0
-    (1, TType.LIST, 'nodes', (TType.STRUCT,(locator.ttypes.Location, locator.ttypes.Location.thrift_spec)), None, ), # 1
-    (2, TType.MAP, 'store', (TType.STRING,None,TType.STRING,None), None, ), # 2
-  )
-
-  def __init__(self, nodes=None, store=None,):
-    self.nodes = nodes
-    self.store = store
-
-  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.LIST:
-          self.nodes = []
-          (_etype3, _size0) = iprot.readListBegin()
-          for _i4 in xrange(_size0):
-            _elem5 = locator.ttypes.Location()
-            _elem5.read(iprot)
-            self.nodes.append(_elem5)
-          iprot.readListEnd()
-        else:
-          iprot.skip(ftype)
-      elif fid == 2:
-        if ftype == TType.MAP:
-          self.store = {}
-          (_ktype7, _vtype8, _size6 ) = iprot.readMapBegin() 
-          for _i10 in xrange(_size6):
-            _key11 = iprot.readString();
-            _val12 = iprot.readString();
-            self.store[_key11] = _val12
-          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('StarterPackage')
-    if self.nodes != None:
-      oprot.writeFieldBegin('nodes', TType.LIST, 1)
-      oprot.writeListBegin(TType.STRUCT, len(self.nodes))
-      for iter13 in self.nodes:
-        iter13.write(oprot)
-      oprot.writeListEnd()
-      oprot.writeFieldEnd()
-    if self.store != None:
-      oprot.writeFieldBegin('store', TType.MAP, 2)
-      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.store))
-      for kiter14,viter15 in self.store.items():
-        oprot.writeString(kiter14)
-        oprot.writeString(viter15)
-      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)
-
         self.add(location, [self.location])
         ping_until_return(location)
         items = self.ring.nodes.difference([loc2str(location)])
-        # for item in items:
-        #     remote_call(location, 'add', str2loc(item), map(str2loc, self.ring.nodes))
     
     def remove(self, location, authorities):
         """