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

Integrate roachlib with storage/engine. #317

Merged
merged 1 commit into from
Feb 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
_vendor
roachlib/*.o
roachlib/*.a
proto/*.pb.go
proto/lib/*
proto/lib/github.com/gogo/protobuf/gogoproto/*
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export CPLUS_INCLUDE_PATH := $(CURDIR)/_vendor/usr/include:$(CPLUS_INCLUDE_PATH)
export LIBRARY_PATH := $(CURDIR)/_vendor/usr/lib:$(LIBRARY_PATH)

ROACH_PROTO := proto
ROACH_LIB := roachlib
SQL_PARSER := sql/parser

PKG := "./..."
Expand All @@ -59,7 +58,7 @@ endif

all: build test

auxiliary: storage/engine/engine.pc roach_proto roach_lib sqlparser
auxiliary: storage/engine/engine.pc roach_proto sqlparser

build: auxiliary
cd _vendor/src/github.com/coreos/etcd/raft ; $(GO) install $(GOFLAGS)
Expand All @@ -71,9 +70,6 @@ storage/engine/engine.pc: storage/engine/engine.pc.in
roach_proto:
make -C $(ROACH_PROTO) static_lib

roach_lib: roach_proto
make -C $(ROACH_LIB) static_lib

sqlparser:
make -C $(SQL_PARSER)

Expand Down Expand Up @@ -117,11 +113,10 @@ acceptance:
./local-cluster.sh stop)

clean:
$(GO) clean
$(GO) clean -i -r ./...
find . -name '*.test' -type f -exec rm -f {} \;
rm -f storage/engine/engine.pc
make -C $(ROACH_PROTO) clean
make -C $(ROACH_LIB) clean
make -C $(SQL_PARSER) clean

# The gopath target outputs the GOPATH that should be used for building this
Expand Down
1 change: 0 additions & 1 deletion githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
cd "$(git rev-parse --show-toplevel)"
(cd proto; make clean) > /dev/null 2>&1
(cd roachlib; make clean) > /dev/null 2>&1
2 changes: 1 addition & 1 deletion proto/internal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ message InternalTruncateLogResponse {

// A ReadWriteCmdResponse is a union type containing instances of all
// mutating commands. Note that any entry added here must be handled
// in roachlib/db.cc in GetResponseHeader().
// in storage/engine/db.cc in GetResponseHeader().
message ReadWriteCmdResponse {
option (gogoproto.onlyone) = true;
optional PutResponse put = 1;
Expand Down
38 changes: 0 additions & 38 deletions roachlib/Makefile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions storage/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ type Engine interface {
// (stored as byte slices with a special tag on the proto.Value) are
// combined with specialized logic beyond that of simple byte slices.
//
// The logic for merges is written in our C++ "roachlib" library in order to
// be compatible with RocksDB.
// The logic for merges is written in db.cc in order to be compatible with RocksDB.
Merge(key proto.EncodedKey, value []byte) error
// Capacity returns capacity details for the engine's available storage.
Capacity() (StoreCapacity, error)
Expand Down
4 changes: 2 additions & 2 deletions storage/engine/engine.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Name: Cockroach
Description: Cockroach Engine Dependencies
Version: 0.1
Requires:
Libs: -L${prefix}/_vendor/usr/lib -L${prefix}/_vendor/rocksdb -L${prefix}/proto/lib -L${prefix}/roachlib -lroach -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -lroachproto -lprotobuf @LDEXTRA@
Cflags: -I${prefix}/_vendor/usr/include -I${prefix}/_vendor/rocksdb/include -I${prefix}/proto/lib -I${prefix}/roachlib
Libs: -L${prefix}/_vendor/usr/lib -L${prefix}/_vendor/rocksdb -L${prefix}/proto/lib -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -lroachproto -lprotobuf @LDEXTRA@
Cflags: -I${prefix}/_vendor/usr/include -I${prefix}/_vendor/rocksdb/include -I${prefix}/proto/lib
4 changes: 2 additions & 2 deletions storage/engine/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ var (
// command responses used to guarantee idempotency (see
// ResponseCache).
// NOTE: if this value changes, it must be updated in C++
// (roachlib/db.cc).
// (storage/engine/db.cc).
KeyLocalResponseCacheSuffix = proto.Key("res-")

// KeyLocalRangeKeyPrefix is the prefix identifying per-range data
Expand All @@ -364,7 +364,7 @@ var (
// KeyLocalTransactionSuffix specifies the key suffix for
// transaction records. The additional detail is the transaction id.
// NOTE: if this value changes, it must be updated in C++
// (roachlib/db.cc).
// (storage/engine/db.cc).
KeyLocalTransactionSuffix = proto.Key("txn-")

// KeyLocalMax is the end of the local key range.
Expand Down
1 change: 1 addition & 0 deletions storage/engine/rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package engine

// #cgo CXXFLAGS: -std=c++11
// #cgo pkg-config: ./engine.pc
// #include <stdlib.h>
// #include "db.h"
Expand Down