use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgfsTaskSelfTest method config.
/**
* Create grid configuration.
*
* @param idx Node index.
* @return Grid configuration
*/
private IgniteConfiguration config(int idx) {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(BLOCK_SIZE);
igfsCfg.setDefaultMode(PRIMARY);
igfsCfg.setFragmentizerEnabled(false);
CacheConfiguration dataCacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(1));
dataCacheCfg.setBackups(0);
CacheConfiguration metaCacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIgniteInstanceName("node-" + idx);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class SpringAppCfg method igniteInstance.
/**
* Creating Apache Ignite instance bean. A bean will be passed to {@link IgniteRepositoryFactoryBean} to initialize
* all Ignite based Spring Data repositories and connect to a cluster.
*/
@Bean
public Ignite igniteInstance() {
IgniteConfiguration cfg = new IgniteConfiguration();
// Setting some custom name for the node.
cfg.setIgniteInstanceName("springDataNode");
// Enabling peer-class loading feature.
cfg.setPeerClassLoadingEnabled(true);
// Defining and creating a new cache to be used by Ignite Spring Data repository.
CacheConfiguration ccfg = new CacheConfiguration("PersonCache");
// Setting SQL schema for the cache.
ccfg.setIndexedTypes(Long.class, Person.class);
cfg.setCacheConfiguration(ccfg);
return Ignition.start(cfg);
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class RestProcessorTest method testRest.
/**
* @throws Exception If failed.
*/
public void testRest() throws Exception {
IgniteConfiguration cfg = getConfiguration((String) null);
cfg = cacheTestConfiguration(cfg);
G.start(cfg);
populateCache();
deployTasks();
// Wait until Ok is pressed.
JOptionPane.showMessageDialog(null, new JComponent[] { new JLabel("Ignite started."), new JLabel("<html>" + "You can use JMX console at <u>http://localhost:1234</u>" + "</html>"), new JLabel("Press OK to stop Ignite.") }, "Ignite Startup JUnit", JOptionPane.INFORMATION_MESSAGE);
G.stop(true);
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class JdbcThinMetadataSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgniteCacheDatabaseSharedManager method registerMetricsMBeans.
/**
* Registers MBeans for all DataRegionMetrics configured in this instance.
*/
private void registerMetricsMBeans() {
if (U.IGNITE_MBEANS_DISABLED)
return;
IgniteConfiguration cfg = cctx.gridConfig();
for (DataRegionMetrics memMetrics : memMetricsMap.values()) {
DataRegionConfiguration memPlcCfg = dataRegionMap.get(memMetrics.getName()).config();
registerMetricsMBean((DataRegionMetricsImpl) memMetrics, memPlcCfg, cfg);
}
}
Aggregations