HADOOP-6548. Replace mortbay imports with commons logging.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@909802 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christopher Douglas 2010-02-13 12:21:26 +00:00
parent e0a0e6b9f5
commit fc83909c3f
4 changed files with 24 additions and 8 deletions

View File

@ -189,6 +189,8 @@ Trunk (unreleased changes)
HADOOP-6505. Use tr rather than sed to effect literal substitution in the HADOOP-6505. Use tr rather than sed to effect literal substitution in the
build script. (Allen Wittenauer via cdouglas) build script. (Allen Wittenauer via cdouglas)
HADOOP-6548. Replace mortbay imports with commons logging. (cdouglas)
Release 0.21.0 - Unreleased Release 0.21.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -27,12 +27,17 @@
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Shell; import org.apache.hadoop.util.Shell;
import org.apache.hadoop.util.Shell.ShellCommandExecutor; import org.apache.hadoop.util.Shell.ShellCommandExecutor;
import org.mortbay.log.Log;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** /**
* A collection of file-processing util methods * A collection of file-processing util methods
*/ */
public class FileUtil { public class FileUtil {
private static final Log LOG = LogFactory.getLog(FileUtil.class);
/** /**
* convert an array of FileStatus to an array of Path * convert an array of FileStatus to an array of Path
* *
@ -752,8 +757,8 @@ public static int chmod(String filename, String perm, boolean recursive)
try { try {
shExec.execute(); shExec.execute();
}catch(Exception e) { }catch(Exception e) {
if(Log.isDebugEnabled()) { if(LOG.isDebugEnabled()) {
Log.debug("Error while changing permission : " + filename LOG.debug("Error while changing permission : " + filename
+" Exception: " + StringUtils.stringifyException(e)); +" Exception: " + StringUtils.stringifyException(e));
} }
} }

View File

@ -23,7 +23,9 @@
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.compress.Compressor; import org.apache.hadoop.io.compress.Compressor;
import org.mortbay.log.Log;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** /**
* A wrapper around java.util.zip.Deflater to make it conform * A wrapper around java.util.zip.Deflater to make it conform
@ -32,6 +34,8 @@
*/ */
public class BuiltInZlibDeflater extends Deflater implements Compressor { public class BuiltInZlibDeflater extends Deflater implements Compressor {
private static final Log LOG = LogFactory.getLog(BuiltInZlibDeflater.class);
public BuiltInZlibDeflater(int level, boolean nowrap) { public BuiltInZlibDeflater(int level, boolean nowrap) {
super(level, nowrap); super(level, nowrap);
} }
@ -69,9 +73,9 @@ public void reinit(Configuration conf) {
try { try {
setStrategy(strategy.compressionStrategy()); setStrategy(strategy.compressionStrategy());
} catch (IllegalArgumentException ill) { } catch (IllegalArgumentException ill) {
Log.warn(strategy + " not supported by BuiltInZlibDeflater."); LOG.warn(strategy + " not supported by BuiltInZlibDeflater.");
setStrategy(DEFAULT_STRATEGY); setStrategy(DEFAULT_STRATEGY);
} }
Log.debug("Reinit compressor with new compression configuration"); LOG.debug("Reinit compressor with new compression configuration");
} }
} }

View File

@ -25,7 +25,9 @@
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.compress.Compressor; import org.apache.hadoop.io.compress.Compressor;
import org.apache.hadoop.util.NativeCodeLoader; import org.apache.hadoop.util.NativeCodeLoader;
import org.mortbay.log.Log;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** /**
* A {@link Compressor} based on the popular * A {@link Compressor} based on the popular
@ -34,6 +36,9 @@
* *
*/ */
public class ZlibCompressor implements Compressor { public class ZlibCompressor implements Compressor {
private static final Log LOG = LogFactory.getLog(ZlibCompressor.class);
private static final int DEFAULT_DIRECT_BUFFER_SIZE = 64*1024; private static final int DEFAULT_DIRECT_BUFFER_SIZE = 64*1024;
// HACK - Use this as a global lock in the JNI layer // HACK - Use this as a global lock in the JNI layer
@ -248,7 +253,7 @@ public synchronized void reinit(Configuration conf) {
stream = init(level.compressionLevel(), stream = init(level.compressionLevel(),
strategy.compressionStrategy(), strategy.compressionStrategy(),
windowBits.windowBits()); windowBits.windowBits());
Log.debug("Reinit compressor with new compression configuration"); LOG.debug("Reinit compressor with new compression configuration");
} }
public synchronized void setInput(byte[] b, int off, int len) { public synchronized void setInput(byte[] b, int off, int len) {