YARN-6958. Moving logging APIs over to slf4j in hadoop-yarn-server-timelineservice. Contributed by Yeliang Cang.
This commit is contained in:
parent
c556cdaaf4
commit
1f80e05eb4
@ -19,8 +19,6 @@
|
||||
package org.apache.hadoop.yarn.server.timeline;
|
||||
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
||||
import org.apache.hadoop.classification.InterfaceStability.Unstable;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
@ -34,6 +32,8 @@
|
||||
import org.iq80.leveldb.DB;
|
||||
import org.iq80.leveldb.DBIterator;
|
||||
import org.iq80.leveldb.Options;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -58,8 +58,8 @@
|
||||
@Private
|
||||
@Unstable
|
||||
public class LevelDBCacheTimelineStore extends KeyValueBasedTimelineStore {
|
||||
private static final Log LOG
|
||||
= LogFactory.getLog(LevelDBCacheTimelineStore.class);
|
||||
private static final Logger LOG
|
||||
= LoggerFactory.getLogger(LevelDBCacheTimelineStore.class);
|
||||
private static final String CACHED_LDB_FILE_PREFIX = "-timeline-cache.ldb";
|
||||
private String dbId;
|
||||
private DB entityDb;
|
||||
@ -102,7 +102,7 @@ protected synchronized void serviceInit(Configuration conf) throws Exception {
|
||||
localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
|
||||
}
|
||||
} finally {
|
||||
IOUtils.cleanup(LOG, localFS);
|
||||
IOUtils.cleanupWithLogger(LOG, localFS);
|
||||
}
|
||||
LOG.info("Using leveldb path " + dbPath);
|
||||
entityDb = factory.open(new File(dbPath.toString()), options);
|
||||
@ -113,7 +113,7 @@ protected synchronized void serviceInit(Configuration conf) throws Exception {
|
||||
|
||||
@Override
|
||||
protected synchronized void serviceStop() throws Exception {
|
||||
IOUtils.cleanup(LOG, entityDb);
|
||||
IOUtils.cleanupWithLogger(LOG, entityDb);
|
||||
Path dbPath = new Path(
|
||||
configuration.get(YarnConfiguration.TIMELINE_SERVICE_LEVELDB_PATH),
|
||||
dbId + CACHED_LDB_FILE_PREFIX);
|
||||
@ -125,7 +125,7 @@ protected synchronized void serviceStop() throws Exception {
|
||||
"timeline store " + dbPath);
|
||||
}
|
||||
} finally {
|
||||
IOUtils.cleanup(LOG, localFS);
|
||||
IOUtils.cleanupWithLogger(LOG, localFS);
|
||||
}
|
||||
super.serviceStop();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user