Search in sources :

Example 11 with BinaryMarshaller

use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.

the class IgniteCacheNoClassQuerySelfTest method getConfiguration.

/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
    c.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true).setIpFinder(ipFinder));
    CacheConfiguration cc = defaultCacheConfiguration();
    c.setMarshaller(new BinaryMarshaller());
    cc.setName("cache");
    cc.setAtomicityMode(TRANSACTIONAL);
    cc.setWriteSynchronizationMode(FULL_SYNC);
    cc.setRebalanceMode(SYNC);
    QueryEntity qryEntity = new QueryEntity();
    qryEntity.setKeyType(Integer.class.getName());
    qryEntity.setValueType("MyClass");
    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("strField", String.class.getName());
    fields.put("intField", Integer.class.getName());
    fields.put("doubleField", Double.class.getName());
    qryEntity.setFields(fields);
    qryEntity.setFields(fields);
    qryEntity.setIndexes(Arrays.asList(new QueryIndex("strField"), new QueryIndex("intField"), new QueryIndex("doubleField")));
    cc.setQueryEntities(Collections.singletonList(qryEntity));
    c.setCacheConfiguration(cc);
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) QueryIndex(org.apache.ignite.cache.QueryIndex) QueryEntity(org.apache.ignite.cache.QueryEntity) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) LinkedHashMap(java.util.LinkedHashMap)

Example 12 with BinaryMarshaller

use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.

the class CacheStartupInDeploymentModesTest method testStartedInPrivateMode.

/**
     * @throws Exception If fail.
     */
public void testStartedInPrivateMode() throws Exception {
    deploymentMode = DeploymentMode.PRIVATE;
    marshaller = new BinaryMarshaller();
    doCheckStarted(deploymentMode);
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller)

Example 13 with BinaryMarshaller

use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.

the class CacheStartupInDeploymentModesTest method testStartedInIsolatedMode.

/**
     * @throws Exception If fail.
     */
public void testStartedInIsolatedMode() throws Exception {
    deploymentMode = DeploymentMode.ISOLATED;
    marshaller = new BinaryMarshaller();
    doCheckStarted(deploymentMode);
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller)

Example 14 with BinaryMarshaller

use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.

the class CacheStartupInDeploymentModesTest method doCheckStarted.

/**
     * @param mode Deployment mode.
     * @throws Exception If failed.
     */
private void doCheckStarted(DeploymentMode mode) throws Exception {
    startGridsMultiThreaded(2);
    checkTopology(2);
    assertEquals(mode, ignite(0).configuration().getDeploymentMode());
    assert ignite(0).configuration().getMarshaller() instanceof BinaryMarshaller;
    IgniteCache rCache = ignite(0).cache(REPLICATED_CACHE);
    checkPutCache(rCache);
    IgniteCache pCache = ignite(0).cache(PARTITIONED_CACHE);
    checkPutCache(pCache);
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) IgniteCache(org.apache.ignite.IgniteCache)

Example 15 with BinaryMarshaller

use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.

the class GridCacheBinaryObjectsAbstractDataStreamerSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    cacheCfg.setCacheMode(cacheMode());
    cacheCfg.setAtomicityMode(atomicityMode());
    cacheCfg.setNearConfiguration(nearConfiguration());
    cacheCfg.setWriteSynchronizationMode(writeSynchronizationMode());
    cfg.setCacheConfiguration(cacheCfg);
    BinaryConfiguration bCfg = new BinaryConfiguration();
    bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName())));
    cfg.setBinaryConfiguration(bCfg);
    cfg.setMarshaller(new BinaryMarshaller());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) BinaryTypeConfiguration(org.apache.ignite.binary.BinaryTypeConfiguration) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Aggregations

BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)87 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)56 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)30 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)21 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)12 Ignite (org.apache.ignite.Ignite)9 ArrayList (java.util.ArrayList)8 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)8 GridBinaryMarshaller (org.apache.ignite.internal.binary.GridBinaryMarshaller)8 BinaryContext (org.apache.ignite.internal.binary.BinaryContext)7 BinaryObject (org.apache.ignite.binary.BinaryObject)6 NullLogger (org.apache.ignite.logger.NullLogger)6 Marshaller (org.apache.ignite.marshaller.Marshaller)6 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)5 MarshallerContextTestImpl (org.apache.ignite.marshaller.MarshallerContextTestImpl)5 Connection (java.sql.Connection)4 ResultSet (java.sql.ResultSet)4 HashMap (java.util.HashMap)4 IgniteException (org.apache.ignite.IgniteException)4 CacheKeyConfiguration (org.apache.ignite.cache.CacheKeyConfiguration)4