Modifier and Type | Field and Description |
---|---|
static String |
AUTO_CREATE_SCHEMA |
static String |
DATASTORE |
static String |
GORA |
static String |
GORA_DEFAULT_DATASTORE_KEY |
static String |
GORA_DEFAULT_PROPERTIES_FILE |
static String |
INPUT_PATH |
static org.slf4j.Logger |
log |
static String |
MAPPING_FILE |
static String |
OUTPUT_PATH |
static Properties |
properties
Deprecated.
|
static String |
SCHEMA_NAME |
Modifier and Type | Method and Description |
---|---|
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
org.apache.hadoop.conf.Configuration conf)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
org.apache.hadoop.conf.Configuration conf,
Properties properties)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
org.apache.hadoop.conf.Configuration conf,
Properties properties,
String schemaName)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
org.apache.hadoop.conf.Configuration conf,
String schemaName)
Instantiate a new
DataStore . |
static Properties |
createProps()
Creates a new
Properties . |
static boolean |
findBooleanProperty(Properties properties,
DataStore<?,?> store,
String baseKey,
String defaultValue) |
static String |
findProperty(Properties properties,
DataStore<?,?> store,
String baseKey,
String defaultValue)
Tries to find a property with the given baseKey.
|
static String |
findPropertyOrDie(Properties properties,
DataStore<?,?> store,
String baseKey)
Tries to find a property with the given baseKey.
|
static boolean |
getAutoCreateSchema(Properties properties,
DataStore<?,?> store) |
static <D extends DataStore<K,T>,K,T extends Persistent> |
getDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistentClass,
org.apache.hadoop.conf.Configuration conf)
Instantiate a new
DataStore . |
static <K,T extends Persistent> |
getDataStore(Class<K> keyClass,
Class<T> persistent,
org.apache.hadoop.conf.Configuration conf)
Instantiate the default
DataStore . |
static <K,T extends Persistent> |
getDataStore(String dataStoreClass,
Class<K> keyClass,
Class<T> persistentClass,
org.apache.hadoop.conf.Configuration conf)
Instantiate a new
DataStore . |
static <K,T extends Persistent> |
getDataStore(String dataStoreClass,
String keyClass,
String persistentClass,
org.apache.hadoop.conf.Configuration conf)
Instantiate a new
DataStore . |
static String |
getDefaultSchemaName(Properties properties,
DataStore<?,?> store)
Gets the default schema name of a given store class
|
static String |
getInputPath(Properties properties,
DataStore<?,?> store)
Returns the input path as read from the properties for file-backed data stores.
|
static String |
getMappingFile(Properties properties,
DataStore<?,?> store,
String defaultValue)
Looks for the
gora-<classname>-mapping.xml as a resource
on the classpath. |
static String |
getOutputPath(Properties properties,
DataStore<?,?> store)
Returns the output path as read from the properties for file-backed data stores.
|
static <D extends DataStore<K,T>,K,T extends Persistent> |
setDefaultSchemaName(Properties properties,
Class<D> dataStoreClass,
String schemaName)
Sets the default schema name to be used by the datastore of the given class
|
static void |
setDefaultSchemaName(Properties properties,
String schemaName)
Sets the default schema name.
|
public static final org.slf4j.Logger log
public static final String GORA_DEFAULT_PROPERTIES_FILE
public static final String GORA_DEFAULT_DATASTORE_KEY
public static final String GORA
public static final String DATASTORE
public static final String AUTO_CREATE_SCHEMA
public static final String INPUT_PATH
public static final String OUTPUT_PATH
public static final String MAPPING_FILE
public static final String SCHEMA_NAME
@Deprecated public static final Properties properties
createProps()
instead.public static Properties createProps()
Properties
. It adds the default gora configuration
resources. This properties object can be modified and used to instantiate
store instances. It is recommended to use a properties object for a single
store, because the properties object is passed on to store initialization
methods that are able to store the properties as a field.public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.conf
- Configuration
to be used be the store.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf, String schemaName) throws GoraException
DataStore
. Uses default properties.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.conf
- Configuration
to be used be the store.schemaName
- A default schemaname that will be put on the properties.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf, Properties properties, String schemaName) throws GoraException
DataStore
.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.conf
- Configuration
to be used be the store.properties
- The properties to be used be the store.schemaName
- A default schemaname that will be put on the properties.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf, Properties properties) throws GoraException
DataStore
. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.conf
- Configuration
to be used be the store.properties
- The properties to be used be the store.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D getDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass, org.apache.hadoop.conf.Configuration conf) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistentClass
- The value class.conf
- Configuration
to be used be the store.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(String dataStoreClass, Class<K> keyClass, Class<T> persistentClass, org.apache.hadoop.conf.Configuration conf) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class as string.keyClass
- The key class.persistentClass
- The value class.conf
- Configuration
to be used be the store.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(String dataStoreClass, String keyClass, String persistentClass, org.apache.hadoop.conf.Configuration conf) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class as string.keyClass
- The key class as string.persistentClass
- The value class as string.conf
- Configuration
to be used be the store.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.keyClass
- The key class.persistent
- The value class.conf
- Configuration
to be used be the store.GoraException
public static String findProperty(Properties properties, DataStore<?,?> store, String baseKey, String defaultValue)
public static String findPropertyOrDie(Properties properties, DataStore<?,?> store, String baseKey) throws IOException
IOException
public static boolean findBooleanProperty(Properties properties, DataStore<?,?> store, String baseKey, String defaultValue)
public static boolean getAutoCreateSchema(Properties properties, DataStore<?,?> store)
public static String getInputPath(Properties properties, DataStore<?,?> store)
public static String getOutputPath(Properties properties, DataStore<?,?> store)
public static String getMappingFile(Properties properties, DataStore<?,?> store, String defaultValue) throws IOException
gora-<classname>-mapping.xml
as a resource
on the classpath. This can however also be specified within the
gora.properties
file with the key
gora.<classname>.mapping.file=
.properties
- which hold keys from which we can obtain values for datastore mappings.store
- DataStore
object to get the mapping for.defaultValue
- default value for the gora-<classname>-mapping.xml
IOException
- if there is a problem reading or obtaining the mapping file.public static String getDefaultSchemaName(Properties properties, DataStore<?,?> store)
public static void setDefaultSchemaName(Properties properties, String schemaName)
public static <D extends DataStore<K,T>,K,T extends Persistent> void setDefaultSchemaName(Properties properties, Class<D> dataStoreClass, String schemaName)
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.