From 7903ffe93feeff92970b994c67db8bcf0efdda68 Mon Sep 17 00:00:00 2001 From: John McCann Cunniff Jr Date: Wed, 29 Sep 2021 11:13:55 -0400 Subject: [PATCH 1/4] CHG go modules --- src/.gitignore => .gitignore | 6 ++++++ {src/diskv => diskv}/client.go | 0 {src/diskv => diskv}/common.go | 0 {src/diskv => diskv}/server.go | 0 {src/diskv => diskv}/test_test.go | 0 src/main/diskvd.go => diskvd.go | 0 go.mod | 6 ++++++ {src/kvpaxos => kvpaxos}/client.go | 0 {src/kvpaxos => kvpaxos}/common.go | 0 {src/kvpaxos => kvpaxos}/server.go | 0 {src/kvpaxos => kvpaxos}/test_test.go | 0 src/main/lockc.go => lockc.go | 0 src/main/lockd.go => lockd.go | 0 {src/lockservice => lockservice}/client.go | 0 {src/lockservice => lockservice}/common.go | 0 {src/lockservice => lockservice}/server.go | 0 {src/lockservice => lockservice}/test_test.go | 0 {src/mapreduce => mapreduce}/common.go | 0 {src/mapreduce => mapreduce}/mapreduce.go | 0 {src/mapreduce => mapreduce}/master.go | 0 {src/mapreduce => mapreduce}/test_test.go | 0 {src/mapreduce => mapreduce}/worker.go | 0 {src/paxos => paxos}/paxos.go | 0 {src/paxos => paxos}/test_test.go | 0 src/main/pbc.go => pbc.go | 0 src/main/pbd.go => pbd.go | 0 {src/pbservice => pbservice}/client.go | 0 {src/pbservice => pbservice}/common.go | 0 {src/pbservice => pbservice}/server.go | 0 {src/pbservice => pbservice}/test_test.go | 0 {src/shardkv => shardkv}/client.go | 0 {src/shardkv => shardkv}/common.go | 0 {src/shardkv => shardkv}/server.go | 0 {src/shardkv => shardkv}/test_test.go | 0 {src/shardmaster => shardmaster}/client.go | 0 {src/shardmaster => shardmaster}/common.go | 0 {src/shardmaster => shardmaster}/server.go | 0 {src/shardmaster => shardmaster}/test_test.go | 0 src/main/test-wc.sh => test-wc.sh | 4 ++-- {src/main => txt}/kjv12.txt | 0 {src/main => txt}/mr-testout.txt | 0 src/main/viewd.go => viewd.go | 0 {src/viewservice => viewservice}/client.go | 0 {src/viewservice => viewservice}/common.go | 0 {src/viewservice => viewservice}/server.go | 0 {src/viewservice => viewservice}/test_test.go | 0 src/main/wc.go => wc.go | 2 +- 47 files changed, 15 insertions(+), 3 deletions(-) rename src/.gitignore => .gitignore (58%) rename {src/diskv => diskv}/client.go (100%) rename {src/diskv => diskv}/common.go (100%) rename {src/diskv => diskv}/server.go (100%) rename {src/diskv => diskv}/test_test.go (100%) rename src/main/diskvd.go => diskvd.go (100%) create mode 100644 go.mod rename {src/kvpaxos => kvpaxos}/client.go (100%) rename {src/kvpaxos => kvpaxos}/common.go (100%) rename {src/kvpaxos => kvpaxos}/server.go (100%) rename {src/kvpaxos => kvpaxos}/test_test.go (100%) rename src/main/lockc.go => lockc.go (100%) rename src/main/lockd.go => lockd.go (100%) rename {src/lockservice => lockservice}/client.go (100%) rename {src/lockservice => lockservice}/common.go (100%) rename {src/lockservice => lockservice}/server.go (100%) rename {src/lockservice => lockservice}/test_test.go (100%) rename {src/mapreduce => mapreduce}/common.go (100%) rename {src/mapreduce => mapreduce}/mapreduce.go (100%) rename {src/mapreduce => mapreduce}/master.go (100%) rename {src/mapreduce => mapreduce}/test_test.go (100%) rename {src/mapreduce => mapreduce}/worker.go (100%) rename {src/paxos => paxos}/paxos.go (100%) rename {src/paxos => paxos}/test_test.go (100%) rename src/main/pbc.go => pbc.go (100%) rename src/main/pbd.go => pbd.go (100%) rename {src/pbservice => pbservice}/client.go (100%) rename {src/pbservice => pbservice}/common.go (100%) rename {src/pbservice => pbservice}/server.go (100%) rename {src/pbservice => pbservice}/test_test.go (100%) rename {src/shardkv => shardkv}/client.go (100%) rename {src/shardkv => shardkv}/common.go (100%) rename {src/shardkv => shardkv}/server.go (100%) rename {src/shardkv => shardkv}/test_test.go (100%) rename {src/shardmaster => shardmaster}/client.go (100%) rename {src/shardmaster => shardmaster}/common.go (100%) rename {src/shardmaster => shardmaster}/server.go (100%) rename {src/shardmaster => shardmaster}/test_test.go (100%) rename src/main/test-wc.sh => test-wc.sh (60%) mode change 100644 => 100755 rename {src/main => txt}/kjv12.txt (100%) rename {src/main => txt}/mr-testout.txt (100%) rename src/main/viewd.go => viewd.go (100%) rename {src/viewservice => viewservice}/client.go (100%) rename {src/viewservice => viewservice}/common.go (100%) rename {src/viewservice => viewservice}/server.go (100%) rename {src/viewservice => viewservice}/test_test.go (100%) rename src/main/wc.go => wc.go (97%) diff --git a/src/.gitignore b/.gitignore similarity index 58% rename from src/.gitignore rename to .gitignore index 7f88ba6..c5215c3 100644 --- a/src/.gitignore +++ b/.gitignore @@ -1,5 +1,11 @@ +*.*/ mrtmp.* +824-mrinput-*.txt /main/diff.out /mapreduce/x.txt /pbservice/x.txt /kvpaxos/x.txt +diff.out +.idea +.vscode +.theia \ No newline at end of file diff --git a/src/diskv/client.go b/diskv/client.go similarity index 100% rename from src/diskv/client.go rename to diskv/client.go diff --git a/src/diskv/common.go b/diskv/common.go similarity index 100% rename from src/diskv/common.go rename to diskv/common.go diff --git a/src/diskv/server.go b/diskv/server.go similarity index 100% rename from src/diskv/server.go rename to diskv/server.go diff --git a/src/diskv/test_test.go b/diskv/test_test.go similarity index 100% rename from src/diskv/test_test.go rename to diskv/test_test.go diff --git a/src/main/diskvd.go b/diskvd.go similarity index 100% rename from src/main/diskvd.go rename to diskvd.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..103caa5 --- /dev/null +++ b/go.mod @@ -0,0 +1,6 @@ +module golabs + +go 1.17 + +require ( +) diff --git a/src/kvpaxos/client.go b/kvpaxos/client.go similarity index 100% rename from src/kvpaxos/client.go rename to kvpaxos/client.go diff --git a/src/kvpaxos/common.go b/kvpaxos/common.go similarity index 100% rename from src/kvpaxos/common.go rename to kvpaxos/common.go diff --git a/src/kvpaxos/server.go b/kvpaxos/server.go similarity index 100% rename from src/kvpaxos/server.go rename to kvpaxos/server.go diff --git a/src/kvpaxos/test_test.go b/kvpaxos/test_test.go similarity index 100% rename from src/kvpaxos/test_test.go rename to kvpaxos/test_test.go diff --git a/src/main/lockc.go b/lockc.go similarity index 100% rename from src/main/lockc.go rename to lockc.go diff --git a/src/main/lockd.go b/lockd.go similarity index 100% rename from src/main/lockd.go rename to lockd.go diff --git a/src/lockservice/client.go b/lockservice/client.go similarity index 100% rename from src/lockservice/client.go rename to lockservice/client.go diff --git a/src/lockservice/common.go b/lockservice/common.go similarity index 100% rename from src/lockservice/common.go rename to lockservice/common.go diff --git a/src/lockservice/server.go b/lockservice/server.go similarity index 100% rename from src/lockservice/server.go rename to lockservice/server.go diff --git a/src/lockservice/test_test.go b/lockservice/test_test.go similarity index 100% rename from src/lockservice/test_test.go rename to lockservice/test_test.go diff --git a/src/mapreduce/common.go b/mapreduce/common.go similarity index 100% rename from src/mapreduce/common.go rename to mapreduce/common.go diff --git a/src/mapreduce/mapreduce.go b/mapreduce/mapreduce.go similarity index 100% rename from src/mapreduce/mapreduce.go rename to mapreduce/mapreduce.go diff --git a/src/mapreduce/master.go b/mapreduce/master.go similarity index 100% rename from src/mapreduce/master.go rename to mapreduce/master.go diff --git a/src/mapreduce/test_test.go b/mapreduce/test_test.go similarity index 100% rename from src/mapreduce/test_test.go rename to mapreduce/test_test.go diff --git a/src/mapreduce/worker.go b/mapreduce/worker.go similarity index 100% rename from src/mapreduce/worker.go rename to mapreduce/worker.go diff --git a/src/paxos/paxos.go b/paxos/paxos.go similarity index 100% rename from src/paxos/paxos.go rename to paxos/paxos.go diff --git a/src/paxos/test_test.go b/paxos/test_test.go similarity index 100% rename from src/paxos/test_test.go rename to paxos/test_test.go diff --git a/src/main/pbc.go b/pbc.go similarity index 100% rename from src/main/pbc.go rename to pbc.go diff --git a/src/main/pbd.go b/pbd.go similarity index 100% rename from src/main/pbd.go rename to pbd.go diff --git a/src/pbservice/client.go b/pbservice/client.go similarity index 100% rename from src/pbservice/client.go rename to pbservice/client.go diff --git a/src/pbservice/common.go b/pbservice/common.go similarity index 100% rename from src/pbservice/common.go rename to pbservice/common.go diff --git a/src/pbservice/server.go b/pbservice/server.go similarity index 100% rename from src/pbservice/server.go rename to pbservice/server.go diff --git a/src/pbservice/test_test.go b/pbservice/test_test.go similarity index 100% rename from src/pbservice/test_test.go rename to pbservice/test_test.go diff --git a/src/shardkv/client.go b/shardkv/client.go similarity index 100% rename from src/shardkv/client.go rename to shardkv/client.go diff --git a/src/shardkv/common.go b/shardkv/common.go similarity index 100% rename from src/shardkv/common.go rename to shardkv/common.go diff --git a/src/shardkv/server.go b/shardkv/server.go similarity index 100% rename from src/shardkv/server.go rename to shardkv/server.go diff --git a/src/shardkv/test_test.go b/shardkv/test_test.go similarity index 100% rename from src/shardkv/test_test.go rename to shardkv/test_test.go diff --git a/src/shardmaster/client.go b/shardmaster/client.go similarity index 100% rename from src/shardmaster/client.go rename to shardmaster/client.go diff --git a/src/shardmaster/common.go b/shardmaster/common.go similarity index 100% rename from src/shardmaster/common.go rename to shardmaster/common.go diff --git a/src/shardmaster/server.go b/shardmaster/server.go similarity index 100% rename from src/shardmaster/server.go rename to shardmaster/server.go diff --git a/src/shardmaster/test_test.go b/shardmaster/test_test.go similarity index 100% rename from src/shardmaster/test_test.go rename to shardmaster/test_test.go diff --git a/src/main/test-wc.sh b/test-wc.sh old mode 100644 new mode 100755 similarity index 60% rename from src/main/test-wc.sh rename to test-wc.sh index 29ea0da..3abfe54 --- a/src/main/test-wc.sh +++ b/test-wc.sh @@ -1,6 +1,6 @@ #!/bin/bash -go run wc.go master kjv12.txt sequential -sort -n -k2 mrtmp.kjv12.txt | tail -10 | diff - mr-testout.txt > diff.out +go run wc.go master txt/kjv12.txt sequential +sort -n -k2 mrtmp.kjv12.txt | tail -10 | diff - txt/mr-testout.txt > diff.out if [ -s diff.out ] then echo "Failed test. Output should be as in mr-testout.txt. Your output differs as follows (from diff.out):" diff --git a/src/main/kjv12.txt b/txt/kjv12.txt similarity index 100% rename from src/main/kjv12.txt rename to txt/kjv12.txt diff --git a/src/main/mr-testout.txt b/txt/mr-testout.txt similarity index 100% rename from src/main/mr-testout.txt rename to txt/mr-testout.txt diff --git a/src/main/viewd.go b/viewd.go similarity index 100% rename from src/main/viewd.go rename to viewd.go diff --git a/src/viewservice/client.go b/viewservice/client.go similarity index 100% rename from src/viewservice/client.go rename to viewservice/client.go diff --git a/src/viewservice/common.go b/viewservice/common.go similarity index 100% rename from src/viewservice/common.go rename to viewservice/common.go diff --git a/src/viewservice/server.go b/viewservice/server.go similarity index 100% rename from src/viewservice/server.go rename to viewservice/server.go diff --git a/src/viewservice/test_test.go b/viewservice/test_test.go similarity index 100% rename from src/viewservice/test_test.go rename to viewservice/test_test.go diff --git a/src/main/wc.go b/wc.go similarity index 97% rename from src/main/wc.go rename to wc.go index 3846bad..d510cdd 100644 --- a/src/main/wc.go +++ b/wc.go @@ -2,7 +2,7 @@ package main import "os" import "fmt" -import "mapreduce" +import "golabs/mapreduce" import "container/list" From b994bf1961c2001b977e28a7acf12cb27c8c5051 Mon Sep 17 00:00:00 2001 From: John McCann Cunniff Jr Date: Tue, 5 Oct 2021 13:21:12 -0400 Subject: [PATCH 2/4] FIX txt thing --- txt/kjv12.txt => kjv12.txt | 0 txt/mr-testout.txt => mr-testout.txt | 0 test-wc.sh | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename txt/kjv12.txt => kjv12.txt (100%) rename txt/mr-testout.txt => mr-testout.txt (100%) diff --git a/txt/kjv12.txt b/kjv12.txt similarity index 100% rename from txt/kjv12.txt rename to kjv12.txt diff --git a/txt/mr-testout.txt b/mr-testout.txt similarity index 100% rename from txt/mr-testout.txt rename to mr-testout.txt diff --git a/test-wc.sh b/test-wc.sh index 3abfe54..29ea0da 100755 --- a/test-wc.sh +++ b/test-wc.sh @@ -1,6 +1,6 @@ #!/bin/bash -go run wc.go master txt/kjv12.txt sequential -sort -n -k2 mrtmp.kjv12.txt | tail -10 | diff - txt/mr-testout.txt > diff.out +go run wc.go master kjv12.txt sequential +sort -n -k2 mrtmp.kjv12.txt | tail -10 | diff - mr-testout.txt > diff.out if [ -s diff.out ] then echo "Failed test. Output should be as in mr-testout.txt. Your output differs as follows (from diff.out):" From a1872c2c2769a770351caea7e950bdcb670003d9 Mon Sep 17 00:00:00 2001 From: Gustavo Sandoval Date: Tue, 12 Oct 2021 11:22:48 -0400 Subject: [PATCH 3/4] Fix Line 127 typo. Line 127 was missing a %s --- mapreduce/mapreduce.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapreduce/mapreduce.go b/mapreduce/mapreduce.go index 470e6f1..485bff5 100644 --- a/mapreduce/mapreduce.go +++ b/mapreduce/mapreduce.go @@ -124,7 +124,7 @@ func (mr *MapReduce) StartRegistrationServer() { conn.Close() }() } else { - DPrintf("RegistrationServer: accept error", err) + DPrintf("RegistrationServer: accept error %s", err) break } } From 8989ad07ee03b03f42cfdb5baaf198c275a6005a Mon Sep 17 00:00:00 2001 From: John McCann Cunniff Jr Date: Wed, 13 Oct 2021 17:48:31 -0400 Subject: [PATCH 4/4] ADD theia debugging --- .gitignore | 3 --- .theia/launch.json | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .theia/launch.json diff --git a/.gitignore b/.gitignore index c5215c3..c147807 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -*.*/ mrtmp.* 824-mrinput-*.txt /main/diff.out @@ -7,5 +6,3 @@ mrtmp.* /kvpaxos/x.txt diff.out .idea -.vscode -.theia \ No newline at end of file diff --git a/.theia/launch.json b/.theia/launch.json new file mode 100644 index 0000000..8f4e277 --- /dev/null +++ b/.theia/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + "version": "0.2.0", + "configurations": [ + { + "name": "wc.go", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/wc.go", + "env": {}, + "args": ["master", "kjv12.txt", "sequential"], + "showLog": false + } + ] +}