Search in sources :

Example 6 with ChecksumType

use of com.ms.silverking.cloud.dht.client.ChecksumType in project SilverKing by Morgan-Stanley.

the class MetaDataUtil method getChecksumLength.

private static int getChecksumLength(ByteBuffer storedValue, int baseOffset) {
    ChecksumType checksumType;
    checksumType = getChecksumType(storedValue, baseOffset);
    return checksumType.length();
}
Also used : ChecksumType(com.ms.silverking.cloud.dht.client.ChecksumType)

Example 7 with ChecksumType

use of com.ms.silverking.cloud.dht.client.ChecksumType in project SilverKing by Morgan-Stanley.

the class DevTest method main.

/**
 * @param args
 */
public static void main(String[] args) {
    try {
        if (args.length != 9) {
            System.out.println("args: <zkLocs> <dhtName> <valueSize> <numKeys> <reps> <namespace> <compression> <checksum> <tests>");
            return;
        } else {
            HostAndPort[] zkLocs;
            String dhtName;
            int valueSize;
            int numKeys;
            int reps;
            String namespace;
            Compression compression;
            ChecksumType checksumType;
            EnumSet<Test> tests;
            LWTPoolProvider.createDefaultWorkPools();
            zkLocs = HostAndPort.parseMultiple(args[0]);
            dhtName = args[1];
            valueSize = Integer.parseInt(args[2]);
            numKeys = Integer.parseInt(args[3]);
            reps = Integer.parseInt(args[4]);
            namespace = args[5];
            compression = Compression.valueOf(args[6]);
            checksumType = ChecksumType.valueOf(args[7]);
            tests = parseTests(args[8]);
            // Log.setLevelAll();
            new DevTest(zkLocs, dhtName, valueSize).test(numKeys, reps, namespace, compression, checksumType, tests);
        // ThreadUtil.sleep(60000);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : HostAndPort(com.ms.silverking.net.HostAndPort) Compression(com.ms.silverking.cloud.dht.client.Compression) ChecksumType(com.ms.silverking.cloud.dht.client.ChecksumType)

Aggregations

ChecksumType (com.ms.silverking.cloud.dht.client.ChecksumType)7 Compression (com.ms.silverking.cloud.dht.client.Compression)1 Checksum (com.ms.silverking.cloud.dht.client.impl.Checksum)1 HostAndPort (com.ms.silverking.net.HostAndPort)1