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
73daaa01
Commit
73daaa01
authored
Feb 04, 2015
by
Harshit Pande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit channel monitor
parent
b7cb0294
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
assignment2/replic_kvstore.go
assignment2/replic_kvstore.go
+14
-2
No files found.
assignment2/replic_kvstore.go
View file @
73daaa01
...
@@ -26,7 +26,7 @@ type LogEntry interface {
...
@@ -26,7 +26,7 @@ type LogEntry interface {
}
}
type
LogEntryData
struct
{
type
LogEntryData
struct
{
id
uint64
id
Lsn
data
[]
byte
data
[]
byte
committed
bool
committed
bool
}
}
...
@@ -49,12 +49,24 @@ type SharedLog interface {
...
@@ -49,12 +49,24 @@ 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
}
}
var
cluster_config
*
ClusterConfig
var
cluster_config
*
ClusterConfig
//goroutine that monitors channel for commiting log entry
func
monitor_commitCh
(
c
<-
chan
*
LogEntryData
)
{
//unidirectional -- can only read from the channel
for
{
var
temp
*
LogEntryData
temp
=
<-
c
//receive from the channel
temp
.
committed
=
true
//now update key value store here
}
}
//make LogEntryData implement the
//make LogEntryData implement the
func
(
entry
*
LogEntryData
)
Lsn
()
uint64
{
func
(
entry
*
LogEntryData
)
Lsn
()
Lsn
{
return
entry
.
id
return
entry
.
id
}
}
...
...
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