Ejemplo n.º 1
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.owners = set([])  #owners
     self.blockQueue = []  #blocked queue: [thread]
     self.blockedThreads = {}  #block thread info: {thread : (state, event)}
     self.state = Lockable.UNLOCKED
Ejemplo n.º 2
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.owners = set([])               #owners
     self.blockQueue = []                #blocked queue: [thread]
     self.blockedThreads = {}            #block thread info: {thread : (state, event)}
     self.state = Lockable.UNLOCKED
Ejemplo n.º 3
0
 def __init__(self, ID, zoneID, actions, config):
     IDable.__init__(self, 'txn%s' % ID)
     self.zoneID = zoneID
     self.actions = actions
     self.gids = set([])
     self.config = config
     for action in actions:
         self.gids.add(action.itemID.gid)
Ejemplo n.º 4
0
 def __init__(self, repID, gid, size):
     IDable.__init__(self, 'R%s/G%s' % (repID, gid))
     self.gid = gid
     self.items = []
     for i in range(size):
         itemid = ItemID(gid, i)
         item = Item(repID, itemid)
         self.items.append(item)
Ejemplo n.º 5
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.events = []
     self.timeline = []
     self.attrs = []
     #register self to profiler
     self.parent = None
     self.children = set([])
Ejemplo n.º 6
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.events = []
     self.timeline = []
     self.attrs = []
     #register self to profiler
     self.parent = None
     self.children = set([])
Ejemplo n.º 7
0
 def __init__(self, repID, gid, size):
     IDable.__init__(self, 'R%s/G%s'%(repID, gid))
     self.gid = gid
     self.items = []
     for i in range(size):
         itemid = ItemID(gid, i)
         item = Item(repID, itemid)
         self.items.append(item)
Ejemplo n.º 8
0
 def __init__(self, ID, zoneID, actions, config):
     IDable.__init__(self, 'txn%s'%ID)
     self.zoneID = zoneID
     self.actions = actions
     self.gids = set([])
     self.config = config
     for action in actions:
         self.gids.add(action.itemID.gid)
Ejemplo n.º 9
0
 def __init__(self, cnode):
     IDable.__init__(self, '%s/lnr' % cnode.ID)
     Thread.__init__(self)
     MsgXeiver.__init__(self, cnode.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.cnode = cnode
     self.shouldClose = False
     self.learned = {}  #{eid : {cnodeID : batch}}
     self.votes = {}  #{(eid, cnodeID) : votes}
Ejemplo n.º 10
0
 def __init__(self, cnode):
     IDable.__init__(self, '%s/acc' % cnode.ID)
     Thread.__init__(self)
     MsgXeiver.__init__(self, cnode.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.cnode = cnode
     self.accepted = {}  #{(eid, cnodeID) : batch}
     self.timeout = cnode.configs.get('tide.acceptor.epoch.timeout', 500)
     self.shouldClose = False
Ejemplo n.º 11
0
 def __init__(self, system, ID, configs):
     IDable.__init__(self, 'zone%s/cn' % ID)
     Thread.__init__(self)
     RTI.__init__(self, self.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.system = system
     self.snodes = []
     self.configs = configs
     self.groupLocations = {}
     self.txnsRunning = set([])
     self.shouldClose = False
     self.closeEvent = SimEvent()
     #paxos entities
     self.paxosPRunner = None
     self.paxosAcceptor = None
     self.paxosLearner = None
Ejemplo n.º 12
0
 def __init__(self, system, ID, configs):
     IDable.__init__(self, 'zone%s/cn'%ID)
     Thread.__init__(self)
     RTI.__init__(self, self.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.system = system
     self.snodes = []
     self.configs = configs
     self.groupLocations = {}
     self.txnsRunning = set([])
     self.shouldClose = False
     self.closeEvent = SimEvent()
     #paxos entities
     self.paxosPRunner = None
     self.paxosAcceptor = None
     self.paxosLearner = None
Ejemplo n.º 13
0
 def __init__(self, cnode, ID, configs):
     IDable.__init__(self, '%s/sn%s' % (cnode.ID.split('/')[0], ID))
     Thread.__init__(self)
     RTI.__init__(self, self.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.system = cnode.system
     self.configs = configs
     self.cnode = cnode
     self.maxNumTxns = configs.get('max.num.txns.per.storage.node', 1024)
     self.pool = Resource(self.maxNumTxns, name='pool', unitName='thread')
     self.groups = {}  #{gid : group}
     self.newTxns = []
     self.txnsRunning = set([])
     self.shouldClose = False
     self.monitor = Profiler.getMonitor(self.ID)
     self.M_POOL_WAIT_PREFIX = '%s.pool.wait' % self.ID
     self.M_TXN_RUN_PREFIX = '%s.txn.run' % self.ID
     self.M_NUM_TXNS_RUN_KEY = '%s.num.txns' % self.ID
     self.runningThreads = set([])
     self.closeEvent = SimEvent()
     self.newTxnEvent = SimEvent()
Ejemplo n.º 14
0
 def __init__(self, cnode, ID, configs):
     IDable.__init__(self, '%s/sn%s'%(cnode.ID.split('/')[0], ID))
     Thread.__init__(self)
     RTI.__init__(self, self.ID)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.system = cnode.system
     self.configs = configs
     self.cnode = cnode
     self.maxNumTxns = configs.get('max.num.txns.per.storage.node', 1024)
     self.pool = Resource(self.maxNumTxns, name='pool', unitName='thread')
     self.groups = {}    #{gid : group}
     self.newTxns = []
     self.txnsRunning = set([])
     self.shouldClose = False
     self.monitor = Profiler.getMonitor(self.ID)
     self.M_POOL_WAIT_PREFIX = '%s.pool.wait' %self.ID
     self.M_TXN_RUN_PREFIX = '%s.txn.run' %self.ID
     self.M_NUM_TXNS_RUN_KEY = '%s.num.txns'%self.ID
     self.runningThreads = set([])
     self.closeEvent = SimEvent()
     self.newTxnEvent = SimEvent()
Ejemplo n.º 15
0
 def __init__(self, ID, zoneID, gid):
     IDable.__init__(self, 'txn%s' % ID)
     self.zoneID = zoneID
     self.gids = set([gid])
Ejemplo n.º 16
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     BThread.__init__(self)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.monitor = Profiler.getMonitor(self.ID)
Ejemplo n.º 17
0
 def __init__(self, ID, zoneID, gid):
     IDable.__init__(self, 'txn%s'%ID)
     self.zoneID = zoneID
     self.gids = set([gid])
Ejemplo n.º 18
0
 def __init__(self, gid, iid):
     IDable.__init__(self, 'G%s/I%s' % (gid, iid))
     self.gid = gid
     self.iid = iid
Ejemplo n.º 19
0
 def __init__(self, repID, gconfigs):
     IDable.__init__(self, 'D%s'%repID)
     self.groups = {}
     for gid, size in gconfigs.iteritems():
         self.groups[gid] = Group(repID, gid, size)
Ejemplo n.º 20
0
 def __init__(self, gid, iid):
     IDable.__init__(self, 'G%s/I%s'%(gid, iid))
     self.gid = gid
     self.iid = iid
Ejemplo n.º 21
0
 def __init__(self, repID, gconfigs):
     IDable.__init__(self, 'D%s' % repID)
     self.groups = {}
     for gid, size in gconfigs.iteritems():
         self.groups[gid] = Group(repID, gid, size)
Ejemplo n.º 22
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     BThread.__init__(self)
     self.logger = logging.getLogger(self.__class__.__name__)
     self.monitor = Profiler.getMonitor(self.ID)
Ejemplo n.º 23
0
 def __init__(self, runner, proxy):
     IDable.__init__(self, '%s--%s'%(runner.ID, proxy.ID))
Ejemplo n.º 24
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.batch = []