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


Java IgniteLogger.isDebugEnabled方法代码示例

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


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

示例1: testLogInitialize

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/** */
public void testLogInitialize() {
    IgniteLogger log = new Log4JLogger().getLogger(GridLog4jNotInitializedTest.class);

    System.out.println(log.toString());

    assertTrue(log.toString().contains("Log4JLogger"));
    assertTrue(log.toString().contains("config=null"));

    if (log.isDebugEnabled())
        log.debug("This is 'debug' message.");
    else
        System.out.println("DEBUG level is not enabled.");

    if (log.isInfoEnabled())
        log.info("This is 'info' message.");
    else
        System.out.println("INFO level is not enabled.");

    log.warning("This is 'warning' message.");
    log.error("This is 'error' message.");
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:GridLog4jNotInitializedTest.java

示例2: processWithDescriptorFile

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * Processes given GAR file and returns back all tasks which are in
 * descriptor.
 *
 * @param doc GAR file descriptor.
 * @param file GAR file.
 * @param uri GAR file deployment URI.
 * @param log Logger.
 * @throws org.apache.ignite.spi.IgniteSpiException Thrown if it's impossible to open file.
 * @return List of tasks from descriptor.
 */
@SuppressWarnings({"ClassLoader2Instantiation"})
private static GridUriDeploymentFileProcessorResult processWithDescriptorFile(GridUriDeploymentSpringDocument doc,
    File file, String uri, IgniteLogger log) throws IgniteSpiException {
    ClassLoader clsLdr = GridUriDeploymentClassLoaderFactory.create(U.gridClassLoader(), file, log);

    List<Class<? extends ComputeTask<?, ?>>> tasks = doc.getTasks(clsLdr);

    List<Class<? extends ComputeTask<?, ?>>> validTasks = null;

    if (!F.isEmpty(tasks)) {
        validTasks = new ArrayList<>();

        for (Class<? extends ComputeTask<?, ?>> task : tasks) {
            if (!isAllowedTaskClass(task)) {
                U.warn(log, "Failed to load task. Task should be public none-abstract class " +
                    "(might be inner static one) that implements ComputeTask interface [taskCls=" + task + ']');
            }
            else {
                if (log.isDebugEnabled())
                    log.debug("Found grid deployment task: " + task.getName());

                validTasks.add(task);
            }
        }
    }

    GridUriDeploymentFileProcessorResult res = new GridUriDeploymentFileProcessorResult();

    res.setFile(file);
    res.setClassLoader(clsLdr);

    if (!F.isEmpty(validTasks))
        res.setTaskClasses(validTasks);
    else if (log.isDebugEnabled())
        log.debug("No tasks loaded from file [file=" + file.getAbsolutePath() +
            ", uri=" + U.hidePassword(uri) + ']');

    return res;
}
 
开发者ID:apache,项目名称:ignite,代码行数:51,代码来源:GridUriDeploymentFileProcessor.java

示例3: processNoDescriptorFile

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * Processes GAR files which have no descriptor. It scans every class and
 * checks if it is a valid task or not. All valid tasks are returned back.
 *
 * @param file GAR file or directory.
 * @param uri GAR file deployment URI.
 * @param log Logger.
 * @throws org.apache.ignite.spi.IgniteSpiException Thrown if file reading error happened.
 * @return List of tasks from given file.
 */
private static GridUriDeploymentFileProcessorResult processNoDescriptorFile(File file, String uri, IgniteLogger log)
    throws IgniteSpiException {
    ClassLoader clsLdr = GridUriDeploymentClassLoaderFactory.create(U.gridClassLoader(), file, log);

    Set<Class<? extends ComputeTask<?, ?>>> clss = GridUriDeploymentDiscovery.getClasses(clsLdr, file);

    GridUriDeploymentFileProcessorResult res = new GridUriDeploymentFileProcessorResult();

    res.setFile(file);
    res.setClassLoader(clsLdr);

    if (clss != null) {
        List<Class<? extends ComputeTask<?, ?>>> validTasks =
            new ArrayList<>(clss.size());

        for (Class<? extends ComputeTask<?, ?>> cls : clss) {
            if (isAllowedTaskClass(cls)) {
                if (log.isDebugEnabled())
                    log.debug("Found grid deployment task: " + cls.getName());

                validTasks.add(cls);
            }
        }

        if (!validTasks.isEmpty())
            res.setTaskClasses(validTasks);
        else if (log.isDebugEnabled())
            log.debug("No tasks loaded from file [file=" + file.getAbsolutePath() +
                ", uri=" + U.hidePassword(uri) + ']');
    }

    return res;
}
 
开发者ID:apache,项目名称:ignite,代码行数:44,代码来源:GridUriDeploymentFileProcessor.java

示例4: printStopInfo

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 *
 */
void printStopInfo() {
    IgniteLogger log = this.log;

    if (log != null && log.isDebugEnabled())
        log.debug(stopInfo());
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:TcpDiscoverySpi.java

示例5: onNodeLeft

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * @param nodeId Node ID.
 */
public void onNodeLeft(UUID nodeId) {
    if (compareAndSet(nodeId, null)) {
        IgniteLogger log = cctx.logger(TxDeadlockDetection.class);

        if (log.isDebugEnabled())
            log.debug("Failed to finish deadlock detection, node left: " + nodeId);

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

示例6: log0

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * @param log Logger.
 * @param time Time.
 * @param msg Message.
 */
private static void log0(@Nullable IgniteLogger log, long time, String msg) {
    if (log != null) {
        if (log.isDebugEnabled())
            log.debug(msg);
        else
            log.warning(msg);
    }
    else
        X.println(String.format("[%s][%s]%s",
            DEBUG_DATE_FMT.get().format(time), Thread.currentThread().getName(), msg));
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:VisorTaskUtils.java

示例7: BlockingSslHandler

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * @param sslEngine SSLEngine.
 * @param ch Socket channel.
 * @param directBuf Direct buffer flag.
 * @param order Byte order.
 * @param log Logger.
 */
public BlockingSslHandler(SSLEngine sslEngine,
    SocketChannel ch,
    boolean directBuf,
    ByteOrder order,
    IgniteLogger log)
    throws SSLException {
    this.ch = ch;
    this.log = log;
    this.sslEngine = sslEngine;
    this.order = order;

    // Allocate a little bit more so SSL engine would not return buffer overflow status.
    //
    // System property override is for test purposes only.
    int netBufSize = Integer.getInteger("BlockingSslHandler.netBufSize",
        sslEngine.getSession().getPacketBufferSize() + 50);

    outNetBuf = directBuf ? ByteBuffer.allocateDirect(netBufSize) : ByteBuffer.allocate(netBufSize);
    outNetBuf.order(order);

    // Initially buffer is empty.
    outNetBuf.position(0);
    outNetBuf.limit(0);

    inNetBuf = directBuf ? ByteBuffer.allocateDirect(netBufSize) : ByteBuffer.allocate(netBufSize);
    inNetBuf.order(order);

    appBuf = allocateAppBuff();

    handshakeStatus = sslEngine.getHandshakeStatus();

    if (log.isDebugEnabled())
        log.debug("Started SSL session [netBufSize=" + netBufSize + ", appBufSize=" + appBuf.capacity() + ']');
}
 
开发者ID:apache,项目名称:ignite,代码行数:42,代码来源:BlockingSslHandler.java

示例8: verify0

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * Tests whether all files in given JAR file are signed
 * with public key. If manifest is {@code null} than method returns
 * {@code true} if public key is null.
 * <p>
 * <strong>DO NOT REFACTOR THIS METHOD. THERE IS A SUN DEFECT ABOUT PROCESSING JAR AS
 * FILE AND AS STREAM. THE PROCESSING IS DIFFERENT.</strong>
 *
 * @param jarName JAR file name.
 * @param pubKey Public key to be tested with.
 * @param allSigned Hint which means that all files in entry must be signed.
 * @param log Logger.
 * @return {@code true} if JAR file is signed with given public key.
 * @throws IOException Thrown if JAR file or its entries could not be read.
 */
private static boolean verify0(String jarName, PublicKey pubKey, boolean allSigned, IgniteLogger log)
    throws IOException {
    JarFile jarFile = null;

    try {
        jarFile = new JarFile(jarName, true);

        Manifest manifest = jarFile.getManifest();

        // Manifest must be included in signed GAR file.
        if (manifest == null)
            return pubKey == null;

        Set<String> manifestFiles = getSignedFiles(manifest);

        Enumeration<JarEntry> entries = jarFile.entries();

        while (entries.hasMoreElements()) {
            JarEntry jarEntry = entries.nextElement();

            if (jarEntry.isDirectory())
                continue;

            // Verify by reading the file if altered.
            // Will return quietly if no problem.
            verifyDigestsImplicitly(jarFile.getInputStream(jarEntry));

            if (verifyEntry(jarEntry, manifest, pubKey, allSigned, false) == false)
                return false;

            manifestFiles.remove(jarEntry.getName());
        }

        return manifestFiles.size() <= 0;
    }
    catch (SecurityException e) {
        if (log.isDebugEnabled())
            log.debug("Got security error (ignoring): " + e.getMessage());
    }
    finally {
        U.close(jarFile, log);
    }

    return false;
}
 
开发者ID:apache,项目名称:ignite,代码行数:61,代码来源:GridUriDeploymentJarVerifier.java

示例9: start

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * @param props Properties.
 */
public void start(Properties props)  {
    String gridCfg = props.getProperty(GRID_CONFIG_PROPERTY);
    String igniteInstanceName = props.getProperty(IGNITE_INSTANCE_NAME_PROPERTY);

    if (igniteInstanceName == null)
        igniteInstanceName = props.getProperty(GRID_NAME_PROPERTY);

    if (gridCfg != null) {
        try {
            ignite = G.start(gridCfg);
        }
        catch (IgniteException e) {
            throw eConverter.convert(e);
        }
    }
    else
        ignite = Ignition.ignite(igniteInstanceName);

    for (Map.Entry<Object, Object> prop : props.entrySet()) {
        String key = prop.getKey().toString();

        if (key.startsWith(REGION_CACHE_PROPERTY)) {
            String regionName = key.substring(REGION_CACHE_PROPERTY.length());

            String cacheName = prop.getValue().toString();

            if (((IgniteKernal)ignite).getCache(cacheName) == null)
                throw new IllegalArgumentException("Cache '" + cacheName + "' specified for region '" + regionName + "' " +
                    "is not configured.");

            regionCaches.put(regionName, cacheName);
        }
    }

    String dfltCacheName = props.getProperty(DFLT_CACHE_NAME_PROPERTY);

    if (dfltCacheName != null) {
        IgniteInternalCache<Object, Object> dfltCache = ((IgniteKernal)ignite).getCache(dfltCacheName);

        if (dfltCache == null)
            throw new IllegalArgumentException("Cache specified as default is not configured: " + dfltCacheName);

        this.dfltCache = new HibernateCacheProxy(dfltCache, keyTransformer);
    }

    IgniteLogger log = ignite.log().getLogger(getClass());

    if (log.isDebugEnabled())
        log.debug("HibernateRegionFactory started [igniteInstanceName=" + igniteInstanceName + ']');
}
 
开发者ID:apache,项目名称:ignite,代码行数:54,代码来源:HibernateAccessStrategyFactory.java

示例10: requestFromNextNode

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * Requests affinity from next node in the list.
 */
private void requestFromNextNode() {
    boolean complete;

    // Avoid 'protected field is accessed in synchronized context' warning.
    IgniteLogger log0 = log;

    synchronized (this) {
        while (!availableNodes.isEmpty()) {
            ClusterNode node = availableNodes.poll();

            try {
                if (log0.isDebugEnabled())
                    log0.debug("Sending affinity fetch request to remote node [locNodeId=" + ctx.localNodeId() +
                        ", node=" + node + ']');

                ctx.io().send(node,
                    new GridDhtAffinityAssignmentRequest(id, grpId, topVer, needPartState),
                    AFFINITY_POOL);

                // Close window for listener notification.
                if (ctx.discovery().node(node.id()) == null) {
                    U.warn(log0, "Failed to request affinity assignment from remote node (node left grid, will " +
                        "continue to another node): " + node);

                    continue;
                }

                pendingNode = node;

                break;
            }
            catch (ClusterTopologyCheckedException ignored) {
                U.warn(log0, "Failed to request affinity assignment from remote node (node left grid, will " +
                    "continue to another node): " + node);
            }
            catch (IgniteCheckedException e) {
                if (ctx.discovery().reconnectSupported() && X.hasCause(e, IOException.class)) {
                    onDone(new IgniteNeedReconnectException(ctx.localNode(), e));

                    return;
                }

                U.warn(log0, "Failed to request affinity assignment from remote node (will " +
                    "continue to another node): " + node);
            }
        }

        complete = pendingNode == null;
    }

    // No more nodes left, complete future with null outside of synchronization.
    // Affinity should be calculated from scratch.
    if (complete)
        onDone((GridDhtAffinityAssignmentResponse)null);
}
 
开发者ID:apache,项目名称:ignite,代码行数:59,代码来源:GridDhtAssignmentFetchFuture.java

示例11: logDebug

import org.apache.ignite.IgniteLogger; //导入方法依赖的package包/类
/**
 * @param log IgniteLogger.
 * @param msg ShortMessage.
 */
protected void logDebug(IgniteLogger log, String msg) {
    if (log != null && log.isDebugEnabled())
        log.debug(msg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:GridCompoundFuture.java


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