Skip to content

Commit

Permalink
Add the coldWritesEnabled option to Namespace options (#233)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Schallert <mattschallert@gmail.com>
  • Loading branch information
EdgeJ and schallert authored Oct 7, 2020
1 parent 8edea4b commit 27c3036
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ NamespaceOptions defines parameters for an M3DB namespace. See https://m3db.gith
| snapshotEnabled | SnapshotEnabled controls whether snapshotting is enabled. | bool | false |
| retentionOptions | RetentionOptions sets the retention parameters. | [RetentionOptions](#retentionoptions) | false |
| indexOptions | IndexOptions sets the indexing parameters. | [IndexOptions](#indexoptions) | false |
| coldWritesEnabled | ColdWritesEnabled controls whether cold writes are enabled. | bool | false |

[Back to TOC](#table-of-contents)

Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/m3dboperator/v1alpha1/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ type NamespaceOptions struct {

// IndexOptions sets the indexing parameters.
IndexOptions IndexOptions `json:"indexOptions,omitempty"`

// ColdWritesEnabled controls whether cold writes are enabled.
ColdWritesEnabled bool `json:"coldWritesEnabled,omitempty"`
}
2 changes: 1 addition & 1 deletion pkg/controller/add_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"k8s.io/utils/pointer"
"github.com/rakyll/statik/fs"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/utils/pointer"
)

func registerValidConfigMap(content string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/update_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (

myspec "github.com/m3db/m3db-operator/pkg/apis/m3dboperator/v1alpha1"
crdfake "github.com/m3db/m3db-operator/pkg/client/clientset/versioned/fake"
"github.com/m3db/m3db-operator/pkg/k8sops/m3db"
"github.com/m3db/m3db-operator/pkg/k8sops/labels"
"github.com/m3db/m3db-operator/pkg/k8sops/m3db"
"github.com/m3db/m3db-operator/pkg/k8sops/podidentity"
"github.com/m3db/m3db-operator/pkg/m3admin"

Expand Down
2 changes: 1 addition & 1 deletion pkg/k8sops/m3db/config_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (

corev1 "k8s.io/api/core/v1"

"k8s.io/utils/pointer"
"github.com/rakyll/statik/fs"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/utils/pointer"
)

func registerValidConfigMap() error {
Expand Down
1 change: 1 addition & 0 deletions pkg/m3admin/namespace/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func m3dbNamespaceOptsFromSpec(opts *myspec.NamespaceOptions) (*m3ns.NamespaceOp
RetentionOptions: retentionOpts,
SnapshotEnabled: opts.SnapshotEnabled,
IndexOptions: indexOpts,
ColdWritesEnabled: opts.ColdWritesEnabled,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/m3admin/namespace/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var (
Enabled: true,
BlockSize: (2 * time.Hour).String(),
},
ColdWritesEnabled: false,
}

presetOneMinuteFourtyDaysIndexed = myspec.NamespaceOptions{
Expand All @@ -82,5 +83,6 @@ var (
Enabled: true,
BlockSize: (24 * time.Hour).String(),
},
ColdWritesEnabled: false,
}
)

0 comments on commit 27c3036

Please sign in to comment.