use of org.apache.gora.infinispan.store.InfinispanStore in project gora by apache.
the class GoraInfinispanTestDriver method createDataStore.
@Override
public <K, T extends Persistent> DataStore<K, T> createDataStore(Class<K> keyClass, Class<T> persistentClass) throws GoraException {
InfinispanStore store = (InfinispanStore) super.createDataStore(keyClass, persistentClass);
if (persistentClass.equals(Employee.class)) {
store.setPrimaryFieldName("ssn");
store.setPrimaryFieldPos(2);
} else if (persistentClass.equals(WebPage.class)) {
store.setPrimaryFieldName("url");
store.setPrimaryFieldPos(0);
}
return store;
}
use of org.apache.gora.infinispan.store.InfinispanStore in project gora by apache.
the class InfinispanStoreMapReduceTest method createWebPageDataStore.
@Override
protected DataStore<String, WebPage> createWebPageDataStore() throws IOException {
conf = driver.getConfiguration();
conf.set(ISPN_CONNECTION_STRING_KEY, driver.connectionString());
try {
InfinispanStore<String, WebPage> store = new InfinispanStore<>();
store.setConf(conf);
store.initialize(String.class, WebPage.class, new Properties());
return store;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations