Commit 24816db0 authored by Nickolai Zeldovich's avatar Nickolai Zeldovich

update

parent 45d6c0d2
package kvpaxos package kvpaxos
import "net/rpc" import "net/rpc"
import "time" import "fmt"
import "crypto/rand"
import "math/big"
type Clerk struct { type Clerk struct {
servers []string servers []string
...@@ -46,6 +44,8 @@ func call(srv string, rpcname string, ...@@ -46,6 +44,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
...@@ -65,6 +65,7 @@ func (ck *Clerk) Get(key string) string { ...@@ -65,6 +65,7 @@ func (ck *Clerk) Get(key string) string {
// //
func (ck *Clerk) PutExt(key string, value string, dohash bool) string { func (ck *Clerk) PutExt(key string, value string, dohash bool) string {
// You will have to modify this function. // You will have to modify this function.
return ""
} }
func (ck *Clerk) Put(key string, value string) { func (ck *Clerk) Put(key string, value string) {
......
package lockservice package lockservice
import "net/rpc" import "net/rpc"
import "fmt"
// //
// the lockservice Clerk lives in the client // the lockservice Clerk lives in the client
...@@ -48,6 +49,8 @@ func call(srv string, rpcname string, ...@@ -48,6 +49,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
This diff is collapsed.
package mapreduce package mapreduce
import "fmt"
import "net/rpc" import "net/rpc"
const ( const (
...@@ -67,5 +68,7 @@ func call(srv string, rpcname string, ...@@ -67,5 +68,7 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
...@@ -74,6 +74,8 @@ func call(srv string, name string, args interface{}, reply interface{}) bool { ...@@ -74,6 +74,8 @@ func call(srv string, name string, args interface{}, reply interface{}) bool {
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
...@@ -2,6 +2,7 @@ package pbservice ...@@ -2,6 +2,7 @@ package pbservice
import "viewservice" import "viewservice"
import "net/rpc" import "net/rpc"
import "fmt"
// You'll probably need to uncomment these: // You'll probably need to uncomment these:
// import "time" // import "time"
...@@ -53,6 +54,8 @@ func call(srv string, rpcname string, ...@@ -53,6 +54,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
...@@ -4,7 +4,7 @@ import "shardmaster" ...@@ -4,7 +4,7 @@ import "shardmaster"
import "net/rpc" import "net/rpc"
import "time" import "time"
import "sync" import "sync"
// import "fmt" import "fmt"
type Clerk struct { type Clerk struct {
mu sync.Mutex // one RPC at a time mu sync.Mutex // one RPC at a time
...@@ -50,6 +50,8 @@ func call(srv string, rpcname string, ...@@ -50,6 +50,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
...@@ -7,6 +7,7 @@ package shardmaster ...@@ -7,6 +7,7 @@ package shardmaster
import "net/rpc" import "net/rpc"
import "time" import "time"
import "fmt"
type Clerk struct { type Clerk struct {
servers []string // shardmaster replicas servers []string // shardmaster replicas
...@@ -46,6 +47,8 @@ func call(srv string, rpcname string, ...@@ -46,6 +47,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
...@@ -47,6 +47,8 @@ func call(srv string, rpcname string, ...@@ -47,6 +47,8 @@ func call(srv string, rpcname string,
if err == nil { if err == nil {
return true return true
} }
fmt.Println(err)
return false return false
} }
......
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