Search in sources :

Example 46 with DHTKey

use of com.ms.silverking.cloud.dht.common.DHTKey in project SilverKing by Morgan-Stanley.

the class StringSHA1KeyCreator method main.

public static void main(String[] args) {
    StringSHA1KeyCreator stringSHA1KeyCreator;
    DHTKey key;
    DHTKey[] subKeys;
    int numSubKeys;
    stringSHA1KeyCreator = new StringSHA1KeyCreator();
    key = stringSHA1KeyCreator.createKey("GeorgeWashington");
    numSubKeys = 5;
    subKeys = stringSHA1KeyCreator.createSubKeys(key, numSubKeys);
    System.out.println(key);
    for (int i = 0; i < subKeys.length; i++) {
        System.out.printf("%d\t%s\n", i, subKeys[i]);
    }
}
Also used : DHTKey(com.ms.silverking.cloud.dht.common.DHTKey)

Example 47 with DHTKey

use of com.ms.silverking.cloud.dht.common.DHTKey in project SilverKing by Morgan-Stanley.

the class ProtoChecksumTreeMessageGroup method deserializeKeyAndVersionChecksum.

private static KeyAndVersionChecksum deserializeKeyAndVersionChecksum(ByteBuffer buffer) {
    DHTKey key;
    long versionChecksum;
    key = deserializeKey(buffer);
    versionChecksum = buffer.getLong();
    return new KeyAndVersionChecksum(key, versionChecksum);
}
Also used : KeyAndVersionChecksum(com.ms.silverking.cloud.dht.daemon.storage.KeyAndVersionChecksum) DHTKey(com.ms.silverking.cloud.dht.common.DHTKey)

Aggregations

DHTKey (com.ms.silverking.cloud.dht.common.DHTKey)47 VersionConstraint (com.ms.silverking.cloud.dht.VersionConstraint)10 OpResult (com.ms.silverking.cloud.dht.common.OpResult)7 ByteBuffer (java.nio.ByteBuffer)7 KeyAndVersionChecksum (com.ms.silverking.cloud.dht.daemon.storage.KeyAndVersionChecksum)5 SimpleKey (com.ms.silverking.cloud.dht.common.SimpleKey)4 MessageGroupKeyOrdinalEntry (com.ms.silverking.cloud.dht.net.MessageGroupKeyOrdinalEntry)4 MessageGroupRetrievalResponseEntry (com.ms.silverking.cloud.dht.net.MessageGroupRetrievalResponseEntry)4 IOException (java.io.IOException)4 WeakReference (java.lang.ref.WeakReference)4 InternalRetrievalOptions (com.ms.silverking.cloud.dht.common.InternalRetrievalOptions)3 ConvergencePoint (com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)3 ProtoRetrievalMessageGroup (com.ms.silverking.cloud.dht.net.ProtoRetrievalMessageGroup)3 Triple (com.ms.silverking.collection.Triple)3 File (java.io.File)3 Map (java.util.Map)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 ConcurrentMap (java.util.concurrent.ConcurrentMap)3 RetrievalOptions (com.ms.silverking.cloud.dht.RetrievalOptions)2 DHTKeyIntEntry (com.ms.silverking.cloud.dht.collection.DHTKeyIntEntry)2