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


Java U.getIgniteHome方法代码示例

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


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

示例1: writeConfiguration

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Writes down the configuration to local disk and returns its path.
 *
 * @param cfg the configuration to write.
 * @param pathFromIgniteHome path relatively to Ignite home.
 * @return Full path of the written configuration.
 */
static String writeConfiguration(Configuration cfg, String pathFromIgniteHome) throws IOException {
    if (!pathFromIgniteHome.startsWith("/"))
        pathFromIgniteHome = "/" + pathFromIgniteHome;

    final String path = U.getIgniteHome() + pathFromIgniteHome;

    delete(path);

    File file = new File(path);

    try (FileOutputStream fos = new FileOutputStream(file)) {
        cfg.writeXml(fos);
    }

    assertTrue(file.exists());
    return path;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:HadoopSecondaryFileSystemConfigurationTest.java

示例2: writeConfigurationToFile

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Write configuration to file.
 *
 * @param conf Configuration.
 * @throws Exception If failed.
 */
@SuppressWarnings("ResultOfMethodCallIgnored")
private static void writeConfigurationToFile(Configuration conf) throws Exception {
    final String path = U.getIgniteHome() + SECONDARY_CFG_PATH;

    File file = new File(path);

    file.delete();

    assertFalse(file.exists());

    try (FileOutputStream fos = new FileOutputStream(file)) {
        conf.writeXml(fos);
    }

    assertTrue(file.exists());
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:HadoopFIleSystemFactorySelfTest.java

示例3: testLoader

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public void testLoader() throws Exception {
    String path = U.getIgniteHome() + GRID_CFG_PATH;

    info("Loading Grid from configuration file: " + path);

    G.addListener(new IgnitionListener() {
        @Override public void onStateChange(String name, IgniteState state) {
            if (state == STARTED) {
                info("Received started notification from grid: " + name);

                latch.countDown();

                G.stop(name, true);
            }
        }
    });

    CommandLineStartup.main(new String[]{path});
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:GridCommandLineLoaderTest.java

示例4: resolvePath

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @param igniteHome Optional ignite home path.
 * @param path Path to resolve.
 * @return Resolved path, or {@code null} if file cannot be resolved.
 */
@Nullable private static File resolvePath(@Nullable String igniteHome, String path) {
    File file = new File(path).getAbsoluteFile();

    if (!file.exists()) {
        String home = igniteHome != null ? igniteHome : U.getIgniteHome();

        if (home == null)
            return null;

        file = new File(home, path);

        return file.exists() ? file : null;
    }

    return file;
}
 
开发者ID:apache,项目名称:ignite,代码行数:22,代码来源:GridTestUtils.java

示例5: afterTestsStopped

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void afterTestsStopped() throws Exception {
    G.stopAll(true);

    String path = U.getIgniteHome() + SECONDARY_CFG_PATH;

    new File(path).delete();
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:IgniteHadoopFileSystemAbstractSelfTest.java

示例6: IgnitePdsMultiNodePutGetRestartTest

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Default constructor.
 */
public IgnitePdsMultiNodePutGetRestartTest() {
    String home = U.getIgniteHome();

    allocPath = new File(home, "work/db/" + UUID.randomUUID());

    allocPath.mkdirs();
}
 
开发者ID:apache,项目名称:ignite,代码行数:11,代码来源:IgnitePdsMultiNodePutGetRestartTest.java

示例7: tearDown

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void tearDown() throws Exception {
    // Next grid in the same VM shouldn't use cached values produced by these tests.
    nullifyHomeDirectory();

    U.getIgniteHome();
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:GridStartupWithUndefinedIgniteHomeSelfTest.java

示例8: beforeTestsStarted

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
    Configuration secondaryConf = configurationSecondary(SECONDARY_AUTHORITY);

    secondaryConf.setInt("fs.igfs.block.size", 1024);

    String path = U.getIgniteHome() + SECONDARY_CFG_PATH;

    File file = new File(path);

    try (FileOutputStream fos = new FileOutputStream(file)) {
        secondaryConf.writeXml(fos);
    }

    startNodes();
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:IgniteHadoopFileSystemAbstractSelfTest.java

示例9: testNoClassOnServerNode

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @throws Exception If failed.
 */
public final void testNoClassOnServerNode() throws Exception {
    info("Run test with client: " + clientClassName());

    // Check class is really not available.
    try {
        Class.forName("org.apache.ignite.tests.p2p.cache.Person");

        fail();
    }
    catch (ClassNotFoundException ignore) {
        // Expected exception.
    }

    try (Ignite ignite = Ignition.start(createConfiguration())) {
        CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

        cfg.setCopyOnRead(true); // To store only value bytes.

        ignite.createCache(cfg);

        final CountDownLatch clientReadyLatch = new CountDownLatch(1);

        Collection<String> jvmArgs = Arrays.asList("-ea", "-DIGNITE_QUIET=false");

        GridJavaProcess clientNode = null;

        try {
            String cp = U.getIgniteHome() + "/modules/extdata/p2p/target/classes/";

            clientNode = GridJavaProcess.exec(
                clientClassName(), null,
                log,
                new CI1<String>() {
                    @Override public void apply(String s) {
                        info("Client node: " + s);

                        if (s.contains(NODE_START_MSG))
                            clientReadyLatch.countDown();
                    }
                },
                null,
                null,
                jvmArgs,
                cp
            );

            assertTrue(clientReadyLatch.await(60, SECONDS));

            int exitCode = clientNode.getProcess().waitFor();

            assertEquals("Unexpected exit code", 0, exitCode);
        }
        finally {
            if (clientNode != null)
                clientNode.killProcess();
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:62,代码来源:IgniteNoClassOnServerAbstractTest.java

示例10: buildPath

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @param path Path to the working directory.
 * @param consId Consistent ID of the local node.
 * @return DB storage path.
 *
 * @throws IgniteCheckedException If resolving swap directory fails.
 */
protected File buildPath(String path, String consId) throws IgniteCheckedException {
    String igniteHomeStr = U.getIgniteHome();

    File workDir = igniteHomeStr == null ? new File(path) : U.resolveWorkDirectory(igniteHomeStr, path, false);


    return new File(workDir, consId);
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:IgniteCacheDatabaseSharedManager.java


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