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
5219d33b
Commit
5219d33b
authored
Feb 11, 2015
by
Harshit Pande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation
parent
905de3df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
assignment2/src/server.go
assignment2/src/server.go
+6
-2
assignment2/src/server_test.go
assignment2/src/server_test.go
+2
-2
No files found.
assignment2/src/server.go
View file @
5219d33b
...
...
@@ -22,22 +22,26 @@ var rft *raft.Raft
//Receiver fot RPC
type
AppendEntries
struct
{}
//
encapsulate the return value of
RPC
//
receiver for testing
RPC
//only for testing purpose
type
Tester
struct
{}
//RPC argument for testing the replication of keys value version across key value stores
type
TestArgs
struct
{
key
string
value
[]
byte
version
uint64
}
// RPC argument with boolean value in the reply to confirm that indeed the replication went through across servers
type
TestReply
struct
{
replica_updated
bool
}
//only for testing purpose
//this function checks for the key value in its kvstore and sets replica_updated true if present and false if absent
//this function checks for the key value in its kvstore and sets reply.replica_updated true if present and false if absent
//arguments: args contains the key, value, version to be matched
//reply is the reply to be sent
func
(
t
*
Tester
)
testerRPC
(
args
*
TestArgs
,
reply
*
TestReply
)
error
{
table
:=
raft
.
GetKeyValStr
()
table
.
RLock
()
...
...
assignment2/src/server_test.go
View file @
5219d33b
...
...
@@ -28,11 +28,11 @@ type Testpair struct {
//
func
TestAll
(
t
*
testing
.
T
)
{
//start the servers
/*
for i := 1; i <= NUM_SERVERS; i++ {
for
i
:=
1
;
i
<=
NUM_SERVERS
;
i
++
{
go
testServersCommunic
(
i
,
t
)
}
//wait for some time so that servers are ready
time.Sleep(4 * time.Second)
*/
time
.
Sleep
(
4
*
time
.
Second
)
//run client that tries connecting to the followers
testConnectFollower
(
t
)
...
...
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