Skip to content

Commit

Permalink
Add missing periods; update incorrect copyrights
Browse files Browse the repository at this point in the history
  • Loading branch information
nbroyles committed Aug 10, 2020
1 parent 4a914df commit e3ef775
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 41 deletions.
9 changes: 5 additions & 4 deletions src/dbnode/persist/fs/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import (
// on a fileset. This typically involves updating files in a fileset that were created by
// a previous version of the database client.
type Task interface {
// Run is the set of steps to successfully complete a migration
// Run is the set of steps to successfully complete a migration.
Run() error
}

// toVersion1_1Task is an object responsible for migrating a fileset to version 1.1
// toVersion1_1Task is an object responsible for migrating a fileset to version 1.1.
type toVersion1_1Task struct {
newMergerFn fs.NewMergerFn
infoFileResult fs.ReadInfoFileResult
Expand All @@ -47,11 +47,12 @@ type toVersion1_1Task struct {
fsOpts fs.Options
}

// ShouldMigrateToVersion1_1 indicates whether the fileset should be migrated to 1.1 or not
// ShouldMigrateToVersion1_1 indicates whether the fileset should be migrated to 1.1 or not.
func ShouldMigrateToVersion1_1(info fs.ReadInfoFileResult) bool {
return info.Info.MajorVersion == 1 && info.Info.MinorVersion == 0
}

// NewToVersion1_1Task creates a task for migrating a fileset to version 1.1.
func NewToVersion1_1Task(opts TaskOptions) (Task, error) {
if err := opts.Validate(); err != nil {
return nil, err
Expand All @@ -67,7 +68,7 @@ func NewToVersion1_1Task(opts TaskOptions) (Task, error) {
}, nil
}

// Run executes the steps to bring a fileset to Version 1.1
// Run executes the steps to bring a fileset to Version 1.1.
func (v *toVersion1_1Task) Run() error {
opts := v.sOpts
reader, err := fs.NewReader(opts.BytesPool(), v.fsOpts)
Expand Down
2 changes: 1 addition & 1 deletion src/dbnode/persist/fs/migration/task_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type taskOptions struct {

var _ TaskOptions = &taskOptions{}

// NewTaskOptions creates new taskOptions
// NewTaskOptions creates new taskOptions.
func NewTaskOptions() TaskOptions {
return &taskOptions{
newMergerFn: fs.NewMerger,
Expand Down
28 changes: 14 additions & 14 deletions src/dbnode/persist/fs/migration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,45 @@ type Options interface {
// MigrationVersion is an enum that corresponds to the major and minor version number to migrate data files to.
type MigrationVersion uint

// TaskOptions represents options for individual migration tasks
// TaskOptions represents options for individual migration tasks.
type TaskOptions interface {
// Validate validates the options
// Validate validates the options.
Validate() error

// SetNewMergerFn sets the function to create a new Merger
// SetNewMergerFn sets the function to create a new Merger.
SetNewMergerFn(value fs.NewMergerFn) TaskOptions

// NewMergerFn returns the function to create a new Merger
// NewMergerFn returns the function to create a new Merger.
NewMergerFn() fs.NewMergerFn

// SetInfoFileResult sets the info file resulted associated with this run
// SetInfoFileResult sets the info file resulted associated with this run.
SetInfoFileResult(value fs.ReadInfoFileResult) TaskOptions

// InfoFileResult gets the info file resulted associated with this run
// InfoFileResult gets the info file resulted associated with this run.
InfoFileResult() fs.ReadInfoFileResult

// SetShard sets the shard associated with this task
// SetShard sets the shard associated with this task.
SetShard(value uint32) TaskOptions

// Shard gets the shard associated with this task
// Shard gets the shard associated with this task.
Shard() uint32

// SetNamespaceMetadata sets the namespace metadata associated with this task
// SetNamespaceMetadata sets the namespace metadata associated with this task.
SetNamespaceMetadata(value namespace.Metadata) TaskOptions

// NamespaceMetadata gets the namespace metadata associated with this task
// NamespaceMetadata gets the namespace metadata associated with this task.
NamespaceMetadata() namespace.Metadata

// SetPersistManager sets the persist manager used for this task
// SetPersistManager sets the persist manager used for this task.
SetPersistManager(value persist.Manager) TaskOptions

// PersistManager gets the persist manager use for this task
// PersistManager gets the persist manager use for this task.
PersistManager() persist.Manager

// SetStorageOptions sets the storage options associated with this task
// SetStorageOptions sets the storage options associated with this task.
SetStorageOptions(value storage.Options) TaskOptions

// StorageOptions gets the storage options associated with this task
// StorageOptions gets the storage options associated with this task.
StorageOptions() storage.Options

// SetFilesystemOptions sets the filesystem options.
Expand Down
42 changes: 20 additions & 22 deletions src/dbnode/persist/fs/noop_merge_with.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
/*
* Copyright (c) 2020 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.
*/
// Copyright (c) 2020 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 fs

Expand All @@ -33,7 +31,7 @@ import (
type noopMergeWith struct{}

// NewNoopMergeWith creates a new noopMergeWith object. NoopMergeWith can be used
// in conjunction with the merge.Merger to generate copies of filesets
// in conjunction with the merge.Merger to generate copies of filesets.
func NewNoopMergeWith() MergeWith {
return &noopMergeWith{}
}
Expand Down

0 comments on commit e3ef775

Please sign in to comment.