Search in sources :

Example 41 with BinaryMarshaller

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

the class IgniteExternalizableAbstractTest method getMarshallers.

/**
 * @return Marshallers.
 */
protected List<Marshaller> getMarshallers() throws IgniteCheckedException {
    List<Marshaller> marshallers = new ArrayList<>();
    BinaryMarshaller bin = createStandaloneBinaryMarshaller();
    marshallers.add(new JdkMarshaller());
    marshallers.add(bin);
    return marshallers;
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) Marshaller(org.apache.ignite.marshaller.Marshaller) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) ArrayList(java.util.ArrayList) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller)

Example 42 with BinaryMarshaller

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

the class CacheEnumOperationsAbstractTest method assertBinaryEnum.

/**
 * @param cache Cache.
 * @param key Key.
 * @param expVal Expected value.
 */
private static void assertBinaryEnum(IgniteCache<Object, Object> cache, int key, TestEnum expVal) {
    Marshaller marsh = ((IgniteCacheProxy) cache).context().marshaller();
    if (marsh instanceof BinaryMarshaller) {
        BinaryObject enumObj = (BinaryObject) cache.withKeepBinary().get(key);
        assertEquals(expVal.ordinal(), enumObj.enumOrdinal());
        assertTrue(enumObj.type().isEnum());
        assertTrue(enumObj instanceof BinaryEnumObjectImpl);
    }
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) Marshaller(org.apache.ignite.marshaller.Marshaller) BinaryObject(org.apache.ignite.binary.BinaryObject) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) BinaryEnumObjectImpl(org.apache.ignite.internal.binary.BinaryEnumObjectImpl)

Example 43 with BinaryMarshaller

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

the class CacheKeepBinaryTransactionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TransactionConfiguration txCfg = new TransactionConfiguration();
    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;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 44 with BinaryMarshaller

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

the class GridManagerStopSelfTest method testStopCommunicationManager.

/**
 * @throws Exception If failed.
 */
public void testStopCommunicationManager() throws Exception {
    CommunicationSpi spi = new TcpCommunicationSpi();
    injectLogger(spi);
    ctx.config().setCommunicationSpi(spi);
    ctx.config().setMarshaller(new BinaryMarshaller());
    GridIoManager mgr = new GridIoManager(ctx);
    mgr.onKernalStop(true);
    mgr.stop(false);
}
Also used : CommunicationSpi(org.apache.ignite.spi.communication.CommunicationSpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridIoManager(org.apache.ignite.internal.managers.communication.GridIoManager) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Example 45 with BinaryMarshaller

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

the class GridCacheStoreManagerDeserializationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(final String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
    if (igniteInstanceName != null && igniteInstanceName.toLowerCase().startsWith("binary"))
        c.setMarshaller(new BinaryMarshaller());
    else
        c.setMarshaller(new JdkMarshaller());
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    c.setDiscoverySpi(disco);
    c.setCacheConfiguration(cacheConfiguration());
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) 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