Skip to content

Commit

Permalink
Address PR comments and use temp dir as root data dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
notbdu committed Mar 1, 2019
1 parent 3ee0549 commit 51ba7fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integration/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ database:
- id: testNamespace
retention: 87600h # 10 years in hours, DB has a default data retention of 24 hours that will break fixtures if we run them in the future (fixtures have hard coded timestamps).
numShards: 8
filePathPrefix: /var/lib/eventdb
filePathPrefix: /tmp/eventdb
fieldPathSeparator: .
namespaceFieldName: service
timestampFieldName: "@timestamp"
Expand Down
3 changes: 2 additions & 1 deletion values/decoding/raw_size_string_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/xichen2020/eventdb/x/bytes"
xio "github.com/xichen2020/eventdb/x/io"
"github.com/xichen2020/eventdb/x/safe"
)

const (
Expand Down Expand Up @@ -52,7 +53,7 @@ func (it *rawSizeStringIterator) Next() bool {
return false
}

it.curr = string(it.buf[:rawSizeBytes])
it.curr = safe.ToString(it.buf[:rawSizeBytes])
return true
}

Expand Down
6 changes: 3 additions & 3 deletions x/hash/hash.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hash

import (
"github.com/xichen2020/eventdb/x/safe"
"github.com/xichen2020/eventdb/x/unsafe"

murmur3 "github.com/m3db/stackmurmur3"
)
Expand All @@ -22,7 +22,7 @@ func BytesHash(d []byte) Hash {

// StringHash returns the hash of a string.
func StringHash(s string) Hash {
return BytesHash(safe.ToBytes(s))
return BytesHash(unsafe.ToBytes(s))
}

// StringArrayHash returns the hash of a string array
Expand All @@ -35,7 +35,7 @@ func StringArrayHash(d []string, sep byte) Hash {
)
// NB: If needed, can fork murmur3 to do this more properly
for i := 0; i < len(d); i++ {
h = h.Write(safe.ToBytes(d[i]))
h = h.Write(unsafe.ToBytes(d[i]))
if i < len(d)-1 {
h = h.Write(b)
}
Expand Down

0 comments on commit 51ba7fc

Please sign in to comment.