Skip to content

Commit 5f32981

Browse files
spelling
1 parent 45276ce commit 5f32981

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

example/ClientServer/ClientServer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package main
22

33
import (
44
"fmt"
5-
"github.com/DistributedClocks/GoVector/govec"
65
"net"
76
"os"
87
"time"
8+
9+
"github.com/DistributedClocks/GoVector/govec"
910
)
1011

12+
//Hardcoded client/sever port values, and total messages sent
1113
const (
1214
SERVERPORT = "8080"
1315
CLIENTPORT = "8081"

example/MessagePack/MessagePackTests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"github.com/vmihailenco/msgpack"
88
)
99

10+
//ClockPayload is the wire type for vector clocks, and their
11+
//associated payloads
1012
type ClockPayload struct {
1113
Pid string
1214
VcMap map[string]uint64

govec/govec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
_ msgpack.CustomDecoder = (*VClockPayload)(nil)
2323
)
2424

25-
//LogPriority controls the minumum priority of logging events which
25+
//LogPriority controls the minimum priority of logging events which
2626
//will be logged.
2727
type LogPriority int
2828

@@ -58,7 +58,7 @@ var prefixLookup = [...]string{
5858
//input to GoLog initialization. See defaults in GetDefaultsConfig
5959
type GoLogConfig struct {
6060
//If true logging events are buffered until flushed. This option
61-
//increase logging performance at the cost of saftey.
61+
//increase logging performance at the cost of safety.
6262
Buffered bool
6363
//Logging events are printed to screen
6464
PrintOnScreen bool
@@ -273,7 +273,7 @@ func InitGoVector(processid string, logfilename string, config GoLogConfig) *GoL
273273
}
274274
print(config.EncodingStrategy)
275275

276-
//we create a new Vector Clock with processname and 0 as the intial time
276+
//we create a new Vector Clock with processname and 0 as the initial time
277277
vc1 := vclock.New()
278278
vc1.Tick(processid)
279279
gv.currentVC = vc1

govec/vclock/vclock.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ import (
1111
// and may be ORed together when being provided to the Compare method.
1212
type Condition int
1313

14+
//Constants define compairison conditions between pairs of vector
15+
//clocks
1416
const (
1517
Equal Condition = 1 << iota
1618
Ancestor
1719
Descendant
1820
Concurrent
1921
)
2022

23+
//Vector clocks are maps of string to uint64 where the string is the
24+
//id of the process, and the uint64 is the clock value
2125
type VClock map[string]uint64
2226

2327
//FindTicks returns the clock value for a given id, if a value is not
@@ -130,7 +134,7 @@ func (vc VClock) ReturnVCString() string {
130134
}
131135

132136
//Compare takes another clock and determines if it is Equal, an
133-
//Ancestor, Decendent, or Concurrent with the callees clock.
137+
//Ancestor, Descendant, or Concurrent with the callees clock.
134138
func (vc VClock) Compare(other VClock, cond Condition) bool {
135139
var otherIs Condition
136140
// Preliminary qualification based on length

govec/vrpc/vrpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func RPCDial(network, address string, logger *govec.GoLog) (*rpc.Client, error)
2424
return rpc.NewClientWithCodec(newClientCodec(conn, logger)), err
2525
}
2626

27-
//ServeRPCCon is a convenience function that accepts connections for a
27+
//ServerRPCCon is a convenience function that accepts connections for a
2828
//given listener and starts a new goroutine for the server to serve a
2929
//new connection. The logger is provided to be used by the
3030
//RPCServerCodec for message capture.

0 commit comments

Comments
 (0)