use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.
the class HadoopExternalProcessStarter method run.
/**
* Run the process.
*
* @throws Exception If failed.
*/
public void run() throws Exception {
File outputDir = outputDirectory();
initializeStreams(outputDir);
ExecutorService msgExecSvc = Executors.newFixedThreadPool(Integer.getInteger("MSG_THREAD_POOL_SIZE", Runtime.getRuntime().availableProcessors() * 2));
IgniteLogger log = logger(outputDir);
HadoopExternalCommunication comm = new HadoopExternalCommunication(args.nodeId, args.childProcId, new JdkMarshaller(), log, msgExecSvc, "external", args.workDir);
comm.start();
HadoopProcessDescriptor nodeDesc = new HadoopProcessDescriptor(args.nodeId, args.parentProcId);
nodeDesc.address(args.addr);
nodeDesc.tcpPort(args.tcpPort);
nodeDesc.sharedMemoryPort(args.shmemPort);
HadoopChildProcessRunner runner = new HadoopChildProcessRunner();
runner.start(comm, nodeDesc, msgExecSvc, log);
System.err.println("Started");
System.err.flush();
System.setOut(new PrintStream(out));
System.setErr(new PrintStream(err));
}
use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.
the class HadoopSortingExternalTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setMarshaller(new JdkMarshaller());
return cfg;
}
use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.
the class IgniteH2Indexing method start.
/** {@inheritDoc} */
@SuppressWarnings("NonThreadSafeLazyInitialization")
@Override
public void start(GridKernalContext ctx, GridSpinBusyLock busyLock) throws IgniteCheckedException {
if (log.isDebugEnabled())
log.debug("Starting cache query index...");
this.busyLock = busyLock;
qryIdGen = new AtomicLong();
if (SysProperties.serializeJavaObject) {
U.warn(log, "Serialization of Java objects in H2 was enabled.");
SysProperties.serializeJavaObject = false;
}
String dbName = (ctx != null ? ctx.localNodeId() : UUID.randomUUID()).toString();
dbUrl = "jdbc:h2:mem:" + dbName + DB_OPTIONS;
org.h2.Driver.load();
try {
if (getString(IGNITE_H2_DEBUG_CONSOLE) != null) {
Connection c = DriverManager.getConnection(dbUrl);
int port = getInteger(IGNITE_H2_DEBUG_CONSOLE_PORT, 0);
WebServer webSrv = new WebServer();
Server web = new Server(webSrv, "-webPort", Integer.toString(port));
web.start();
String url = webSrv.addSession(c);
U.quietAndInfo(log, "H2 debug console URL: " + url);
try {
Server.openBrowser(url);
} catch (Exception e) {
U.warn(log, "Failed to open browser: " + e.getMessage());
}
}
} catch (SQLException e) {
throw new IgniteCheckedException(e);
}
if (ctx == null) {
// This is allowed in some tests.
nodeId = UUID.randomUUID();
marshaller = new JdkMarshaller();
} else {
this.ctx = ctx;
schemas.put(QueryUtils.DFLT_SCHEMA, new H2Schema(QueryUtils.DFLT_SCHEMA));
valCtx = new CacheQueryObjectValueContext(ctx);
nodeId = ctx.localNodeId();
marshaller = ctx.config().getMarshaller();
mapQryExec = new GridMapQueryExecutor(busyLock);
rdcQryExec = new GridReduceQueryExecutor(qryIdGen, busyLock);
mapQryExec.start(ctx, this);
rdcQryExec.start(ctx, this);
stmtCacheCleanupTask = ctx.timeout().schedule(new Runnable() {
@Override
public void run() {
cleanupStatementCache();
}
}, CLEANUP_STMT_CACHE_PERIOD, CLEANUP_STMT_CACHE_PERIOD);
dmlProc = new DmlStatementsProcessor();
ddlProc = new DdlStatementsProcessor();
dmlProc.start(ctx, this);
ddlProc.start(ctx, this);
}
if (JdbcUtils.serializer != null)
U.warn(log, "Custom H2 serialization is already configured, will override.");
JdbcUtils.serializer = h2Serializer();
// TODO https://issues.apache.org/jira/browse/IGNITE-2139
// registerMBean(igniteInstanceName, this, GridH2IndexingSpiMBean.class);
}
use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.
the class TcpClientDiscoveryMarshallerCheckSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (igniteInstanceName.endsWith("0"))
cfg.setMarshaller(new JdkMarshaller());
else {
cfg.setClientMode(true);
cfg.setMarshaller(new BinaryMarshaller());
}
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));
return cfg;
}
use of org.apache.ignite.marshaller.jdk.JdkMarshaller in project ignite by apache.
the class TcpDiscoveryMarshallerCheckSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setLocalHost("127.0.0.1");
if (flag)
cfg.setMarshaller(new JdkMarshaller());
else
cfg.setMarshaller(sameMarsh ? new JdkMarshaller() : new BinaryMarshaller());
// Flip flag.
flag = !flag;
return cfg;
}
Aggregations