Commit 9ce5f1f1 authored by Sushant Mahajan's avatar Sushant Mahajan

Merge branch 'master' of git.cse.iitb.ac.in:smahajan/cs733

parents 8e8b83e4 3c6fa851
......@@ -15,6 +15,22 @@ const (
CLIENT_PORT = 9000
)
//type Lsn uint64 //Log sequence number, unique for all time.
type ErrRedirect int // See Log.Append. Implements Error interface.
type LogEntry interface {
Lsn() uint64
Data() []byte
Committed() bool
}
type LogEntryData struct {
Id uint64
Data []byte
Committed bool
}
type ServerConfig struct {
Id int // Id of server. Must be unique
Hostname string // name or ip of host
......@@ -31,6 +47,18 @@ type ErrRedirect int
var cluster_config *ClusterConfig
func Lsn(entry *LogEntryData) uint64 {
return entry.Id
}
func Data(entry *LogEntryData) []byte {
return entry.Data
}
func Committed(entry *LogEntryData) bool {
return entry.Committed
}
func NewServerConfig(server_id int) (*ServerConfig, error) {
this_server := new(ServerConfig)
this_server.Id = server_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment