use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class IgniteCacheQueriesLoadTest1 method getTraderCfg.
/**
* @param parentCfg Parent config.
* @return Configuration.
*/
private static CacheConfiguration<Object, Object> getTraderCfg(CacheConfiguration<Object, Object> parentCfg) {
CacheConfiguration<Object, Object> traderCfg = new CacheConfiguration<>(parentCfg);
traderCfg.setName(TRADER_CACHE);
String strCls = String.class.getCanonicalName();
LinkedHashMap<String, String> qryFields = new LinkedHashMap<>();
qryFields.put(ID, strCls);
qryFields.put(FIRSTNAME, strCls);
qryFields.put(SECONDNAME, strCls);
qryFields.put(EMAIL, strCls);
QueryEntity qryEntity = new QueryEntity();
qryEntity.setValueType(TRADER);
qryEntity.setKeyType(strCls);
qryEntity.setFields(qryFields);
LinkedHashMap<String, Boolean> grpIdx = new LinkedHashMap<>();
grpIdx.put(FIRSTNAME, false);
grpIdx.put(SECONDNAME, false);
qryEntity.setIndexes(Arrays.asList(new QueryIndex(ID, true), new QueryIndex(grpIdx, QueryIndexType.FULLTEXT)));
traderCfg.setQueryEntities(Collections.singleton(qryEntity));
return traderCfg;
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class IgniteCacheQueriesLoadTest1 method getDepositHistoryCfg.
/**
* @param parentCfg Parent config.
* @return Configuration.
*/
private static CacheConfiguration<Object, Object> getDepositHistoryCfg(CacheConfiguration<Object, Object> parentCfg) {
CacheConfiguration<Object, Object> depositHistCfg = new CacheConfiguration<>(parentCfg);
depositHistCfg.setName(DEPOSIT_HISTORY_CACHE);
String strCls = String.class.getCanonicalName();
String dblCls = Double.class.getCanonicalName();
String dtCls = Date.class.getCanonicalName();
LinkedHashMap<String, String> qryFields = new LinkedHashMap<>();
qryFields.put(ID, strCls);
qryFields.put(DEPOSIT_ID, strCls);
qryFields.put(BUSINESS_DAY, dtCls);
qryFields.put(BALANCE, dblCls);
QueryEntity qryEntity = new QueryEntity();
qryEntity.setValueType(OPERATION);
qryEntity.setKeyType(strCls);
qryEntity.setFields(qryFields);
qryEntity.setIndexes(Arrays.asList(new QueryIndex(ID, true), new QueryIndex(DEPOSIT_ID, true)));
depositHistCfg.setQueryEntities(Collections.singleton(qryEntity));
return depositHistCfg;
}
Aggregations