Example usage for org.apache.cassandra.config DatabaseDescriptor getPartitioner

List of usage examples for org.apache.cassandra.config DatabaseDescriptor getPartitioner

Introduction

In this page you can find the example usage for org.apache.cassandra.config DatabaseDescriptor getPartitioner.

Prototype

public static IPartitioner getPartitioner() 

Source Link

Usage

From source file:org.elasticsearch.common.io.stream.StreamInput.java

License:Apache License

@SuppressWarnings({ "unchecked" })
@Nullable//  w w  w.j  av  a  2  s  .c o m
public Object readGenericValue() throws IOException {
    byte type = readByte();
    switch (type) {
    case -1:
        return null;
    case 0:
        return readString();
    case 1:
        return readInt();
    case 2:
        return readLong();
    case 3:
        return readFloat();
    case 4:
        return readDouble();
    case 5:
        return readBoolean();
    case 6:
        int bytesSize = readVInt();
        byte[] value = new byte[bytesSize];
        readBytes(value, 0, bytesSize);
        return value;
    case 7:
        int size = readVInt();
        List list = new ArrayList(size);
        for (int i = 0; i < size; i++) {
            list.add(readGenericValue());
        }
        return list;
    case 8:
        int size8 = readVInt();
        Object[] list8 = new Object[size8];
        for (int i = 0; i < size8; i++) {
            list8[i] = readGenericValue();
        }
        return list8;
    case 9:
        int size9 = readVInt();
        Map map9 = new LinkedHashMap(size9);
        for (int i = 0; i < size9; i++) {
            map9.put(readString(), readGenericValue());
        }
        return map9;
    case 10:
        int size10 = readVInt();
        Map map10 = new HashMap(size10);
        for (int i = 0; i < size10; i++) {
            map10.put(readString(), readGenericValue());
        }
        return map10;
    case 11:
        return readByte();
    case 12:
        return new Date(readLong());
    case 13:
        final String timeZoneId = readString();
        return new DateTime(readLong(), DateTimeZone.forID(timeZoneId));
    case 14:
        return readBytesReference();
    case 15:
        return readText();
    case 16:
        return readShort();
    case 17:
        return readIntArray();
    case 18:
        return readLongArray();
    case 19:
        return readFloatArray();
    case 20:
        return readDoubleArray();
    case 21:
        return readBytesRef();
    case 22:
        return readGeoPoint();
    case 64: // Token
        byte[] buf = new byte[readVInt()];
        readFully(buf);
        return DatabaseDescriptor.getPartitioner().getTokenFactory().fromByteArray(ByteBuffer.wrap(buf));
    default:
        throw new IOException("Can't read unknown type [" + type + "]");
    }
}