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


Java U.log方法代码示例

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


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

示例1: stop

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Stops the streamer.
 *
 * @throws IgniteException In cases if failed to stop the streamer.
 */
public void stop() throws IgniteException {
    // If the Camel Context is stopping or stopped, reject this call to stop.
    if (camelCtx.getStatus() == ServiceStatus.Stopped || camelCtx.getStatus() == ServiceStatus.Stopping)
        throw new IgniteException("Failed to stop Camel streamer (CamelContext already stopped or stopping).");

    // Stop Camel services.
    try {
        ServiceHelper.stopAndShutdownServices(camelCtx, endpoint, consumer);
    }
    catch (Exception e) {
        throw new IgniteException("Failed to stop Camel streamer [errMsg=" + e.getMessage() + ']');
    }

    U.log(log, "Stopped Camel streamer, formerly consuming from endpoint URI: " + endpointUri);
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:CamelStreamer.java

示例2: cancel

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Cancels this future.
 *
 * @return {@code True}.
 */
@Override public boolean cancel() {
    synchronized (this) {
        if (isDone())
            return true;

        U.log(log, "Cancelled rebalancing from all nodes [topology=" + topologyVersion() + ']');

        if (!ctx.kernalContext().isStopping()) {
            for (UUID nodeId : remaining.keySet())
                cleanupRemoteContexts(nodeId);
        }

        remaining.clear();

        checkIsDone(true /* cancelled */);
    }

    return true;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:GridDhtPartitionDemander.java

示例3: throttle

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 *
 * @param log Logger to use.
 * @param warn Whether or not this is a warning.
 * @param msg Message to log.
 */
private void throttle(IgniteLogger log, boolean warn, String msg) {
    assert(log != null);
    assert(msg != null);

    long now = U.currentTimeMillis();

    if (now - lastLog > THROTTLE_PERIOD) {
        if (!warn)
            U.log(log, msg);
        else {
            U.quiet(true, msg);

            if (log.isInfoEnabled())
                log.warning(msg);
        }

        lastLog = now;
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:26,代码来源:GridUpdateNotifier.java

示例4: checkIsDone

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @param cancelled Is cancelled.
 */
private void checkIsDone(boolean cancelled) {
    if (remaining.isEmpty()) {
        sendRebalanceFinishedEvent();

        if (log.isDebugEnabled())
            log.debug("Completed rebalance future: " + this);

        ctx.exchange().scheduleResendPartitions();

        Collection<Integer> m = new HashSet<>();

        for (Map.Entry<UUID, Collection<Integer>> e : missed.entrySet()) {
            if (e.getValue() != null && !e.getValue().isEmpty())
                m.addAll(e.getValue());
        }

        if (!m.isEmpty()) {
            U.log(log, ("Reassigning partitions that were missed: " + m));

            onDone(false); //Finished but has missed partitions, will force dummy exchange

            ctx.exchange().forceReassign(exchId);

            return;
        }

        if (!cancelled && !grp.preloader().syncFuture().isDone())
            ((GridFutureAdapter)grp.preloader().syncFuture()).onDone();

        onDone(!cancelled);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:36,代码来源:GridDhtPartitionDemander.java

示例5: onReadyForRead

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void onReadyForRead(ReadOnlyMetastorage metastorage) throws IgniteCheckedException {
    BaselineTopology blt = (BaselineTopology) metastorage.read(METASTORE_CURR_BLT_KEY);

    if (blt != null) {
        if (log.isInfoEnabled())
            U.log(log, "Restoring history for BaselineTopology[id=" + blt.id() + "]");

        bltHist.restoreHistory(metastorage, blt.id());
    }

    onStateRestored(blt);
}
 
开发者ID:apache,项目名称:ignite,代码行数:14,代码来源:GridClusterStateProcessor.java

示例6: resetBranchingHistory

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Resets branching history on current BaselineTopology.
 *
 * @throws IgniteCheckedException If write to metastore has failed.
 */
public void resetBranchingHistory(long newBranchingHash) throws IgniteCheckedException {
    globalState.baselineTopology().resetBranchingHistory(newBranchingHash);

    writeBaselineTopology(globalState.baselineTopology(), null);

    U.log(log,
        String.format("Branching history of current BaselineTopology is reset to the value %d", newBranchingHash));
}
 
开发者ID:apache,项目名称:ignite,代码行数:14,代码来源:GridClusterStateProcessor.java

示例7: restart

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Restarts <b>all</b> started grids. If {@code cancel} flag is set to {@code true} then
 * all jobs currently executing on the local node will be interrupted.
 * If {@code wait} parameter is set to {@code true} then grid will wait for all
 * tasks to be finished.
 * <p>
 * <b>Note:</b> it is usually safer and more appropriate to stop grid instances individually
 * instead of blanket operation. In most cases, the party that started the grid instance
 * should be responsible for stopping it.
 * <p>
 * Note also that restarting functionality only works with the tools that specifically
 * support Ignite's protocol for restarting. Currently only standard <tt>ignite.{sh|bat}</tt>
 * scripts support restarting of JVM Ignite's process.
 *
 * @param cancel If {@code true} then all jobs currently executing on
 *      all grids will be cancelled by calling {@link ComputeJob#cancel()}
 *      method. Note that just like with {@link Thread#interrupt()}, it is
 *      up to the actual job to exit from execution.
 * @see Ignition#RESTART_EXIT_CODE
 */
public static void restart(boolean cancel) {
    String file = System.getProperty(IGNITE_SUCCESS_FILE);

    if (file == null)
        U.warn(null, "Cannot restart node when restart not enabled.");
    else {
        try {
            new File(file).createNewFile();
        }
        catch (IOException e) {
            U.error(null, "Failed to create restart marker file (restart aborted): " + e.getMessage());

            return;
        }

        U.log(null, "Restarting node. Will exit (" + Ignition.RESTART_EXIT_CODE + ").");

        // Set the exit code so that shell process can recognize it and loop
        // the start up sequence again.
        System.setProperty(IGNITE_RESTART_CODE, Integer.toString(Ignition.RESTART_EXIT_CODE));

        stopAll(cancel);

        // This basically leaves loaders hang - we accept it.
        System.exit(Ignition.RESTART_EXIT_CODE);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:48,代码来源:IgnitionEx.java

示例8: ackMemoryConfiguration

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 *
 */
private void ackMemoryConfiguration() {
    DataStorageConfiguration memCfg = cfg.getDataStorageConfiguration();

    if (memCfg == null)
        return;

    U.log(log, "System cache's DataRegion size is configured to " +
        (memCfg.getSystemRegionInitialSize() / (1024 * 1024)) + " MB. " +
        "Use DataStorageConfiguration.systemCacheMemorySize property to change the setting.");
}
 
开发者ID:apache,项目名称:ignite,代码行数:14,代码来源:IgniteKernal.java

示例9: ackCacheConfiguration

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 *
 */
private void ackCacheConfiguration() {
    CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();

    if (cacheCfgs == null || cacheCfgs.length == 0)
        U.warn(log, "Cache is not configured - in-memory data grid is off.");
    else {
        SB sb = new SB();

        HashMap<String, ArrayList<String>> memPlcNamesMapping = new HashMap<>();

        for (CacheConfiguration c : cacheCfgs) {
            String cacheName = U.maskName(c.getName());

            String memPlcName = c.getDataRegionName();

            if (CU.isSystemCache(cacheName))
                memPlcName = "sysMemPlc";
            else if (memPlcName == null && cfg.getDataStorageConfiguration() != null)
                memPlcName = cfg.getDataStorageConfiguration().getDefaultDataRegionConfiguration().getName();

            if (!memPlcNamesMapping.containsKey(memPlcName))
                memPlcNamesMapping.put(memPlcName, new ArrayList<String>());

            ArrayList<String> cacheNames = memPlcNamesMapping.get(memPlcName);

            cacheNames.add(cacheName);
        }

        for (Map.Entry<String, ArrayList<String>> e : memPlcNamesMapping.entrySet()) {
            sb.a("in '").a(e.getKey()).a("' dataRegion: [");

            for (String s : e.getValue())
                sb.a("'").a(s).a("', ");

            sb.d(sb.length() - 2, sb.length()).a("], ");
        }

        U.log(log, "Configured caches [" + sb.d(sb.length() - 2, sb.length()).toString() + ']');
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:44,代码来源:IgniteKernal.java


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