Documentation ¶
Index ¶
- Constants
- func GenerateJobID() (string, error)
- func GenerateProjectID() (string, error)
- func GetCCLsChecksum(ccls []storage.ColumnPriv) string
- func GetTableChecksum(meta storage.TableMeta) string
- type App
- func (app *App) AddSession(sid string, session *Session)
- func (app *App) CancelSession(info *storage.SessionInfo) error
- func (app *App) DeleteSession(sid string)
- func (app *App) GetSession(sid string) (*Session, bool)
- func (app *App) GetSessionInfo(sid string) (*storage.SessionInfo, error)
- func (app *App) GetSessionResult(sid string) (*pb.QueryResponse, error)
- func (app *App) PersistSessionInfo(session *Session) error
- func (app *App) PersistSessionResult(sid string, resp *pb.QueryResponse) error
- func (app *App) SessionGc()
- func (app *App) StorageGc()
- type Checksum
- type ChecksumHasher
- type ChecksumStorage
- func (s *ChecksumStorage) CompareChecksumFor(partyCode string) (pb.ChecksumCompareResult, error)
- func (s *ChecksumStorage) GetLocal(partyCode string) (Checksum, error)
- func (s *ChecksumStorage) GetRemote(partyCode string) (Checksum, error)
- func (s *ChecksumStorage) SaveLocal(partyCode string, sum Checksum) error
- func (s *ChecksumStorage) SaveRemote(partyCode string, pbChecksum *pb.Checksum) error
- type ExecutionInfo
- type InterStub
- func (stub *InterStub) AskInfo(url string, req *pb.AskInfoRequest, response *pb.AskInfoResponse) (err error)
- func (stub *InterStub) CancelQueryJob(url string, req *pb.CancelQueryJobRequest, response *pb.CancelQueryJobResponse) (err error)
- func (stub *InterStub) DistributeQuery(url string, req *pb.DistributeQueryRequest, ...) (err error)
- func (stub *InterStub) ExchangeJobInfo(url string, req *pb.ExchangeJobInfoRequest, ...) (err error)
- func (stub *InterStub) InviteToProject(url string, req *pb.InviteToProjectRequest, ...) (err error)
- func (stub *InterStub) ReplyInvitation(url string, req *pb.ReplyInvitationRequest, ...) (err error)
- func (stub *InterStub) SyncInfo(url string, req *pb.SyncInfoRequest, response *pb.SyncInfoResponse) (err error)
- type IntraStub
- func (stub *IntraStub) CancelJob(url string, req *pb.CancelQueryRequest, response *pb.CancelQueryResponse) (err error)
- func (stub *IntraStub) CheckAndUpdateStatus(url string, req *pb.CheckAndUpdateStatusRequest, ...) (err error)
- func (stub *IntraStub) CreateJob(url string, req *pb.QueryRequest, response *pb.SubmitResponse) (err error)
- func (stub *IntraStub) CreateProject(url string, req *pb.CreateProjectRequest, response *pb.CreateProjectResponse) (err error)
- func (stub *IntraStub) CreateTable(url string, req *pb.CreateTableRequest, response *pb.CreateTableResponse) (err error)
- func (stub *IntraStub) DropTable(url string, req *pb.DropTableRequest, response *pb.DropTableResponse) (err error)
- func (stub *IntraStub) GetResult(url string, req *pb.FetchResultRequest, response *pb.QueryResponse) (err error)
- func (stub *IntraStub) GrantCCL(url string, req *pb.GrantCCLRequest, response *pb.GrantCCLResponse) (err error)
- func (stub *IntraStub) InviteMember(url string, req *pb.InviteMemberRequest, response *pb.InviteMemberResponse) (err error)
- func (stub *IntraStub) ListCCLs(url string, req *pb.ShowCCLRequest, response *pb.ShowCCLResponse) (err error)
- func (stub *IntraStub) ListInvitations(url string, req *pb.ListInvitationsRequest, ...) (err error)
- func (stub *IntraStub) ListProjects(url string, req *pb.ListProjectsRequest, response *pb.ListProjectsResponse) (err error)
- func (stub *IntraStub) ListTables(url string, req *pb.ListTablesRequest, response *pb.ListTablesResponse) (err error)
- func (stub *IntraStub) ProcessInvitation(url string, req *pb.ProcessInvitationRequest, ...) (err error)
- func (stub *IntraStub) RevokeCCL(url string, req *pb.RevokeCCLRequest, response *pb.RevokeCCLResponse) (err error)
- func (stub *IntraStub) RunQuery(url string, req *pb.QueryRequest, response *pb.QueryResponse) (err error)
- type Session
- func (s *Session) CheckChecksum() error
- func (s *Session) GetEndpoint(partyCode string) (string, error)
- func (s *Session) GetLocalChecksum(partyCode string) (Checksum, error)
- func (s *Session) GetRemoteChecksum(partyCode string) (Checksum, error)
- func (s *Session) GetResultSafely() *pb.QueryResponse
- func (s *Session) GetSelfChecksum() (Checksum, error)
- func (s *Session) GetSelfPartyCode() string
- func (s *Session) GetSessionVars() *variable.SessionVars
- func (s *Session) IsIssuer() bool
- func (s *Session) OnError(err error)
- func (s *Session) OnSuccess()
- func (s *Session) SaveEndpoint(partyCode, endpoint string)
- func (s *Session) SaveLocalChecksum(partyCode string, sum Checksum) error
- func (s *Session) SaveRemoteChecksum(partyCode string, pbChecksum *pb.Checksum) error
- func (s *Session) SetResultSafely(result *pb.QueryResponse)
- func (s *Session) SetValue(key fmt.Stringer, value interface{})
- func (s *Session) Value(key fmt.Stringer) interface{}
Constants ¶
View Source
const (
Version pb.BrokerProtocolVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
func GenerateJobID ¶
func GenerateProjectID ¶
remove hyphens due to project id may work as db name.
func GetCCLsChecksum ¶
func GetCCLsChecksum(ccls []storage.ColumnPriv) string
func GetTableChecksum ¶
TODO(jingshi): DRY, use ChecksumHasher.InfeedTable instead
Types ¶
type App ¶
type App struct { Sessions *cache.Cache PartyMgr partymgr.PartyMgr MetaMgr *storage.MetaManager Conf *config.Config Auth *auth.Auth EngineClient executor.EngineClient InterStub *InterStub Scheduler scheduler.EngineScheduler JobWatcher *executor.JobWatcher }
func (*App) AddSession ¶
func (*App) CancelSession ¶
func (app *App) CancelSession(info *storage.SessionInfo) error
cancel session to release memory and engine resource
func (*App) DeleteSession ¶
func (*App) GetSessionInfo ¶
func (app *App) GetSessionInfo(sid string) (*storage.SessionInfo, error)
func (*App) GetSessionResult ¶
func (app *App) GetSessionResult(sid string) (*pb.QueryResponse, error)
func (*App) PersistSessionInfo ¶
func (*App) PersistSessionResult ¶
func (app *App) PersistSessionResult(sid string, resp *pb.QueryResponse) error
type Checksum ¶
func NewChecksumFromProto ¶
func (*Checksum) CompareWith ¶
func (c *Checksum) CompareWith(checksum Checksum) pb.ChecksumCompareResult
func (*Checksum) TruncateString ¶
type ChecksumHasher ¶
type ChecksumHasher struct {
// contains filtered or unexported fields
}
func NewChecksumHasher ¶
func NewChecksumHasher() *ChecksumHasher
func (*ChecksumHasher) Finalize ¶
func (c *ChecksumHasher) Finalize() Checksum
func (*ChecksumHasher) InfeedCCLs ¶
func (c *ChecksumHasher) InfeedCCLs(ccls []*pb.SecurityConfig_ColumnControl)
func (*ChecksumHasher) InfeedTable ¶
func (c *ChecksumHasher) InfeedTable(tableName string, columnInfos []*model.ColumnInfo)
type ChecksumStorage ¶
type ChecksumStorage struct {
// contains filtered or unexported fields
}
func (*ChecksumStorage) CompareChecksumFor ¶
func (s *ChecksumStorage) CompareChecksumFor(partyCode string) (pb.ChecksumCompareResult, error)
func (*ChecksumStorage) GetLocal ¶
func (s *ChecksumStorage) GetLocal(partyCode string) (Checksum, error)
func (*ChecksumStorage) GetRemote ¶
func (s *ChecksumStorage) GetRemote(partyCode string) (Checksum, error)
func (*ChecksumStorage) SaveLocal ¶
func (s *ChecksumStorage) SaveLocal(partyCode string, sum Checksum) error
func (*ChecksumStorage) SaveRemote ¶
func (s *ChecksumStorage) SaveRemote(partyCode string, pbChecksum *pb.Checksum) error
type ExecutionInfo ¶
type ExecutionInfo struct { Issuer *pb.PartyId ProjectID string JobID string Query string // map from party to engine endpoint EngineEndpoints sync.Map EngineClient exe.EngineClient InterStub *InterStub // sorted parties who's data has been used in current session DataParties []string // sorted parties who work in current session WorkParties []string Checksums ChecksumStorage CompileOpts *pb.CompileOptions // for debug DebugOpts *pb.DebugOptions }
func (*ExecutionInfo) CheckProjectConf ¶
func (e *ExecutionInfo) CheckProjectConf() error
type InterStub ¶
type InterStub struct { Timeout time.Duration EncodingType message.ContentEncodingType Auth *auth.Auth }
func (*InterStub) AskInfo ¶
func (stub *InterStub) AskInfo(url string, req *pb.AskInfoRequest, response *pb.AskInfoResponse) (err error)
func (*InterStub) CancelQueryJob ¶
func (stub *InterStub) CancelQueryJob(url string, req *pb.CancelQueryJobRequest, response *pb.CancelQueryJobResponse) (err error)
func (*InterStub) DistributeQuery ¶
func (stub *InterStub) DistributeQuery(url string, req *pb.DistributeQueryRequest, response *pb.DistributeQueryResponse) (err error)
func (*InterStub) ExchangeJobInfo ¶
func (stub *InterStub) ExchangeJobInfo(url string, req *pb.ExchangeJobInfoRequest, response *pb.ExchangeJobInfoResponse) (err error)
func (*InterStub) InviteToProject ¶
func (stub *InterStub) InviteToProject(url string, req *pb.InviteToProjectRequest, response *pb.InviteToProjectResponse) (err error)
func (*InterStub) ReplyInvitation ¶
func (stub *InterStub) ReplyInvitation(url string, req *pb.ReplyInvitationRequest, response *pb.ReplyInvitationResponse) (err error)
func (*InterStub) SyncInfo ¶
func (stub *InterStub) SyncInfo(url string, req *pb.SyncInfoRequest, response *pb.SyncInfoResponse) (err error)
type IntraStub ¶
func (*IntraStub) CancelJob ¶
func (stub *IntraStub) CancelJob(url string, req *pb.CancelQueryRequest, response *pb.CancelQueryResponse) (err error)
func (*IntraStub) CheckAndUpdateStatus ¶
func (stub *IntraStub) CheckAndUpdateStatus(url string, req *pb.CheckAndUpdateStatusRequest, response *pb.CheckAndUpdateStatusResponse) (err error)
func (*IntraStub) CreateJob ¶
func (stub *IntraStub) CreateJob(url string, req *pb.QueryRequest, response *pb.SubmitResponse) (err error)
func (*IntraStub) CreateProject ¶
func (stub *IntraStub) CreateProject(url string, req *pb.CreateProjectRequest, response *pb.CreateProjectResponse) (err error)
func (*IntraStub) CreateTable ¶
func (stub *IntraStub) CreateTable(url string, req *pb.CreateTableRequest, response *pb.CreateTableResponse) (err error)
func (*IntraStub) DropTable ¶
func (stub *IntraStub) DropTable(url string, req *pb.DropTableRequest, response *pb.DropTableResponse) (err error)
func (*IntraStub) GetResult ¶
func (stub *IntraStub) GetResult(url string, req *pb.FetchResultRequest, response *pb.QueryResponse) (err error)
func (*IntraStub) GrantCCL ¶
func (stub *IntraStub) GrantCCL(url string, req *pb.GrantCCLRequest, response *pb.GrantCCLResponse) (err error)
func (*IntraStub) InviteMember ¶
func (stub *IntraStub) InviteMember(url string, req *pb.InviteMemberRequest, response *pb.InviteMemberResponse) (err error)
func (*IntraStub) ListCCLs ¶
func (stub *IntraStub) ListCCLs(url string, req *pb.ShowCCLRequest, response *pb.ShowCCLResponse) (err error)
func (*IntraStub) ListInvitations ¶
func (stub *IntraStub) ListInvitations(url string, req *pb.ListInvitationsRequest, response *pb.ListInvitationsResponse) (err error)
func (*IntraStub) ListProjects ¶
func (stub *IntraStub) ListProjects(url string, req *pb.ListProjectsRequest, response *pb.ListProjectsResponse) (err error)
func (*IntraStub) ListTables ¶
func (stub *IntraStub) ListTables(url string, req *pb.ListTablesRequest, response *pb.ListTablesResponse) (err error)
func (*IntraStub) ProcessInvitation ¶
func (stub *IntraStub) ProcessInvitation(url string, req *pb.ProcessInvitationRequest, response *pb.ProcessInvitationResponse) (err error)
func (*IntraStub) RevokeCCL ¶
func (stub *IntraStub) RevokeCCL(url string, req *pb.RevokeCCLRequest, response *pb.RevokeCCLResponse) (err error)
func (*IntraStub) RunQuery ¶
func (stub *IntraStub) RunQuery(url string, req *pb.QueryRequest, response *pb.QueryResponse) (err error)
type Session ¶
type Session struct { CreatedAt time.Time SessionVars *variable.SessionVars Ctx context.Context App *App // all sessions have independent stub to avoid concurrent problems ExecuteInfo *ExecutionInfo Engine scheduler.EngineInstance // current broker host for local engine to call back CallBackHost string Values map[fmt.Stringer]interface{} DryRun bool AsyncMode bool OutputNames []string Warning *pb.Warning Result *pb.QueryResponse // contains filtered or unexported fields }
session stores information that is unrelated to the query.
func NewSession ¶
func (*Session) CheckChecksum ¶
CheckChecksum checks data consistency with other parties via comparing checksum
func (*Session) GetLocalChecksum ¶
func (*Session) GetRemoteChecksum ¶
func (*Session) GetResultSafely ¶
func (s *Session) GetResultSafely() *pb.QueryResponse
func (*Session) GetSelfChecksum ¶
func (*Session) GetSelfPartyCode ¶
func (*Session) GetSessionVars ¶
func (s *Session) GetSessionVars() *variable.SessionVars
GetSessionVars implements the context.Context interface.
func (*Session) OnSuccess ¶
func (s *Session) OnSuccess()
OnSuccess is called when query job success
func (*Session) SaveEndpoint ¶
func (*Session) SaveLocalChecksum ¶
func (*Session) SaveRemoteChecksum ¶
func (*Session) SetResultSafely ¶
func (s *Session) SetResultSafely(result *pb.QueryResponse)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.