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

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

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

Logger.get介绍

[英]Gets a logger named after a class' fully qualified name.
[中]获取以类的完全限定名命名的记录器。

代码示例

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

  1. public static void main(String[] args)
  2. {
  3. Logger log = Logger.get(ThriftTpchServer.class);
  4. try {
  5. start(ImmutableList.of());
  6. log.info("======== SERVER STARTED ========");
  7. }
  8. catch (Throwable t) {
  9. log.error(t);
  10. System.exit(1);
  11. }
  12. }
  13. }

代码示例来源: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. public class RetryDriver
  2. private static final Logger log = Logger.get(RetryDriver.class);
  3. private static final int DEFAULT_RETRY_ATTEMPTS = 10;
  4. private static final Duration DEFAULT_SLEEP_TIME = Duration.valueOf("1s");

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

  1. public static void start(Module... extraModules)
  2. {
  3. Bootstrap app = new Bootstrap(ImmutableList.<Module>builder()
  4. .add(new NodeModule())
  5. .add(new HttpServerModule())
  6. .add(new JsonModule())
  7. .add(new JaxrsModule(true))
  8. .add(new MBeanModule())
  9. .add(new JmxModule())
  10. .add(new LogJmxModule())
  11. .add(new TraceTokenModule())
  12. .add(new EventModule())
  13. .add(new ProxyModule())
  14. .add(extraModules)
  15. .build());
  16. Logger log = Logger.get(PrestoProxy.class);
  17. try {
  18. app.strictConfig().initialize();
  19. log.info("======== SERVER STARTED ========");
  20. }
  21. catch (Throwable t) {
  22. log.error(t);
  23. System.exit(1);
  24. }
  25. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
  6. Thread.sleep(10);
  7. Logger log = Logger.get(TpcdsQueryRunner.class);
  8. log.info("======== SERVER STARTED ========");
  9. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  10. }
  11. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
  6. Thread.sleep(10);
  7. Logger log = Logger.get(MemoryQueryRunner.class);
  8. log.info("======== SERVER STARTED ========");
  9. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  10. }
  11. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. Map<String, String> properties = ImmutableMap.of("http-server.http.port", "8080");
  6. ThriftQueryRunnerWithServers queryRunner = (ThriftQueryRunnerWithServers) createThriftQueryRunner(3, 3, true, properties);
  7. Thread.sleep(10);
  8. Logger log = Logger.get(ThriftQueryRunner.class);
  9. log.info("======== SERVER STARTED ========");
  10. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  11. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
  6. Thread.sleep(10);
  7. Logger log = Logger.get(BlackHoleQueryRunner.class);
  8. log.info("======== SERVER STARTED ========");
  9. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  10. }
  11. }

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

  1. verifySystemTimeIsReasonable();
  2. Logger log = Logger.get(PrestoServer.class);

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. // You need to add "--user user" to your CLI for your queries to work
  5. Logging.initialize();
  6. DistributedQueryRunner queryRunner = createQueryRunner(TpchTable.getTables(), ImmutableMap.of("http-server.http.port", "8080"));
  7. Thread.sleep(10);
  8. Logger log = Logger.get(DistributedQueryRunner.class);
  9. log.info("======== SERVER STARTED ========");
  10. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  11. }
  12. }

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

  1. public class HiveMetadataFactory
  2. implements Supplier<TransactionalMetadata>
  3. private static final Logger log = Logger.get(HiveMetadataFactory.class);

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
  6. Logger log = Logger.get(GeoQueryRunner.class);
  7. log.info("======== SERVER STARTED ========");
  8. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  9. }
  10. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createKafkaQueryRunner(EmbeddedKafka.createEmbeddedKafka(), TpchTable.getTables());
  6. Thread.sleep(10);
  7. Logger log = Logger.get(KafkaQueryRunner.class);
  8. log.info("======== SERVER STARTED ========");
  9. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  10. }
  11. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = createElasticsearchQueryRunner(EmbeddedElasticsearchNode.createEmbeddedElasticsearchNode(), TpchTable.getTables());
  6. Thread.sleep(10);
  7. Logger log = Logger.get(ElasticsearchQueryRunner.class);
  8. log.info("======== SERVER STARTED ========");
  9. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  10. }
  11. }

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

  1. public static void main(String[] args)
  2. throws Exception
  3. {
  4. Logging.initialize();
  5. DistributedQueryRunner queryRunner = TpchQueryRunnerBuilder.builder()
  6. .setSingleExtraProperty("http-server.http.port", "8080")
  7. .build();
  8. Thread.sleep(10);
  9. Logger log = Logger.get(TpchQueryRunner.class);
  10. log.info("======== SERVER STARTED ========");
  11. log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
  12. }
  13. }

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

  1. protected void dropTable(SchemaTableName table)
  2. {
  3. try (Transaction transaction = newTransaction()) {
  4. ConnectorMetadata metadata = transaction.getMetadata();
  5. ConnectorSession session = newSession();
  6. ConnectorTableHandle handle = metadata.getTableHandle(session, table);
  7. if (handle == null) {
  8. return;
  9. }
  10. metadata.dropTable(session, handle);
  11. try {
  12. // todo I have no idea why this is needed... maybe there is a propagation delay in the metastore?
  13. metadata.dropTable(session, handle);
  14. fail("expected NotFoundException");
  15. }
  16. catch (TableNotFoundException expected) {
  17. }
  18. transaction.commit();
  19. }
  20. catch (Exception e) {
  21. Logger.get(getClass()).warn(e, "failed to drop table");
  22. }
  23. }

相关文章