Versions in this module Expand all Collapse all v1 v1.1.5 Jan 29, 2018 Changes in this version + const MaxSQLBytes + const PgServerVersion + const TableTruncateChunkSize + var ClusterOrganization = settings.RegisterStringSetting("cluster.organization", "organization name", "") + var DistSQLClusterExecMode = settings.RegisterEnumSetting("sql.defaults.distsql", "Default distributed SQL execution mode", "Auto", ...) + var LeaseDuration = 5 * time.Minute + var MetaDdl = metric.Metadata + var MetaDelete = metric.Metadata + var MetaDistSQLExecLatency = metric.Metadata + var MetaDistSQLSelect = metric.Metadata + var MetaDistSQLServiceLatency = metric.Metadata + var MetaInsert = metric.Metadata + var MetaMisc = metric.Metadata + var MetaQuery = metric.Metadata + var MetaSQLExecLatency = metric.Metadata + var MetaSQLServiceLatency = metric.Metadata + var MetaSelect = metric.Metadata + var MetaTxnAbort = metric.Metadata + var MetaTxnBegin = metric.Metadata + var MetaTxnCommit = metric.Metadata + var MetaTxnRollback = metric.Metadata + var MetaUpdate = metric.Metadata + var MinSchemaChangeLeaseDuration = time.Minute + var NilVirtualTabler nilVirtualTabler + var SchemaChangeLeaseDuration = 5 * time.Minute + func AddPlanHook(f planHookFn) + func CheckPrivilege(user string, descriptor sqlbase.DescriptorProto, privilege privilege.Kind) error + func DropTableDesc(ctx context.Context, tableDesc *sqlbase.TableDescriptor, db *client.DB, ...) error + func DropTableName(ctx context.Context, tableDesc *sqlbase.TableDescriptor, db *client.DB, ...) error + func EvalAsOfTimestamp(evalCtx *parser.EvalContext, asOf parser.AsOfClause, max hlc.Timestamp) (hlc.Timestamp, error) + func GenerateInsertRow(defaultExprs []parser.TypedExpr, ...) (parser.Datums, error) + func GenerateUniqueDescID(ctx context.Context, db *client.DB) (sqlbase.ID, error) + func GetKeysForTableDescriptor(tableDesc *sqlbase.TableDescriptor) (zoneKey roachpb.Key, nameKey roachpb.Key, descKey roachpb.Key) + func GetTableDesc(cfg config.SystemConfig, id sqlbase.ID) (*sqlbase.TableDescriptor, error) + func GetUserHashedPassword(ctx context.Context, executor *Executor, metrics *MemoryMetrics, ...) (bool, []byte, error) + func GetZoneConfig(cfg config.SystemConfig, id uint32) (config.ZoneConfig, bool, error) + func HashAppName(appName string) string + func HoistConstraints(n *parser.CreateTable) + func IsStmtParallelized(stmt Statement) bool + func MakeTableDesc(ctx context.Context, txn *client.Txn, vt VirtualTabler, ...) (sqlbase.TableDescriptor, error) + func MustGetDatabaseDesc(ctx context.Context, txn *client.Txn, vt VirtualTabler, name string) (*sqlbase.DatabaseDescriptor, error) + func MustGetDatabaseDescByID(ctx context.Context, txn *client.Txn, id sqlbase.ID) (*sqlbase.DatabaseDescriptor, error) + func MustGetTableDesc(ctx context.Context, txn *client.Txn, vt VirtualTabler, tn *parser.TableName, ...) (*sqlbase.TableDescriptor, error) + func MustGetTableOrViewDesc(ctx context.Context, txn *client.Txn, vt VirtualTabler, tn *parser.TableName, ...) (*sqlbase.TableDescriptor, error) + func NewWireFailureError(err error) error + func NormalizeAndValidateUsername(username string) (string, error) + func RecomputeViewDependencies(ctx context.Context, txn *client.Txn, e *Executor) error + func TestDisableTableLeases() func() + type AuthorizationAccessor interface + CheckPrivilege func(descriptor sqlbase.DescriptorProto, privilege privilege.Kind) error + RequireSuperUser func(action string) error + type CopyDataBlock struct + Done bool + func (CopyDataBlock) Format(buf *bytes.Buffer, f parser.FmtFlags) + func (CopyDataBlock) StatementTag() string + func (CopyDataBlock) StatementType() parser.StatementType + func (CopyDataBlock) String() string + type DatabaseAccessor interface + type DependencyAnalyzer interface + Analyze func(runParams, planNode) error + Clear func(planNode) + Independent func(planNode, planNode) bool + var NoDependenciesAnalyzer DependencyAnalyzer = dependencyAnalyzerFunc(func(_ planNode, _ planNode) bool { ... }) + func NewSpanBasedDependencyAnalyzer() DependencyAnalyzer + type DescriptorAccessor interface + type DistLoader struct + func (l *DistLoader) LoadCSV(ctx context.Context, job *jobs.Job, db *client.DB, evalCtx parser.EvalContext, ...) error + type DistSQLExecMode int64 + const DistSQLAlways + const DistSQLAuto + const DistSQLOff + const DistSQLOn + func DistSQLExecModeFromString(val string) DistSQLExecMode + func (m DistSQLExecMode) String() string + type DistSQLPlannerTestingKnobs struct + OverrideHealthCheck func(node roachpb.NodeID, addrString string) error + type EventLogType string + const EventLogAlterTable + const EventLogCreateDatabase + const EventLogCreateIndex + const EventLogCreateTable + const EventLogCreateView + const EventLogDropDatabase + const EventLogDropIndex + const EventLogDropTable + const EventLogDropView + const EventLogFinishSchemaChange + const EventLogNodeJoin + const EventLogNodeRestart + const EventLogReverseSchemaChange + const EventLogSetClusterSetting + type EventLogger struct + func MakeEventLogger(leaseMgr *LeaseManager) EventLogger + func (ev EventLogger) InsertEventRecord(ctx context.Context, txn *client.Txn, eventType EventLogType, ...) error + type Executor struct + DdlCount *metric.Counter + DeleteCount *metric.Counter + DistSQLExecLatency *metric.Histogram + DistSQLSelectCount *metric.Counter + DistSQLServiceLatency *metric.Histogram + InsertCount *metric.Counter + MiscCount *metric.Counter + QueryCount *metric.Counter + SQLExecLatency *metric.Histogram + SQLServiceLatency *metric.Histogram + SelectCount *metric.Counter + TxnAbortCount *metric.Counter + TxnBeginCount *metric.Counter + TxnCommitCount *metric.Counter + TxnRollbackCount *metric.Counter + UpdateCount *metric.Counter + func NewExecutor(cfg ExecutorConfig, stopper *stop.Stopper) *Executor + func (e *Executor) AnnotateCtx(ctx context.Context) context.Context + func (e *Executor) CopyData(session *Session, data string) error + func (e *Executor) CopyDone(session *Session) error + func (e *Executor) ExecutePreparedStatement(session *Session, stmt *PreparedStatement, pinfo *parser.PlaceholderInfo) error + func (e *Executor) ExecuteStatements(session *Session, stmts string, pinfo *parser.PlaceholderInfo) error + func (e *Executor) ExecuteStatementsBuffered(session *Session, stmts string, pinfo *parser.PlaceholderInfo, ...) (StatementResults, error) + func (e *Executor) FillUnimplementedErrorCounts(fill map[string]int64) + func (e *Executor) GetScrubbedStmtStats() []roachpb.CollectedStatementStatistics + func (e *Executor) GetVirtualTabler() VirtualTabler + func (e *Executor) IsVirtualDatabase(name string) bool + func (e *Executor) Prepare(stmt Statement, stmtStr string, session *Session, ...) (res *PreparedStatement, err error) + func (e *Executor) PrepareStmt(session *Session, s *parser.Prepare) error + func (e *Executor) ResetStatementStats(ctx context.Context) + func (e *Executor) ResetUnimplementedCounts() + func (e *Executor) SetDistSQLSpanResolver(spanResolver distsqlplan.SpanResolver) + func (e *Executor) Start(ctx context.Context, startupMemMetrics *MemoryMetrics, ...) + type ExecutorConfig struct + AmbientCtx log.AmbientContext + Clock *hlc.Clock + DB *client.DB + DistSQLSrv *distsqlrun.ServerImpl + DistSender *kv.DistSender + Gossip *gossip.Gossip + HistogramWindowInterval time.Duration + JobRegistry *jobs.Registry + LeaseHolderCache *kv.LeaseHolderCache + LeaseManager *LeaseManager + RPCContext *rpc.Context + RangeDescriptorCache *kv.RangeDescriptorCache + SchemaChangerTestingKnobs *SchemaChangerTestingKnobs + SessionRegistry *SessionRegistry + Settings *cluster.Settings + StatusServer serverpb.StatusServer + TestingKnobs *ExecutorTestingKnobs + func (ec *ExecutorConfig) Organization() string + type ExecutorTestingKnobs struct + AfterExecute func(ctx context.Context, stmt string, res StatementResult, err error) + BeforeAutoCommit func(ctx context.Context, stmt string) error + BeforeExecute func(ctx context.Context, stmt string, isParallel bool) + BeforePrepare func(ctx context.Context, stmt string, planner *planner) (*PreparedStatement, error) + CheckStmtStringChange bool + DisableAutoCommit bool + DistSQLPlannerKnobs DistSQLPlannerTestingKnobs + StatementFilter StatementFilter + WaitForGossipUpdate bool + func (*ExecutorTestingKnobs) ModuleTestingKnobs() + type InternalExecutor struct + LeaseManager *LeaseManager + func (ie InternalExecutor) ExecuteStatementInTransaction(ctx context.Context, opName string, txn *client.Txn, statement string, ...) (int, error) + func (ie InternalExecutor) GetTableSpan(ctx context.Context, user string, txn *client.Txn, dbName, tableName string) (roachpb.Span, error) + func (ie InternalExecutor) QueryRowInTransaction(ctx context.Context, opName string, txn *client.Txn, statement string, ...) (parser.Datums, error) + func (ie InternalExecutor) QueryRowsInTransaction(ctx context.Context, opName string, txn *client.Txn, statement string, ...) ([]parser.Datums, error) + type LeaseManager struct + func NewLeaseManager(nodeID *base.NodeIDContainer, db client.DB, clock *hlc.Clock, ...) *LeaseManager + func (m *LeaseManager) Acquire(ctx context.Context, timestamp hlc.Timestamp, tableID sqlbase.ID) (*sqlbase.TableDescriptor, hlc.Timestamp, error) + func (m *LeaseManager) AcquireByName(ctx context.Context, timestamp hlc.Timestamp, dbID sqlbase.ID, ...) (*sqlbase.TableDescriptor, hlc.Timestamp, error) + func (m *LeaseManager) RefreshLeases(s *stop.Stopper, db *client.DB, gossip *gossip.Gossip) + func (m *LeaseManager) Release(desc *sqlbase.TableDescriptor) error + func (m *LeaseManager) SetDraining(drain bool) + type LeaseManagerTestingKnobs struct + GossipUpdateEvent func(config.SystemConfig) + LeaseStoreTestingKnobs LeaseStoreTestingKnobs + TestingLeasesRefreshedEvent func(config.SystemConfig) + func (*LeaseManagerTestingKnobs) ModuleTestingKnobs() + type LeaseStore struct + func (s LeaseStore) Publish(ctx context.Context, tableID sqlbase.ID, ...) (*sqlbase.Descriptor, error) + func (s LeaseStore) WaitForOneVersion(ctx context.Context, tableID sqlbase.ID, retryOpts retry.Options) (sqlbase.DescriptorVersion, error) + type LeaseStoreTestingKnobs struct + LeaseAcquiredEvent func(table sqlbase.TableDescriptor, err error) + LeaseReleasedEvent func(table sqlbase.TableDescriptor, err error) + RemoveOnceDereferenced bool + func (*LeaseStoreTestingKnobs) ModuleTestingKnobs() + type MemoryMetrics struct + CurBytesCount *metric.Counter + MaxBytesHist *metric.Histogram + SessionCurBytesCount *metric.Counter + SessionMaxBytesHist *metric.Histogram + TxnCurBytesCount *metric.Counter + TxnMaxBytesHist *metric.Histogram + func MakeMemMetrics(endpoint string, histogramWindow time.Duration) MemoryMetrics + func (MemoryMetrics) MetricStruct() + type NodeInfo struct + AdminURL func() *url.URL + ClusterID func() uuid.UUID + NodeID *base.NodeIDContainer + PGURL func(*url.Userinfo) (*url.URL, error) + type ParallelizeQueue struct + func MakeParallelizeQueue(analyzer DependencyAnalyzer) ParallelizeQueue + func (pq *ParallelizeQueue) Add(params runParams, plan planNode, exec func(planNode) error) error + func (pq *ParallelizeQueue) Errs() []error + func (pq *ParallelizeQueue) Len() int + func (pq *ParallelizeQueue) Wait() []error + type PlanHookState interface + DistLoader func() *DistLoader + EvalContext func() parser.EvalContext + ExecCfg func() *ExecutorConfig + TypeAsString func(e parser.Expr, op string) (func() (string, error), error) + TypeAsStringArray func(e parser.Exprs, op string) (func() ([]string, error), error) + TypeAsStringOpts func(opts parser.KVOptions, valuelessOpts map[string]bool) (func() (map[string]string, error), error) + User func() string + type PreparedPortal struct + ProtocolMeta interface{} + Qargs parser.QueryArguments + Stmt *PreparedStatement + type PreparedPortals struct + func (pp PreparedPortals) Delete(ctx context.Context, name string) bool + func (pp PreparedPortals) Exists(name string) bool + func (pp PreparedPortals) Get(name string) (*PreparedPortal, bool) + func (pp PreparedPortals) New(ctx context.Context, name string, stmt *PreparedStatement, ...) (*PreparedPortal, error) + type PreparedStatement struct + Columns sqlbase.ResultColumns + ProtocolMeta interface{} + Statement parser.Statement + Str string + TypeHints parser.PlaceholderTypes + Types parser.PlaceholderTypes + type PreparedStatements struct + func (ps *PreparedStatements) DeleteAll(ctx context.Context) + func (ps PreparedStatements) Delete(ctx context.Context, name string) bool + func (ps PreparedStatements) Exists(name string) bool + func (ps PreparedStatements) Get(name string) (*PreparedStatement, bool) + func (ps PreparedStatements) New(e *Executor, name string, stmt Statement, stmtStr string, ...) (*PreparedStatement, error) + func (ps PreparedStatements) NewFromString(e *Executor, name, query string, placeholderHints parser.PlaceholderTypes) (*PreparedStatement, error) + type Result struct + Columns sqlbase.ResultColumns + Err error + PGTag string + Rows *sqlbase.RowContainer + RowsAffected int + Type parser.StatementType + func (r *Result) Close(ctx context.Context) + type ResultList []Result + func (rl ResultList) Close(ctx context.Context) + type ResultsGroup interface + Close func() + Flush func(context.Context) error + NewStatementResult func() StatementResult + Reset func(context.Context) + ResultsSentToClient func() bool + type ResultsWriter interface + NewResultsGroup func() ResultsGroup + SetEmptyQuery func() + type RowBuffer struct + func (rb *RowBuffer) Next() bool + func (rb *RowBuffer) Values() parser.Datums + type RowResultWriter struct + func NewRowResultWriter(statementType parser.StatementType, rowContainer *sqlbase.RowContainer) *RowResultWriter + func (b *RowResultWriter) AddRow(ctx context.Context, row parser.Datums) error + func (b *RowResultWriter) IncrementRowsAffected(n int) + func (b *RowResultWriter) StatementType() parser.StatementType + type SchemaAccessor interface + type SchemaChangeManager struct + func NewSchemaChangeManager(st *cluster.Settings, ambientCtx log.AmbientContext, ...) *SchemaChangeManager + func (s *SchemaChangeManager) Start(stopper *stop.Stopper) + type SchemaChanger struct + func NewSchemaChangerForTesting(tableID sqlbase.ID, mutationID sqlbase.MutationID, nodeID roachpb.NodeID, ...) SchemaChanger + func (sc *SchemaChanger) AcquireLease(ctx context.Context) (sqlbase.TableDescriptor_SchemaChangeLease, error) + func (sc *SchemaChanger) ExtendLease(ctx context.Context, existingLease *sqlbase.TableDescriptor_SchemaChangeLease) error + func (sc *SchemaChanger) MaybeIncrementVersion(ctx context.Context) (*sqlbase.Descriptor, error) + func (sc *SchemaChanger) ReleaseLease(ctx context.Context, lease sqlbase.TableDescriptor_SchemaChangeLease) error + func (sc *SchemaChanger) RunStateMachineBeforeBackfill(ctx context.Context) error + type SchemaChangerTestingKnobs struct + AsyncExecNotification func() error + AsyncExecQuickly bool + BackfillChunkSize int64 + RenameOldNameNotInUseNotification func() + RunAfterBackfillChunk func() + RunBeforeBackfill func() error + RunBeforeBackfillChunk func(sp roachpb.Span) error + RunBeforeIndexBackfill func() + RunBeforePublishWriteAndDelete func() + SyncFilter SyncSchemaChangersFilter + WriteCheckpointInterval time.Duration + func (*SchemaChangerTestingKnobs) ModuleTestingKnobs() + type Session struct + ActiveSyncQueries []uint128.Uint128 + ClientAddr string + Database string + DefaultIsolationLevel enginepb.IsolationType + DistSQLMode DistSQLExecMode + Location *time.Location + PreparedPortals PreparedPortals + PreparedStatements PreparedStatements + ResultsWriter ResultsWriter + SafeUpdates bool + SearchPath parser.SearchPath + Tracing SessionTracing + TxnState txnState + User string + func NewSession(ctx context.Context, args SessionArgs, e *Executor, remote net.Addr, ...) *Session + func (s *Session) ClearStatementsAndPortals(ctx context.Context) + func (s *Session) CopyEnd(ctx context.Context) + func (s *Session) Ctx() context.Context + func (s *Session) EmergencyClose() + func (s *Session) Finish(e *Executor) + func (s *Session) FinishPlan() + func (s *Session) OpenAccount() WrappableMemoryAccount + func (s *Session) ProcessCopyData(ctx context.Context, data string, msg copyMsg) (StatementList, error) + func (s *Session) StartMonitor(pool *mon.BytesMonitor, reserved mon.BoundAccount) + func (s *Session) StartUnlimitedMonitor() + type SessionArgs struct + ApplicationName string + Database string + User string + type SessionRegistry struct + func MakeSessionRegistry() *SessionRegistry + func (r *SessionRegistry) CancelQuery(queryIDStr string, username string) (bool, error) + func (r *SessionRegistry) SerializeAll() []serverpb.Session + type SessionTracing struct + func (st *SessionTracing) Enabled() bool + func (st *SessionTracing) KVTracingEnabled() bool + func (st *SessionTracing) RecordingType() tracing.RecordingType + func (st *SessionTracing) StartTracing(recType tracing.RecordingType, kvTracingEnabled bool) error + func (st *SessionTracing) StopTracing() error + type Statement struct + AST parser.Statement + ExpectedTypes sqlbase.ResultColumns + func (s Statement) String() string + type StatementFilter func(context.Context, string, ResultsWriter, error) error + type StatementList []Statement + func NewStatementList(stmts parser.StatementList) StatementList + func (l StatementList) Format(buf *bytes.Buffer, f parser.FmtFlags) + func (l StatementList) String() string + type StatementResult interface + AddRow func(ctx context.Context, row parser.Datums) error + BeginResult func(stmt parser.Statement) + CloseResult func() error + IncrementRowsAffected func(n int) + PGTag func() string + RowsAffected func() int + SetColumns func(columns sqlbase.ResultColumns) + StatementType func() parser.StatementType + type StatementResults struct + Empty bool + func (s *StatementResults) Close(ctx context.Context) + type SyncSchemaChangersFilter func(TestingSchemaChangerCollection) + type TableCollection struct + type TestingSchemaChangerCollection struct + func (tscc TestingSchemaChangerCollection) ClearSchemaChangers() + type TxnStateEnum int64 + const Aborted + const AutoRetry + const CommitWait + const NoTxn + const Open + const RestartWait + func (i TxnStateEnum) String() string + type VirtualTabler interface + type WireFailureError struct + func (e WireFailureError) Error() string + type WrappableMemoryAccount struct + func (w *WrappableMemoryAccount) Wsession(s *Session) WrappedMemoryAccount + func (w *WrappableMemoryAccount) Wtxn(s *Session) WrappedMemoryAccount + type WrappedMemoryAccount struct + func (w WrappedMemoryAccount) Clear(ctx context.Context) + func (w WrappedMemoryAccount) Close(ctx context.Context) + func (w WrappedMemoryAccount) Grow(ctx context.Context, extraSize int64) error + func (w WrappedMemoryAccount) OpenAndInit(ctx context.Context, initialAllocation int64) error + func (w WrappedMemoryAccount) ResizeItem(ctx context.Context, oldSize, newSize int64) error