mirror of
https://github.com/ChronosX88/KademliaDHT.git
synced 2024-11-22 02:02:21 +00:00
- Moved the items from kademlia.core package to kademlia package since both packages are core package.
- Deleted the kademlia.core package
This commit is contained in:
parent
720b062646
commit
fd0620aaf1
@ -1,4 +1,4 @@
|
|||||||
package kademlia.core;
|
package kademlia;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package kademlia.core;
|
package kademlia;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface that defines a KadConfiguration object
|
* Interface that defines a KadConfiguration object
|
@ -1,4 +1,4 @@
|
|||||||
package kademlia.core;
|
package kademlia;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
@ -11,10 +11,7 @@ import java.net.InetAddress;
|
|||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import kademlia.core.DefaultConfiguration;
|
|
||||||
import kademlia.dht.GetParameter;
|
import kademlia.dht.GetParameter;
|
||||||
import kademlia.core.KadConfiguration;
|
|
||||||
import kademlia.core.KadServer;
|
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
import kademlia.dht.KadContent;
|
import kademlia.dht.KadContent;
|
||||||
import kademlia.dht.StorageEntry;
|
import kademlia.dht.StorageEntry;
|
||||||
|
@ -2,4 +2,13 @@
|
|||||||
|
|
||||||
1. Implement the "Optimized Contact Accounting" features as mentioned in the paper
|
1. Implement the "Optimized Contact Accounting" features as mentioned in the paper
|
||||||
2. Implement the "Accelerated Lookups" featured as described in the paper
|
2. Implement the "Accelerated Lookups" featured as described in the paper
|
||||||
3. Add a setup file on how to setup Kademlia and run it.
|
3. Add a setup file on how to setup Kademlia and run it.
|
||||||
|
|
||||||
|
|
||||||
|
Next Steps:
|
||||||
|
- Write Unit Tests
|
||||||
|
- Improve multi-threading system
|
||||||
|
-- I think server is slow in handling requests because the listen method runs in a single thread.
|
||||||
|
--- Listen() method should create a new thread to handle every incoming request.
|
||||||
|
- KadStatistician
|
||||||
|
-- Let the statistician keep track of failed get requests!
|
@ -9,7 +9,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.exceptions.ContentExistException;
|
import kademlia.exceptions.ContentExistException;
|
||||||
import kademlia.exceptions.ContentNotFoundException;
|
import kademlia.exceptions.ContentNotFoundException;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
@ -2,7 +2,7 @@ package kademlia.message;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives a ConnectMessage and sends an AcknowledgeMessage as reply.
|
* Receives a ConnectMessage and sends an AcknowledgeMessage as reply.
|
||||||
|
@ -3,8 +3,8 @@ package kademlia.message;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,7 +2,7 @@ package kademlia.message;
|
|||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A factory that handles creating messages and receivers
|
* A factory that handles creating messages and receivers
|
||||||
|
@ -3,8 +3,8 @@ package kademlia.message;
|
|||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,8 +3,8 @@ package kademlia.message;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.node.Node;
|
import kademlia.node.Node;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,7 +2,7 @@ package kademlia.message;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,8 +2,8 @@ package kademlia.operation;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,8 +8,8 @@ package kademlia.operation;
|
|||||||
import kademlia.message.Receiver;
|
import kademlia.message.Receiver;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.exceptions.RoutingException;
|
import kademlia.exceptions.RoutingException;
|
||||||
import kademlia.message.AcknowledgeMessage;
|
import kademlia.message.AcknowledgeMessage;
|
||||||
import kademlia.message.ConnectMessage;
|
import kademlia.message.ConnectMessage;
|
||||||
|
@ -12,8 +12,8 @@ import java.util.SortedMap;
|
|||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.dht.GetParameter;
|
import kademlia.dht.GetParameter;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.StorageEntry;
|
import kademlia.dht.StorageEntry;
|
||||||
import kademlia.exceptions.ContentNotFoundException;
|
import kademlia.exceptions.ContentNotFoundException;
|
||||||
import kademlia.exceptions.RoutingException;
|
import kademlia.exceptions.RoutingException;
|
||||||
|
@ -3,8 +3,8 @@ package kademlia.operation;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
import kademlia.dht.StorageEntryMetadata;
|
import kademlia.dht.StorageEntryMetadata;
|
||||||
import kademlia.exceptions.ContentNotFoundException;
|
import kademlia.exceptions.ContentNotFoundException;
|
||||||
|
@ -2,8 +2,8 @@ package kademlia.operation;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,8 +9,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.exceptions.RoutingException;
|
import kademlia.exceptions.RoutingException;
|
||||||
import kademlia.message.Message;
|
import kademlia.message.Message;
|
||||||
import kademlia.message.NodeLookupMessage;
|
import kademlia.message.NodeLookupMessage;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
package kademlia.operation;
|
package kademlia.operation;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.exceptions.RoutingException;
|
import kademlia.exceptions.RoutingException;
|
||||||
import kademlia.node.Node;
|
import kademlia.node.Node;
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package kademlia.operation;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.core.KadServer;
|
import kademlia.KadServer;
|
||||||
import kademlia.dht.DHT;
|
import kademlia.dht.DHT;
|
||||||
import kademlia.dht.KadContent;
|
import kademlia.dht.KadContent;
|
||||||
import kademlia.dht.StorageEntry;
|
import kademlia.dht.StorageEntry;
|
||||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.node.Node;
|
import kademlia.node.Node;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package kademlia.routing;
|
package kademlia.routing;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.node.Node;
|
import kademlia.node.Node;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package kademlia.routing;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.node.KeyComparator;
|
import kademlia.node.KeyComparator;
|
||||||
import kademlia.node.Node;
|
import kademlia.node.Node;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
@ -2,9 +2,9 @@ package kademlia.simulations;
|
|||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import kademlia.core.DefaultConfiguration;
|
import kademlia.DefaultConfiguration;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,9 +2,9 @@ package kademlia.simulations;
|
|||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import kademlia.core.DefaultConfiguration;
|
import kademlia.DefaultConfiguration;
|
||||||
import kademlia.KademliaNode;
|
import kademlia.KademliaNode;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.node.KademliaId;
|
import kademlia.node.KademliaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@ import java.io.OutputStreamWriter;
|
|||||||
import kademlia.routing.RoutingTable;
|
import kademlia.routing.RoutingTable;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import kademlia.core.KadConfiguration;
|
import kademlia.KadConfiguration;
|
||||||
import kademlia.routing.Contact;
|
import kademlia.routing.Contact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user