use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class GridIndexingSpiAbstractSelfTest method cacheBCfg.
/**
*/
private CacheConfiguration cacheBCfg() {
CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cfg.setName("B");
QueryEntity eA = new QueryEntity(Integer.class.getName(), "A");
eA.setFields(fieldsBA);
cfg.setQueryEntities(Collections.singleton(eA));
return cfg;
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class JdbcErrorsAbstractSelfTest method beforeTestsStarted.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
IgniteEx grid = startGrid(getConfiguration(getTestIgniteInstanceName(0)).setCacheConfiguration(new CacheConfiguration("test").setQueryEntities(Collections.singletonList(new QueryEntity(Integer.class, Integer.class)))));
// add cache template for cache with enabled read-through cache store
grid.addCacheConfiguration(new CacheConfiguration<>(CACHE_STORE_TEMPLATE).setCacheStoreFactory(singletonFactory(new TestCacheStore())).setReadThrough(true));
// add cache template for cache with enabled cache interceptor
grid.addCacheConfiguration(new CacheConfiguration<>(CACHE_INTERCEPTOR_TEMPLATE).setInterceptor(new TestCacheInterceptor()));
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class JdbcMetadataSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
LinkedHashMap<String, Boolean> persFields = new LinkedHashMap<>();
persFields.put("name", true);
persFields.put("age", false);
cfg.setCacheConfiguration(cacheConfiguration("pers").setQueryEntities(Arrays.asList(new QueryEntityEx(new QueryEntity(AffinityKey.class.getName(), Person.class.getName()).addQueryField("name", String.class.getName(), null).addQueryField("age", Integer.class.getName(), null).addQueryField("orgId", Integer.class.getName(), null).setIndexes(Arrays.asList(new QueryIndex("orgId"), new QueryIndex().setFields(persFields)))).setNotNullFields(new HashSet<>(Arrays.asList("age", "name"))))), cacheConfiguration("org").setQueryEntities(Arrays.asList(new QueryEntity(AffinityKey.class, Organization.class))));
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
return cfg;
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class JdbcThinAbstractDmlStatementSelfTest method binaryCacheConfig.
/**
* @return Cache configuration for binary marshaller tests.
*/
final CacheConfiguration binaryCacheConfig() {
CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
QueryEntity e = new QueryEntity();
e.setKeyType(String.class.getName());
e.setValueType("Person");
e.addQueryField("id", Integer.class.getName(), null);
e.addQueryField("age", Integer.class.getName(), null);
e.addQueryField("firstName", String.class.getName(), null);
e.addQueryField("lastName", String.class.getName(), null);
cache.setQueryEntities(Collections.singletonList(e));
return cache;
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class JdbcThinAbstractDmlStatementSelfTest method getBinaryConfiguration.
/**
* @param igniteInstanceName Ignite instance name.
* @return Grid configuration used for starting the grid ready for manipulating binary objects.
* @throws Exception If failed.
*/
IgniteConfiguration getBinaryConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = getConfiguration0(igniteInstanceName);
cfg.setMarshaller(new BinaryMarshaller());
CacheConfiguration ccfg = cfg.getCacheConfiguration()[0];
ccfg.getQueryEntities().clear();
QueryEntity e = new QueryEntity();
e.setKeyType(String.class.getName());
e.setValueType("Person");
e.addQueryField("id", Integer.class.getName(), null);
e.addQueryField("age", Integer.class.getName(), null);
e.addQueryField("firstName", String.class.getName(), null);
e.addQueryField("lastName", String.class.getName(), null);
ccfg.setQueryEntities(Collections.singletonList(e));
return cfg;
}
Aggregations