io.airlift.log.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(317)

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

Logger.warn介绍

[英]Logs a message at WARN level.
[中]以警告级别记录消息。

代码示例

代码示例来源:origin: prestodb/presto

  1. private void logCleanupFailure(Throwable t, String format, Object... args)
  2. {
  3. if (throwOnCleanupFailure) {
  4. throw new RuntimeException(format(format, args), t);
  5. }
  6. log.warn(t, format, args);
  7. }

代码示例来源:origin: prestodb/presto

  1. private void logCleanupFailure(String format, Object... args)
  2. {
  3. if (throwOnCleanupFailure) {
  4. throw new RuntimeException(format(format, args));
  5. }
  6. log.warn(format, args);
  7. }

代码示例来源:origin: prestodb/presto

  1. private void cleanupFile(Path file)
  2. {
  3. try {
  4. fileSystem.delete(file, false);
  5. if (fileSystem.exists(file)) {
  6. throw new IOException("Delete failed");
  7. }
  8. }
  9. catch (IOException e) {
  10. log.warn(e, "Failed to delete temporary file: " + file);
  11. }
  12. }

代码示例来源:origin: prestodb/presto

  1. private static void closeSplitSource(SplitSource source)
  2. {
  3. try {
  4. source.close();
  5. }
  6. catch (Throwable t) {
  7. log.warn(t, "Error closing split source");
  8. }
  9. }

代码示例来源:origin: prestodb/presto

  1. private static void deleteDir(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path, boolean recursive)
  2. {
  3. try {
  4. hdfsEnvironment.getFileSystem(context, path).delete(path, recursive);
  5. }
  6. catch (Exception e) {
  7. // don't fail if unable to delete path
  8. log.warn(e, "Failed to delete path: " + path.toString());
  9. }
  10. }

代码示例来源:origin: prestodb/presto

  1. private NetworkLocation locate(HostAddress host)
  2. {
  3. try {
  4. return networkTopology.locate(host);
  5. }
  6. catch (RuntimeException e) {
  7. negativeCache.put(host, true);
  8. log.warn(e, "Unable to determine location of %s. Will attempt again in %s", host, NEGATIVE_CACHE_DURATION);
  9. // no one will see the exception thrown here
  10. throw e;
  11. }
  12. }
  13. }

代码示例来源:origin: prestodb/presto

  1. @PreDestroy
  2. public void tearDown()
  3. {
  4. for (Map.Entry<HostAddress, JedisPool> entry : jedisPoolCache.asMap().entrySet()) {
  5. try {
  6. entry.getValue().destroy();
  7. }
  8. catch (Exception e) {
  9. log.warn(e, "While destroying JedisPool %s:", entry.getKey());
  10. }
  11. }
  12. }

代码示例来源:origin: prestodb/presto

  1. @PreDestroy
  2. public void tearDown()
  3. {
  4. for (Map.Entry<HostAddress, SimpleConsumer> entry : consumerCache.asMap().entrySet()) {
  5. try {
  6. entry.getValue().close();
  7. }
  8. catch (Exception e) {
  9. log.warn(e, "While closing consumer %s:", entry.getKey());
  10. }
  11. }
  12. }

代码示例来源:origin: prestodb/presto

  1. @Override
  2. public void run()
  3. {
  4. try {
  5. updateMonitoredServices();
  6. }
  7. catch (Throwable e) {
  8. // ignore to avoid getting unscheduled
  9. log.warn(e, "Error updating services");
  10. }
  11. }
  12. }, 0, 5, TimeUnit.SECONDS);

代码示例来源:origin: prestodb/presto

  1. @Override
  2. public void close()
  3. {
  4. for (SourceScheduler sourceScheduler : sourceSchedulers) {
  5. try {
  6. sourceScheduler.close();
  7. }
  8. catch (Throwable t) {
  9. log.warn(t, "Error closing split source");
  10. }
  11. }
  12. sourceSchedulers.clear();
  13. }

代码示例来源:origin: prestodb/presto

  1. @Override
  2. public void run()
  3. {
  4. try {
  5. ping();
  6. updateState();
  7. }
  8. catch (Throwable e) {
  9. // ignore to avoid getting unscheduled
  10. log.warn(e, "Error pinging service %s (%s)", service.getId(), uri);
  11. }
  12. }
  13. }, heartbeat.toMillis(), heartbeat.toMillis(), TimeUnit.MILLISECONDS);

代码示例来源:origin: prestodb/presto

  1. private void loadPlugin(URLClassLoader pluginClassLoader)
  2. {
  3. ServiceLoader<Plugin> serviceLoader = ServiceLoader.load(Plugin.class, pluginClassLoader);
  4. List<Plugin> plugins = ImmutableList.copyOf(serviceLoader);
  5. if (plugins.isEmpty()) {
  6. log.warn("No service providers of type %s", Plugin.class.getName());
  7. }
  8. for (Plugin plugin : plugins) {
  9. log.info("Installing %s", plugin.getClass().getName());
  10. installPlugin(plugin);
  11. }
  12. }

代码示例来源:origin: prestodb/presto

  1. private static ResumableTask.TaskStatus safeProcessTask(ResumableTask task)
  2. {
  3. try {
  4. return task.process();
  5. }
  6. catch (Throwable t) {
  7. log.warn(t, "ResumableTask completed exceptionally");
  8. return ResumableTask.TaskStatus.finished();
  9. }
  10. }
  11. }

代码示例来源:origin: prestodb/presto

  1. @AfterTestWithContext
  2. public void cleanup()
  3. {
  4. try {
  5. aliceExecutor.executeQuery(format("DROP TABLE IF EXISTS %s", tableName));
  6. aliceExecutor.executeQuery(format("DROP VIEW IF EXISTS %s", viewName));
  7. }
  8. catch (Exception e) {
  9. Logger.get(getClass()).warn(e, "failed to drop table/view");
  10. }
  11. }

代码示例来源:origin: prestodb/presto

  1. @BeforeTestWithContext
  2. @AfterTestWithContext
  3. public void dropTestTables()
  4. {
  5. try {
  6. query(format("DROP TABLE IF EXISTS %s", TABLE_NAME));
  7. query(format("DROP TABLE IF EXISTS %s", RENAMED_TABLE_NAME));
  8. }
  9. catch (Exception e) {
  10. Logger.get(getClass()).warn(e, "failed to drop table");
  11. }
  12. }

代码示例来源:origin: prestodb/presto

  1. @BeforeTestWithContext
  2. @AfterTestWithContext
  3. public void dropTestTables()
  4. {
  5. try {
  6. onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", CREATE_TABLE_AS_SELECT));
  7. }
  8. catch (Exception e) {
  9. Logger.get(getClass()).warn(e, "failed to drop table");
  10. }
  11. }

代码示例来源:origin: prestodb/presto

  1. @BeforeTestWithContext
  2. @AfterTestWithContext
  3. public void dropTestTables()
  4. {
  5. try {
  6. onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", INSERT_TABLE_NAME));
  7. }
  8. catch (Exception e) {
  9. Logger.get(getClass()).warn(e, "failed to drop table");
  10. }
  11. }

代码示例来源:origin: prestodb/presto

  1. @BeforeTestWithContext
  2. @AfterTestWithContext
  3. public void dropTestTable()
  4. {
  5. try {
  6. onMySql().executeQuery(format("DROP TABLE IF EXISTS %s", TABLE_NAME));
  7. }
  8. catch (Exception e) {
  9. Logger.get(getClass()).warn(e, "failed to drop table");
  10. }
  11. }

代码示例来源:origin: prestodb/presto

  1. private void tearDownControl()
  2. {
  3. QueryResult controlTearDownResult = executeTearDown(
  4. queryPair.getControl(),
  5. controlGateway,
  6. controlUsername,
  7. controlPassword,
  8. controlTimeout,
  9. controlPostQueryResults,
  10. controlTeardownRetries);
  11. if (controlTearDownResult.getState() != State.SUCCESS) {
  12. log.warn("Control table teardown failed");
  13. }
  14. }

代码示例来源:origin: prestodb/presto

  1. private static <T> T handleProxyException(Request request, ProxyException e)
  2. {
  3. log.warn(e, "Proxy request failed: %s %s", request.getMethod(), request.getUri());
  4. throw badRequest(BAD_GATEWAY, e.getMessage());
  5. }

相关文章