Commit a212f611 authored by Sushant Mahajan's avatar Sushant Mahajan

rearranged structs and functions

parent bde95ec0
......@@ -2,12 +2,9 @@ package main
import (
"fmt"
<<<<<<< HEAD
=======
"log"
"net"
"net/rpc"
>>>>>>> 67cd155b37c8122a61dfc1cfdaead50ea7f5729a
"os"
"reflect"
"strconv"
......@@ -57,6 +54,12 @@ type Raft struct {
id int //this server id
}
type Args struct {
X int
}
type AppendEntries struct{}
var cluster_config *ClusterConfig
func NewRaft(config *ClusterConfig, thisServerId int, commitCh chan LogEntry) (*Raft, error) {
......@@ -108,14 +111,6 @@ func (raft *Raft) Append(data []byte) (LogEntry, error) {
return temp, nil
}
type RPChandle struct {
}
func (r *RPChandle) AppendEntriesRPC(log_entry LogEntryData) bool {
return true
}
func NewServerConfig(server_id int) (*ServerConfig, error) {
server := new(ServerConfig)
server.Id = server_id
......@@ -146,12 +141,6 @@ func start_rpc(this_server *ServerConfig) {
//rpc.Register()
}
type Args struct {
X int
}
type AppendEntries struct{}
func (t *AppendEntries) AppendEntriesRPC(args *Args, reply *int) error {
*reply = args.X
return nil
......
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