Search in sources :

Example 66 with BinaryMarshaller

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

the class CacheGetFutureHangsSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    cfg.setMarshaller(new BinaryMarshaller());
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
    ccfg.setNearConfiguration(null);
    cfg.setCacheConfiguration(ccfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 67 with BinaryMarshaller

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

the class DynamicProxySerializationMultiJvmSelfTest method testToBinary.

/**
 * @throws Exception If failed.
 */
public void testToBinary() throws Exception {
    marshFactory = new Callable<Marshaller>() {

        @Override
        public Marshaller call() throws Exception {
            return new BinaryMarshaller();
        }
    };
    Ignite ignite = startGrid(0);
    MyProxy p = create();
    MyProxy p0 = ignite.binary().toBinary(p);
    assertSame(p, p0);
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) OptimizedMarshaller(org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) Ignite(org.apache.ignite.Ignite)

Example 68 with BinaryMarshaller

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

the class DynamicProxySerializationMultiJvmSelfTest method testBinaryField.

/**
 * @throws Exception If failed.
 */
public void testBinaryField() throws Exception {
    marshFactory = new Callable<Marshaller>() {

        @Override
        public Marshaller call() throws Exception {
            return new BinaryMarshaller();
        }
    };
    Ignite ignite = startGrids(2);
    BinaryObject bo = ignite.binary().builder("ProxyWrapper").setField("proxy", create()).build();
    int val = ignite.compute(ignite.cluster().forRemotes()).call(new FieldTestCallable(bo));
    assertEquals(42, val);
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) OptimizedMarshaller(org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller) BinaryObject(org.apache.ignite.binary.BinaryObject) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) Ignite(org.apache.ignite.Ignite)

Example 69 with BinaryMarshaller

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

the class DynamicProxySerializationMultiJvmSelfTest method testBinaryMarshaller.

/**
 * @throws Exception If failed.
 */
public void testBinaryMarshaller() throws Exception {
    marshFactory = new Callable<Marshaller>() {

        @Override
        public Marshaller call() throws Exception {
            return new BinaryMarshaller();
        }
    };
    doTestMarshaller();
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) OptimizedMarshaller(org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller)

Example 70 with BinaryMarshaller

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

the class IgniteMessagingWithClientTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setMarshaller(new BinaryMarshaller());
    if (igniteInstanceName.equals(getTestIgniteInstanceName(2))) {
        cfg.setClientMode(true);
        ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setForceServerMode(true);
    }
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)93 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)61 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)34 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)22 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)14 Ignite (org.apache.ignite.Ignite)9 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)9 GridBinaryMarshaller (org.apache.ignite.internal.binary.GridBinaryMarshaller)9 BinaryContext (org.apache.ignite.internal.binary.BinaryContext)8 ArrayList (java.util.ArrayList)7 BinaryObject (org.apache.ignite.binary.BinaryObject)7 Marshaller (org.apache.ignite.marshaller.Marshaller)7 IgniteException (org.apache.ignite.IgniteException)6 NullLogger (org.apache.ignite.logger.NullLogger)6 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)6 HashMap (java.util.HashMap)5 CacheKeyConfiguration (org.apache.ignite.cache.CacheKeyConfiguration)5 MarshallerContextTestImpl (org.apache.ignite.marshaller.MarshallerContextTestImpl)5 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)4 JdkMarshaller (org.apache.ignite.marshaller.jdk.JdkMarshaller)4