Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: move dist_sql to separate package #6561

Merged
merged 3 commits into from May 6, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -53,7 +53,7 @@ ADMIN_GW_GO := $(ADMIN_PROTO:%.proto=%.pb.gw.go)
GO_PROTOS := $(addprefix $(REPO_ROOT)/, $(sort $(shell cd $(REPO_ROOT) && git ls-files --exclude-standard --cached --others -- '*.proto')))
GO_SOURCES := $(GO_PROTOS:%.proto=%.pb.go)

CPP_PROTOS := $(filter %/metadata.proto %/data.proto %/internal.proto %/mvcc.proto %/unresolved_addr.proto,$(GO_PROTOS))
CPP_PROTOS := $(filter %/roachpb/metadata.proto %/roachpb/data.proto %/roachpb/internal.proto %/mvcc.proto %/unresolved_addr.proto,$(GO_PROTOS))
CPP_HEADERS := $(subst ./,$(NATIVE_ROOT)/,$(CPP_PROTOS:%.proto=%.pb.h)) $(subst $(GOGOPROTO_ROOT),$(NATIVE_ROOT),$(GOGOPROTO_PROTO:%.proto=%.pb.h))
CPP_SOURCES := $(subst ./,$(NATIVE_ROOT)/,$(CPP_PROTOS:%.proto=%.pb.cc)) $(subst $(GOGOPROTO_ROOT),$(NATIVE_ROOT),$(GOGOPROTO_PROTO:%.proto=%.pb.cc))

@@ -41,6 +41,7 @@ import (
"github.com/cockroachdb/cockroach/rpc"
"github.com/cockroachdb/cockroach/server/status"
"github.com/cockroachdb/cockroach/sql"
"github.com/cockroachdb/cockroach/sql/distsql"
"github.com/cockroachdb/cockroach/sql/pgwire"
"github.com/cockroachdb/cockroach/storage"
"github.com/cockroachdb/cockroach/ts"
@@ -76,7 +77,7 @@ type Server struct {
db *client.DB
kvDB *kv.DBServer
pgServer *pgwire.Server
distSQLServer *sql.DistSQLServerImpl
distSQLServer *distsql.ServerImpl
node *Node
recorder *status.MetricsRecorder
runtime status.RuntimeStatSampler
@@ -189,11 +190,11 @@ func NewServer(ctx *Context, stopper *stop.Stopper) (*Server, error) {

s.pgServer = pgwire.MakeServer(&s.ctx.Context, s.sqlExecutor, sqlRegistry)

distSQLCtx := sql.DistSQLServerContext{
distSQLCtx := distsql.ServerContext{
DB: s.db,
}
s.distSQLServer = sql.NewDistSQLServer(distSQLCtx)
sql.RegisterDistSQLServer(s.grpc, s.distSQLServer)
s.distSQLServer = distsql.NewServer(distSQLCtx)
distsql.RegisterDistSQLServer(s.grpc, s.distSQLServer)

// TODO(bdarnell): make StoreConfig configurable.
nCtx := storage.StoreContext{
@@ -30,9 +30,9 @@ type TestServerInterface interface {
// ServingAddr returns the server's address.
ServingAddr() string

// ClientDB() returns a *client.DB instance for talking to this server, as
// an interface{}.
ClientDB() interface{}
// KVClient() returns a *client.DB instance for talking to this KV server,
// as an interface{}.
KVClient() interface{}

// KVDB() returns the *kv.DB instance as an interface{}.
KVDB() interface{}
@@ -64,12 +64,7 @@ func InitTestServerFactory(impl TestServerFactory) {
serviceImpl = impl
}

// NewTestServerWithParams creates a new test server with the given parameters.
func NewTestServerWithParams(params TestServerParams) TestServerInterface {
// NewTestServer creates a new test server with the given parameters.
func NewTestServer(params TestServerParams) TestServerInterface {
return serviceImpl.New(params)
}

// NewTestServer creates a new test server with default parameters.
func NewTestServer() TestServerInterface {
return NewTestServerWithParams(TestServerParams{})
}
@@ -384,8 +384,8 @@ func (ts *TestServer) MustGetSQLNetworkCounter(name string) int64 {

var _ testingshim.TestServerInterface = &TestServer{}

// ClientDB is part of TestServerInterface.
func (ts *TestServer) ClientDB() interface{} { return ts.db }
// KVClient is part of TestServerInterface.
func (ts *TestServer) KVClient() interface{} { return ts.db }

// KVDB is part of TestServerInterface.
func (ts *TestServer) KVDB() interface{} { return ts.kvDB }
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.