MCPcopy
hub / github.com/uber/aresdb / cleanSession

Method cleanSession

datanode/bootstrap/bootstrap_server.go:567–586  ·  view source on GitHub ↗

closeSession remove session from memory

(sessionID int64, needLock bool)

Source from the content-addressed store, hash-verified

565
566// closeSession remove session from memory
567func (p *PeerDataNodeServerImpl) cleanSession(sessionID int64, needLock bool) {
568 if needLock {
569 p.Lock()
570 defer p.Unlock()
571 }
572
573 session := p.sessions[sessionID]
574 if session != nil {
575 delete(p.sessions, sessionID)
576 tableShardKey := tableShardPair{table: session.table, shardID: session.shardID}
577 sessionIDs := p.tableShardSessions[tableShardKey]
578 for i, sid := range sessionIDs {
579 if sid == sessionID {
580 sessionIDs = append(sessionIDs[:i], sessionIDs[i+1:]...)
581 p.tableShardSessions[tableShardKey] = sessionIDs
582 break
583 }
584 }
585 }
586}
587
588// retrieve session info using session id
589func (p *PeerDataNodeServerImpl) getSession(sessionID int64) (*sessionInfo, error) {

Callers 3

AcquireTokenMethod · 0.95
KeepAliveMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected