Versions in this module Expand all Collapse all v1 v1.0.1 May 18, 2017 Changes in this version + const JobTypeBackup + const JobTypeRestore + const PgServerVersion + const TableTruncateChunkSize + var DistSQLClusterExecMode = settings.RegisterEnumSetting("sql.defaults.distsql", "Default distributed SQL execution mode", "Auto", ...) + var ErrIntOverflowJobs = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthJobs = fmt.Errorf("proto: negative length found during unmarshaling") + 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 MinLeaseDuration = time.Minute + var MinSchemaChangeLeaseDuration = time.Minute + var NilVirtualTabler nilVirtualTabler + var SQLStatsCollectionLatencyThreshold = settings.RegisterDurationSetting("sql.metrics.statement_details.threshold", ...) + var SchemaChangeLeaseDuration = 5 * time.Minute + var StmtStatsEnable = settings.RegisterBoolSetting("sql.metrics.statement_details.enabled", ...) + func AddPlanHook(f planHookFn) + 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, txn *client.Txn) (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, ...) ([]byte, error) + func GetZoneConfig(cfg config.SystemConfig, id uint32) (config.ZoneConfig, bool, error) + func HashAppName(appName string) string + func IsStmtParallelized(stmt parser.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 NormalizeAndValidateUsername(username string) (string, error) + func ProcessDefaultColumns(cols []sqlbase.ColumnDescriptor, tableDesc *sqlbase.TableDescriptor, ...) ([]sqlbase.ColumnDescriptor, []parser.TypedExpr, error) + func SetTxnTimestamps(txn *client.Txn, ts hlc.Timestamp) + func TestDisableTableLeases() func() + type AppStatementStatistics map[string]map[string]roachpb.StatementStatistics + type AuthorizationAccessor interface + CheckPrivilege func(descriptor sqlbase.DescriptorProto, privilege privilege.Kind) error + RequireSuperUser func(action string) error + type BackupJobDetails struct + func (*BackupJobDetails) Descriptor() ([]byte, []int) + func (*BackupJobDetails) ProtoMessage() + func (m *BackupJobDetails) Marshal() (dAtA []byte, err error) + func (m *BackupJobDetails) MarshalTo(dAtA []byte) (int, error) + func (m *BackupJobDetails) Reset() + func (m *BackupJobDetails) Size() (n int) + func (m *BackupJobDetails) String() string + func (m *BackupJobDetails) Unmarshal(dAtA []byte) 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 + Clear func(planNode) + Independent func(context.Context, planNode, planNode) bool + var NoDependenciesAnalyzer DependencyAnalyzer = dependencyAnalyzerFunc(func(_ planNode, _ planNode) bool { ... }) + func NewSpanBasedDependencyAnalyzer() DependencyAnalyzer + type DescriptorAccessor interface + type DistSQLExecMode int64 + const DistSQLAlways + const DistSQLAuto + const DistSQLOff + const DistSQLOn + func DistSQLExecModeFromInt(val int64) DistSQLExecMode + func DistSQLExecModeFromString(val string) DistSQLExecMode + func (m DistSQLExecMode) String() string + 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 + 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) StatementResults + func (e *Executor) CopyDone(session *Session) StatementResults + func (e *Executor) ExecuteStatements(session *Session, stmts string, pinfo *parser.PlaceholderInfo) StatementResults + func (e *Executor) GetScrubbedStmtStats() AppStatementStatistics + func (e *Executor) IsVirtualDatabase(name string) bool + func (e *Executor) Prepare(query string, session *Session, pinfo parser.PlaceholderTypes) (*PreparedStatement, error) + func (e *Executor) ResetStatementStats(ctx context.Context) + 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 + ClusterID func() uuid.UUID + DB *client.DB + DistSQLSrv *distsqlrun.ServerImpl + DistSender *kv.DistSender + Gossip *gossip.Gossip + HistogramWindowInterval time.Duration + LeaseHolderCache *kv.LeaseHolderCache + LeaseManager *LeaseManager + NodeID *base.NodeIDContainer + RPCContext *rpc.Context + RangeDescriptorCache *kv.RangeDescriptorCache + SchemaChangerTestingKnobs *SchemaChangerTestingKnobs + TestingKnobs *ExecutorTestingKnobs + type ExecutorTestingKnobs struct + BeforePrepare func(ctx context.Context, stmt string, planner *planner) (*PreparedStatement, error) + CheckStmtStringChange bool + DisableAutoCommit bool + OverrideDistSQLMode *settings.EnumSetting + 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) + type JobLogger struct + Job JobRecord + func NewJobLogger(db *client.DB, leaseMgr *LeaseManager, job JobRecord) JobLogger + func (jl *JobLogger) Created(ctx context.Context) error + func (jl *JobLogger) Failed(ctx context.Context, err error) + func (jl *JobLogger) JobID() *int64 + func (jl *JobLogger) Progressed(ctx context.Context, fractionCompleted float32) error + func (jl *JobLogger) Started(ctx context.Context) error + func (jl *JobLogger) Succeeded(ctx context.Context) error + type JobPayload struct + Description string + DescriptorIDs []github_com_cockroachdb_cockroach_pkg_sql_sqlbase.ID + Details isJobPayload_Details + Error string + FinishedMicros int64 + FractionCompleted float32 + ModifiedMicros int64 + StartedMicros int64 + Username string + func (*JobPayload) Descriptor() ([]byte, []int) + func (*JobPayload) ProtoMessage() + func (*JobPayload) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...) + func (m *JobPayload) GetBackup() *BackupJobDetails + func (m *JobPayload) GetDetails() isJobPayload_Details + func (m *JobPayload) GetRestore() *RestoreJobDetails + func (m *JobPayload) Marshal() (dAtA []byte, err error) + func (m *JobPayload) MarshalTo(dAtA []byte) (int, error) + func (m *JobPayload) Reset() + func (m *JobPayload) Size() (n int) + func (m *JobPayload) String() string + func (m *JobPayload) Unmarshal(dAtA []byte) error + type JobPayload_Backup struct + Backup *BackupJobDetails + func (m *JobPayload_Backup) MarshalTo(dAtA []byte) (int, error) + func (m *JobPayload_Backup) Size() (n int) + type JobPayload_Restore struct + Restore *RestoreJobDetails + func (m *JobPayload_Restore) MarshalTo(dAtA []byte) (int, error) + func (m *JobPayload_Restore) Size() (n int) + type JobRecord struct + Description string + DescriptorIDs sqlbase.IDs + Details interface{} + Username string + type JobStatus string + const JobStatusFailed + const JobStatusPending + const JobStatusRunning + const JobStatusSucceeded + type LeaseCollection struct + type LeaseManager struct + func NewLeaseManager(nodeID *base.NodeIDContainer, db client.DB, clock *hlc.Clock, ...) *LeaseManager + func (m *LeaseManager) Acquire(ctx context.Context, txn *client.Txn, tableID sqlbase.ID, ...) (*LeaseState, error) + func (m *LeaseManager) AcquireByName(ctx context.Context, txn *client.Txn, dbID sqlbase.ID, tableName string) (*LeaseState, error) + func (m *LeaseManager) RefreshLeases(s *stop.Stopper, db *client.DB, gossip *gossip.Gossip) + func (m *LeaseManager) Release(lease *LeaseState) error + func (m *LeaseManager) SetDraining(drain bool) + type LeaseManagerTestingKnobs struct + GossipUpdateEvent func(config.SystemConfig) + LeaseStoreTestingKnobs LeaseStoreTestingKnobs + TestingLeasesRefreshedEvent func(config.SystemConfig) + func (*LeaseManagerTestingKnobs) ModuleTestingKnobs() + type LeaseState struct + func (s *LeaseState) Expiration() time.Time + func (s *LeaseState) Refcount() int + func (s *LeaseState) String() string + type LeaseStore struct + func (s LeaseStore) Acquire(ctx context.Context, txn *client.Txn, tableID sqlbase.ID, ...) (*LeaseState, error) + func (s LeaseStore) Publish(ctx context.Context, tableID sqlbase.ID, ...) (*sqlbase.Descriptor, error) + func (s LeaseStore) Release(ctx context.Context, stopper *stop.Stopper, lease *LeaseState) + func (s LeaseStore) WaitForOneVersion(ctx context.Context, tableID sqlbase.ID, retryOpts retry.Options) (sqlbase.DescriptorVersion, error) + type LeaseStoreTestingKnobs struct + CanUseExpiredLeases bool + LeaseAcquiredEvent func(lease *LeaseState, err error) + LeaseAcquiringEvent func(tableID sqlbase.ID, txn *client.Txn) + LeaseReleasedEvent func(lease *LeaseState, 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 ParallelizeQueue struct + func MakeParallelizeQueue(analyzer DependencyAnalyzer) ParallelizeQueue + func (pq *ParallelizeQueue) Add(ctx context.Context, plan planNode, exec func(planNode) error) + func (pq *ParallelizeQueue) Err() error + func (pq *ParallelizeQueue) Len() int + func (pq *ParallelizeQueue) Wait() error + type PlanHookState interface + ExecCfg func() *ExecutorConfig + LeaseMgr func() *LeaseManager + TypeAsString func(e *parser.Expr) (func() string, error) + TypeAsStringArray func(e *parser.Exprs) (func() []string, 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{} + Query string + SQLTypes parser.PlaceholderTypes + Type parser.StatementType + 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, query string, placeholderHints parser.PlaceholderTypes) (*PreparedStatement, error) + type RestoreJobDetails struct + func (*RestoreJobDetails) Descriptor() ([]byte, []int) + func (*RestoreJobDetails) ProtoMessage() + func (m *RestoreJobDetails) Marshal() (dAtA []byte, err error) + func (m *RestoreJobDetails) MarshalTo(dAtA []byte) (int, error) + func (m *RestoreJobDetails) Reset() + func (m *RestoreJobDetails) Size() (n int) + func (m *RestoreJobDetails) String() string + func (m *RestoreJobDetails) Unmarshal(dAtA []byte) 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 RowBuffer struct + func (rb *RowBuffer) Next() bool + func (rb *RowBuffer) Values() parser.Datums + type SchemaAccessor interface + type SchemaChangeManager struct + func NewSchemaChangeManager(testingKnobs *SchemaChangerTestingKnobs, db client.DB, ...) *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() + RunAfterTableNameDropped func() error + RunBeforeBackfill func() error + RunBeforeBackfillChunk func(sp roachpb.Span) error + SyncFilter SyncSchemaChangersFilter + WriteCheckpointInterval time.Duration + func (*SchemaChangerTestingKnobs) ModuleTestingKnobs() + type Session struct + ApplicationName string + Database string + DefaultIsolationLevel enginepb.IsolationType + DistSQLMode DistSQLExecMode + Location *time.Location + PreparedPortals PreparedPortals + PreparedStatements PreparedStatements + SearchPath parser.SearchPath + 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) Ctx() context.Context + func (s *Session) Finish(e *Executor) + func (s *Session) OpenAccount() WrappableMemoryAccount + func (s *Session) ProcessCopyData(ctx context.Context, data string, msg copyMsg) (parser.StatementList, error) + func (s *Session) StartMonitor(pool *mon.MemoryMonitor, reserved mon.BoundAccount) + func (s *Session) StartUnlimitedMonitor() + func (session *Session) CopyEnd(ctx context.Context) + type SessionArgs struct + ApplicationName string + Database string + User string + type StatementFilter func(context.Context, string, *Result) + type StatementResults struct + Empty bool + func (s *StatementResults) Close(ctx context.Context) + type SyncSchemaChangersFilter func(TestingSchemaChangerCollection) + type TestingSchemaChangerCollection struct + func (tscc TestingSchemaChangerCollection) ClearSchemaChangers() + type TxnStateEnum int + const Aborted + const CommitWait + const NoTxn + const Open + const RestartWait + func (i TxnStateEnum) String() string + type VirtualTabler interface + 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