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

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

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

Logger.info介绍

[英]Logs a message at INFO level.
[中]在信息级别记录消息。

代码示例

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

@VisibleForTesting
protected void setConfiguredEventListener(String name, Map<String, String> properties)
{
  requireNonNull(name, "name is null");
  requireNonNull(properties, "properties is null");
  log.info("-- Loading event listener --");
  EventListenerFactory eventListenerFactory = eventListenerFactories.get(name);
  checkState(eventListenerFactory != null, "Event listener %s is not registered", name);
  EventListener eventListener = eventListenerFactory.create(ImmutableMap.copyOf(properties));
  this.configuredEventListener.set(Optional.of(eventListener));
  log.info("-- Loaded event listener %s --", name);
}

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

@VisibleForTesting
public void setConfigurationManager(String name, Map<String, String> properties)
{
  requireNonNull(name, "name is null");
  requireNonNull(properties, "properties is null");
  log.info("-- Loading resource group configuration manager --");
  ResourceGroupConfigurationManagerFactory configurationManagerFactory = configurationManagerFactories.get(name);
  checkState(configurationManagerFactory != null, "Resource group configuration manager %s is not registered", name);
  ResourceGroupConfigurationManager<C> configurationManager = cast(configurationManagerFactory.create(ImmutableMap.copyOf(properties), configurationManagerContext));
  checkState(this.configurationManager.compareAndSet(cast(legacyManager), configurationManager), "configurationManager already set");
  log.info("-- Loaded resource group configuration manager %s --", name);
}

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

private synchronized void cleanUpExpiredTransactions()
{
  Iterator<Entry<TransactionId, TransactionMetadata>> iterator = transactions.entrySet().iterator();
  while (iterator.hasNext()) {
    Entry<TransactionId, TransactionMetadata> entry = iterator.next();
    if (entry.getValue().isExpired(idleTimeout)) {
      iterator.remove();
      log.info("Removing expired transaction: %s", entry.getKey());
      entry.getValue().asyncAbort();
    }
  }
}

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

private void loadPlugin(URLClassLoader pluginClassLoader)
{
  ServiceLoader<Plugin> serviceLoader = ServiceLoader.load(Plugin.class, pluginClassLoader);
  List<Plugin> plugins = ImmutableList.copyOf(serviceLoader);
  if (plugins.isEmpty()) {
    log.warn("No service providers of type %s", Plugin.class.getName());
  }
  for (Plugin plugin : plugins) {
    log.info("Installing %s", plugin.getClass().getName());
    installPlugin(plugin);
  }
}

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

private void loadPlugin(String plugin)
    throws Exception
{
  log.info("-- Loading plugin %s --", plugin);
  URLClassLoader pluginClassLoader = buildClassLoader(plugin);
  try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(pluginClassLoader)) {
    loadPlugin(pluginClassLoader);
  }
  log.info("-- Finished loading plugin %s --", plugin);
}

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

@Override
public void installPlugin(Plugin plugin)
{
  long start = System.nanoTime();
  for (TestingPrestoServer server : servers) {
    server.installPlugin(plugin);
  }
  log.info("Installed plugin %s in %s", plugin.getClass().getSimpleName(), nanosSince(start).convertToMostSuccinctTimeUnit());
}

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

public static void copyTable(QueryRunner queryRunner, QualifiedObjectName table, Session session)
  {
    long start = System.nanoTime();
    log.info("Running import for %s", table.getObjectName());
    @Language("SQL") String sql = format("CREATE TABLE %s AS SELECT * FROM %s", table.getObjectName(), table);
    long rows = (Long) queryRunner.execute(session, sql).getMaterializedRows().get(0).getField(0);
    log.info("Imported %s rows for %s in %s", rows, table.getObjectName(), nanosSince(start).convertToMostSuccinctTimeUnit());
  }
}

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

private JedisPool createConsumer(HostAddress host)
  {
    log.info("Creating new JedisPool for %s", host);
    return new JedisPool(jedisPoolConfig,
        host.getHostText(),
        host.getPort(),
        toIntExact(redisConnectorConfig.getRedisConnectTimeout().toMillis()),
        redisConnectorConfig.getRedisPassword(),
        redisConnectorConfig.getRedisDataBaseIndex());
  }
}

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

@AfterMethod
public void tearDown(Method method)
{
  assertTrue(Futures.allAsList(futures).isDone(), "Expression test futures are not complete");
  log.info("FINISHED %s in %s verified %s expressions", method.getName(), Duration.nanosSince(start), futures.size());
}

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

private static void checkConnectivity(CassandraSession session)
{
  ResultSet result = session.execute("SELECT release_version FROM system.local");
  List<Row> rows = result.all();
  assertEquals(rows.size(), 1);
  String version = rows.get(0).getString(0);
  log.info("Cassandra version: %s", version);
}

代码示例来源: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

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();
    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
  {
    // 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

private static void loadTpchTopic(EmbeddedKafka embeddedKafka, TestingPrestoClient prestoClient, TpchTable<?> table)
{
  long start = System.nanoTime();
  log.info("Running import for %s", table.getTableName());
  TestUtils.loadTpchTopic(embeddedKafka, prestoClient, kafkaTopicName(table), new QualifiedObjectName("tpch", TINY_SCHEMA_NAME, table.getTableName().toLowerCase(ENGLISH)));
  log.info("Imported %s in %s", 0, table.getTableName(), nanosSince(start).convertToMostSuccinctTimeUnit());
}

代码示例来源: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

private static void loadTpchTable(EmbeddedRedis embeddedRedis, TestingPrestoClient prestoClient, TpchTable<?> table, String dataFormat)
{
  long start = System.nanoTime();
  log.info("Running import for %s", table.getTableName());
  RedisTestUtils.loadTpchTable(
      embeddedRedis,
      prestoClient,
      redisTableName(table),
      new QualifiedObjectName("tpch", TINY_SCHEMA_NAME, table.getTableName().toLowerCase(ENGLISH)),
      dataFormat);
  log.info("Imported %s in %s", table.getTableName(), nanosSince(start).convertToMostSuccinctTimeUnit());
}

代码示例来源: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

private static void loadTpchTopic(EmbeddedElasticsearchNode embeddedElasticsearchNode, TestingPrestoClient prestoClient, TpchTable<?> table)
{
  long start = System.nanoTime();
  LOG.info("Running import for %s", table.getTableName());
  ElasticsearchLoader loader = new ElasticsearchLoader(embeddedElasticsearchNode.getClient(), table.getTableName().toLowerCase(ENGLISH), prestoClient.getServer(), prestoClient.getDefaultSession());
  loader.execute(format("SELECT * from %s", new QualifiedObjectName(TPCH_SCHEMA, TINY_SCHEMA_NAME, table.getTableName().toLowerCase(ENGLISH))));
  LOG.info("Imported %s in %s", table.getTableName(), nanosSince(start).convertToMostSuccinctTimeUnit());
}

相关文章