Skip to content

Commit

Permalink
docs: fixed various typos and grammatical errors (lni#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevburnsjr authored Sep 9, 2023
1 parent 54497b9 commit 3af07b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ type Config struct {
// SyncRequestSnapshot methods to manually request snapshots.
SnapshotEntries uint64
// CompactionOverhead defines the number of most recent entries to keep after
// each Raft log compaction. Raft log compaction is performance automatically
// every time when a snapshot is created.
// each Raft log compaction. Raft log compaction is performed automatically
// every time a snapshot is created.
//
// For example, when a snapshot is created at let's say index 10,000, then all
// Raft log entries with index <= 10,000 can be removed from that node as they
Expand All @@ -128,8 +128,8 @@ type Config struct {
// have to be sent to the follower if the follower requires any Raft log entry
// at index <= 10,000. When CompactionOverhead is set to say 500, Dragonboat
// then compacts the Raft log up to index 9,500 and keeps Raft log entries
// between index (9,500, 1,0000]. As a result, the node can still replicate
// Raft log entries between index (9,500, 1,0000] to other peers and only fall
// between index (9,500, 10,000]. As a result, the node can still replicate
// Raft log entries between index (9,500, 10,000] to other peers and only fall
// back to stream the full snapshot if any Raft log entry with index <= 9,500
// is required to be replicated.
CompactionOverhead uint64
Expand Down
16 changes: 8 additions & 8 deletions nodehost.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func (nh *NodeHost) GetNodeHostRegistry() (INodeHostRegistry, bool) {
// - joining a new node to an existing Raft shard, set join to true and leave
// the initialMembers map empty. This requires the joining node to have already
// been added as a member node of the Raft shard.
// - restarting an crashed or stopped node, set join to false and leave the
// - restarting a crashed or stopped node, set join to false and leave the
// initialMembers map to be empty. This applies to both initial member nodes
// and those joined later.
func (nh *NodeHost) StartReplica(initialMembers map[uint64]Target,
Expand Down Expand Up @@ -556,7 +556,7 @@ func (nh *NodeHost) StopReplica(shardID uint64, replicaID uint64) error {
}

// SyncPropose makes a synchronous proposal on the Raft shard specified by
// the input client session object. The specified context parameter must has
// the input client session object. The specified context parameter must have
// the timeout value set.
//
// SyncPropose returns the result returned by IStateMachine or
Expand Down Expand Up @@ -592,7 +592,7 @@ func (nh *NodeHost) SyncPropose(ctx context.Context,
}

// SyncRead performs a synchronous linearizable read on the specified Raft
// shard. The specified context parameter must has the timeout value set. The
// shard. The specified context parameter must have the timeout value set. The
// query interface{} specifies what to query, it will be passed to the Lookup
// method of the IStateMachine or IOnDiskStateMachine after the system
// determines that it is safe to perform the local read. It returns the query
Expand Down Expand Up @@ -646,9 +646,9 @@ type Membership struct {
Removed map[uint64]struct{}
}

// SyncGetShardMembership is a rsynchronous method that queries the membership
// SyncGetShardMembership is a synchronous method that queries the membership
// information from the specified Raft shard. The specified context parameter
// must has the timeout value set.
// must have the timeout value set.
func (nh *NodeHost) SyncGetShardMembership(ctx context.Context,
shardID uint64) (*Membership, error) {
v, err := nh.linearizableRead(ctx, shardID,
Expand Down Expand Up @@ -711,7 +711,7 @@ func (nh *NodeHost) GetNoOPSession(shardID uint64) *client.Session {

// SyncGetSession starts a synchronous proposal to create, register and return
// a new client session object for the specified Raft shard. The specified
// context parameter must has the timeout value set.
// context parameter must have the timeout value set.
//
// A client session object is used to ensure that a retried proposal, e.g.
// proposal retried after timeout, will not be applied more than once into the
Expand Down Expand Up @@ -747,7 +747,7 @@ func (nh *NodeHost) SyncGetSession(ctx context.Context,

// SyncCloseSession closes the specified client session by unregistering it
// from the system in a synchronous manner. The specified context parameter
// must has the timeout value set.
// must have the timeout value set.
//
// Closed client session should not be used in future proposals.
func (nh *NodeHost) SyncCloseSession(ctx context.Context,
Expand Down Expand Up @@ -919,7 +919,7 @@ func (nh *NodeHost) StaleRead(shardID uint64,
// SyncRequestSnapshot is the synchronous variant of the RequestSnapshot
// method. See RequestSnapshot for more details.
//
// The input context object must has deadline set.
// The input context object must have deadline set.
//
// SyncRequestSnapshot returns the index of the created snapshot or the error
// encountered.
Expand Down
6 changes: 3 additions & 3 deletions statemachine/rsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ type SnapshotFile struct {
// IStateMachine instance recovers from the saved snapshot.
type ISnapshotFileCollection interface {
// AddFile adds an external file to the snapshot being currently generated.
// The file must has been finalized meaning its content will not change in
// The file must have been finalized meaning its content will not change in
// the future. It is your application's responsibility to make sure that the
// file being added can be accessible from the current process and it is
// file being added is accessible from the current process and it is
// possible to create a hard link to it from the NodeHostDir directory
// specified in NodeHost's NodeHostConfig. The file to be added is identified
// by the specified fileID. The metadata byte slice is the metadata of the
// file being added, it can be the checksum of the file, file type, file name,
// file being added. It can be the checksum of the file, file type, file name,
// other file hierarchy information, or a serialized combination of such
// metadata.
AddFile(fileID uint64, path string, metadata []byte)
Expand Down

0 comments on commit 3af07b0

Please sign in to comment.