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

Move MVCCKey encoding into C++. #3337

Merged
merged 1 commit into from
Dec 9, 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: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func setupClientBenchData(useSSL bool, numVersions, numKeys int, b *testing.B) (
}

if r, ok := s.Ctx.Engines[0].(*engine.RocksDB); ok {
r.CompactRange(nil, nil)
r.CompactRange(engine.NilKey, engine.NilKey)
}

return s, db
Expand Down
10 changes: 5 additions & 5 deletions keys/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ var (
// (storage/engine/rocksdb/db.cc).
localTransactionSuffix = roachpb.RKey("txn-")

// SystemPrefix indicates the beginning of the key range for
// global, system data which are replicated across the cluster.
SystemPrefix = roachpb.Key("\x04")
SystemMax = roachpb.Key("\x05")

// Meta1Prefix is the first level of key addressing. It is selected such that
// all range addressing records sort before any system tables which they
// might describe. The value is a RangeDescriptor struct.
Expand All @@ -141,6 +136,11 @@ var (
// MetaMax is the end of the range of addressing keys.
MetaMax = roachpb.Key("\x04")

// SystemPrefix indicates the beginning of the key range for
// global, system data which are replicated across the cluster.
SystemPrefix = roachpb.Key("\x04")
SystemMax = roachpb.Key("\x05")

// DescIDGenerator is the global descriptor ID generator sequence used for
// table and namespace IDs.
DescIDGenerator = roachpb.Key(MakeKey(SystemPrefix, roachpb.RKey("desc-idgen")))
Expand Down
2 changes: 1 addition & 1 deletion kv/txn_coord_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func verifyCleanup(key roachpb.Key, coord *TxnCoordSender, eng engine.Engine, t
return fmt.Errorf("expected empty transactions map; got %d", l)
}
meta := &engine.MVCCMetadata{}
ok, _, _, err := eng.GetProto(engine.MVCCEncodeKey(key), meta)
ok, _, _, err := eng.GetProto(engine.MakeMVCCMetadataKey(key), meta)
if err != nil {
return fmt.Errorf("error getting MVCC metadata: %s", err)
}
Expand Down
52 changes: 50 additions & 2 deletions roachpb/internal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions roachpb/internal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ message RaftSnapshotData {
message KeyValue {
optional bytes key = 1;
optional bytes value = 2;
optional int64 wall_time = 3 [(gogoproto.nullable) = false];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we embed a roachpb.Timestamp here or does that add noticeable overhead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I had an import issue with the protos and meant to revisit this. I had used separate fields purely for expediency during development.

optional int32 logical = 4 [(gogoproto.nullable) = false];
}
// The latest RangeDescriptor
optional RangeDescriptor range_descriptor = 1 [(gogoproto.nullable) = false];
Expand Down
Loading