github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/src/dbnode/integration/options.go (about)

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