Commit bc1485a8 authored by Ellis Michael's avatar Ellis Michael

Factoring imports

parent 0efcbed7
package diskv
import "shardmaster"
import "net/rpc"
import "time"
import "sync"
import "fmt"
import "crypto/rand"
import "math/big"
import (
"crypto/rand"
"fmt"
"math/big"
"net/rpc"
"sync"
"time"
"shardmaster"
)
type Clerk struct {
mu sync.Mutex // one RPC at a time
......
package diskv
import "net"
import "fmt"
import "net/rpc"
import "log"
import "time"
import "paxos"
import "sync"
import "sync/atomic"
import "os"
import "syscall"
import "encoding/gob"
import "encoding/base32"
import "math/rand"
import "shardmaster"
import "io/ioutil"
import "strconv"
import (
"encoding/base32"
"encoding/gob"
"fmt"
"io/ioutil"
"log"
"math/rand"
"net"
"net/rpc"
"os"
"strconv"
"sync"
"sync/atomic"
"syscall"
"time"
"paxos"
"shardmaster"
)
const Debug = 0
......
package diskv
import "testing"
import "shardmaster"
import "runtime"
import "strconv"
import "strings"
import "os"
import "os/exec"
import "time"
import "fmt"
import "sync"
import "io/ioutil"
import "log"
import "math/rand"
import crand "crypto/rand"
import "encoding/base64"
import "path/filepath"
import "sync/atomic"
import (
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
crand "crypto/rand"
"shardmaster"
)
type tServer struct {
p *os.Process
......
package kvpaxos
import "net/rpc"
import "crypto/rand"
import "math/big"
import "fmt"
import (
"crypto/rand"
"fmt"
"math/big"
"net/rpc"
)
type Clerk struct {
servers []string
......
package kvpaxos
import "net"
import "fmt"
import "net/rpc"
import "log"
import "paxos"
import "sync"
import "sync/atomic"
import "os"
import "syscall"
import "encoding/gob"
import "math/rand"
import (
"encoding/gob"
"fmt"
"log"
"math/rand"
"net"
"net/rpc"
"os"
"sync"
"sync/atomic"
"syscall"
"paxos"
)
const Debug = 0
......
package kvpaxos
import "testing"
import "runtime"
import "strconv"
import "os"
import "time"
import "fmt"
import "math/rand"
import "strings"
import "sync/atomic"
import (
"fmt"
"math/rand"
"os"
"runtime"
"strconv"
"strings"
"sync/atomic"
"testing"
"time"
)
func check(t *testing.T, ck *Clerk, key string, value string) {
v := ck.Get(key)
......
package lockservice
import "net/rpc"
import "fmt"
import (
"fmt"
"net/rpc"
)
//
// the lockservice Clerk lives in the client
......
package lockservice
import "net"
import "net/rpc"
import "log"
import "sync"
import "fmt"
import "os"
import "io"
import "time"
import (
"fmt"
"io"
"log"
"net"
"net/rpc"
"os"
"sync"
"time"
)
type LockServer struct {
mu sync.Mutex
......
package lockservice
import "testing"
import "runtime"
import "math/rand"
import "os"
import "strconv"
import "time"
import "fmt"
import (
"fmt"
"math/rand"
"os"
"runtime"
"strconv"
"testing"
"time"
)
func tl(t *testing.T, ck *Clerk, lockname string, expected bool) {
x := ck.Lock(lockname)
......
......@@ -15,12 +15,14 @@ package main
// -d directory
// -r restart
import "time"
import "diskv"
import "os"
import "fmt"
import "strconv"
import "runtime"
import (
"diskv"
"fmt"
"os"
"runtime"
"strconv"
"time"
)
func usage() {
fmt.Printf("Usage: diskvd -g gid -m master... -s server... -i my-index -d dir\n")
......
......@@ -4,9 +4,12 @@ package main
// see comments in lockd.go
//
import "lockservice"
import "os"
import "fmt"
import (
"fmt"
"os"
"lockservice"
)
func usage() {
fmt.Printf("Usage: lockc -l|-u primaryport backupport lockname\n")
......
......@@ -11,10 +11,13 @@ package main
// on Athena, use /tmp/myname-a and /tmp/myname-b
// instead of a and b.
import "time"
import "lockservice"
import "os"
import "fmt"
import (
"fmt"
"os"
"time"
"lockservice"
)
func main() {
if len(os.Args) == 4 && os.Args[1] == "-p" {
......
......@@ -18,9 +18,12 @@ package main
// and restart them to exercise fault tolerance.
//
import "pbservice"
import "os"
import "fmt"
import (
"fmt"
"os"
"pbservice"
)
func usage() {
fmt.Printf("Usage: pbc viewport key\n")
......
......@@ -4,10 +4,13 @@ package main
// see directions in pbc.go
//
import "time"
import "pbservice"
import "os"
import "fmt"
import (
"fmt"
"os"
"time"
"pbservice"
)
func main() {
if len(os.Args) != 3 {
......
......@@ -4,10 +4,13 @@ package main
// see directions in pbc.go
//
import "time"
import "viewservice"
import "os"
import "fmt"
import (
"fmt"
"os"
"time"
"viewservice"
)
func main() {
if len(os.Args) != 2 {
......
package main
import "os"
import "fmt"
import "mapreduce"
import (
"container/list"
"fmt"
"os"
import "container/list"
"mapreduce"
)
// our simplified version of MapReduce does not supply a
// key to the Map function, as in the paper; only a value,
......
package mapreduce
import "fmt"
import "net/rpc"
import (
"fmt"
"net/rpc"
)
const (
Map = "Map"
......
package mapreduce
import "fmt"
import "os"
import "log"
import "strconv"
import "encoding/json"
import "sort"
import "container/list"
import "net/rpc"
import "net"
import "bufio"
import "hash/fnv"
// import "os/exec"
import (
"bufio"
"container/list"
"encoding/json"
"fmt"
"hash/fnv"
"log"
"net"
"net/rpc"
"os"
"sort"
"strconv"
)
// A simple mapreduce library with a sequential implementation.
//
......
package mapreduce
import "container/list"
import "fmt"
import (
"container/list"
"fmt"
)
type WorkerInfo struct {
address string
......
package mapreduce
import "testing"
import "fmt"
import "time"
import "container/list"
import "strings"
import "os"
import "bufio"
import "log"
import "sort"
import "strconv"
import (
"bufio"
"container/list"
"fmt"
"log"
"os"
"sort"
"strconv"
"strings"
"testing"
"time"
)
const (
nNumber = 100000
......
package mapreduce
import "fmt"
import "os"
import "log"
import "net/rpc"
import "net"
import "container/list"
import (
"container/list"
"fmt"
"log"
"net"
"net/rpc"
"os"
)
// Worker is a server waiting for DoJob or Shutdown RPCs
......
......@@ -20,16 +20,17 @@ package paxos
// px.Min() int -- instances before this seq have been forgotten
//
import "net"
import "net/rpc"
import "log"
import "os"
import "syscall"
import "sync"
import "sync/atomic"
import "fmt"
import "math/rand"
import (
"fmt"
"log"
"math/rand"
"net"
"net/rpc"
"os"
"sync"
"sync/atomic"
"syscall"
)
// px.Status() return values, indicating
// whether an agreement has been decided,
......
package paxos
import "testing"
import "runtime"
import "strconv"
import "os"
import "time"
import "fmt"
import "math/rand"
import crand "crypto/rand"
import "encoding/base64"
import "sync/atomic"
import (
"encoding/base64"
"fmt"
"math/rand"
"os"
"runtime"
"strconv"
"sync/atomic"
"testing"
"time"
crand "crypto/rand"
)
func randstring(n int) string {
b := make([]byte, 2*n)
......
package pbservice
import "viewservice"
import "net/rpc"
import "fmt"
import "crypto/rand"
import "math/big"
import (
"crypto/rand"
"fmt"
"math/big"
"net/rpc"
"viewservice"
)
type Clerk struct {
vs *viewservice.Clerk
......
package pbservice
import "net"
import "fmt"
import "net/rpc"
import "log"
import "time"
import "viewservice"
import "sync"
import "sync/atomic"
import "os"
import "syscall"
import "math/rand"
import (
"fmt"
"log"
"math/rand"
"net"
"net/rpc"
"os"
"sync"
"sync/atomic"
"syscall"
"time"
"viewservice"
)
type PBServer struct {
mu sync.Mutex
......
package pbservice
import "viewservice"
import "fmt"
import "io"
import "net"
import "testing"
import "time"
import "log"
import "runtime"
import "math/rand"
import "os"
import "sync"
import "strconv"
import "strings"
import "sync/atomic"
import (
"fmt"
"io"
"log"
"math/rand"
"net"
"os"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
"viewservice"
)
func check(ck *Clerk, key string, value string) {
v := ck.Get(key)
......
package shardkv
import "shardmaster"
import "net/rpc"
import "time"
import "sync"
import "fmt"
import "crypto/rand"
import "math/big"
import (
"crypto/rand"
"fmt"