/** * Gets the default schema name of a given store class */ public static String getDefaultSchemaName(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, SCHEMA_NAME, null); }
/** * Sets the default schema name to be used by the datastore of the given class */ public static<D extends DataStore<K,T>, K, T extends Persistent> void setDefaultSchemaName(Properties properties, Class<D> dataStoreClass, String schemaName) { setProperty(properties, dataStoreClass, SCHEMA_NAME, schemaName); } }
protected T getOrCreatePersistent(T persistent) throws Exception { if(persistent != null) { return persistent; } return dataStore.newPersistent(); }
public static void testAutoCreateSchema(DataStore<String,Employee> dataStore) throws Exception { //should not throw exception dataStore.put("foo", createEmployee()); }
public static Employee testPutEmployee(DataStore<String, Employee> dataStore) throws Exception { dataStore.createSchema(); Employee employee = DataStoreTestUtil.createEmployee(); return employee; }
@Override /** * Executes the query */ public Result<K,T> execute() { //compile(); return dataStore.execute(this); }
public static void testCreateEmployeeSchema(DataStore<String, Employee> dataStore) throws Exception { dataStore.createSchema(); //should not throw exception dataStore.createSchema(); }
private static <K, T extends Persistent> void initializeDataStore( DataStore<K, T> dataStore, Class<K> keyClass, Class<T> persistent, Properties properties) throws Exception { dataStore.initialize(keyClass, persistent, properties); }
public static void testResultSizeWebPagesKeyRangeWithLimit(DataStore<String, WebPage> store) throws Exception { testResultSize(store, true, true, true); } }
/** * Gets the default schema name of a given store class */ public static String getDefaultSchemaName(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, SCHEMA_NAME, null); }
protected T getOrCreatePersistent(T persistent) throws Exception { if(persistent != null) { return persistent; } return dataStore.newPersistent(); }
@Override /** * Executes the query */ public Result<K,T> execute() throws GoraException { //compile(); return dataStore.execute(this); }
/** * Sets the default schema name. */ public static void setDefaultSchemaName(Properties properties, String schemaName) { if (schemaName != null) { setProperty(properties, SCHEMA_NAME, schemaName); } }
private static <K, T extends Persistent> void initializeDataStore( DataStore<K, T> dataStore, Class<K> keyClass, Class<T> persistent, Properties properties) throws IOException { dataStore.initialize(keyClass, persistent, properties); }
/** * Returns the input path as read from the properties for file-backed data stores. */ public static String getInputPath(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, INPUT_PATH, null); }
/** * Sets the default schema name. */ public static void setDefaultSchemaName(Properties properties, String schemaName) { if (schemaName != null) { setProperty(properties, SCHEMA_NAME, schemaName); } }
private static <K, T extends Persistent> void initializeDataStore( DataStore<K, T> dataStore, Class<K> keyClass, Class<T> persistent, Properties properties) throws Exception { dataStore.initialize(keyClass, persistent, properties); }
/** * Returns the output path as read from the properties for file-backed data stores. */ public static String getOutputPath(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, OUTPUT_PATH, null); }
/** * Sets the default schema name to be used by the datastore of the given class */ public static<D extends DataStore<K,T>, K, T extends Persistent> void setDefaultSchemaName(Properties properties, Class<D> dataStoreClass, String schemaName) { setProperty(properties, dataStoreClass, SCHEMA_NAME, schemaName); } }
private static <K, T extends Persistent> void initializeDataStore( DataStore<K, T> dataStore, Class<K> keyClass, Class<T> persistent, Properties properties) throws IOException { dataStore.initialize(keyClass, persistent, properties); }