Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setMarshaller()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setMarshaller() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IgniteHadoopFileSystemAbstractSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = new IgniteConfiguration(); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(IP_FINDER); cfg.setIgniteInstanceName(igniteInstanceName); cfg.setMarshaller(new BinaryMarshaller()); cfg.setDiscoverySpi(discoSpi); cfg.setFileSystemConfiguration(igfsConfiguration(igniteInstanceName)); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); cfg.setFailureHandler(new NoOpFailureHandler()); return cfg; }
Example 2
Source File: ClientReconnectAfterClusterRestartTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(new BinaryMarshaller()); cfg.setIncludeEventTypes(EventType.EVTS_CACHE); if (getTestIgniteInstanceName(CLIENT_ID).equals(igniteInstanceName)) { CacheConfiguration ccfg = getCacheConfiguration(); cfg.setCacheConfiguration(ccfg); } if (joinTimeout != 0 && getTestIgniteInstanceName(1).equals(igniteInstanceName)) ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setJoinTimeout(joinTimeout); return cfg; }
Example 3
Source File: BinaryObjectExceptionSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); cfg.setMarshaller(new BinaryMarshaller()); cfg.setCacheConfiguration( new CacheConfiguration(cacheName) .setCopyOnRead(true) ); BinaryConfiguration bcfg = new BinaryConfiguration() .setNameMapper(new BinaryBasicNameMapper(false)); cfg.setBinaryConfiguration(bcfg); return cfg; }
Example 4
Source File: OptimizedMarshallerNodeFailoverTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(new OptimizedMarshaller()); cfg.setWorkDirectory(workDir); if (cache) { CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setCacheMode(PARTITIONED); ccfg.setBackups(1); ccfg.setWriteSynchronizationMode(FULL_SYNC); cfg.setCacheConfiguration(ccfg); } else cfg.setClientMode(true); return cfg; }
Example 5
Source File: IgniteCacheLockPartitionOnAffinityRunAbstractTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); // Enables template with default test configuration cfg.setCacheConfiguration(F.concat(cfg.getCacheConfiguration(), cacheConfiguration(igniteInstanceName).setName("*"))); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); cfg.setMarshaller(new BinaryMarshaller()); // TODO remove key configuration when https://issues.apache.org/jira/browse/IGNITE-5795 is fixed. cfg.setCacheKeyConfiguration(new CacheKeyConfiguration(Person.Key.class.getName(), "orgId")); AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi(); failSpi.setMaximumFailoverAttempts(MAX_FAILOVER_ATTEMPTS); cfg.setFailoverSpi(failSpi); return cfg; }
Example 6
Source File: DynamicProxySerializationMultiJvmSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(marshFactory.call()); return cfg; }
Example 7
Source File: GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(new BinaryMarshaller()); return cfg; }
Example 8
Source File: GridLocalIgniteSerializationTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(final String igniteInstanceName) throws Exception { final IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (igniteInstanceName != null && igniteInstanceName.startsWith("binary")) cfg.setMarshaller(new BinaryMarshaller()); return cfg; }
Example 9
Source File: BinaryEnumsSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (register) { BinaryConfiguration bCfg = new BinaryConfiguration(); BinaryTypeConfiguration enumCfg = new BinaryTypeConfiguration(EnumType.class.getName()); enumCfg.setEnum(true); if (igniteInstanceName.equals(WRONG_CONF_NODE_NAME)) enumCfg.setEnumValues(F.asMap(EnumType.ONE.name(), EnumType.ONE.ordinal(), EnumType.TWO.name(), EnumType.ONE.ordinal())); else enumCfg.setEnumValues(F.asMap(EnumType.ONE.name(), EnumType.ONE.ordinal(), EnumType.TWO.name(), EnumType.TWO.ordinal())); bCfg.setTypeConfigurations(Arrays.asList(enumCfg, new BinaryTypeConfiguration(EnumHolder.class.getName()))); cfg.setBinaryConfiguration(bCfg); } cfg.setMarshaller(new BinaryMarshaller()); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(CACHE_NAME); ccfg.setCacheMode(CacheMode.PARTITIONED); cfg.setCacheConfiguration(ccfg); return cfg; }
Example 10
Source File: GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(new BinaryMarshaller()); return cfg; }
Example 11
Source File: GridClosureSerializationTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(final String igniteInstanceName) throws Exception { final IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(null); return cfg; }
Example 12
Source File: BinaryObjectBuilderAdditionalSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cacheCfg.setCacheMode(REPLICATED); CacheConfiguration cacheCfg2 = new CacheConfiguration("partitioned"); cacheCfg2.setCacheMode(PARTITIONED); cfg.setCacheConfiguration(cacheCfg, cacheCfg2); BinaryConfiguration bCfg = new BinaryConfiguration(); bCfg.setCompactFooter(compactFooter()); bCfg.setClassNames(Arrays.asList("org.apache.ignite.internal.binary.mutabletest.*")); cfg.setMarshaller(new BinaryMarshaller()); return cfg; }
Example 13
Source File: IgniteDbAbstractTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); DataStorageConfiguration dbCfg = new DataStorageConfiguration(); if (client) cfg.setClientMode(true); dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4); if (isLargePage()) dbCfg.setPageSize(16 * 1024); dbCfg.setWalMode(WALMode.LOG_ONLY); dbCfg.setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE) ); configure(dbCfg); cfg.setDataStorageConfiguration(dbCfg); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); if (indexingEnabled()) ccfg.setIndexedTypes(Integer.class, DbValue.class); ccfg.setAtomicityMode(TRANSACTIONAL); ccfg.setWriteSynchronizationMode(FULL_SYNC); ccfg.setRebalanceMode(SYNC); ccfg.setAffinity(new RendezvousAffinityFunction(false, 32)); CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive"); if (indexingEnabled()) ccfg2.setIndexedTypes(DbKey.class, DbValue.class); ccfg2.setAtomicityMode(TRANSACTIONAL); ccfg2.setWriteSynchronizationMode(FULL_SYNC); ccfg2.setRebalanceMode(SYNC); ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32)); CacheConfiguration ccfg3 = new CacheConfiguration("large"); if (indexingEnabled()) ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class); ccfg3.setAtomicityMode(TRANSACTIONAL); ccfg3.setWriteSynchronizationMode(FULL_SYNC); ccfg3.setRebalanceMode(SYNC); ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32)); CacheConfiguration ccfg4 = new CacheConfiguration("tiny"); ccfg4.setAtomicityMode(TRANSACTIONAL); ccfg4.setWriteSynchronizationMode(FULL_SYNC); ccfg4.setRebalanceMode(SYNC); ccfg4.setAffinity(new RendezvousAffinityFunction(1, null)); CacheConfiguration ccfg5 = new CacheConfiguration("atomic"); if (indexingEnabled()) ccfg5.setIndexedTypes(DbKey.class, DbValue.class); ccfg5.setAtomicityMode(ATOMIC); ccfg5.setWriteSynchronizationMode(FULL_SYNC); ccfg5.setRebalanceMode(SYNC); ccfg5.setAffinity(new RendezvousAffinityFunction(false, 32)); if (!client) cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4, ccfg5); cfg.setMarshaller(null); configure(cfg); return cfg; }
Example 14
Source File: CacheKeepBinaryTransactionTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); TransactionConfiguration txCfg = new TransactionConfiguration(); if (!MvccFeatureChecker.forcedMvcc()) { txCfg.setDefaultTxConcurrency(TransactionConcurrency.OPTIMISTIC); txCfg.setDefaultTxIsolation(TransactionIsolation.REPEATABLE_READ); } cfg.setTransactionConfiguration(txCfg); cfg.setMarshaller(new BinaryMarshaller()); CacheConfiguration ccfg = new CacheConfiguration("tx-cache"); ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); cfg.setCacheConfiguration(ccfg); return cfg; }
Example 15
Source File: BinaryMetadataUpdatesFlowTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); cfg.setPeerClassLoadingEnabled(false); if (discoveryHook != null) { ((TestTcpDiscoverySpi)cfg.getDiscoverySpi()).discoveryHook(discoveryHook); cfg.setMetricsUpdateFrequency(1000); } cfg.setMarshaller(new BinaryMarshaller()); cfg.setClientMode("client".equals(gridName) || getTestIgniteInstanceIndex(gridName) >= GRID_CNT); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setCacheMode(CacheMode.REPLICATED); cfg.setCacheConfiguration(ccfg); return cfg; }
Example 16
Source File: GridCacheBinaryObjectsAbstractSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cacheCfg = createCacheConfig(); cacheCfg.setCacheStoreFactory(singletonFactory(new TestStore())); CacheConfiguration binKeysCacheCfg = createCacheConfig(); binKeysCacheCfg.setCacheStoreFactory(singletonFactory(new MapCacheStoreStrategy.MapCacheStore())); binKeysCacheCfg.setStoreKeepBinary(true); binKeysCacheCfg.setName("BinKeysCache"); cfg.setCacheConfiguration(cacheCfg, binKeysCacheCfg); cfg.setMarshaller(new BinaryMarshaller()); List<BinaryTypeConfiguration> binTypes = new ArrayList<>(); binTypes.add(new BinaryTypeConfiguration() {{ setTypeName("ArrayHashedKey"); }}); BinaryConfiguration binCfg = new BinaryConfiguration(); binCfg.setTypeConfigurations(binTypes); cfg.setBinaryConfiguration(binCfg); CacheKeyConfiguration arrayHashCfg = new CacheKeyConfiguration("ArrayHashedKey", "fld1"); cfg.setCacheKeyConfiguration(arrayHashCfg); GridCacheBinaryObjectsAbstractSelfTest.cfg = cfg; return cfg; }
Example 17
Source File: IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setPeerClassLoadingEnabled(false); cfg.setMarshaller(marshaller()); cfg.setUserAttributes(Collections.singletonMap(NODE_NAME_ATTR, igniteInstanceName)); if (extClsLdrGrids.contains(igniteInstanceName)) cfg.setClassLoader(extClsLdr); return cfg; }
Example 18
Source File: GridCacheBinaryStoreAbstractSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); BinaryConfiguration bCfg = new BinaryConfiguration(); bCfg.setNameMapper(new BinaryBasicNameMapper(false)); bCfg.setIdMapper(new BinaryBasicIdMapper(false)); bCfg.setClassNames(Arrays.asList(Key.class.getName(), Value.class.getName())); cfg.setBinaryConfiguration(bCfg); cfg.setMarshaller(new BinaryMarshaller()); CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cacheCfg.setCacheStoreFactory(singletonFactory(STORE)); cacheCfg.setStoreKeepBinary(keepBinaryInStore()); cacheCfg.setReadThrough(true); cacheCfg.setWriteThrough(true); cacheCfg.setLoadPreviousValue(true); cfg.setCacheConfiguration(cacheCfg); GridCacheBinaryStoreAbstractSelfTest.cfg = cfg; return cfg; }
Example 19
Source File: BinaryConfigurationConsistencySelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMarshaller(new BinaryMarshaller()); cfg.setBinaryConfiguration(binaryCfg); return cfg; }
Example 20
Source File: GridLifecycleAwareSelfTest.java From ignite with Apache License 2.0 | 2 votes |
/** {@inheritDoc} */ @Override protected final IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TestConnectorMessageInterceptor interceptor = new TestConnectorMessageInterceptor(); ConnectorConfiguration clientCfg = new ConnectorConfiguration(); clientCfg.setMessageInterceptor(interceptor); cfg.setConnectorConfiguration(clientCfg); lifecycleAwares.add(interceptor); TestSegmentationResolver segmentationRslvr = new TestSegmentationResolver(); cfg.setSegmentationResolvers(segmentationRslvr); lifecycleAwares.add(segmentationRslvr); TestContextFactory ctxFactory = new TestContextFactory(); clientCfg.setSslContextFactory(ctxFactory); lifecycleAwares.add(ctxFactory); TestLifecycleBean lifecycleBean = new TestLifecycleBean(); cfg.setLifecycleBeans(lifecycleBean); lifecycleAwares.add(lifecycleBean); TestMarshaller marshaller = new TestMarshaller(); cfg.setMarshaller(marshaller); lifecycleAwares.add(marshaller.lifecycleAware()); TestLogger testLog = new TestLogger(); cfg.setGridLogger(testLog); lifecycleAwares.add(testLog.lifecycleAware()); return cfg; }