# tuplespace **Repository Path**: junphine/tuplespace ## Basic Information - **Project Name**: tuplespace - **Description**: light weigh mapreduce - **Primary Language**: Unknown - **License**: LGPL-2.1 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2014-05-29 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ========== Distributed TupleSpace Computing Systems,Have hightweight map reduce system. Feather: Easy of use, unlike hadoop High performence, like spark Scale up, Build with Python,can run in Cpython,Jython,IronPython,PyPy JsonRPC interface build on bottle define map-reduce job example: ``` class GroupCount: def __init__(self,group_field='_id'): self.group_field=group_field pass #print 'start map reduce.',init_value #yeild tupid,v1,v2,... def map(self,i,x): tup=x if(self.group_field=='_id'): yield 0,1 return if self.group_field in tup: k=x[self.group_field] yield (int(k)/10,dict(count=1,value=k)) def reduce(self,k,ys): sumv=0 count=0 for y in ys: sumv+=y['value']*y['count']; count+=y['count'] yield k,{'sum':sumv,'count':count} on client: space = TSpaceProxy(_config.ServerConfig) print space.login.__name__ space.login('u', 'p') rv,s,job= space.map_reduce('table', 'example', 'GroupCount',['score']); rv,s,result= space.wait_for(job) if not rv: raise TSpaceError(-1,str(result)) for tup in result: print 'example.GroupCount.reduce=', tup ```