本文整理了Java中io.airlift.log.Logger.warn()
方法的一些代码示例,展示了Logger.warn()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()
方法的具体详情如下:
包路径:io.airlift.log.Logger
类名称:Logger
方法名:warn
[英]Logs a message at WARN level.
[中]以警告级别记录消息。
代码示例来源:origin: prestodb/presto
private void logCleanupFailure(Throwable t, String format, Object... args)
{
if (throwOnCleanupFailure) {
throw new RuntimeException(format(format, args), t);
}
log.warn(t, format, args);
}
代码示例来源:origin: prestodb/presto
private void logCleanupFailure(String format, Object... args)
{
if (throwOnCleanupFailure) {
throw new RuntimeException(format(format, args));
}
log.warn(format, args);
}
代码示例来源:origin: prestodb/presto
private void cleanupFile(Path file)
{
try {
fileSystem.delete(file, false);
if (fileSystem.exists(file)) {
throw new IOException("Delete failed");
}
}
catch (IOException e) {
log.warn(e, "Failed to delete temporary file: " + file);
}
}
代码示例来源:origin: prestodb/presto
private static void closeSplitSource(SplitSource source)
{
try {
source.close();
}
catch (Throwable t) {
log.warn(t, "Error closing split source");
}
}
代码示例来源:origin: prestodb/presto
private static void deleteDir(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path, boolean recursive)
{
try {
hdfsEnvironment.getFileSystem(context, path).delete(path, recursive);
}
catch (Exception e) {
// don't fail if unable to delete path
log.warn(e, "Failed to delete path: " + path.toString());
}
}
代码示例来源:origin: prestodb/presto
private NetworkLocation locate(HostAddress host)
{
try {
return networkTopology.locate(host);
}
catch (RuntimeException e) {
negativeCache.put(host, true);
log.warn(e, "Unable to determine location of %s. Will attempt again in %s", host, NEGATIVE_CACHE_DURATION);
// no one will see the exception thrown here
throw e;
}
}
}
代码示例来源:origin: prestodb/presto
@PreDestroy
public void tearDown()
{
for (Map.Entry<HostAddress, JedisPool> entry : jedisPoolCache.asMap().entrySet()) {
try {
entry.getValue().destroy();
}
catch (Exception e) {
log.warn(e, "While destroying JedisPool %s:", entry.getKey());
}
}
}
代码示例来源:origin: prestodb/presto
@PreDestroy
public void tearDown()
{
for (Map.Entry<HostAddress, SimpleConsumer> entry : consumerCache.asMap().entrySet()) {
try {
entry.getValue().close();
}
catch (Exception e) {
log.warn(e, "While closing consumer %s:", entry.getKey());
}
}
}
代码示例来源:origin: prestodb/presto
@Override
public void run()
{
try {
updateMonitoredServices();
}
catch (Throwable e) {
// ignore to avoid getting unscheduled
log.warn(e, "Error updating services");
}
}
}, 0, 5, TimeUnit.SECONDS);
代码示例来源:origin: prestodb/presto
@Override
public void close()
{
for (SourceScheduler sourceScheduler : sourceSchedulers) {
try {
sourceScheduler.close();
}
catch (Throwable t) {
log.warn(t, "Error closing split source");
}
}
sourceSchedulers.clear();
}
代码示例来源:origin: prestodb/presto
@Override
public void run()
{
try {
ping();
updateState();
}
catch (Throwable e) {
// ignore to avoid getting unscheduled
log.warn(e, "Error pinging service %s (%s)", service.getId(), uri);
}
}
}, heartbeat.toMillis(), heartbeat.toMillis(), TimeUnit.MILLISECONDS);
代码示例来源: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 static ResumableTask.TaskStatus safeProcessTask(ResumableTask task)
{
try {
return task.process();
}
catch (Throwable t) {
log.warn(t, "ResumableTask completed exceptionally");
return ResumableTask.TaskStatus.finished();
}
}
}
代码示例来源: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
private void tearDownControl()
{
QueryResult controlTearDownResult = executeTearDown(
queryPair.getControl(),
controlGateway,
controlUsername,
controlPassword,
controlTimeout,
controlPostQueryResults,
controlTeardownRetries);
if (controlTearDownResult.getState() != State.SUCCESS) {
log.warn("Control table teardown failed");
}
}
代码示例来源:origin: prestodb/presto
private static <T> T handleProxyException(Request request, ProxyException e)
{
log.warn(e, "Proxy request failed: %s %s", request.getMethod(), request.getUri());
throw badRequest(BAD_GATEWAY, e.getMessage());
}
内容来源于网络,如有侵权,请联系作者删除!