commit
e83eca61ca
|
@ -19,7 +19,7 @@ import (
|
||||||
// testing, a value above the number of cores on the machine does not provide
|
// testing, a value above the number of cores on the machine does not provide
|
||||||
// any additional benefit. For now we'll set it to the number of cores on the
|
// any additional benefit. For now we'll set it to the number of cores on the
|
||||||
// largest box we could imagine running influx.
|
// largest box we could imagine running influx.
|
||||||
const ringShards = 4096
|
const ringShards = 16
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrSnapshotInProgress is returned if a snapshot is attempted while one is already running.
|
// ErrSnapshotInProgress is returned if a snapshot is attempted while one is already running.
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
// basically defines the maximum number of partitions you can have in the ring.
|
// basically defines the maximum number of partitions you can have in the ring.
|
||||||
// If a smaller number of partitions are chosen when creating a ring, then
|
// If a smaller number of partitions are chosen when creating a ring, then
|
||||||
// they're evenly spread across this many partitions in the ring.
|
// they're evenly spread across this many partitions in the ring.
|
||||||
const partitions = 4096
|
const partitions = 16
|
||||||
|
|
||||||
// ring is a structure that maps series keys to entries.
|
// ring is a structure that maps series keys to entries.
|
||||||
//
|
//
|
||||||
|
|
|
@ -12,8 +12,8 @@ func TestRing_newRing(t *testing.T) {
|
||||||
n int
|
n int
|
||||||
returnErr bool
|
returnErr bool
|
||||||
}{
|
}{
|
||||||
{n: 1}, {n: 2}, {n: 4}, {n: 8}, {n: 16}, {n: 32}, {n: 64}, {n: 128}, {n: 256},
|
{n: 1}, {n: 2}, {n: 4}, {n: 8}, {n: 16}, {n: 32, returnErr: true},
|
||||||
{n: 0, returnErr: true}, {n: 3, returnErr: true}, {n: 512, returnErr: true},
|
{n: 0, returnErr: true}, {n: 3, returnErr: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, example := range examples {
|
for i, example := range examples {
|
||||||
|
|
|
@ -1025,7 +1025,7 @@ type WALSegmentWriter struct {
|
||||||
// NewWALSegmentWriter returns a new WALSegmentWriter writing to w.
|
// NewWALSegmentWriter returns a new WALSegmentWriter writing to w.
|
||||||
func NewWALSegmentWriter(w io.WriteCloser) *WALSegmentWriter {
|
func NewWALSegmentWriter(w io.WriteCloser) *WALSegmentWriter {
|
||||||
return &WALSegmentWriter{
|
return &WALSegmentWriter{
|
||||||
bw: bufio.NewWriter(w),
|
bw: bufio.NewWriterSize(w, 16*1024),
|
||||||
w: w,
|
w: w,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue