本文整理汇总了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;
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}