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

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

本文整理了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

public static void main(String[] args)
  {
    Logger log = Logger.get(ThriftTpchServer.class);
    try {
      start(ImmutableList.of());
      log.info("======== SERVER STARTED ========");
    }
    catch (Throwable t) {
      log.error(t);
      System.exit(1);
    }
  }
}

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

@AfterTestWithContext
public void cleanup()
{
  try {
    aliceExecutor.executeQuery(format("DROP TABLE IF EXISTS %s", tableName));
    aliceExecutor.executeQuery(format("DROP VIEW IF EXISTS %s", viewName));
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table/view");
  }
}

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

@BeforeTestWithContext
@AfterTestWithContext
public void dropTestTables()
{
  try {
    query(format("DROP TABLE IF EXISTS %s", TABLE_NAME));
    query(format("DROP TABLE IF EXISTS %s", RENAMED_TABLE_NAME));
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table");
  }
}

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

@BeforeTestWithContext
@AfterTestWithContext
public void dropTestTables()
{
  try {
    onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", CREATE_TABLE_AS_SELECT));
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table");
  }
}

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

@BeforeTestWithContext
@AfterTestWithContext
public void dropTestTables()
{
  try {
    onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", INSERT_TABLE_NAME));
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table");
  }
}

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

@BeforeTestWithContext
@AfterTestWithContext
public void dropTestTable()
{
  try {
    onMySql().executeQuery(format("DROP TABLE IF EXISTS %s", TABLE_NAME));
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table");
  }
}

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

public class RetryDriver
  private static final Logger log = Logger.get(RetryDriver.class);
  private static final int DEFAULT_RETRY_ATTEMPTS = 10;
  private static final Duration DEFAULT_SLEEP_TIME = Duration.valueOf("1s");

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

public static void start(Module... extraModules)
{
  Bootstrap app = new Bootstrap(ImmutableList.<Module>builder()
      .add(new NodeModule())
      .add(new HttpServerModule())
      .add(new JsonModule())
      .add(new JaxrsModule(true))
      .add(new MBeanModule())
      .add(new JmxModule())
      .add(new LogJmxModule())
      .add(new TraceTokenModule())
      .add(new EventModule())
      .add(new ProxyModule())
      .add(extraModules)
      .build());
  Logger log = Logger.get(PrestoProxy.class);
  try {
    app.strictConfig().initialize();
    log.info("======== SERVER STARTED ========");
  }
  catch (Throwable t) {
    log.error(t);
    System.exit(1);
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

protected void dropTable(SchemaTableName table)
{
  try (Transaction transaction = newTransaction()) {
    ConnectorMetadata metadata = transaction.getMetadata();
    ConnectorSession session = newSession();
    ConnectorTableHandle handle = metadata.getTableHandle(session, table);
    if (handle == null) {
      return;
    }
    metadata.dropTable(session, handle);
    try {
      // todo I have no idea why this is needed... maybe there is a propagation delay in the metastore?
      metadata.dropTable(session, handle);
      fail("expected NotFoundException");
    }
    catch (TableNotFoundException expected) {
    }
    transaction.commit();
  }
  catch (Exception e) {
    Logger.get(getClass()).warn(e, "failed to drop table");
  }
}

相关文章