org.apache.druid.java.util.common.logger.Logger.warn()方法的使用及代码示例

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

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

Logger.warn介绍

[英]Protect against assuming slf4j convention. use warn(Throwable t, String message, Object... formatArgs) instead
[中]防止采用slf4j公约。使用“warn(Throwable t,String message,Object…formatArgs)”代替

代码示例

代码示例来源:origin: apache/incubator-druid

@Override
 public void shutdownCompleted(ShutdownSignalException cause)
 {
  log.warn(cause, "Channel closed!");
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void abortTask(TaskAttemptContext taskContext)
 {
  log.warn("Aborting task. Nothing to clean up.");
 }
};

代码示例来源:origin: apache/incubator-druid

@Override
public void onTrackLimitationNotice(int numberOfLimitedStatuses)
{
 // This notice will be sent each time a limited stream becomes unlimited.
 // If this number is high and or rapidly increasing, it is an indication that your predicate is too broad, and you should consider a predicate with higher selectivity.
 log.warn("Got track limitation notice:" + numberOfLimitedStatuses);
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void run()
 {
  final int shouldBeZero = count.get();
  if (shouldBeZero != 0) {
   leakedClients.incrementAndGet();
   log.warn("Expected 0 resource count, got [%d]! Object was[%s].", shouldBeZero, clientIF);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

public static Expr binaryOp(BinaryOpExprBase binary, Expr left, Expr right)
{
 try {
  return binary.getClass()
         .getDeclaredConstructor(String.class, Expr.class, Expr.class)
         .newInstance(binary.op, left, right);
 }
 catch (Exception e) {
  log.warn(e, "failed to rewrite expression " + binary);
  return binary;  // best effort.. keep it working
 }
}

代码示例来源:origin: apache/incubator-druid

private static Field getFieldByReflection(Class cls, String fieldName)
{
 Field field = null;
 try {
  field = cls.getDeclaredField(fieldName);
  field.setAccessible(true);
 }
 catch (Exception e) {
  log.warn("Unable to read [%s] field from [%s]", fieldName, cls.getName());
 }
 return field;
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void close()
 {
  if (mergeBufferHolders != null) {
   if (mergeBuffers.size() != mergeBufferHolders.size()) {
    log.warn("%d resources are not returned yet", mergeBufferHolders.size() - mergeBuffers.size());
   }
   mergeBufferHolders.forEach(ReferenceCountingResourceHolder::close);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

public void unregister(String serviceName)
 {
  log.info("Unregistering EventReceiverFirehoseMetric for service [%s]", serviceName);
  if (metrics.remove(serviceName) == null) {
   log.warn("Unregistering a non-exist service. Service [%s] never exists.", serviceName);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public void close()
{
 for (BufferAggregator aggregator : aggregators) {
  try {
   aggregator.close();
  }
  catch (Exception e) {
   LOG.warn(e, "Could not close aggregator [%s], skipping.", aggregator);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public void close()
{
 for (BufferAggregator aggregator : aggregators) {
  try {
   aggregator.close();
  }
  catch (Exception e) {
   LOG.warn(e, "Could not close aggregator [%s], skipping.", aggregator);
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void close()
 {
  if (!released) {
   decrement();
   released = true;
  } else {
   log.warn(new ISE("Already closed"), "Already closed");
  }
 }
};

代码示例来源:origin: apache/incubator-druid

@Override
 public synchronized void stop()
 {
  if (!mmapDB.isClosed()) {
   mmapDB.close();
   if (!tmpFile.delete()) {
    log.warn("Unable to delete file at [%s]", tmpFile.getAbsolutePath());
   }
  }
 }
}

代码示例来源:origin: apache/incubator-druid

/**
 * Decrements the reference count by 1. If it reaches to 0, then closes {@link #closer}.
 */
@Override
public void close()
{
 if (closed.compareAndSet(false, true)) {
  decrement();
 } else {
  log.warn(new ISE("Already closed"), "Already closed");
 }
}

代码示例来源:origin: apache/incubator-druid

private byte[] getZkDataForNode(String path)
{
 try {
  return curatorFramework.getData().decompressed().forPath(path);
 }
 catch (Exception ex) {
  log.warn(ex, "Exception while getting data for node %s", path);
  return null;
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public void returnResource()
{
 if (returned.getAndSet(true)) {
  log.warn(StringUtils.format("Resource at key[%s] was returned multiple times?", key));
 } else {
  holder.giveBack(value);
 }
}

代码示例来源:origin: apache/incubator-druid

@Override
public void put(NamedKey key, byte[] value)
{
 totalRequestCount.incrementAndGet();
 try (Jedis jedis = pool.getResource()) {
  jedis.psetex(key.toByteArray(), config.getExpiration(), value);
 }
 catch (JedisException e) {
  errorCount.incrementAndGet();
  log.warn(e, "Exception pushing item to cache");
 }
}

代码示例来源:origin: apache/incubator-druid

private QueryableDruidServer addServer(DruidServer server)
{
 QueryableDruidServer retVal = new QueryableDruidServer(server, makeDirectClient(server));
 QueryableDruidServer exists = clients.put(server.getName(), retVal);
 if (exists != null) {
  log.warn("QueryRunner for server[%s] already existed!? Well it's getting replaced", server);
 }
 return retVal;
}

代码示例来源:origin: apache/incubator-druid

@LifecycleStop
 public void stop()
 {
  if (log4jShutdown != null) {
   log.debug("Shutting down log4j");
   log4jShutdown.stop();
  } else {
   log.warn("Log4j shutdown was registered in lifecycle but no shutdown object exists!");
  }
 }
}

代码示例来源:origin: apache/incubator-druid

@SuppressWarnings("MalformedFormatString")
@Test
public void testLogWithCrazyMessages()
{
 final String message = "this % might %d kill %*.s the %s parser";
 final Logger log = new Logger(LoggerTest.class);
 log.warn(message);
}

代码示例来源:origin: apache/incubator-druid

@SuppressWarnings("MalformedFormatString")
 @Test
 public void testLegacyLogging()
 {
  final Logger log = new Logger(LoggerTest.class);
  final Throwable throwable = new Throwable();
  // These should show up in an IDE as deprecated, but shouldn't actually fail.
  log.error("foo", throwable);
  log.warn("foo", throwable);
 }
}

相关文章