org.apache.ignite.Ignite.log()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中org.apache.ignite.Ignite.log()方法的一些代码示例,展示了Ignite.log()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ignite.log()方法的具体详情如下:
包路径:org.apache.ignite.Ignite
类名称:Ignite
方法名:log

Ignite.log介绍

[英]Gets grid's logger.
[中]获取网格的记录器。

代码示例

代码示例来源:origin: apache/ignite

/**
 * Constructs a new asynchronous native process runner.
 *
 * @param ignite Ignite instance.
 * @param executor Executor.
 */
public AsyncNativeProcessRunner(Ignite ignite, ExecutorService executor) {
  this.log = ignite.log().getLogger(AsyncNativeProcessRunner.class);
  this.executor = executor;
}

代码示例来源:origin: apache/ignite

@Override public void run() {
    U.error(ignite.log(), "Restarting JVM on Ignite failure: [failureCtx=" + failureCtx + ']');
    G.restart(true);
  }
},

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public void start(PluginContext ctx) {
  final Ignite ignite = ctx.grid();
  log = ignite.log();
  managedBuffers = setupDirect((IgniteEx)ignite);
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
    int cnt = 0;
    for (CacheEntryEvent<?, ?> evt : evts) {
      ignite.log().info("Received cache event: " + evt);
      cnt++;
    }
    assertEquals(1, cnt);
    if (latch != null)
      latch.countDown();
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override protected boolean handle(Ignite ignite, FailureContext failureCtx) {
  if (this.failureCtx == null) {
    this.failureCtx = failureCtx;
    if (latch != null)
      latch.countDown();
    ignite.log().warning("Handled ignite failure: " + failureCtx);
  }
  return invalidate;
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public boolean apply(UUID uuid, Object msg) {
    ignite.log().info("Remote listener received message: " + msg);
    if (latch != null)
      latch.countDown();
    return true;
  }
}

代码示例来源:origin: apache/ignite

@Override public void run() {
    U.error(ignite.log(), "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']');
    IgnitionEx.stop(ignite.name(), true, true);
  }
},

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public void run() {
    ignite.log().info("Job run.");
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public int foo() {
    locNode.log().info("Service called.");
    return 42;
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public void store(@Nullable String cacheName, Object key, Object val, long expirationTime) {
  if (err && ignite.name().endsWith("IgniteErrorOnRebalanceTest1")) {
    ignite.log().warning("Test error on store [cache=" + cacheName + ", key=" + key + ']');
    throw new IgniteSpiException("Test error");
  }
}

代码示例来源:origin: apache/ignite

@Override public void run() {
    U.error(ignite.log(), "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']');
    IgnitionEx.stop(ignite.name(), true, true);
    stopLatch.countDown();
  }
},

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public boolean apply(UUID uuid, Event evt) {
    assertTrue(ignite.cluster().localNode().isClient());
    ignite.log().info("Received event: " + evt);
    if (latch != null)
      latch.countDown();
    return true;
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]");
  IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null);
  assertNotNull(queue);
  Collection<Integer> items = new ArrayList<>();
  for (int i = 0; i < size; i++)
    items.add(cntr.getAndIncrement());
  queue.addAll(items);
  return queue.size();
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]");
  retries(ignite, true);
  return 0;
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]");
  retries(ignite, false);
  return 0;
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]");
  removeRetriesSimple(ignite, true);
  return 0;
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + ']');
  IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null);
  assertNotNull(queue);
  for (int i = 0; i < retries; i++) {
    queue.put(i);
    assertNotNull(queue.take());
  }
  return queue.size();
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Integer call() throws IgniteCheckedException {
  assertNotNull(ignite);
  ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]");
  IgniteQueue<Integer> queue = ignite.queue(queueName, QUEUE_CAPACITY, colCfg);
  assertNotNull(queue);
  for (int i = 0; i < retries; i++)
    queue.put(i);
  return queue.size();
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public void cancel(ServiceContext ctx) {
  locNode.log().info("Service cancelled [execId=" + ctx.executionId() +
    ", node=" + locNode.cluster().localNode() + ']');
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public void execute(ServiceContext ctx) {
  locNode.log().info("Service started [execId=" + ctx.executionId() +
    ", node=" + locNode.cluster().localNode() + ']');
}

相关文章