org.apache.log4j.varia.NullAppender#org.apache.ignite.configuration.IgniteConfiguration源码实例Demo

下面列出了org.apache.log4j.varia.NullAppender#org.apache.ignite.configuration.IgniteConfiguration 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(
        String.class, Integer.class
    );

    cfg.setCacheConfiguration(cache);

    return cfg;
}
 
源代码2 项目: ignite   文件: CacheContinuousBatchAckTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    if (igniteInstanceName.endsWith(CLIENT)) {
        cfg.setClientMode(true);

        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(true, false));
    }
    else if (igniteInstanceName.endsWith(SERVER2))
        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(false, true));
    else
        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(false, false));

    return cfg;
}
 
/** */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    return super.getConfiguration(igniteInstanceName)
        .setDataStorageConfiguration(
            new DataStorageConfiguration().setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setInitialSize(10 * 1024L * 1024L)
                    .setMaxSize(50 * 1024L * 1024L)
            )
            .setCheckpointFrequency(Long.MAX_VALUE / 2)
        )
        .setCacheConfiguration(
            new CacheConfiguration(DEFAULT_CACHE_NAME)
                .setBackups(1)
                .setSqlSchema("PUBLIC")
        )
        .setGridLogger(testLog);
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setWalSegmentSize(WAL_SEGMENT_SIZE)
            .setWalSegments(2)
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
            )
    );

    cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME));

    return cfg;
}
 
源代码5 项目: ignite   文件: TcpCommunicationSpiMultiJvmTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpCommunicationSpi commSpi = new TestCommunicationSpi(replacingAttrSpi);
    commSpi.setLocalPort(45010);

    if (localAddrStr != null)
        commSpi.setLocalAddress(localAddrStr);

    if (externalAddr != null) {

        commSpi.setAddressResolver(new AddressResolver() {
            @Override public Collection<InetSocketAddress> getExternalAddresses(
                InetSocketAddress addr) throws IgniteCheckedException {
                return Collections.singletonList(externalAddr);
            }
        });
    }
    else
        commSpi.setLocalAddress(InetAddress.getLocalHost().getHostName());

    cfg.setCommunicationSpi(commSpi);

    return cfg;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();

    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setBackups(1);
    cacheCfg.setIndexedTypes(
        AffinityUuid.class, Purchase.class
    );

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
/** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

        c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        c.setIncludeProperties();
        c.setDeploymentMode(DeploymentMode.SHARED);
        c.setNetworkTimeout(10000);
        c.setConnectorConfiguration(null);

//        c.setPeerClassLoadingLocalClassPathExclude(GridCachePreloadLifecycleAbstractTest.class.getName(),
//            MyValue.class.getName());

        c.setPublicThreadPoolSize(10);
        c.setSystemThreadPoolSize(10);
        c.setPeerClassLoadingThreadPoolSize(3);

        c.setLifecycleBeans(lifecycleBean);

        return c;
    }
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setName(CACHE_NAME);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MINUTES, 10)));

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
源代码9 项目: ignite   文件: CacheDataPageScanQueryTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String instanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(instanceName);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE)
            ));

    cfg.setCacheConfiguration(
        new CacheConfiguration(CACHE)
            .setAtomicityMode(ATOMIC)
            .setAffinity(
                new RendezvousAffinityFunction()
                    .setPartitions(PARTS)
            )
    );

    return cfg;
}
 
源代码10 项目: ignite   文件: AbstractSnapshotSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi discoSpi = new BlockingCustomMessageDiscoverySpi();

    discoSpi.setIpFinder(((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder());

    return cfg.setConsistentId(igniteInstanceName)
        .setCommunicationSpi(new TestRecordingCommunicationSpi())
        .setDataStorageConfiguration(new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
                .setMaxSize(100L * 1024 * 1024)
                .setPersistenceEnabled(persistence))
            .setCheckpointFrequency(3000)
            .setPageSize(4096))
        .setCacheConfiguration(dfltCacheCfg)
        .setClusterStateOnStart(INACTIVE)
        .setDiscoverySpi(discoSpi);
}
 
源代码11 项目: ignite   文件: GridCacheBasicStoreAbstractTest.java
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);

    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(cacheMode());
    cc.setWriteSynchronizationMode(FULL_SYNC);
    cc.setAtomicityMode(atomicityMode());
    cc.setRebalanceMode(SYNC);

    cc.setCacheStoreFactory(singletonFactory(store));
    cc.setReadThrough(true);
    cc.setWriteThrough(true);
    cc.setLoadPreviousValue(true);

    c.setCacheConfiguration(cc);

    return c;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();

    commSpi.setSocketWriteTimeout(1000);
    commSpi.setSharedMemoryPort(-1);
    commSpi.setConnectionsPerNode(connectionsPerNode());

    cfg.setCommunicationSpi(commSpi);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setCacheMode(PARTITIONED);
    ccfg.setAtomicityMode(atomicityMode());
    ccfg.setBackups(1);
    ccfg.setNearConfiguration(null);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
源代码13 项目: ignite   文件: GridAbstractTest.java
/**
 * @return Test kernal context.
 */
protected GridTestKernalContext newContext() throws IgniteCheckedException {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setClientMode(false);
    cfg.setDiscoverySpi(new TcpDiscoverySpi() {
        @Override public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
            // No-op.
        }
    });
    cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi() {
        @Override protected void register(SystemView<?> sysView) {
            // No-op.
        }
    });

    GridTestKernalContext ctx = new GridTestKernalContext(log(), cfg);
    return ctx;
}
 
源代码14 项目: ignite   文件: IgniteDbPutGetWithCacheStoreTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    DataStorageConfiguration dbCfg = new DataStorageConfiguration();

    dbCfg
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(512L * 1024 * 1024)
                .setPersistenceEnabled(true))
        .setWalMode(WALMode.LOG_ONLY);

    cfg.setDataStorageConfiguration(dbCfg);

    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(CACHE_NAME)
        .setCacheStoreFactory(new IgniteReflectionFactory<>(TestStore.class))
        .setAtomicityMode(atomicityMode)
        .setBackups(1)
        .setWriteThrough(true)
        .setReadThrough(true);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
源代码15 项目: ignite   文件: IgnitePersistentStoreTest.java
private IgniteConfiguration igniteConfig() throws IOException {
    URL url = getClass().getClassLoader().getResource("org/apache/ignite/tests/persistence/pojo/persistence-settings-3.xml");
    String persistence = U.readFileToString(url.getFile(), "UTF-8");

    KeyValuePersistenceSettings persistenceSettings = new KeyValuePersistenceSettings(persistence);

    DataSource dataSource = new DataSource();
    dataSource.setContactPoints(CassandraHelper.getContactPointsArray());
    dataSource.setCredentials(new CassandraAdminCredentials());
    dataSource.setLoadBalancingPolicy(new RoundRobinPolicy());

    CassandraCacheStoreFactory<String, Person> storeFactory = new CassandraCacheStoreFactory<>();
    storeFactory.setDataSource(dataSource);
    storeFactory.setPersistenceSettings(persistenceSettings);

    CacheConfiguration<String, Person> cacheConfiguration = new CacheConfiguration<>();
    cacheConfiguration.setName("cache1");
    cacheConfiguration.setReadThrough(true);
    cacheConfiguration.setWriteThrough(true);
    cacheConfiguration.setCacheStoreFactory(storeFactory);

    IgniteConfiguration config = new IgniteConfiguration();
    config.setCacheConfiguration(cacheConfiguration);

    return config;
}
 
源代码16 项目: ignite   文件: IgniteCacheMultiTxLockSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    ccfg.setName(CACHE_NAME);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
    ccfg.setBackups(2);
    ccfg.setCacheMode(PARTITIONED);

    LruEvictionPolicy plc = new LruEvictionPolicy();
    plc.setMaxSize(100000);

    ccfg.setEvictionPolicy(plc);
    ccfg.setOnheapCacheEnabled(true);

    c.setCacheConfiguration(ccfg);

    return c;
}
 
源代码17 项目: ignite   文件: HibernateL2CacheSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(discoSpi);

    cfg.setCacheConfiguration(generalRegionConfiguration(DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME),
        generalRegionConfiguration(DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME),
        transactionalRegionConfiguration(ENTITY_NAME),
        transactionalRegionConfiguration(ENTITY2_NAME),
        transactionalRegionConfiguration(VERSIONED_ENTITY_NAME),
        transactionalRegionConfiguration(PARENT_ENTITY_NAME),
        transactionalRegionConfiguration(CHILD_ENTITY_NAME),
        transactionalRegionConfiguration(CHILD_COLLECTION_REGION),
        transactionalRegionConfiguration(NATURAL_ID_REGION),
        transactionalRegionConfiguration(NATURAL_ID_REGION2));

    return cfg;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.setConsistentId(igniteInstanceName);

    CacheConfiguration<?, ?> cc = defaultCacheConfiguration();

    cc.setCacheMode(PARTITIONED);
    cc.setBackups(1);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc.setAtomicityMode(TRANSACTIONAL);
    cc.setRebalanceMode(SYNC);
    cc.setAffinity(new RendezvousAffinityFunction(false, 15));
    cc.setIndexedTypes(
        Integer.class, Integer.class
    );

    c.setCacheConfiguration(cc);
    c.setIncludeEventTypes(EventType.EVTS_ALL);

    return c;
}
 
源代码19 项目: ignite   文件: JdbcThinStatementCancelSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setSqlFunctionClasses(TestSQLFunctions.class);
    cache.setIndexedTypes(Integer.class, Integer.class, Long.class, Long.class, String.class,
        JdbcThinAbstractDmlStatementSelfTest.Person.class);

    cfg.setCacheConfiguration(cache);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().
        setThreadPoolSize(SERVER_THREAD_POOL_SIZE));

    return cfg;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);

    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<Integer, TestObject> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cacheCfg.setCacheStoreFactory(new StoreFactory());
    cacheCfg.setReadThrough(true);
    cacheCfg.setLoadPreviousValue(true);

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration cacheCfg = defaultCacheConfiguration();

    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setBackups(BACKUPS);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setRebalanceMode(SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
源代码22 项目: ignite   文件: Ignition.java
/**
 * Gets or starts new grid instance if it hasn't been started yet.
 *
 * @param cfg Grid configuration. This cannot be {@code null}.
 * @return Grid instance.
 * @throws IgniteException If grid could not be started.
 */
public static Ignite getOrStart(IgniteConfiguration cfg) throws IgniteException {
    try {
        return wrapToProxyIfNeeded(IgnitionEx.start(cfg, false));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
}
 
源代码23 项目: ignite   文件: CacheGetEntryAbstractTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMarshaller(null);

    return cfg;
}
 
源代码24 项目: ignite   文件: GridTestBinaryMarshaller.java
/**
 * @param log Logger.
 */
private BinaryMarshaller createBinaryMarshaller(IgniteLogger log) throws IgniteCheckedException {
    IgniteConfiguration iCfg = new IgniteConfiguration()
        .setBinaryConfiguration(
            new BinaryConfiguration().setCompactFooter(true)
        )
        .setClientMode(false)
        .setDiscoverySpi(new TcpDiscoverySpi() {
            @Override public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
                //No-op.
            }
        });

    BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());

    MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl();

    marshCtx.onMarshallerProcessorStarted(new GridTestKernalContext(log, iCfg), null);

    BinaryMarshaller marsh = new BinaryMarshaller();

    marsh.setContext(marshCtx);

    IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);

    return marsh;
}
 
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setSocketTimeout(50);
    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setAckTimeout(50);

    return cfg;
}
 
源代码26 项目: ignite   文件: JdbcThinComplexQuerySelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setCacheConfiguration(cacheConfiguration());

    return cfg;
}
 
源代码27 项目: ignite   文件: GridMBeansTest.java
/**
 * {@inheritDoc}
 *
 * This implementation registers adds custom executors to the configuration.
 */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setExecutorConfiguration(new ExecutorConfiguration(CUSTOM_EXECUTOR_0),
        new ExecutorConfiguration(CUSTOM_EXECUTOR_1));

    return cfg;
}
 
源代码28 项目: ignite   文件: GridCacheEntryMemorySizeSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMarshaller(createMarshaller());

    return cfg;
}
 
源代码29 项目: ignite   文件: TransactionSensitiveDataTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    return super.getConfiguration(igniteInstanceName)
        .setConsistentId(igniteInstanceName)
        .setGridLogger(testLog)
        .setCommunicationSpi(new TestRecordingCommunicationSpi())
        .setCacheConfiguration(
            new CacheConfiguration<>(DEFAULT_CACHE_NAME)
                .setAtomicityMode(TRANSACTIONAL)
                .setBackups(NODE_COUNT)
                .setAffinity(new RendezvousAffinityFunction(false, 10))
        );
}
 
源代码30 项目: ignite   文件: GridP2PJobClassLoaderSelfTest.java
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setDeploymentMode(depMode);

    return cfg;
}