Search in sources :

Example 6 with JdkMarshaller

use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.

the class HadoopExternalTaskExecutionSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setMarshaller(new JdkMarshaller());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller)

Example 7 with JdkMarshaller

use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.

the class HadoopExternalCommunicationSelfTest method checkSimpleMessageSending.

/**
     * @throws Exception If failed.
     */
private void checkSimpleMessageSending(boolean useShmem) throws Exception {
    UUID parentNodeId = UUID.randomUUID();
    Marshaller marsh = new JdkMarshaller();
    IgniteLogger log = log();
    HadoopExternalCommunication[] comms = new HadoopExternalCommunication[4];
    try {
        String name = "grid";
        TestHadoopListener[] lsnrs = new TestHadoopListener[4];
        int msgs = 10;
        for (int i = 0; i < comms.length; i++) {
            comms[i] = new HadoopExternalCommunication(parentNodeId, UUID.randomUUID(), marsh, log, Executors.newFixedThreadPool(1), name + i, U.defaultWorkDirectory());
            if (useShmem)
                comms[i].setSharedMemoryPort(14000);
            lsnrs[i] = new TestHadoopListener(msgs);
            comms[i].setListener(lsnrs[i]);
            comms[i].start();
        }
        for (int r = 0; r < msgs; r++) {
            for (int from = 0; from < comms.length; from++) {
                for (int to = 0; to < comms.length; to++) {
                    if (from == to)
                        continue;
                    comms[from].sendMessage(comms[to].localProcessDescriptor(), new TestMessage(from, to));
                }
            }
        }
        U.sleep(1000);
        for (TestHadoopListener lsnr : lsnrs) {
            lsnr.await(3_000);
            assertEquals(String.valueOf(lsnr.messages()), msgs * (comms.length - 1), lsnr.messages().size());
        }
    } finally {
        for (HadoopExternalCommunication comm : comms) {
            if (comm != null)
                comm.stop();
        }
    }
}
Also used : JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) Marshaller(org.apache.ignite.marshaller.Marshaller) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) HadoopExternalCommunication(org.apache.ignite.internal.processors.hadoop.taskexecutor.external.communication.HadoopExternalCommunication) UUID(java.util.UUID) IgniteLogger(org.apache.ignite.IgniteLogger)

Example 8 with JdkMarshaller

use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.

the class MarshallerUtils method jdkMarshaller.

/**
     * Create JDK marshaller with provided node name.
     *
     * @param nodeName Node name.
     * @return JDK marshaller.
     */
public static JdkMarshaller jdkMarshaller(@Nullable String nodeName) {
    JdkMarshaller marsh = new JdkMarshaller();
    setNodeName(new JdkMarshaller(), nodeName);
    return marsh;
}
Also used : JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller)

Example 9 with JdkMarshaller

use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.

the class GridDeploymentManagerStopSelfTest method testOnKernalStop.

/**
     * @throws Exception If failed.
     */
public void testOnKernalStop() throws Exception {
    DeploymentSpi spi = new GridTestDeploymentSpi();
    GridTestKernalContext ctx = newContext();
    ctx.config().setMarshaller(new JdkMarshaller());
    ctx.config().setDeploymentSpi(spi);
    GridResourceProcessor resProc = new GridResourceProcessor(ctx);
    resProc.setSpringContext(null);
    ctx.add(resProc);
    GridComponent mgr = new GridDeploymentManager(ctx);
    try {
        mgr.onKernalStop(true);
    } catch (Exception e) {
        error("Error during onKernalStop() callback.", e);
        assert false : "Unexpected exception " + e;
    }
}
Also used : GridComponent(org.apache.ignite.internal.GridComponent) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) GridResourceProcessor(org.apache.ignite.internal.processors.resource.GridResourceProcessor) DeploymentSpi(org.apache.ignite.spi.deployment.DeploymentSpi) IgniteSpiException(org.apache.ignite.spi.IgniteSpiException)

Example 10 with JdkMarshaller

use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.

the class GridCacheP2PUndeploySelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setNetworkTimeout(2000);
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(spi);
    cfg.setMarshaller(new JdkMarshaller());
    CacheConfiguration repCacheCfg = defaultCacheConfiguration();
    repCacheCfg.setName("replicated");
    repCacheCfg.setCacheMode(REPLICATED);
    repCacheCfg.setRebalanceMode(mode);
    repCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    repCacheCfg.setAtomicityMode(TRANSACTIONAL);
    // TODO GG-10884.
    //        if (offheap)
    //            repCacheCfg.setOffHeapMaxMemory(OFFHEAP);
    //        else
    //            repCacheCfg.setSwapEnabled(true);
    CacheConfiguration partCacheCfg = defaultCacheConfiguration();
    partCacheCfg.setName("partitioned");
    partCacheCfg.setCacheMode(PARTITIONED);
    partCacheCfg.setRebalanceMode(mode);
    partCacheCfg.setAffinity(new GridCacheModuloAffinityFunction(11, 1));
    partCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    partCacheCfg.setAtomicityMode(TRANSACTIONAL);
    // TODO GG-10884.
    //        if (offheap)
    //            partCacheCfg.setOffHeapMaxMemory(OFFHEAP);
    //        else
    //            partCacheCfg.setSwapEnabled(true);
    cfg.setCacheConfiguration(repCacheCfg, partCacheCfg);
    cfg.setDeploymentMode(SHARED);
    cfg.setPeerClassLoadingLocalClassPathExclude(GridCacheP2PUndeploySelfTest.class.getName());
    cfg.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, idxGen.getAndIncrement()));
    return cfg;
}
Also used : GridCacheModuloAffinityFunction(org.apache.ignite.internal.processors.cache.distributed.GridCacheModuloAffinityFunction) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

JdkMarshaller (org.apache.ignite.marshaller.jdk.JdkMarshaller)14 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)7 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)3 IgniteLogger (org.apache.ignite.IgniteLogger)2 HadoopExternalCommunication (org.apache.ignite.internal.processors.hadoop.taskexecutor.external.communication.HadoopExternalCommunication)2 Marshaller (org.apache.ignite.marshaller.Marshaller)2 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)2 File (java.io.File)1 PrintStream (java.io.PrintStream)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 UUID (java.util.UUID)1 ExecutorService (java.util.concurrent.ExecutorService)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 CacheException (javax.cache.CacheException)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 IgniteSystemProperties.getString (org.apache.ignite.IgniteSystemProperties.getString)1