• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IgniteLogger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: logSuggestions

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param log Log.
 * @param igniteInstanceName Ignite instance name.
 */
public synchronized void logSuggestions(IgniteLogger log, @Nullable String igniteInstanceName) {
    if (disabled)
        return;

    if (!F.isEmpty(perfs) && !suppressed.containsAll(perfs)) {
        U.quietAndInfo(log, "Performance suggestions for grid " +
            (igniteInstanceName == null ? "" : '\'' + igniteInstanceName + '\'') + " (fix if possible)");
        U.quietAndInfo(log, "To disable, set -D" + IGNITE_PERFORMANCE_SUGGESTIONS_DISABLED + "=true");

        for (String s : perfs)
            if (!suppressed.contains(s))
                U.quietAndInfo(log, "  ^-- " + s);

        perfs.clear();
    }

    U.quietAndInfo(log, "Refer to this page for more performance suggestions: " + SUGGESTIONS_LINK);
    U.quietAndInfo(log, "");
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:GridPerformanceSuggestions.java


示例2: start

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Starts child process runner.
 */
public void start(HadoopExternalCommunication comm, HadoopProcessDescriptor nodeDesc,
    ExecutorService msgExecSvc, IgniteLogger parentLog)
    throws IgniteCheckedException {
    this.comm = comm;
    this.nodeDesc = nodeDesc;
    this.msgExecSvc = msgExecSvc;

    comm.setListener(new MessageListener());
    log = parentLog.getLogger(HadoopChildProcessRunner.class);

    startTime = U.currentTimeMillis();

    // At this point node knows that this process has started.
    comm.sendMessage(this.nodeDesc, new HadoopProcessStartedAck());
}
 
开发者ID:apache,项目名称:ignite,代码行数:19,代码来源:HadoopChildProcessRunner.java


示例3: connectEndpoint

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Connects to open server IPC endpoint.
 *
 * @param endpointAddr Endpoint address.
 * @param log Log.
 * @return Connected client endpoint.
 * @throws IgniteCheckedException If failed to establish connection.
 */
public static IpcEndpoint connectEndpoint(String endpointAddr, IgniteLogger log) throws IgniteCheckedException {
    A.notNull(endpointAddr, "endpointAddr");

    String[] split = endpointAddr.split(":");

    int port;

    if (split.length == 2) {
        try {
            port = Integer.parseInt(split[1]);
        }
        catch (NumberFormatException e) {
            throw new IgniteCheckedException("Failed to parse port number: " + endpointAddr, e);
        }
    }
    else
        // Use default port.
        port = -1;

    return "shmem".equalsIgnoreCase(split[0]) ?
        connectSharedMemoryEndpoint(port > 0 ? port : IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT, log) :
        connectTcpEndpoint(split[0], port > 0 ? port : IpcServerTcpEndpoint.DFLT_IPC_PORT);
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:IpcEndpointFactory.java


示例4: printErrors

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Prints errors.
 *
 * @param log Logger.
 */
public void printErrors(IgniteLogger log) {
    int size = q.size();

    Iterator<ExceptionInfo> descIter = q.descendingIterator();

    for (int i = 0; i < size && descIter.hasNext(); i++) {
        ExceptionInfo error = descIter.next();

        U.error(
            log,
            "Error: " + (i + 1) + U.nl() +
            "    Time: " + new Date(error.time()) + U.nl() +
            "    Error: " + error.message() + U.nl() +
            "    Thread ID: " + error.threadId() + U.nl() +
            "    Thread name: " + error.threadName(),
            error.error()
        );
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:IgniteExceptionRegistry.java


示例5: addOrderedHandler

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
private void addOrderedHandler(GridCacheSharedContext cctx, boolean cacheGrp, Object topic, IgniteBiInClosure<UUID, ? extends GridCacheMessage> c) {
    MessageHandlers msgHandlers = cacheGrp ? grpHandlers : cacheHandlers;

    IgniteLogger log0 = log;

    if (msgHandlers.orderedHandlers.putIfAbsent(topic, c) == null) {
        cctx.gridIO().addMessageListener(topic, new OrderedMessageListener(
            (IgniteBiInClosure<UUID, GridCacheMessage>)c));

        if (log0 != null && log0.isTraceEnabled())
            log0.trace("Registered ordered cache communication handler [topic=" + topic + ", handler=" + c + ']');
    }
    else if (log0 != null)
        U.warn(log0, "Failed to register ordered cache communication handler because it is already " +
            "registered for this topic [topic=" + topic + ", handler=" + c + ']');
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:GridCacheIoManager.java


示例6: IpcToNioAdapter

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param metricsLsnr Metrics listener.
 * @param log Log.
 * @param endp Endpoint.
 * @param lsnr Listener.
 * @param writerFactory Writer factory.
 * @param filters Filters.
 */
public IpcToNioAdapter(GridNioMetricsListener metricsLsnr, IgniteLogger log, IpcEndpoint endp,
    GridNioServerListener<T> lsnr, GridNioMessageWriterFactory writerFactory, GridNioFilter... filters) {
    assert metricsLsnr != null;

    this.metricsLsnr = metricsLsnr;
    this.endp = endp;
    this.writerFactory = writerFactory;

    chain = new GridNioFilterChain<>(log, lsnr, new HeadFilter(), filters);
    ses = new GridNioSessionImpl(chain, null, null, true);

    writeBuf = ByteBuffer.allocate(8 << 10);

    writeBuf.order(ByteOrder.nativeOrder());
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:IpcToNioAdapter.java


示例7: split

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/** {@inheritDoc} */
@Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) {
    Collection<ComputeJob> jobs = new ArrayList<>(JOB_COUNT);

    for (int i = 0; i < JOB_COUNT; i++) {
        jobs.add(new ComputeJobAdapter(i) {
            @LoggerResource
            private IgniteLogger log;

            @Override public Serializable execute() {
                if (log.isInfoEnabled())
                    log.info("Executing job [index=" + argument(0) + ']');

                return argument(0);
            }
        });
    }

    return jobs;
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridSingleExecutionTest.java


示例8: StandaloneWalRecordsIterator

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Creates iterator in file-by-file iteration mode. Directory
 * @param log Logger.
 * @param sharedCtx Shared context. Cache processor is to be configured if Cache Object Key & Data Entry is
 * required.
 * @param ioFactory File I/O factory.
 * @param workDir Work directory is scanned, false - archive
 * @param keepBinary Keep binary. This flag disables converting of non primitive types
 * (BinaryObjects will be used instead)
 * @param walFiles Wal files.
 */
StandaloneWalRecordsIterator(
        @NotNull IgniteLogger log,
        @NotNull GridCacheSharedContext sharedCtx,
        @NotNull FileIOFactory ioFactory,
        boolean workDir,
        boolean keepBinary,
        int bufSize,
        @NotNull File... walFiles) throws IgniteCheckedException {
    super(log,
        sharedCtx,
        new RecordSerializerFactoryImpl(sharedCtx),
        ioFactory,
        bufSize);

    this.keepBinary = keepBinary;
    init(null, workDir, walFiles);
    advance();
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:StandaloneWalRecordsIterator.java


示例9: errorLogger

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param log Logger.
 * @param excl Excludes.
 * @return Future listener that logs errors.
 */
public static IgniteInClosure<IgniteInternalFuture<?>> errorLogger(final IgniteLogger log,
    final Class<? extends Exception>... excl) {
    return new CI1<IgniteInternalFuture<?>>() {
        @Override public void apply(IgniteInternalFuture<?> f) {
            try {
                f.get();
            }
            catch (IgniteCheckedException e) {
                if (!F.isEmpty(excl))
                    for (Class cls : excl)
                        if (e.hasCause(cls))
                            return;

                U.error(log, "Future execution resulted in error: " + f, e);
            }
        }

        @Override public String toString() {
            return "Error logger [excludes=" + Arrays.toString(excl) + ']';
        }
    };
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:GridCacheUtils.java


示例10: read

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Reads all checkpoint data from given file. File is read as binary
 * data which is than deserialized.
 *
 * @param file File which contains checkpoint data.
 * @param m Grid marshaller.
 * @param log Messages logger.
 * @return Checkpoint data object read from given file.
 * @throws IgniteCheckedException Thrown if data could not be converted
 *    to {@link SharedFsCheckpointData} object.
 * @throws IOException Thrown if file read error occurred.
 */
static SharedFsCheckpointData read(File file, Marshaller m, IgniteLogger log)
    throws IOException, IgniteCheckedException {
    assert file != null;
    assert m != null;
    assert log != null;

    InputStream in = new FileInputStream(file);

    try {
        return U.unmarshal(m, in, U.gridClassLoader());
    }
    finally {
        U.close(in, log);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:SharedFsUtils.java


示例11: write

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Writes given checkpoint data to a given file. Data are serialized to
 * the binary stream and saved to the file.
 *
 * @param file File data should be saved to.
 * @param data Checkpoint data.
 * @param m Grid marshaller.
 * @param log Messages logger.
 * @throws IgniteCheckedException Thrown if data could not be marshalled.
 * @throws IOException Thrown if file write operation failed.
 */
static void write(File file, SharedFsCheckpointData data, Marshaller m, IgniteLogger log)
    throws IOException, IgniteCheckedException {
    assert file != null;
    assert m != null;
    assert data != null;
    assert log != null;

    OutputStream out = null;

    try {
        out = new FileOutputStream(file);

        U.marshal(m, data, out);
    }
    finally {
        U.close(out, log);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:SharedFsUtils.java


示例12: join

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Joins runnable.
 *
 * @param w Worker to join.
 * @param log The logger to possible exception.
 * @return {@code true} if worker has not been interrupted, {@code false} if it was interrupted.
 */
public static boolean join(@Nullable GridWorker w, @Nullable IgniteLogger log) {
    if (w != null)
        try {
            w.join();
        }
        catch (InterruptedException ignore) {
            warn(log, "Got interrupted while waiting for completion of runnable: " + w);

            Thread.currentThread().interrupt();

            return false;
        }

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


示例13: marshalData

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param src Source.
 * @param target Target.
 * @param marsh Marsh.
 * @param log Logger.
 */
private void marshalData(
        Map<Integer, Serializable> src,
        Map<Integer, byte[]> target,
        Marshaller marsh,
        IgniteLogger log
) {
    //may happen if nothing was collected from components,
    // corresponding map (for common data or for node specific data) left null
    if (src == null)
        return;

    for (Map.Entry<Integer, Serializable> entry : src.entrySet()) {
        try {
            target.put(entry.getKey(), marsh.marshal(entry.getValue()));
        }
        catch (IgniteCheckedException e) {
            U.error(log, "Failed to marshal discovery data " +
                    "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e);
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:DiscoveryDataPacket.java


示例14: readResolve

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Reconstructs object on unmarshalling.
 *
 * @return Reconstructed object.
 * @throws ObjectStreamException Thrown in case of unmarshalling error.
 */
protected Object readResolve() throws ObjectStreamException {
    try {
        IgniteBiTuple<String, Object> t = stash.get();

        Object ctgrR = t.get2();

        IgniteLogger log = IgnitionEx.localIgnite().log();

        return ctgrR != null ? log.getLogger(ctgrR) : log;
    }
    catch (IllegalStateException e) {
        throw U.withCause(new InvalidObjectException(e.getMessage()), e);
    }
    finally {
        stash.remove();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:GridLoggerProxy.java


示例15: IpcSharedMemorySpace

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * This will allocate system resources for the space.
 *
 * @param tokFileName Token filename.
 * @param writerPid Writer PID.
 * @param readerPid Reader PID.
 * @param size Size in bytes.
 * @param reader {@code True} if reader.
 * @param parent Parent logger.
 * @throws IgniteCheckedException If failed.
 */
public IpcSharedMemorySpace(String tokFileName, int writerPid, int readerPid, int size, boolean reader,
                            IgniteLogger parent) throws IgniteCheckedException {
    assert size > 0 : "Size cannot be less than 1 byte";

    log = parent.getLogger(IpcSharedMemorySpace.class);

    opSize = size;

    shmemPtr = IpcSharedMemoryUtils.allocateSystemResources(tokFileName, size, DEBUG && log.isDebugEnabled());

    shmemId = IpcSharedMemoryUtils.sharedMemoryId(shmemPtr);
    semId = IpcSharedMemoryUtils.semaphoreId(shmemPtr);

    isReader = reader;

    this.tokFileName = tokFileName;
    this.readerPid = readerPid;
    this.writerPid = writerPid;

    if (DEBUG && log.isDebugEnabled())
        log.debug("Shared memory space has been created: " + this);
}
 
开发者ID:apache,项目名称:ignite,代码行数:34,代码来源:IpcSharedMemorySpace.java


示例16: showAscii

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param mtx {@link Matrix} object to show as a plain text.
 * @param log {@link IgniteLogger} instance to output the logged matrix.
 * @param fmt Format string for matrix rows.
 */
public static void showAscii(Matrix mtx, IgniteLogger log, String fmt) {
    String cls = mtx.getClass().getSimpleName();

    int rows = mtx.rowSize();
    int cols = mtx.columnSize();

    log.info(String.format(LOCALE, "%s(%dx%d)", cls, rows, cols));

    for (int row = 0; row < rows; row++)
        log.info(rowStr(mtx, row, fmt));
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:17,代码来源:Tracer.java


示例17: HadoopIpcToNioAdapter

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param log Log.
 * @param endp Endpoint.
 * @param lsnr Listener.
 * @param filters Filters.
 */
public HadoopIpcToNioAdapter(IgniteLogger log, IpcEndpoint endp, boolean accepted,
    GridNioServerListener<T> lsnr, GridNioFilter... filters) {
    this.endp = endp;

    chain = new GridNioFilterChain<>(log, lsnr, new HeadFilter(), filters);
    ses = new GridNioSessionImpl(chain, null, null, accepted);

    writeBuf = ByteBuffer.allocate(8 << 10);

    writeBuf.order(ByteOrder.nativeOrder());
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:HadoopIpcToNioAdapter.java


示例18: warn

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * Depending on whether or not log is provided and quiet mode is enabled logs given
 * messages as quiet message or normal log WARN message. If {@code log} is {@code null}
 * or in QUIET mode it will add {@code (wrn)} prefix to the message.
 *
 * @param log Optional logger to use when QUIET mode is not enabled.
 * @param longMsg Message to log using normal logger.
 * @param shortMsg Message to log using quiet logger.
 */
public static void warn(@Nullable IgniteLogger log, Object longMsg, Object shortMsg) {
    assert longMsg != null;
    assert shortMsg != null;

    if (log != null)
        log.warning(compact(longMsg.toString()));
    else
        X.println("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] (wrn) " +
            compact(shortMsg.toString()));
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:IgniteUtils.java


示例19: GridTcpNioCommunicationClient

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/**
 * @param connIdx Connection index.
 * @param ses Session.
 * @param log Logger.
 */
public GridTcpNioCommunicationClient(
    int connIdx,
    GridNioSession ses,
    IgniteLogger log
) {
    super(connIdx, null);

    assert ses != null;
    assert log != null;

    this.ses = ses;
    this.log = log;
}
 
开发者ID:apache,项目名称:ignite,代码行数:19,代码来源:GridTcpNioCommunicationClient.java


示例20: createJob

import org.apache.ignite.IgniteLogger; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls, HadoopJobId jobId, IgniteLogger log,
    @Nullable String[] libNames, HadoopHelper helper) throws IgniteCheckedException {
    assert false;

    return null;
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:HadoopAbstractMapTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockBed类代码示例发布时间:2022-05-22
下一篇:
Java Source类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap