JDHT: Java Distributed Hash Table

A Java Collections/Map compatible DHT

Introduction

JDHT is a simple Java based Distributed Hash Table (DHT) which implements java.util.Map.
It is therefore very simple and intuitive to use. DHTs are very scalable distributed data structured originated from research on peer-to-peer (P2P) computing.

Under the hood, JDHT uses DKS, which provides a DHT among other things.

Connects to an existing node in a DHT (using the reference printed by the Server as a command line argument), makes a lookup and prints it
[JDHTClient.java]

import org.kth.dks.JDHT;publicclassJDHTClient{/**
* @param args contains a reference to an existing node in a DHT
*/publicstaticvoidmain(String[]args){if(args.length!=1)System.exit(0);try{// Start an instance listening on port 5550// Connect to an existing node running a DHT at args[0]JDHTmyDHT=newJDHT(5550, args[0]);StringhelloString=(String)myDHT.get("myKey");System.out.println(helloString);myDHT.close();}catch(Exceptione){e.printStackTrace();}}}