MCPcopy Create free account
hub / github.com/uber/aresdb / validateRequest

Method validateRequest

datanode/bootstrap/bootstrap_server.go:529–548  ·  view source on GitHub ↗
(sessionID int64, nodeID string, table string, shard uint32)

Source from the content-addressed store, hash-verified

527}
528
529func (p *PeerDataNodeServerImpl) validateRequest(sessionID int64, nodeID string, table string, shard uint32) error {
530 if sessionID == 0 {
531 return errNoSessionID
532 }
533 if len(nodeID) == 0 {
534 return errNoCallerID
535 }
536 sessionInfo, err := p.getSession(sessionID)
537 if err != nil {
538 return err
539 }
540 if sessionInfo.nodeID != nodeID {
541 return errInvalidRequset
542 }
543
544 if sessionInfo.table != table || sessionInfo.shardID != shard {
545 return errInvalidRequset
546 }
547 return nil
548}
549
550// record new requested session
551func (p *PeerDataNodeServerImpl) addSession(session *sessionInfo) {

Callers 2

Calls 1

getSessionMethod · 0.95

Tested by

no test coverage detected