diff --git a/Controller.java b/Controller.java index d3fe6ff825dd111110f0b9ae66d32ce7899f15d0..cbfe8fc675d7cd8ff4be73649f240802f640df6a 100644 --- a/Controller.java +++ b/Controller.java @@ -192,19 +192,13 @@ public class Controller { protected class RebalanceThread implements Runnable { public void run() { while(true) { - if(rebalanceLock.waitToRebalance()) { - //Another dstore joined, it requested a rebalance - try {runRebalance();} catch(Exception e) {e.printStackTrace();} - } - else { - //Timeout occured, i.e. rebalancePeriod has passed since the last rebalance - try { - if(dstores.size() >= rFactor) { - runRebalance(); - } + rebalanceLock.waitToRebalance(); + try { + if(dstores.size() >= rFactor) { + runRebalance(); } - catch(Exception e) {e.printStackTrace();} } + catch(Exception e) {e.printStackTrace();} } } @@ -312,12 +306,13 @@ public class Controller { String message = Protocol.STORE_TO_TOKEN; for(Integer thisStore : storesToStore) { message = message + " " + thisStore.intValue(); + IndexEntry entryf = entry; new Thread(() -> { try { - String[] receivedMessage = dstores.get(thisStore).receive(Protocol.STORE_ACK_TOKEN).split(" "); + String[] receivedMessage = dstores.get(thisStore).receive(Protocol.STORE_ACK_TOKEN + " " + filename).split(" "); if(receivedMessage[0].equals(Protocol.STORE_ACK_TOKEN)) { try { - storeAck(thisStore, receivedMessage[1], latch); + storeAck(thisStore, entryf, latch); } catch(Exception e) { //Log error @@ -334,6 +329,9 @@ public class Controller { e.printStackTrace(); removeDstore(e); } + catch(DeadStoreException e) { + System.err.println("Store for " + filename + " failed due to dead dstore"); + } }).start(); } out.println(message); @@ -365,14 +363,8 @@ public class Controller { } } - void storeAck(Integer port, String filename, CountDownLatch latch) throws Exception { - if(!index.containsKey(filename)) { - //Throw logging exception - throw new Exception("Index does not contain " + filename); - } - - IndexEntry thisEntry = index.get(filename); - thisEntry.addStoredBy(port); + void storeAck(Integer port, IndexEntry entry, CountDownLatch latch) throws Exception { + entry.addStoredBy(port); latch.countDown(); } @@ -409,16 +401,21 @@ public class Controller { void sendLoadFrom(Socket client, String filename) { try { PrintWriter out = new PrintWriter(client.getOutputStream()); - Reloader storedBy = loadRequests.get(client); - System.out.println("Load requested for file " + filename + ", there are " + storedBy.size() + " dstores to select from"); String message; - if(storedBy.isEmpty()) { - message = Protocol.ERROR_LOAD_TOKEN; + if(!index.containsKey(filename) || index.get(filename).getStatus() != IndexEntry.Status.STORE_COMPLETE) { + message = Protocol.ERROR_FILE_DOES_NOT_EXIST_TOKEN; } else { - Integer thisStore = storedBy.get(0); - storedBy.remove(thisStore); - message = Protocol.LOAD_FROM_TOKEN + thisStore + " " + storedBy.filesize; + Reloader storedBy = loadRequests.get(client); + System.out.println("Load requested for file " + filename + ", there are " + storedBy.size() + " dstores to select from"); + if(storedBy.isEmpty()) { + message = Protocol.ERROR_LOAD_TOKEN; + } + else { + Integer thisStore = storedBy.get(0); + storedBy.remove(thisStore); + message = Protocol.LOAD_FROM_TOKEN + thisStore + " " + storedBy.filesize; + } } out.println(message); out.flush(); @@ -464,7 +461,7 @@ public class Controller { Integer dstore = it.next(); new Thread(() -> { try { - String[] message = dstores.get(dstore).sendAndReceive(Protocol.REMOVE_TOKEN + " " + filename, Protocol.REMOVE_ACK_TOKEN, Protocol.ERROR_FILE_DOES_NOT_EXIST_TOKEN).split(" "); + String[] message = dstores.get(dstore).sendAndReceive(Protocol.REMOVE_TOKEN + " " + filename, Protocol.REMOVE_ACK_TOKEN + " " + filename, Protocol.ERROR_FILE_DOES_NOT_EXIST_TOKEN).split(" "); if((message[0].equals(Protocol.REMOVE_ACK_TOKEN) && message[1].equals(filename)) || message[0].equals(Protocol.ERROR_FILE_DOES_NOT_EXIST_TOKEN)) { entry.removeStoredBy(dstore.intValue()); latch.countDown(); @@ -478,26 +475,30 @@ public class Controller { e.printStackTrace(); removeDstore(e); } + catch(DeadStoreException e) { + System.err.println("Remove for " + filename + " failed due to dead dstore"); + } }).start(); } //Wait for REMOVE_ACKs from all Dstores which were sent the REMOVE message - if(!latch.await(timeout, TimeUnit.MILLISECONDS)) { + if(latch.await(timeout, TimeUnit.MILLISECONDS)) { + //Update index to "remove complete" + entry.setStatus(IndexEntry.Status.REMOVE_COMPLETE); + synchronized(index) { + if(index.get(filename) == entry) index.remove(filename); + } + + //Send REMOVE_COMPLETE to client + PrintWriter clientOut = new PrintWriter(client.getOutputStream()); + clientOut.println(Protocol.REMOVE_COMPLETE_TOKEN); + clientOut.flush(); + messageSent(client, Protocol.REMOVE_COMPLETE_TOKEN); + } + else { //Log error System.err.println("Not all REMOVE_ACKs have been received"); } - - //Update index to "remove complete" - entry.setStatus(IndexEntry.Status.REMOVE_COMPLETE); - synchronized(index) { - if(index.get(filename) == entry) index.remove(filename); - } - - //Send REMOVE_COMPLETE to client - PrintWriter clientOut = new PrintWriter(client.getOutputStream()); - clientOut.println(Protocol.REMOVE_COMPLETE_TOKEN); - clientOut.flush(); - messageSent(client, Protocol.REMOVE_COMPLETE_TOKEN); } catch(IOException e) { e.printStackTrace(); @@ -549,6 +550,7 @@ public class Controller { removeDstore(e); listLatch.countDown(); } + catch(DeadStoreException e) {} }); thisThread.start(); activeThreads.add(thisThread); @@ -572,7 +574,7 @@ public class Controller { } catch(Exception e) {e.printStackTrace();} - if(dstoreFiles.isEmpty()) throw new Exception("All dstores have been disconnected!"); + if(dstoreFiles.size() < rFactor) throw new Exception("Less than R dstores connected; connections may be faulty or timeout may be too strict"); Map<Integer,List<String>> newAlloc = allocate(dstoreFiles); Map<Integer,String> sendIndex = composeRebalanceMessages(dstoreFiles, newAlloc); @@ -644,7 +646,14 @@ public class Controller { for(Integer i : oldDstoreFiles.keySet()) { List<String> files = new ArrayList<String>(); for(String s : oldDstoreFiles.get(i)) { - if(index.containsKey(s)) files.add(s); + if(index.containsKey(s)) { + if(index.get(s).getStatus() == IndexEntry.Status.STORE_COMPLETE) { + files.add(s); + } + else { + index.remove(s); + } + } if(!availableFiles.contains(s)) availableFiles.add(s); } dstoreFiles.put(i, files); diff --git a/DeadStoreException.java b/DeadStoreException.java new file mode 100644 index 0000000000000000000000000000000000000000..7520f8920b15db96c9a10d087a200340ef233418 --- /dev/null +++ b/DeadStoreException.java @@ -0,0 +1,15 @@ +import java.lang.Throwable; +import java.net.Socket; + +public class DeadStoreException extends Exception { + DstoreConnection connection; + + public DeadStoreException(DstoreConnection connection) { + super("Dstore at port " + connection.getPort() + " is unavailable"); + this.connection = connection; + } + + public DstoreConnection getConnection() { + return connection; + } +} diff --git a/Dstore.java b/Dstore.java index 5a86d15f11032e450ed7958fe0bbde18476c580d..44a1bbc5c5d1d6cfb9a8899e4d4384a3267c11e7 100644 --- a/Dstore.java +++ b/Dstore.java @@ -335,7 +335,7 @@ public class Dstore { messageReceived(socket, receivedMessage); if(!receivedMessage.equals(Protocol.ACK_TOKEN)) { //Log error - System.out.println("Dstore " + dstore + " should have sent ACK but " + port + " received " + receivedMessage); + System.err.println("Dstore " + dstore + " should have sent ACK but " + port + " received " + receivedMessage); } byte[] content = new byte[BUFFER_SIZE]; @@ -378,7 +378,6 @@ public class Dstore { controllerOut.println(Protocol.REBALANCE_COMPLETE_TOKEN); messageSent(controllerSocket, Protocol.REBALANCE_COMPLETE_TOKEN); } - System.out.println("Sent message REBALANCE_COMPLETE"); }).start(); } diff --git a/DstoreConnection.java b/DstoreConnection.java index c8550c114eae775b156ede2f6e1311f568108254..134280e11d7e53e240594a360c8385582f465091 100644 --- a/DstoreConnection.java +++ b/DstoreConnection.java @@ -52,12 +52,16 @@ public class DstoreConnection { return new DstoreDisconnectException(this); } - public String sendAndReceive(String message, String... expectedMessages) throws DstoreDisconnectException { + public void checkAvailable() throws DeadStoreException { + if(!available) throw new DeadStoreException(this); + } + + public String sendAndReceive(String message, String... expectedMessages) throws DstoreDisconnectException, DeadStoreException { System.out.println("Getting lock..."); synchronized(this) { try { System.out.println("Lock acquired"); - if(!available) throw getDisconnectData(); + checkAvailable(); writer.println(message); writer.flush(); //System.out.println("Controller sent " + message + " to port " + port); @@ -72,7 +76,7 @@ public class DstoreConnection { } } - public String receive(String... expectedMessages) throws DstoreDisconnectException { + public String receive(String... expectedMessages) throws DstoreDisconnectException, DeadStoreException { String findMessage = checkQueue(expectedMessages); if(findMessage != null) { return findMessage; @@ -81,7 +85,7 @@ public class DstoreConnection { System.out.println("Getting lock..."); synchronized(this) { System.out.println("Lock acquired"); - if(!available) throw getDisconnectData(); + checkAvailable(); //Check the queue twice: once incase the receiver is busy, twice incase the message was added by the last thread findMessage = checkQueue(expectedMessages); @@ -129,37 +133,13 @@ public class DstoreConnection { catch(InterruptedException e) { e.printStackTrace(); } - - /* - String returnMessage = null; - do { - returnMessage = reader.readLine(); - if(returnMessage == null) { - System.out.println("Dstore disconnected"); - available = false; - throw new DstoreDisconnectException(); - } - if(expectedMessage != null && !expectedMessage.equals(returnMessage.split(" ")[0])) { - queue.add(returnMessage); - if(queue.size() > MAX_QUEUE_SIZE) queue.remove(0); - returnMessage = null; - } - } - while(returnMessage == null); - System.out.println("Controller received " + returnMessage); - return returnMessage; - } - catch(IOException e) { - e.printStackTrace(); - return ""; - } - */ + return ""; } protected boolean isExpected(String message, String[] expectedMessages) { for(String s : expectedMessages) { - if(s.equals(message.split(" ")[0])) return true; + if(s.equals(message)) return true; } return false; } diff --git a/error.txt b/error.txt index 308020f60fd0570185aeedeb219af9c2a8f03a3d..c0e41ea4fef346e83901d561aebe4dca4537e2b4 100644 --- a/error.txt +++ b/error.txt @@ -1,52 +1,52 @@ -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists +FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file SnowHalation.txt - file already exists +FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists +FileAlreadyExistsException: Error trying to store file rap.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists +FileAlreadyExistsException: Error trying to store file AllStar.txt - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists +FileAlreadyExistsException: Error trying to store file rap.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Unknown.txt - file already exists +FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file GameDotCom.jpg - file already exists +FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists +FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists +FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) @@ -58,49 +58,82 @@ FileAlreadyExistsException: Error trying to store file GameDotCom.jpg - file alr at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists + at Client.a(SourceFile:277) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) FileAlreadyExistsException: Error trying to store file rap.mp3 - file already exists at Client.a(SourceFile:277) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +FileAlreadyExistsException: Error trying to store file rap.mp3 - file already exists + at Client.a(SourceFile:277) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists + at Client.a(SourceFile:277) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) DstoreDisconnectException: Dstore at port 8081 has been disconnected at DstoreConnection.getDisconnectData(DstoreConnection.java:52) - at DstoreConnection.localReceive(DstoreConnection.java:121) - at DstoreConnection.receive(DstoreConnection.java:92) - at Controller.lambda$store$1(Controller.java:317) - at java.base/java.lang.Thread.run(Thread.java:832) -DstoreDisconnectException: Dstore at port 8081 has been disconnected - at DstoreConnection.getDisconnectData(DstoreConnection.java:52) - at DstoreConnection.receive(DstoreConnection.java:84) - at Controller.lambda$store$1(Controller.java:317) - at java.base/java.lang.Thread.run(Thread.java:832) -DstoreDisconnectException: Dstore at port 8081 has been disconnected - at DstoreConnection.getDisconnectData(DstoreConnection.java:52) - at DstoreConnection.receive(DstoreConnection.java:84) - at Controller.lambda$store$1(Controller.java:317) - at java.base/java.lang.Thread.run(Thread.java:832) -DstoreDisconnectException: Dstore at port 8081 has been disconnected - at DstoreConnection.getDisconnectData(DstoreConnection.java:52) - at DstoreConnection.receive(DstoreConnection.java:84) - at Controller.lambda$store$1(Controller.java:317) - at java.base/java.lang.Thread.run(Thread.java:832) -DstoreDisconnectException: Dstore at port 8081 has been disconnected - at DstoreConnection.getDisconnectData(DstoreConnection.java:52) - at DstoreConnection.receive(DstoreConnection.java:84) - at Controller.lambda$store$1(Controller.java:317) + at DstoreConnection.localReceive(DstoreConnection.java:125) + at DstoreConnection.receive(DstoreConnection.java:96) + at Controller.lambda$store$1(Controller.java:312) at java.base/java.lang.Thread.run(Thread.java:832) +Store for Unknown.txt failed due to dead dstore +Store for rap.mp3 failed due to dead dstore +Store for GameDotCom.jpg failed due to dead dstore +Store for PumpkinHill.txt failed due to dead dstore +Store for SnowHalation.txt failed due to dead dstore +Store for AllStar.txt failed due to dead dstore +Store for Grandad.txt failed due to dead dstore Not all STORE_ACKs have been received Not all STORE_ACKs have been received Not all STORE_ACKs have been received Not all STORE_ACKs have been received Not all STORE_ACKs have been received -FileAlreadyExistsException: Error trying to store file Look_Away.mp3 - file already exists - at Client.a(SourceFile:277) +Not all STORE_ACKs have been received +Not all STORE_ACKs have been received +Not all STORE_ACKs have been received +java.net.SocketTimeoutException: Read timed out + at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) + at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) + at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350) + at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803) + at java.base/java.net.Socket$SocketInputStream.read(Socket.java:982) + at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:297) + at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339) + at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) + at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181) + at java.base/java.io.BufferedReader.fill(BufferedReader.java:161) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392) + at Client.store(SourceFile:239) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-0" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) @@ -118,24 +151,69 @@ java.net.SocketTimeoutException: Read timed out at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file spurk.jpg - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file SnowHalation.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-2" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) +java.net.SocketTimeoutException: Read timed out + at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) + at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) + at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350) + at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803) + at java.base/java.net.Socket$SocketInputStream.read(Socket.java:982) + at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:297) + at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339) + at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) + at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181) + at java.base/java.io.BufferedReader.fill(BufferedReader.java:161) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392) + at Client.store(SourceFile:239) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-9" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) @@ -170,29 +248,31 @@ java.net.SocketTimeoutException: Read timed out at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Unknown.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Unknown.txt - file already exists - at Client.a(SourceFile:277) - at Client.store(SourceFile:183) - at Client.store(SourceFile:156) - at ClientMain.test2Client(ClientMain.java:44) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-3" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) at ClientMain$1.run(ClientMain.java:26) java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) @@ -211,12 +291,46 @@ java.net.SocketTimeoutException: Read timed out at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file SnowHalation.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-6" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.a(SourceFile:280) + at Client.store(SourceFile:183) + at Client.store(SourceFile:156) + at ClientMain.test2Client(ClientMain.java:44) + at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-4" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) java.net.SocketTimeoutException: Read timed out at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) @@ -234,53 +348,66 @@ java.net.SocketTimeoutException: Read timed out at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file PumpkinHill.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Unknown.txt - file already exists - at Client.a(SourceFile:277) - at Client.store(SourceFile:183) - at Client.store(SourceFile:156) - at ClientMain.test2Client(ClientMain.java:44) - at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Unknown.txt - file already exists - at Client.a(SourceFile:277) - at Client.store(SourceFile:183) +java.net.SocketTimeoutException: Read timed out + at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:283) + at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309) + at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350) + at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803) + at java.base/java.net.Socket$SocketInputStream.read(Socket.java:982) + at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:297) + at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339) + at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) + at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181) + at java.base/java.io.BufferedReader.fill(BufferedReader.java:161) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326) + at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392) + at Client.store(SourceFile:239) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file Grandad.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file SnowHalation.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileDoesNotExistException: Error trying to load or remove file spurk.jpg - file does not exist - at Client.remove(SourceFile:505) - at ClientMain.test2Client(ClientMain.java:57) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) at ClientMain$1.run(ClientMain.java:26) -FileDoesNotExistException: Error trying to load or remove file Look_Away.mp3 - file does not exist - at Client.remove(SourceFile:505) - at ClientMain.test2Client(ClientMain.java:57) +Exception in thread "Thread-5" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file AllStar.txt - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) -FileAlreadyExistsException: Error trying to store file GameDotCom.jpg - file already exists - at Client.a(SourceFile:277) +NotEnoughDstoresException + at Client.a(SourceFile:280) at Client.store(SourceFile:183) at Client.store(SourceFile:156) at ClientMain.test2Client(ClientMain.java:44) at ClientMain$1.run(ClientMain.java:26) +NotEnoughDstoresException + at Client.list(SourceFile:107) + at ClientMain.list(ClientMain.java:113) + at ClientMain.test2Client(ClientMain.java:52) + at ClientMain$1.run(ClientMain.java:26) +Exception in thread "Thread-7" java.lang.NullPointerException + at ClientMain.test2Client(ClientMain.java:54) + at ClientMain$1.run(ClientMain.java:26) diff --git a/loggers/ControllerLogger.class b/loggers/ControllerLogger.class deleted file mode 100644 index d1501ec440c94f5a395d546f4a803efe8e9d29ca..0000000000000000000000000000000000000000 Binary files a/loggers/ControllerLogger.class and /dev/null differ diff --git a/loggers/DstoreLogger.class b/loggers/DstoreLogger.class deleted file mode 100644 index ac67d99e6bd1c551748d3b73a4e7891edbc42419..0000000000000000000000000000000000000000 Binary files a/loggers/DstoreLogger.class and /dev/null differ diff --git a/loggers/Logger$LoggingType.class b/loggers/Logger$LoggingType.class deleted file mode 100644 index a62bda1d6229f4047dd872fda4e641c5170aa594..0000000000000000000000000000000000000000 Binary files a/loggers/Logger$LoggingType.class and /dev/null differ diff --git a/loggers/Logger.class b/loggers/Logger.class deleted file mode 100644 index 642bbf6cfdb1489289c40fc83829f40627162802..0000000000000000000000000000000000000000 Binary files a/loggers/Logger.class and /dev/null differ