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

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

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

Logger.debug介绍

[英]Logs a message at DEBUG level.
[中]在调试级别记录消息。

代码示例

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

@Override
  public void stateChanged(TaskState newState)
  {
    log.debug("Task %s is %s", taskId, newState);
  }
});

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

private boolean endOfData()
{
  if (!reported.getAndSet(true)) {
    log.debug("Read a total of %d values with %d bytes.", totalValues, totalBytes);
  }
  return false;
}

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

protected void execute(Connection connection, String query)
    throws SQLException
{
  try (Statement statement = connection.createStatement()) {
    log.debug("Execute: %s", query);
    statement.execute(query);
  }
}

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

private static List<File> listFiles(File dir)
{
  if ((dir != null) && dir.isDirectory()) {
    File[] files = dir.listFiles();
    if (files != null) {
      log.debug("Considering files: %s", asList(files));
      return ImmutableList.copyOf(files);
    }
  }
  return ImmutableList.of();
}

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

private static List<File> listFiles(File dir)
{
  if ((dir != null) && dir.isDirectory()) {
    File[] files = dir.listFiles();
    if (files != null) {
      log.debug("Considering files: %s", asList(files));
      return ImmutableList.copyOf(files);
    }
  }
  return ImmutableList.of();
}

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

private static boolean smallestCardAboveThreshold(ConnectorSession session, long numRows, long smallestCardinality)
{
  double ratio = ((double) smallestCardinality / (double) numRows);
  double threshold = getIndexSmallCardThreshold(session);
  LOG.debug("Smallest cardinality is %d, num rows is %d, ratio is %2f with threshold of %f", smallestCardinality, numRows, ratio, threshold);
  return ratio > threshold;
}

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

@Override
  public void fallbackToNFA()
  {
    log.debug("Fallback to NFA, pattern: %s, DFA states limit: %d, DFA retries: %d", re2jPattern.pattern(), dfaStatesLimit, dfaRetries);
  }
}

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

private URLClassLoader buildClassLoaderFromDirectory(File dir)
    throws Exception
{
  log.debug("Classpath for %s:", dir.getName());
  List<URL> urls = new ArrayList<>();
  for (File file : listFiles(dir)) {
    log.debug("    %s", file);
    urls.add(file.toURI().toURL());
  }
  return createClassLoader(urls);
}

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

@Override
public void cancelQuery(QueryId queryId)
{
  log.debug("Cancel query %s", queryId);
  queryTracker.tryGetQuery(queryId)
      .ifPresent(QueryExecution::cancelQuery);
}

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

private static AWSCredentialsProvider getCustomAWSCredentialsProvider(URI uri, Configuration conf, String providerClass)
{
  try {
    log.debug("Using AWS credential provider %s for URI %s", providerClass, uri);
    return conf.getClassByName(providerClass)
        .asSubclass(AWSCredentialsProvider.class)
        .getConstructor(URI.class, Configuration.class)
        .newInstance(uri, conf);
  }
  catch (ReflectiveOperationException e) {
    throw new RuntimeException(format("Error creating an instance of %s for URI %s", providerClass, uri), e);
  }
}

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

@Inject
RedisMetadata(
    RedisConnectorId connectorId,
    RedisConnectorConfig redisConnectorConfig,
    Supplier<Map<SchemaTableName, RedisTableDescription>> redisTableDescriptionSupplier)
{
  this.connectorId = requireNonNull(connectorId, "connectorId is null").toString();
  requireNonNull(redisConnectorConfig, "redisConfig is null");
  hideInternalColumns = redisConnectorConfig.isHideInternalColumns();
  log.debug("Loading redis table definitions from %s", redisConnectorConfig.getTableDescriptionDir().getAbsolutePath());
  this.redisTableDescriptionSupplier = Suppliers.memoize(redisTableDescriptionSupplier::get)::get;
}

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

@Override
public MongoTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)
{
  requireNonNull(tableName, "tableName is null");
  try {
    return mongoSession.getTable(tableName).getTableHandle();
  }
  catch (TableNotFoundException e) {
    log.debug(e, "Table(%s) not found", tableName);
    return null;
  }
}

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

public TaskInfo abortTaskResults(OutputBufferId bufferId)
{
  requireNonNull(bufferId, "bufferId is null");
  log.debug("Aborting task %s output %s", taskId, bufferId);
  outputBuffer.abort(bufferId);
  return getTaskInfo();
}

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

@Override
public void cancelStage(StageId stageId)
{
  requireNonNull(stageId, "stageId is null");
  log.debug("Cancel stage %s", stageId);
  queryTracker.tryGetQuery(stageId.getQueryId())
      .ifPresent(query -> query.cancelStage(stageId));
}

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

@Inject
public ColumnCardinalityCache(Connector connector, AccumuloConfig config)
{
  this.connector = requireNonNull(connector, "connector is null");
  int size = requireNonNull(config, "config is null").getCardinalityCacheSize();
  Duration expireDuration = config.getCardinalityCacheExpiration();
  // Create a bounded executor with a pool size at 4x number of processors
  this.coreExecutor = newCachedThreadPool(daemonThreadsNamed("cardinality-lookup-%s"));
  this.executorService = new BoundedExecutor(coreExecutor, 4 * Runtime.getRuntime().availableProcessors());
  LOG.debug("Created new cache size %d expiry %s", size, expireDuration);
  cache = CacheBuilder.newBuilder()
      .maximumSize(size)
      .expireAfterWrite(expireDuration.toMillis(), MILLISECONDS)
      .build(new CardinalityCacheLoader());
}

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

public boolean transitionToFailed(Throwable throwable)
{
  requireNonNull(throwable, "throwable is null");
  failureCause.compareAndSet(null, Failures.toFailure(throwable));
  boolean failed = stageState.setIf(FAILED, currentState -> !currentState.isDone());
  if (failed) {
    log.error(throwable, "Stage %s failed", stageId);
  }
  else {
    log.debug(throwable, "Failure after stage %s finished", stageId);
  }
  return failed;
}

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

private boolean endOfData()
{
  if (!reported.getAndSet(true)) {
    log.debug("Found a total of %d messages with %d bytes (%d messages expected). Last Offset: %d (%d, %d)",
        totalMessages, totalBytes, split.getEnd() - split.getStart(),
        cursorOffset, split.getStart(), split.getEnd());
  }
  return false;
}

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

public static <T> Class<? extends T> defineClass(ClassDefinition classDefinition, Class<T> superType, DynamicClassLoader classLoader)
  {
    log.debug("Defining class: %s", classDefinition.getName());
    return classGenerator(classLoader).defineClass(classDefinition, superType);
  }
}

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

public KuduTable openTable(SchemaTableName schemaTableName)
{
  String rawName = schemaEmulation.toRawName(schemaTableName);
  try {
    return client.openTable(rawName);
  }
  catch (KuduException e) {
    log.debug("Error on doOpenTable: " + e, e);
    if (!listSchemaNames().contains(schemaTableName.getSchemaName())) {
      throw new SchemaNotFoundException(schemaTableName.getSchemaName());
    }
    throw new TableNotFoundException(schemaTableName);
  }
}

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

/**
 * Move the task directly to the failed state if there was a failure in this task
 */
private void failTask(Throwable cause)
{
  TaskStatus taskStatus = getTaskStatus();
  if (!taskStatus.getState().isDone()) {
    log.debug(cause, "Remote task %s failed with %s", taskStatus.getSelf(), cause);
  }
  abort(failWith(getTaskStatus(), FAILED, ImmutableList.of(toFailure(cause))));
}

相关文章