voldemort.rest
Class RestUtils

java.lang.Object
  extended by voldemort.rest.RestUtils

public class RestUtils
extends java.lang.Object


Field Summary
protected static org.codehaus.jackson.map.ObjectMapper mapper
           
 
Constructor Summary
RestUtils()
           
 
Method Summary
static java.lang.String constructSerializerInfoXml(StoreDefinition storeDefinition)
          Given a storedefinition, constructs the xml string to be sent out in response to a "schemata" fetch request
static byte[] decodeVoldemortKey(java.lang.String base64Key)
           
static VectorClock deserializeVectorClock(java.lang.String serializedVC)
           
static java.util.List<Version> deserializeVectorClocks(java.lang.String serializedVC)
           
static java.lang.String encodeVoldemortKey(byte[] keyBytes)
           
static java.lang.String getKeyHexString(ByteArray key)
           
static java.lang.String getKeysHexString(java.util.Iterator<ByteArray> keys)
           
static java.lang.String getSerializedVectorClock(VectorClock vc)
          Function to serialize the given Vector clock into a string.
static java.lang.String getSerializedVectorClocks(java.util.List<VectorClock> vectorClocks)
          Function to serialize the given list of Vector clocks into a string.
static SerializerDefinition parseKeySerializerDefinition(java.lang.String serializerInfoXml)
          Given an xml string containing the store's serialization information, obtains the key serializer definition
static SerializerDefinition parseValueSerializerDefinition(java.lang.String serializerInfoXml)
          Given an xml string containing the store's serialization information, obtains the value serializer definition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapper

protected static final org.codehaus.jackson.map.ObjectMapper mapper
Constructor Detail

RestUtils

public RestUtils()
Method Detail

getSerializedVectorClock

public static java.lang.String getSerializedVectorClock(VectorClock vc)
Function to serialize the given Vector clock into a string. If something goes wrong, it returns an empty string.

Parameters:
vc - The Vector clock to serialize
Returns:
The string (JSON) version of the specified Vector clock

deserializeVectorClock

public static VectorClock deserializeVectorClock(java.lang.String serializedVC)

getSerializedVectorClocks

public static java.lang.String getSerializedVectorClocks(java.util.List<VectorClock> vectorClocks)
Function to serialize the given list of Vector clocks into a string. If something goes wrong, it returns an empty string.

Parameters:
vectorClocks - The Vector clock list to serialize
Returns:
The string (JSON) version of the specified Vector clock

deserializeVectorClocks

public static java.util.List<Version> deserializeVectorClocks(java.lang.String serializedVC)

constructSerializerInfoXml

public static java.lang.String constructSerializerInfoXml(StoreDefinition storeDefinition)
Given a storedefinition, constructs the xml string to be sent out in response to a "schemata" fetch request

Parameters:
storeDefinition -
Returns:
serialized store definition

parseKeySerializerDefinition

public static SerializerDefinition parseKeySerializerDefinition(java.lang.String serializerInfoXml)
Given an xml string containing the store's serialization information, obtains the key serializer definition

Parameters:
serializerInfoXml -
Returns:
key serializer definition

parseValueSerializerDefinition

public static SerializerDefinition parseValueSerializerDefinition(java.lang.String serializerInfoXml)
Given an xml string containing the store's serialization information, obtains the value serializer definition

Parameters:
serializerInfoXml -
Returns:
serializer definition

encodeVoldemortKey

public static java.lang.String encodeVoldemortKey(byte[] keyBytes)

decodeVoldemortKey

public static byte[] decodeVoldemortKey(java.lang.String base64Key)

getKeyHexString

public static java.lang.String getKeyHexString(ByteArray key)

getKeysHexString

public static java.lang.String getKeysHexString(java.util.Iterator<ByteArray> keys)


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu