Exemplo n.º 1
0
func (p *proposal) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Proposal for %v-%v", p.txnId, p.instanceRMId))
	sc.Emit(fmt.Sprintf("- Acceptors: %v", p.acceptors))
	sc.Emit(fmt.Sprintf("- Instances: %v", len(p.instances)))
	sc.Emit(fmt.Sprintf("- Finished? %v", p.finished))
	sc.Join()
}
Exemplo n.º 2
0
func (i *instance) status(instId instanceId, sc *server.StatusConsumer) {
	sc.Emit(instId.String())
	sc.Emit(fmt.Sprintf("- Promise Number: %v", i.promiseNum))
	sc.Emit(fmt.Sprintf("- Accepted Number: %v", i.acceptedNum))
	sc.Emit(fmt.Sprintf("- Accepted Ballot: %v", i.accepted))
	sc.Join()
}
Exemplo n.º 3
0
func (sts *SimpleTxnSubmitter) Status(sc *server.StatusConsumer) {
	txnIds := make([]common.TxnId, 0, len(sts.outcomeConsumers))
	for txnId := range sts.outcomeConsumers {
		txnIds = append(txnIds, txnId)
	}
	sc.Emit(fmt.Sprintf("SimpleTxnSubmitter: live TxnIds: %v", txnIds))
	sc.Join()
}
Exemplo n.º 4
0
func (vm *VarManager) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("- Active Vars: %v", len(vm.active)))
	sc.Emit(fmt.Sprintf("- Callbacks: %v", len(vm.callbacks)))
	sc.Emit(fmt.Sprintf("- Beater live? %v", vm.beaterLive))
	for _, v := range vm.active {
		v.Status(sc.Fork())
	}
	sc.Join()
}
Exemplo n.º 5
0
func (conn *Connection) status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Connection to %v (%v, %v)", conn.remoteHost, conn.remoteRMId, conn.remoteBootCount))
	sc.Emit(fmt.Sprintf("- Current State: %v", conn.currentState))
	sc.Emit(fmt.Sprintf("- IsServer? %v", conn.isServer))
	sc.Emit(fmt.Sprintf("- IsClient? %v", conn.isClient))
	if conn.submitter != nil {
		conn.submitter.Status(sc.Fork())
	}
	sc.Join()
}
Exemplo n.º 6
0
func (pm *ProposerManager) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Live proposers: %v", len(pm.proposers)))
	for _, prop := range pm.proposers {
		prop.Status(sc.Fork())
	}
	sc.Emit(fmt.Sprintf("Live proposals: %v", len(pm.proposals)))
	for _, prop := range pm.proposals {
		prop.Status(sc.Fork())
	}
	sc.Join()
}
Exemplo n.º 7
0
func (oa *OutcomeAccumulator) Status(sc *server.StatusConsumer) {
	outcomeToAcceptors := make(map[*txnOutcome][]common.RMId)
	acceptors := make([]common.RMId, 0, len(oa.acceptorIdToTxnOutcome))
	for rmId, outcome := range oa.acceptorIdToTxnOutcome {
		acceptors = append(acceptors, rmId)
		if list, found := outcomeToAcceptors[outcome]; found {
			outcomeToAcceptors[outcome] = append(list, rmId)
		} else {
			outcomeToAcceptors[outcome] = []common.RMId{rmId}
		}
	}
	sc.Emit(fmt.Sprintf("- known outcomes from acceptors: %v", acceptors))
	sc.Emit(fmt.Sprintf("- unique outcomes: %v", outcomeToAcceptors))
	sc.Emit(fmt.Sprintf("- outcome decided? %v", oa.decidingOutcome != nil))
	sc.Emit(fmt.Sprintf("- pending TGCs from: %v", oa.pendingTGC))
	sc.Join()
}
Exemplo n.º 8
0
func (pd *ProposerDispatcher) Status(sc *server.StatusConsumer) {
	sc.Emit("Proposers")
	for idx, executor := range pd.Executors {
		s := sc.Fork()
		s.Emit(fmt.Sprintf("Proposer Manager %v", idx))
		manager := pd.proposermanagers[idx]
		executor.Enqueue(func() { manager.Status(s) })
	}
	sc.Join()
}
Exemplo n.º 9
0
func (ad *AcceptorDispatcher) Status(sc *server.StatusConsumer) {
	sc.Emit("Acceptors")
	for idx, executor := range ad.Executors {
		s := sc.Fork()
		s.Emit(fmt.Sprintf("Acceptor Manager %v", idx))
		manager := ad.acceptormanagers[idx]
		executor.Enqueue(func() { manager.Status(s) })
	}
	sc.Join()
}
Exemplo n.º 10
0
func (vd *VarDispatcher) Status(sc *server.StatusConsumer) {
	sc.Emit("Vars")
	for idx, executor := range vd.Executors {
		s := sc.Fork()
		s.Emit(fmt.Sprintf("Var Manager %v", idx))
		manager := vd.varmanagers[idx]
		executor.Enqueue(func() { manager.Status(s) })
	}
	sc.Join()
}
Exemplo n.º 11
0
func (am *AcceptorManager) Status(sc *server.StatusConsumer) {
	s := sc.Fork()
	s.Emit(fmt.Sprintf("- Live Instances: %v", len(am.instances)))
	for instId, inst := range am.instances {
		inst.status(instId, s.Fork())
	}
	s.Join()
	s = sc.Fork()
	s.Emit(fmt.Sprintf("- Acceptors: %v", len(am.acceptors)))
	for _, aInst := range am.acceptors {
		if acc := aInst.acceptor; acc != nil {
			acc.Status(s.Fork())
		}
	}
	s.Join()
	sc.Join()
}
Exemplo n.º 12
0
func (txn *Txn) Status(sc *server.StatusConsumer) {
	sc.Emit(txn.Id.String())
	sc.Emit(fmt.Sprintf("- Local Actions: %v", txn.localActions))
	sc.Emit(fmt.Sprintf("- Current State: %v", txn.currentState))
	sc.Emit(fmt.Sprintf("- Retry? %v", txn.Retry))
	sc.Emit(fmt.Sprintf("- PreAborted? %v", txn.preAbortedBool))
	sc.Emit(fmt.Sprintf("- Aborted? %v", txn.aborted))
	sc.Emit(fmt.Sprintf("- Outcome Clock: %v", txn.outcomeClock))
	sc.Emit(fmt.Sprintf("- Active Frames Count: %v", atomic.LoadInt32(&txn.activeFramesCount)))
	sc.Emit(fmt.Sprintf("- Completed? %v", txn.completed))
	sc.Join()
}
Exemplo n.º 13
0
func (lc *LocalConnection) status(sc *server.StatusConsumer) {
	sc.Emit("LocalConnection")
	lc.submitter.Status(sc.Fork())
	sc.Join()
}
Exemplo n.º 14
0
func (a *Acceptor) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Acceptor for %v", a.txnId))
	sc.Emit(fmt.Sprintf("- Current State: %v", a.currentState))
	sc.Emit(fmt.Sprintf("- Outcome determined? %v", a.outcome != nil))
	sc.Emit(fmt.Sprintf("- Pending TLC: %v", a.pendingTLC))
	a.ballotAccumulator.Status(sc.Fork())
	sc.Join()
}
Exemplo n.º 15
0
func (cm *ConnectionManager) status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Address: %v", cm.localHost))
	sc.Emit(fmt.Sprintf("Boot Count: %v", cm.BootCount))
	sc.Emit(fmt.Sprintf("Current Topology: %v", cm.topology))
	if cm.topology != nil && cm.topology.Next() != nil {
		sc.Emit(fmt.Sprintf("Next Topology: %v", cm.topology.Next()))
	}
	serverConnections := make([]string, 0, len(cm.servers))
	for server := range cm.servers {
		serverConnections = append(serverConnections, server)
	}
	sc.Emit(fmt.Sprintf("ServerConnectionSubscribers: %v", len(cm.serverConnSubscribers.subscribers)))
	topSubs := make([]int, eng.TopologyChangeSubscriberTypeLimit)
	for idx, subs := range cm.topologySubscribers.subscribers {
		topSubs[idx] = len(subs)
	}
	sc.Emit(fmt.Sprintf("TopologySubscribers: %v", topSubs))
	rms := make([]common.RMId, 0, len(cm.rmToServer))
	for rmId := range cm.rmToServer {
		rms = append(rms, rmId)
	}
	sc.Emit(fmt.Sprintf("Active Server RMIds: %v", rms))
	sc.Emit(fmt.Sprintf("Active Server Connections: %v", serverConnections))
	sc.Emit(fmt.Sprintf("Desired Server Connections: %v", cm.desired))
	for _, conn := range cm.servers {
		if conn.Connection != nil {
			conn.Connection.Status(sc.Fork())
		}
	}
	cm.RLock()
	sc.Emit(fmt.Sprintf("Client Connection Count: %v", len(cm.connCountToClient)))
	cm.connCountToClient[0].(*client.LocalConnection).Status(sc.Fork())
	for _, conn := range cm.connCountToClient {
		if c, ok := conn.(*Connection); ok {
			c.Status(sc.Fork())
		}
	}
	cm.RUnlock()
	cm.Dispatchers.VarDispatcher.Status(sc.Fork())
	cm.Dispatchers.ProposerDispatcher.Status(sc.Fork())
	cm.Dispatchers.AcceptorDispatcher.Status(sc.Fork())
	sc.Join()
}
Exemplo n.º 16
0
func (cts *ClientTxnSubmitter) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("ClientTxnSubmitter: txnLive? %v", cts.txnLive))
	cts.SimpleTxnSubmitter.Status(sc.Fork())
	sc.Join()
}
Exemplo n.º 17
0
func (f *frame) Status(sc *server.StatusConsumer) {
	sc.Emit(f.String())
	readHistogram := make([]int, 4)
	for node := f.reads.First(); node != nil; node = node.Next() {
		readHistogram[int(node.Value.(txnStatus))]++
	}
	writeHistogram := make([]int, 4)
	for node := f.writes.First(); node != nil; node = node.Next() {
		writeHistogram[int(node.Value.(txnStatus))]++
	}
	sc.Emit(fmt.Sprintf("- Read Count: %v %v", f.reads.Len(), readHistogram))
	sc.Emit(fmt.Sprintf("- Uncommitted Read Count: %v", f.uncommittedReads))
	sc.Emit(fmt.Sprintf("- Learnt future reads: %v", len(f.learntFutureReads)))
	sc.Emit(fmt.Sprintf("- Write Count: %v %v", f.writes.Len(), writeHistogram))
	sc.Emit(fmt.Sprintf("- Uncommitted Write Count: %v", f.uncommittedWrites))
	sc.Emit(fmt.Sprintf("- RW Present: %v", f.rwPresent))
	sc.Emit(fmt.Sprintf("- Mask: %v", f.mask))
	sc.Emit(fmt.Sprintf("- Current State: %v", f.currentState))
	sc.Emit(fmt.Sprintf("- Locked? %v", f.isLocked()))
	sc.Emit(fmt.Sprintf("- Roll scheduled/active? %v/%v", f.rollScheduled, f.rollActive))
	sc.Emit(fmt.Sprintf("- DescendentOnDisk? %v", f.onDisk))
	sc.Emit(fmt.Sprintf("- Child == nil? %v", f.child == nil))
	sc.Emit(fmt.Sprintf("- Parent == nil? %v", f.parent == nil))
	if f.parent != nil {
		f.parent.Status(sc.Fork())
	}
	sc.Join()
}
Exemplo n.º 18
0
func (v *Var) Status(sc *server.StatusConsumer) {
	sc.Emit(v.UUId.String())
	if v.positions == nil {
		sc.Emit("- Positions: unknown")
	} else {
		sc.Emit(fmt.Sprintf("- Positions: %v", v.positions))
	}
	sc.Emit("- CurFrame:")
	v.curFrame.Status(sc.Fork())
	sc.Emit(fmt.Sprintf("- Subscribers: %v", len(v.subscribers)))
	sc.Emit(fmt.Sprintf("- Idle? %v", v.isIdle()))
	sc.Join()
}
Exemplo n.º 19
0
func (ba *BallotAccumulator) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Ballot Accumulator for %v", ba.txnId))
	sc.Emit(fmt.Sprintf("- incomplete var count: %v", ba.incompleteVars))
	sc.Emit(fmt.Sprintf("- retry? %v", ba.Txn.Retry()))
	sc.Join()
}
Exemplo n.º 20
0
func (p *Proposer) Status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Proposer for %v", p.txnId))
	sc.Emit(fmt.Sprintf("- Mode: %v", p.mode))
	sc.Emit(fmt.Sprintf("- Current state: %v", p.currentState))
	sc.Emit("- Outcome Accumulator")
	p.outcomeAccumulator.Status(sc.Fork())
	sc.Emit(fmt.Sprintf("- Locally Complete? %v", p.locallyCompleted))
	if p.txn != nil {
		sc.Emit("- Txn")
		p.txn.Status(sc.Fork())
	}
	sc.Join()
}
Exemplo n.º 21
0
func (cm *ConnectionManager) status(sc *server.StatusConsumer) {
	sc.Emit(fmt.Sprintf("Address: %v", cm.localHost))
	sc.Emit(fmt.Sprintf("Boot Count: %v", cm.BootCount))
	sc.Emit(fmt.Sprintf("Current Topology: %v", cm.topology))
	serverConnections := make([]string, 0, len(cm.servers))
	for server := range cm.servers {
		serverConnections = append(serverConnections, server)
	}
	sc.Emit(fmt.Sprintf("Senders: %v", len(cm.senders)))
	rms := make([]common.RMId, 0, len(cm.rmToServer))
	for rmId := range cm.rmToServer {
		rms = append(rms, rmId)
	}
	sc.Emit(fmt.Sprintf("Active Server RMIds: %v", rms))
	sc.Emit(fmt.Sprintf("Active Server Connections: %v", serverConnections))
	sc.Emit(fmt.Sprintf("Desired Server Connections: %v", cm.desired))
	for _, conn := range cm.servers {
		conn.Status(sc.Fork())
	}
	sc.Emit(fmt.Sprintf("Client Connection Count: %v", len(cm.connCountToClient)))
	cm.connCountToClient[0].(*client.LocalConnection).Status(sc.Fork())
	for _, conn := range cm.connCountToClient {
		if c, ok := conn.(*Connection); ok {
			c.Status(sc.Fork())
		}
	}
	cm.Dispatchers.VarDispatcher.Status(sc.Fork())
	cm.Dispatchers.ProposerDispatcher.Status(sc.Fork())
	cm.Dispatchers.AcceptorDispatcher.Status(sc.Fork())
	sc.Join()
}