Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs733
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sushant Mahajan
cs733
Commits
a8826caf
Commit
a8826caf
authored
Feb 04, 2015
by
Harshit Pande
Browse files
Options
Browse Files
Download
Plain Diff
commit channel monitor
parents
73daaa01
e0a060fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
assignment2/replic_kvstore.go
assignment2/replic_kvstore.go
+15
-2
No files found.
assignment2/replic_kvstore.go
View file @
a8826caf
...
@@ -50,6 +50,9 @@ type SharedLog interface {
...
@@ -50,6 +50,9 @@ type SharedLog interface {
type
Raft
struct
{
type
Raft
struct
{
//some good stuff needs to go here
//some good stuff needs to go here
commitCh
chan
*
LogEntryData
commitCh
chan
*
LogEntryData
cluster
*
ClusterConfig
//cluster
id
uint64
//leader
commitCh
chan
LogEntry
}
}
var
cluster_config
*
ClusterConfig
var
cluster_config
*
ClusterConfig
...
@@ -79,8 +82,18 @@ func (entry *LogEntryData) Committed() bool {
...
@@ -79,8 +82,18 @@ func (entry *LogEntryData) Committed() bool {
}
}
//make raft implement the append function
//make raft implement the append function
//func (raft *Raft) Append(data []byte) (LogEntry, error) {
func
(
raft
*
Raft
)
Append
(
data
[]
byte
)
(
LogEntry
,
error
)
{
//}
if
raft
.
server
.
Id
!=
0
{
return
nil
,
raft
.
Id
}
temp
:=
LogEntry
{
1
,
data
,
false
}
//broadcast to other servers
//wait for acks
//send commit on channel
raft
.
commitCh
<-
temp
}
func
AppendEntriesRPC
()
func
NewServerConfig
(
server_id
int
)
(
*
ServerConfig
,
error
)
{
func
NewServerConfig
(
server_id
int
)
(
*
ServerConfig
,
error
)
{
server
:=
new
(
ServerConfig
)
server
:=
new
(
ServerConfig
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment