Improvements

- Massively reduced logging, especially at debug level
- Optimizations to reduce system load
- Use bootstrapping to find stable nodes
This commit is contained in:
2015-11-08 10:14:37 +01:00
parent 2a8834e3c6
commit 1f05a52f05
10 changed files with 88 additions and 94 deletions

View File

@ -29,6 +29,7 @@ import org.junit.Test;
import org.mockito.Mockito;
import java.net.InetAddress;
import java.util.concurrent.Future;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
@ -116,10 +117,10 @@ public class NetworkHandlerTest {
"V1Msg.payload"
);
Thread t = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
Future<?> future = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
mock(NetworkHandler.MessageListener.class),
10);
t.join();
future.get();
assertInventorySize(3, nodeInventory);
assertInventorySize(3, peerInventory);
}
@ -133,10 +134,10 @@ public class NetworkHandlerTest {
nodeInventory.init();
Thread t = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
Future<?> future = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
mock(NetworkHandler.MessageListener.class),
10);
t.join();
future.get();
assertInventorySize(2, nodeInventory);
assertInventorySize(2, peerInventory);
}
@ -149,10 +150,10 @@ public class NetworkHandlerTest {
"V1Msg.payload"
);
Thread t = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
Future<?> future = networkHandler.synchronize(InetAddress.getLocalHost(), 6001,
mock(NetworkHandler.MessageListener.class),
10);
t.join();
future.get();
assertInventorySize(1, nodeInventory);
assertInventorySize(1, peerInventory);
}