Exemple #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
Exemple #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
Exemple #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)
Exemple #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)
Exemple #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([])
Exemple #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([])
Exemple #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)
Exemple #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)
Exemple #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}
Exemple #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
Exemple #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
Exemple #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
Exemple #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()
Exemple #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()
Exemple #15
0
 def __init__(self, ID, zoneID, gid):
     IDable.__init__(self, 'txn%s' % ID)
     self.zoneID = zoneID
     self.gids = set([gid])
Exemple #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)
Exemple #17
0
 def __init__(self, ID, zoneID, gid):
     IDable.__init__(self, 'txn%s'%ID)
     self.zoneID = zoneID
     self.gids = set([gid])
Exemple #18
0
 def __init__(self, gid, iid):
     IDable.__init__(self, 'G%s/I%s' % (gid, iid))
     self.gid = gid
     self.iid = iid
Exemple #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)
Exemple #20
0
 def __init__(self, gid, iid):
     IDable.__init__(self, 'G%s/I%s'%(gid, iid))
     self.gid = gid
     self.iid = iid
Exemple #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)
Exemple #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)
Exemple #23
0
 def __init__(self, runner, proxy):
     IDable.__init__(self, '%s--%s'%(runner.ID, proxy.ID))
Exemple #24
0
 def __init__(self, ID):
     IDable.__init__(self, ID)
     self.batch = []