-
Notifications
You must be signed in to change notification settings - Fork 453
/
options.go
768 lines (597 loc) · 23.8 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package integration
import (
"testing"
"time"
"github.com/m3db/m3/src/dbnode/client"
"github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/dbnode/retention"
"github.com/m3db/m3/src/dbnode/storage/block"
"github.com/m3db/m3/src/dbnode/topology"
"github.com/stretchr/testify/require"
)
const (
// defaultID is the default node ID
defaultID = "testhost"
// defaultServerStateChangeTimeout is the default time we wait for a server to change its state.
defaultServerStateChangeTimeout = 10 * time.Minute
// defaultClusterConnectionTimeout is the default time we wait for cluster connections to be established.
defaultClusterConnectionTimeout = 2 * time.Second
// defaultReadRequestTimeout is the default read request timeout.
defaultReadRequestTimeout = 2 * time.Second
// defaultWriteRequestTimeout is the default write request timeout.
defaultWriteRequestTimeout = 2 * time.Second
// defaultTruncateRequestTimeout is the default truncate request timeout.
defaultTruncateRequestTimeout = 2 * time.Second
// defaultFetchRequestTimeout is the default fetch request timeout
defaultFetchRequestTimeout = 15 * time.Second
// defaultWorkerPoolSize is the default number of workers in the worker pool.
defaultWorkerPoolSize = 10
// defaultTickMinimumInterval is the default minimum tick interval.
defaultTickMinimumInterval = 1 * time.Second
// defaultTickCancellationCheckInterval is the default minimum tick cancellation check interval.
defaultTickCancellationCheckInterval = 1 * time.Second
// defaultUseTChannelClientForReading determines whether we use the tchannel client for reading by default.
defaultUseTChannelClientForReading = false
// defaultUseTChannelClientForWriting determines whether we use the tchannel client for writing by default.
defaultUseTChannelClientForWriting = false
// defaultUseTChannelClientForTruncation determines whether we use the tchannel client for truncation by default.
defaultUseTChannelClientForTruncation = true
// defaultWriteConsistencyLevel is the default write consistency level. This
// should match the default in client/options.
defaultWriteConsistencyLevel = topology.ConsistencyLevelMajority
// defaultNumShards is the default number of shards to use.
defaultNumShards = 12
// defaultMaxWiredBlocks is the default max number of wired blocks to keep in memory at once
defaultMaxWiredBlocks = 10
// defaultWriteNewSeriesAsync inserts, and index series' synchronously by default.
defaultWriteNewSeriesAsync = false
// defaultReportInterval is the default time interval of reporting metrics within the system.
defaultReportInterval = time.Second
)
var (
// DefaultIntegrationTestRetentionOpts are default integration test retention options.
DefaultIntegrationTestRetentionOpts = retention.NewOptions().SetRetentionPeriod(6 * time.Hour)
)
// TestOptions contains integration test options.
type TestOptions interface {
// SetNamespaces sets the namespaces.
SetNamespaces(value []namespace.Metadata) TestOptions
// Namespaces returns the namespaces.
Namespaces() []namespace.Metadata
// SetNamespaceInitializer sets the namespace initializer,
// if this is set, it superseeds Namespaces()
SetNamespaceInitializer(value namespace.Initializer) TestOptions
// NamespaceInitializer returns the namespace initializer
NamespaceInitializer() namespace.Initializer
// SetID sets the node ID.
SetID(value string) TestOptions
// ID returns the node ID.
ID() string
// SetTickMinimumInterval sets the tick interval.
SetTickMinimumInterval(value time.Duration) TestOptions
// TickMinimumInterval returns the tick interval.
TickMinimumInterval() time.Duration
// SetTickCancellationCheckInterval sets the tick cancellation check interval.
SetTickCancellationCheckInterval(value time.Duration) TestOptions
// TickCancellationCheckInterval returns the tick cancellation check interval.
TickCancellationCheckInterval() time.Duration
// SetHTTPClusterAddr sets the http cluster address.
SetHTTPClusterAddr(value string) TestOptions
// HTTPClusterAddr returns the http cluster address.
HTTPClusterAddr() string
// SetTChannelClusterAddr sets the tchannel cluster address.
SetTChannelClusterAddr(value string) TestOptions
// TChannelClusterAddr returns the tchannel cluster address.
TChannelClusterAddr() string
// SetHTTPNodeAddr sets the http node address.
SetHTTPNodeAddr(value string) TestOptions
// HTTPNodeAddr returns the http node address.
HTTPNodeAddr() string
// SetTChannelNodeAddr sets the tchannel node address.
SetTChannelNodeAddr(value string) TestOptions
// TChannelNodeAddr returns the tchannel node address.
TChannelNodeAddr() string
// SetHTTPDebugAddr sets the http debug address.
SetHTTPDebugAddr(value string) TestOptions
// HTTPDebugAddr returns the http debug address.
HTTPDebugAddr() string
// SetServerStateChangeTimeout sets the server state change timeout.
SetServerStateChangeTimeout(value time.Duration) TestOptions
// ServerStateChangeTimeout returns the server state change timeout.
ServerStateChangeTimeout() time.Duration
// SetClusterConnectionTimeout sets the cluster connection timeout.
SetClusterConnectionTimeout(value time.Duration) TestOptions
// ClusterConnectionTimeout returns the cluster connection timeout.
ClusterConnectionTimeout() time.Duration
// SetReadRequestTimeout sets the read request timeout.
SetReadRequestTimeout(value time.Duration) TestOptions
// ReadRequestTimeout returns the read request timeout.
ReadRequestTimeout() time.Duration
// SetWriteRequestTimeout sets the write request timeout.
SetWriteRequestTimeout(value time.Duration) TestOptions
// WriteRequestTimeout returns the write request timeout.
WriteRequestTimeout() time.Duration
// SetTruncateRequestTimeout sets the truncate request timeout.
SetTruncateRequestTimeout(value time.Duration) TestOptions
// TruncateRequestTimeout returns the truncate request timeout.
TruncateRequestTimeout() time.Duration
// SetFetchRequestTimeout sets the fetch request timeout.
SetFetchRequestTimeout(value time.Duration) TestOptions
// FetchRequestTimeout returns the fetch request timeout.
FetchRequestTimeout() time.Duration
// SetWorkerPoolSize sets the number of workers in the worker pool.
SetWorkerPoolSize(value int) TestOptions
// WorkerPoolSize returns the number of workers in the worker pool.
WorkerPoolSize() int
// SetClusterDatabaseTopologyInitializer sets the topology initializer that
// is used when creating a cluster database
SetClusterDatabaseTopologyInitializer(value topology.Initializer) TestOptions
// ClusterDatabaseTopologyInitializer returns the topology initializer that
// is used when creating a cluster database
ClusterDatabaseTopologyInitializer() topology.Initializer
// SetCustomClientAdminOptions sets any custom admin options to set.
SetCustomClientAdminOptions(value []client.CustomAdminOption) TestOptions
// CustomClientAdminOptions returns any custom admin options to set.
CustomClientAdminOptions() []client.CustomAdminOption
// SetUseTChannelClientForReading sets whether we use the tchannel client for reading.
SetUseTChannelClientForReading(value bool) TestOptions
// UseTChannelClientForReading returns whether we use the tchannel client for reading.
UseTChannelClientForReading() bool
// SetUseTChannelClientForWriting sets whether we use the tchannel client for writing.
SetUseTChannelClientForWriting(value bool) TestOptions
// UseTChannelClientForWriting returns whether we use the tchannel client for writing.
UseTChannelClientForWriting() bool
// SetUseTChannelClientForTruncation sets whether we use the tchannel client for truncation.
SetUseTChannelClientForTruncation(value bool) TestOptions
// UseTChannelClientForTruncation returns whether we use the tchannel client for truncation.
UseTChannelClientForTruncation() bool
// SetDatabaseBlockRetrieverManager sets the block retriever manager to
// use when bootstrapping retrievable blocks instead of blocks
// containing data.
// If you don't wish to bootstrap retrievable blocks instead of
// blocks containing data then do not set this manager.
// You can opt into which namespace you wish to have this enabled for
// by returning nil instead of a result when creating a new block retriever
// for a namespace from the manager.
SetDatabaseBlockRetrieverManager(
value block.DatabaseBlockRetrieverManager,
) TestOptions
// NewBlockRetrieverFn returns the new block retriever constructor to
// use when bootstrapping retrievable blocks instead of blocks
// containing data.
DatabaseBlockRetrieverManager() block.DatabaseBlockRetrieverManager
// SetVerifySeriesDebugFilePathPrefix sets the file path prefix for writing a debug file of series comparisons.
SetVerifySeriesDebugFilePathPrefix(value string) TestOptions
// VerifySeriesDebugFilePathPrefix returns the file path prefix for writing a debug file of series comparisons.
VerifySeriesDebugFilePathPrefix() string
// WriteConsistencyLevel returns the consistency level for writing with the m3db client.
WriteConsistencyLevel() topology.ConsistencyLevel
// SetWriteConsistencyLevel sets the consistency level for writing with the m3db client.
SetWriteConsistencyLevel(value topology.ConsistencyLevel) TestOptions
// NumShards returns the number of shards to use.
NumShards() int
// SetNumShards sets the number of shards to use.
SetNumShards(value int) TestOptions
// ShardSetOptions returns the test shard set options.
ShardSetOptions() *TestShardSetOptions
// SetShardSetOptions returns the test shard set options.
SetShardSetOptions(value *TestShardSetOptions) TestOptions
// MaxWiredBlocks returns the maximum number of wired blocks to keep in memory using the LRU cache.
MaxWiredBlocks() uint
// SetMaxWiredBlocks sets the maximum number of wired blocks to keep in memory using the LRU cache.
SetMaxWiredBlocks(value uint) TestOptions
// SetWriteNewSeriesAsync sets whether we insert/index asynchronously.
SetWriteNewSeriesAsync(bool) TestOptions
// WriteNewSeriesAsync returns whether we insert/index asynchronously.
WriteNewSeriesAsync() bool
// SetFilePathPrefix sets the file path prefix.
SetFilePathPrefix(value string) TestOptions
// FilePathPrefix returns the file path prefix.
FilePathPrefix() string
// SetProtoEncoding turns on proto encoder.
SetProtoEncoding(value bool) TestOptions
// ProtoEncoding returns whether proto encoder is turned on.
ProtoEncoding() bool
// SetAssertTestDataEqual sets a comparator to compare two byte arrays,
// useful for proto-encoded annotations.
SetAssertTestDataEqual(value assertTestDataEqual) TestOptions
// AssertTestDataEqual returns a comparator to compare two byte arrays.
AssertTestDataEqual() assertTestDataEqual
// SetNowFn will set the now fn.
SetNowFn(value func() time.Time) TestOptions
// NowFn returns the now fn.
NowFn() func() time.Time
// SetReportInterval sets the time between reporting metrics within the system.
SetReportInterval(value time.Duration) TestOptions
// ReportInterval returns the time between reporting metrics within the system.
ReportInterval() time.Duration
// SetStorageOptsFn sets the StorageOpts modifier.
SetStorageOptsFn(StorageOption) TestOptions
// StorageOptsFn returns the StorageOpts modifier.
StorageOptsFn() StorageOption
// SetCustomAdminOptions sets custom options to apply to the admin client connection.
SetCustomAdminOptions(value []client.CustomAdminOption) TestOptions
// CustomAdminOptions gets custom options to apply to the admin client connection.
CustomAdminOptions() []client.CustomAdminOption
}
type options struct {
namespaces []namespace.Metadata
nsInitializer namespace.Initializer
id string
tickMinimumInterval time.Duration
tickCancellationCheckInterval time.Duration
httpClusterAddr string
tchannelClusterAddr string
httpNodeAddr string
tchannelNodeAddr string
httpDebugAddr string
filePathPrefix string
serverStateChangeTimeout time.Duration
clusterConnectionTimeout time.Duration
readRequestTimeout time.Duration
writeRequestTimeout time.Duration
truncateRequestTimeout time.Duration
fetchRequestTimeout time.Duration
workerPoolSize int
clusterDatabaseTopologyInitializer topology.Initializer
blockRetrieverManager block.DatabaseBlockRetrieverManager
verifySeriesDebugFilePathPrefix string
writeConsistencyLevel topology.ConsistencyLevel
numShards int
shardSetOptions *TestShardSetOptions
maxWiredBlocks uint
customClientAdminOptions []client.CustomAdminOption
useTChannelClientForReading bool
useTChannelClientForWriting bool
useTChannelClientForTruncation bool
writeNewSeriesAsync bool
protoEncoding bool
assertEqual assertTestDataEqual
nowFn func() time.Time
reportInterval time.Duration
storageOptsFn StorageOption
customAdminOpts []client.CustomAdminOption
}
// NewTestOptions returns a new set of integration test options.
func NewTestOptions(t *testing.T) TestOptions {
var namespaces []namespace.Metadata
nsOpts := namespace.NewOptions().
SetRepairEnabled(false).
SetRetentionOptions(DefaultIntegrationTestRetentionOpts)
for _, ns := range testNamespaces {
md, err := namespace.NewMetadata(ns, nsOpts)
require.NoError(t, err)
namespaces = append(namespaces, md)
}
return &options{
namespaces: namespaces,
id: defaultID,
tickMinimumInterval: defaultTickMinimumInterval,
tickCancellationCheckInterval: defaultTickCancellationCheckInterval,
serverStateChangeTimeout: defaultServerStateChangeTimeout,
clusterConnectionTimeout: defaultClusterConnectionTimeout,
readRequestTimeout: defaultReadRequestTimeout,
writeRequestTimeout: defaultWriteRequestTimeout,
truncateRequestTimeout: defaultTruncateRequestTimeout,
fetchRequestTimeout: defaultFetchRequestTimeout,
workerPoolSize: defaultWorkerPoolSize,
writeConsistencyLevel: defaultWriteConsistencyLevel,
numShards: defaultNumShards,
maxWiredBlocks: defaultMaxWiredBlocks,
useTChannelClientForReading: defaultUseTChannelClientForReading,
useTChannelClientForWriting: defaultUseTChannelClientForWriting,
useTChannelClientForTruncation: defaultUseTChannelClientForTruncation,
writeNewSeriesAsync: defaultWriteNewSeriesAsync,
reportInterval: defaultReportInterval,
}
}
func (o *options) SetNamespaces(value []namespace.Metadata) TestOptions {
opts := *o
opts.namespaces = opts.namespaces[:0]
opts.namespaces = value
return &opts
}
func (o *options) Namespaces() []namespace.Metadata {
return o.namespaces
}
func (o *options) SetNamespaceInitializer(value namespace.Initializer) TestOptions {
opts := *o
opts.nsInitializer = value
return &opts
}
func (o *options) NamespaceInitializer() namespace.Initializer {
return o.nsInitializer
}
func (o *options) SetID(value string) TestOptions {
opts := *o
opts.id = value
return &opts
}
func (o *options) ID() string {
return o.id
}
func (o *options) SetTickMinimumInterval(value time.Duration) TestOptions {
opts := *o
opts.tickMinimumInterval = value
return &opts
}
func (o *options) TickMinimumInterval() time.Duration {
return o.tickMinimumInterval
}
func (o *options) SetTickCancellationCheckInterval(value time.Duration) TestOptions {
opts := *o
opts.tickCancellationCheckInterval = value
return &opts
}
func (o *options) TickCancellationCheckInterval() time.Duration {
return o.tickCancellationCheckInterval
}
func (o *options) SetHTTPClusterAddr(value string) TestOptions {
opts := *o
opts.httpClusterAddr = value
return &opts
}
func (o *options) HTTPClusterAddr() string {
return o.httpClusterAddr
}
func (o *options) SetTChannelClusterAddr(value string) TestOptions {
opts := *o
opts.tchannelClusterAddr = value
return &opts
}
func (o *options) TChannelClusterAddr() string {
return o.tchannelClusterAddr
}
func (o *options) SetHTTPNodeAddr(value string) TestOptions {
opts := *o
opts.httpNodeAddr = value
return &opts
}
func (o *options) HTTPNodeAddr() string {
return o.httpNodeAddr
}
func (o *options) SetTChannelNodeAddr(value string) TestOptions {
opts := *o
opts.tchannelNodeAddr = value
return &opts
}
func (o *options) TChannelNodeAddr() string {
return o.tchannelNodeAddr
}
func (o *options) SetHTTPDebugAddr(value string) TestOptions {
opts := *o
opts.httpDebugAddr = value
return &opts
}
func (o *options) HTTPDebugAddr() string {
return o.httpDebugAddr
}
func (o *options) SetServerStateChangeTimeout(value time.Duration) TestOptions {
opts := *o
opts.serverStateChangeTimeout = value
return &opts
}
func (o *options) ServerStateChangeTimeout() time.Duration {
return o.serverStateChangeTimeout
}
func (o *options) SetClusterConnectionTimeout(value time.Duration) TestOptions {
opts := *o
opts.clusterConnectionTimeout = value
return &opts
}
func (o *options) ClusterConnectionTimeout() time.Duration {
return o.clusterConnectionTimeout
}
func (o *options) SetReadRequestTimeout(value time.Duration) TestOptions {
opts := *o
opts.readRequestTimeout = value
return &opts
}
func (o *options) ReadRequestTimeout() time.Duration {
return o.readRequestTimeout
}
func (o *options) SetWriteRequestTimeout(value time.Duration) TestOptions {
opts := *o
opts.writeRequestTimeout = value
return &opts
}
func (o *options) WriteRequestTimeout() time.Duration {
return o.writeRequestTimeout
}
func (o *options) SetTruncateRequestTimeout(value time.Duration) TestOptions {
opts := *o
opts.truncateRequestTimeout = value
return &opts
}
func (o *options) TruncateRequestTimeout() time.Duration {
return o.truncateRequestTimeout
}
func (o *options) SetFetchRequestTimeout(value time.Duration) TestOptions {
opts := *o
opts.fetchRequestTimeout = value
return &opts
}
func (o *options) FetchRequestTimeout() time.Duration {
return o.fetchRequestTimeout
}
func (o *options) SetWorkerPoolSize(value int) TestOptions {
opts := *o
opts.workerPoolSize = value
return &opts
}
func (o *options) WorkerPoolSize() int {
return o.workerPoolSize
}
func (o *options) SetClusterDatabaseTopologyInitializer(value topology.Initializer) TestOptions {
opts := *o
opts.clusterDatabaseTopologyInitializer = value
return &opts
}
func (o *options) ClusterDatabaseTopologyInitializer() topology.Initializer {
return o.clusterDatabaseTopologyInitializer
}
func (o *options) SetCustomClientAdminOptions(value []client.CustomAdminOption) TestOptions {
opts := *o
opts.customClientAdminOptions = value
return &opts
}
func (o *options) CustomClientAdminOptions() []client.CustomAdminOption {
return o.customClientAdminOptions
}
func (o *options) SetUseTChannelClientForReading(value bool) TestOptions {
opts := *o
opts.useTChannelClientForReading = value
return &opts
}
func (o *options) UseTChannelClientForReading() bool {
return o.useTChannelClientForReading
}
func (o *options) SetUseTChannelClientForWriting(value bool) TestOptions {
opts := *o
opts.useTChannelClientForWriting = value
return &opts
}
func (o *options) UseTChannelClientForWriting() bool {
return o.useTChannelClientForWriting
}
func (o *options) SetUseTChannelClientForTruncation(value bool) TestOptions {
opts := *o
opts.useTChannelClientForTruncation = value
return &opts
}
func (o *options) UseTChannelClientForTruncation() bool {
return o.useTChannelClientForTruncation
}
func (o *options) SetDatabaseBlockRetrieverManager(
value block.DatabaseBlockRetrieverManager,
) TestOptions {
opts := *o
opts.blockRetrieverManager = value
return &opts
}
func (o *options) DatabaseBlockRetrieverManager() block.DatabaseBlockRetrieverManager {
return o.blockRetrieverManager
}
func (o *options) SetVerifySeriesDebugFilePathPrefix(value string) TestOptions {
opts := *o
opts.verifySeriesDebugFilePathPrefix = value
return &opts
}
func (o *options) VerifySeriesDebugFilePathPrefix() string {
return o.verifySeriesDebugFilePathPrefix
}
func (o *options) WriteConsistencyLevel() topology.ConsistencyLevel {
return o.writeConsistencyLevel
}
func (o *options) SetWriteConsistencyLevel(cLevel topology.ConsistencyLevel) TestOptions {
opts := *o
opts.writeConsistencyLevel = cLevel
return &opts
}
func (o *options) NumShards() int {
return o.numShards
}
func (o *options) SetNumShards(value int) TestOptions {
opts := *o
opts.numShards = value
return &opts
}
func (o *options) ShardSetOptions() *TestShardSetOptions {
return o.shardSetOptions
}
func (o *options) SetShardSetOptions(value *TestShardSetOptions) TestOptions {
opts := *o
opts.shardSetOptions = value
return &opts
}
func (o *options) MaxWiredBlocks() uint {
return o.maxWiredBlocks
}
func (o *options) SetMaxWiredBlocks(value uint) TestOptions {
opts := *o
opts.maxWiredBlocks = value
return &opts
}
func (o *options) SetWriteNewSeriesAsync(value bool) TestOptions {
opts := *o
opts.writeNewSeriesAsync = value
return &opts
}
func (o *options) WriteNewSeriesAsync() bool {
return o.writeNewSeriesAsync
}
func (o *options) SetFilePathPrefix(value string) TestOptions {
opts := *o
opts.filePathPrefix = value
return &opts
}
func (o *options) FilePathPrefix() string {
return o.filePathPrefix
}
func (o *options) SetProtoEncoding(value bool) TestOptions {
opts := *o
opts.protoEncoding = value
return &opts
}
func (o *options) ProtoEncoding() bool {
return o.protoEncoding
}
func (o *options) SetAssertTestDataEqual(value assertTestDataEqual) TestOptions {
opts := *o
opts.assertEqual = value
return &opts
}
func (o *options) AssertTestDataEqual() assertTestDataEqual {
return o.assertEqual
}
func (o *options) SetNowFn(value func() time.Time) TestOptions {
opts := *o
opts.nowFn = value
return &opts
}
func (o *options) NowFn() func() time.Time {
return o.nowFn
}
func (o *options) SetReportInterval(value time.Duration) TestOptions {
opts := *o
opts.reportInterval = value
return &opts
}
func (o *options) ReportInterval() time.Duration {
return o.reportInterval
}
func (o *options) SetStorageOptsFn(storageOptsFn StorageOption) TestOptions {
opts := *o
opts.storageOptsFn = storageOptsFn
return &opts
}
func (o *options) StorageOptsFn() StorageOption {
return o.storageOptsFn
}
func (o *options) SetCustomAdminOptions(value []client.CustomAdminOption) TestOptions {
opts := *o
opts.customAdminOpts = value
return &opts
}
func (o *options) CustomAdminOptions() []client.CustomAdminOption {
return o.customAdminOpts
}