voldemort.utils
Class StoreDefinitionUtils

java.lang.Object
  extended by voldemort.utils.StoreDefinitionUtils

public class StoreDefinitionUtils
extends java.lang.Object


Constructor Summary
StoreDefinitionUtils()
           
 
Method Summary
static java.util.List<StoreDefinition> filterStores(java.util.List<StoreDefinition> storeDefs, boolean isReadOnly)
          Given a list of store definitions, filters the list depending on the boolean
static StoreDefinitionBuilder getBuilderForStoreDef(StoreDefinition storeDef)
           
static StoreDefinition getStoreDefinitionWithName(java.util.List<StoreDefinition> storeDefs, java.lang.String storeName)
          Given a store name and a list of store definitions, returns the appropriate store definition ( if it exists )
static java.util.List<java.lang.String> getStoreNames(java.util.List<StoreDefinition> storeDefList)
          Given a list of store definitions return a list of store names
static java.util.Set<java.lang.String> getStoreNamesSet(java.util.List<StoreDefinition> storeDefList)
          Given a list of store definitions return a set of store names
static java.util.HashMap<StoreDefinition,java.lang.Integer> getUniqueStoreDefinitionsWithCounts(java.util.List<StoreDefinition> storeDefs)
          Given a list of store definitions, find out and return a map of similar store definitions + count of them
static boolean isAvroSchema(java.lang.String serializerName)
          Determine whether or not a given serializedr is "AVRO" based
static void validateSchemaAsNeeded(StoreDefinition storeDefinition)
          Validate store schema -- backward compatibility if it is AVRO generic versioned -- sanity checks for avro in general
static void validateSchemasAsNeeded(java.util.Collection<StoreDefinition> storeDefinitions)
          Validate store schema for things like backwards compatibility, parseability
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreDefinitionUtils

public StoreDefinitionUtils()
Method Detail

filterStores

public static java.util.List<StoreDefinition> filterStores(java.util.List<StoreDefinition> storeDefs,
                                                           boolean isReadOnly)
Given a list of store definitions, filters the list depending on the boolean

Parameters:
storeDefs - Complete list of store definitions
isReadOnly - Boolean indicating whether filter on read-only or not?
Returns:
List of filtered store definition

getStoreNames

public static java.util.List<java.lang.String> getStoreNames(java.util.List<StoreDefinition> storeDefList)
Given a list of store definitions return a list of store names

Parameters:
storeDefList - The list of store definitions
Returns:
Returns a list of store names

getStoreNamesSet

public static java.util.Set<java.lang.String> getStoreNamesSet(java.util.List<StoreDefinition> storeDefList)
Given a list of store definitions return a set of store names

Parameters:
storeDefList - The list of store definitions
Returns:
Returns a set of store names

getStoreDefinitionWithName

public static StoreDefinition getStoreDefinitionWithName(java.util.List<StoreDefinition> storeDefs,
                                                         java.lang.String storeName)
Given a store name and a list of store definitions, returns the appropriate store definition ( if it exists )

Parameters:
storeDefs - List of store definitions
storeName - The store name whose store definition is required
Returns:
The store definition

getUniqueStoreDefinitionsWithCounts

public static java.util.HashMap<StoreDefinition,java.lang.Integer> getUniqueStoreDefinitionsWithCounts(java.util.List<StoreDefinition> storeDefs)
Given a list of store definitions, find out and return a map of similar store definitions + count of them

Parameters:
storeDefs - All store definitions
Returns:
Map of a unique store definition + counts

isAvroSchema

public static boolean isAvroSchema(java.lang.String serializerName)
Determine whether or not a given serializedr is "AVRO" based

Parameters:
serializerName -
Returns:

validateSchemaAsNeeded

public static void validateSchemaAsNeeded(StoreDefinition storeDefinition)
Validate store schema -- backward compatibility if it is AVRO generic versioned -- sanity checks for avro in general

Parameters:
storeDefinition - the store definition to check on

validateSchemasAsNeeded

public static void validateSchemasAsNeeded(java.util.Collection<StoreDefinition> storeDefinitions)
Validate store schema for things like backwards compatibility, parseability

Parameters:
storeDefinitions - the list of store definition to check on

getBuilderForStoreDef

public static StoreDefinitionBuilder getBuilderForStoreDef(StoreDefinition storeDef)


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