当前位置: 首页>>代码示例>>Java>>正文


Java IgniteConfiguration.setIgniteHome方法代码示例

本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setIgniteHome方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setIgniteHome方法的具体用法?Java IgniteConfiguration.setIgniteHome怎么用?Java IgniteConfiguration.setIgniteHome使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.configuration.IgniteConfiguration的用法示例。


在下文中一共展示了IgniteConfiguration.setIgniteHome方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configuration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public IgniteConfiguration configuration() {
    if (staticCfg != null)
        return staticCfg;

    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setMarshaller(marshaller);
    cfg.setNodeId(nodeId);
    cfg.setMBeanServer(jmx);
    cfg.setIgniteHome(home);
    cfg.setLocalHost(locHost);

    try {
        cfg.setWorkDirectory(U.defaultWorkDirectory());
    }
    catch (IgniteCheckedException e) {
        throw new IgniteException("Failed to get default work directory.", e);
    }

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:IgniteMock.java

示例2: copyDefaultsFromSource

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @param cfg Config.
 * @param srcCfg Source config.
 */
private static void copyDefaultsFromSource(IgniteConfiguration cfg, IgniteConfiguration srcCfg) {
    cfg.setIgniteInstanceName(srcCfg.getIgniteInstanceName());
    cfg.setGridLogger(srcCfg.getGridLogger());
    cfg.setNodeId(srcCfg.getNodeId());
    cfg.setIgniteHome(srcCfg.getIgniteHome());
    cfg.setMBeanServer(srcCfg.getMBeanServer());
    cfg.setMetricsLogFrequency(srcCfg.getMetricsLogFrequency());
    cfg.setConnectorConfiguration(srcCfg.getConnectorConfiguration());
    cfg.setCommunicationSpi(srcCfg.getCommunicationSpi());
    cfg.setNetworkTimeout(srcCfg.getNetworkTimeout());
    cfg.setDiscoverySpi(srcCfg.getDiscoverySpi());
    cfg.setCheckpointSpi(srcCfg.getCheckpointSpi());
    cfg.setIncludeEventTypes(srcCfg.getIncludeEventTypes());

    // Specials.
    ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
    cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:ConfigVariationsFactory.java

示例3: testHandleAsync

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsync() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.to(5);
    req.from(2);

    req.path(igniteHome + "/work/log/" + "test.log");
    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertNull(resp.result().getError());
    assertEquals(GridRestResponse.STATUS_SUCCESS, resp.result().getSuccessStatus());
    assertNotNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridLogCommandHandlerTest.java

示例4: testHandleAsyncForNonExistingLines

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsyncForNonExistingLines() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.to(50);
    req.from(20);

    req.path(igniteHome + "/work/log/" + "test.log");
    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertEquals("Request parameter 'from' and 'to' are for lines that do not exist in log file.", resp.result().getError());
    assertEquals(GridRestResponse.STATUS_FAILED, resp.result().getSuccessStatus());
    assertNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridLogCommandHandlerTest.java

示例5: testHandleAsyncPathIsOutsideIgniteHome

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsyncPathIsOutsideIgniteHome() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.to(5);
    req.from(2);
    req.path("/home/users/mytest.log");

    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertEquals("Request parameter 'path' must contain a path to valid log file.", resp.result().getError());
    assertEquals(GridRestResponse.STATUS_FAILED, resp.result().getSuccessStatus());
    assertNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridLogCommandHandlerTest.java

示例6: testHandleAsyncFromGreaterThanTo

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsyncFromGreaterThanTo() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.to(5);
    req.from(7);

    req.path(igniteHome + "/work/log/" + "test.log");
    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertEquals("Request parameter 'from' must be less than 'to'.", resp.result().getError());
    assertEquals(GridRestResponse.STATUS_FAILED, resp.result().getSuccessStatus());
    assertNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridLogCommandHandlerTest.java

示例7: testHandleAsyncFromEqualTo

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsyncFromEqualTo() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.to(5);
    req.from(5);

    req.path(igniteHome + "/work/log/" + "test.log");
    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertEquals("Request parameter 'from' must be less than 'to'.", resp.result().getError());
    assertEquals(GridRestResponse.STATUS_FAILED, resp.result().getSuccessStatus());
    assertNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridLogCommandHandlerTest.java

示例8: newContext

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
private GridKernalContext newContext() throws IgniteCheckedException {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setIgniteHome(igniteHome);
    cfg.setClientMode(false);

    return new GridTestKernalContext(rootLog.getLogger(OptimizedMarshallerEnumSelfTest.class), cfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:OptimizedMarshallerEnumSelfTest.java

示例9: testHandleAsyncFromAndToNotSet

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testHandleAsyncFromAndToNotSet() throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteHome(igniteHome);
    GridTestKernalContext ctx = newContext(cfg);
    GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
    GridRestLogRequest req = new GridRestLogRequest();

    req.path(igniteHome + "/work/log/" + "test.log");
    IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);

    assertNull(resp.result().getError());
    assertEquals(GridRestResponse.STATUS_SUCCESS, resp.result().getSuccessStatus());
    assertNotNull(resp.result().getResponse());
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:GridLogCommandHandlerTest.java


注:本文中的org.apache.ignite.configuration.IgniteConfiguration.setIgniteHome方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。