Skip to content

Commit

Permalink
HADOOP-15274. Move hadoop-openstack to slf4j
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
  • Loading branch information
fang zhenyi authored and aajisaka committed Mar 1, 2018
1 parent 96e8f26 commit 29233c3
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 73 deletions.
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.http;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.lang.reflect.Constructor;
Expand All @@ -33,7 +33,8 @@
* available in branch-1 too.
*/
public class ExceptionDiags {
private static final Log LOG = LogFactory.getLog(ExceptionDiags.class);
private static final Logger LOG =
LoggerFactory.getLogger(ExceptionDiags.class);

/** text to point users elsewhere: {@value} */
private static final String FOR_MORE_DETAILS_SEE
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.http;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.swift.exceptions.SwiftConfigurationException;

Expand All @@ -39,7 +39,8 @@
* and then builds an appropriate Properties file.
*/
public final class RestClientBindings {
private static final Log LOG = LogFactory.getLog(RestClientBindings.class);
private static final Logger LOG =
LoggerFactory.getLogger(RestClientBindings.class);

public static final String E_INVALID_NAME = "Invalid swift hostname '%s':" +
" hostname must in form container.service";
Expand Down
Expand Up @@ -40,8 +40,8 @@
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicHeader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.swift.auth.ApiKeyAuthenticationRequest;
import org.apache.hadoop.fs.swift.auth.ApiKeyCredentials;
Expand Down Expand Up @@ -97,7 +97,8 @@
* details.
*/
public final class SwiftRestClient {
private static final Log LOG = LogFactory.getLog(SwiftRestClient.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftRestClient.class);

/**
* Header that says "use newest version" -ensures that
Expand Down Expand Up @@ -1725,7 +1726,7 @@ private <M extends HttpUriRequest> HttpResponse execWithDebugOutput(M req,
for (Header header : req.getAllHeaders()) {
builder.append(header.toString());
}
LOG.debug(builder);
LOG.debug(builder.toString());
}
HttpResponse resp = client.execute(req);
if (LOG.isDebugEnabled()) {
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.snative;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.BlockLocation;
Expand Down Expand Up @@ -54,8 +54,8 @@ public class SwiftNativeFileSystem extends FileSystem {

/** filesystem prefix: {@value} */
public static final String SWIFT = "swift";
private static final Log LOG =
LogFactory.getLog(SwiftNativeFileSystem.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftNativeFileSystem.class);

/**
* path to user work directory for storing temporary files
Expand Down
Expand Up @@ -22,8 +22,8 @@
import org.apache.http.Header;
import org.apache.http.HttpStatus;
import org.apache.http.message.BasicHeader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileStatus;
Expand Down Expand Up @@ -65,8 +65,8 @@
public class SwiftNativeFileSystemStore {
private static final Pattern URI_PATTERN = Pattern.compile("\"\\S+?\"");
private static final String PATTERN = "EEE, d MMM yyyy hh:mm:ss zzz";
private static final Log LOG =
LogFactory.getLog(SwiftNativeFileSystemStore.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftNativeFileSystemStore.class);
private URI uri;
private SwiftRestClient swiftRestClient;

Expand Down Expand Up @@ -720,7 +720,7 @@ private void logDirectory(String message, SwiftObjectPath objectPath,
if (LOG.isDebugEnabled()) {
LOG.debug(message + ": listing of " + objectPath);
for (FileStatus fileStatus : statuses) {
LOG.debug(fileStatus.getPath());
LOG.debug(fileStatus.getPath().toString());
}
}
}
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.snative;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.fs.FSExceptionMessages;
import org.apache.hadoop.fs.FSInputStream;
import org.apache.hadoop.fs.FileSystem;
Expand All @@ -43,7 +43,8 @@
*/
class SwiftNativeInputStream extends FSInputStream {

private static final Log LOG = LogFactory.getLog(SwiftNativeInputStream.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftNativeInputStream.class);

/**
* range requested off the server: {@value}
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.snative;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.swift.exceptions.SwiftConnectionClosedException;
Expand All @@ -45,8 +45,8 @@
class SwiftNativeOutputStream extends OutputStream {
public static final int ATTEMPT_LIMIT = 3;
private long filePartSize;
private static final Log LOG =
LogFactory.getLog(SwiftNativeOutputStream.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftNativeOutputStream.class);
private Configuration conf;
private String key;
private File backupFile;
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
Expand All @@ -40,8 +40,8 @@
*/
public class SwiftTestUtils extends org.junit.Assert {

private static final Log LOG =
LogFactory.getLog(SwiftTestUtils.class);
private static final Logger LOG =
LoggerFactory.getLogger(SwiftTestUtils.class);

public static final String TEST_FS_SWIFT = "test.fs.swift.name";
public static final String IO_FILE_BUFFER_SIZE = "io.file.buffer.size";
Expand Down
Expand Up @@ -18,7 +18,7 @@

package org.apache.hadoop.fs.swift.util;

import org.apache.commons.logging.Log;
import org.slf4j.Logger;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
Expand Down Expand Up @@ -98,7 +98,7 @@ public static boolean isRootDir(SwiftObjectPath swiftObject) {
* @param text text message
* @param args args arguments to the print statement
*/
public static void debug(Log log, String text, Object... args) {
public static void debug(Logger log, String text, Object... args) {
if (log.isDebugEnabled()) {
log.debug(String.format(text, args));
}
Expand All @@ -110,7 +110,7 @@ public static void debug(Log log, String text, Object... args) {
* @param text text message
* @param ex exception
*/
public static void debugEx(Log log, String text, Exception ex) {
public static void debugEx(Logger log, String text, Exception ex) {
if (log.isDebugEnabled()) {
log.debug(text + ex, ex);
}
Expand All @@ -124,7 +124,7 @@ public static void debugEx(Log log, String text, Exception ex) {
* @param text text message
* @param args args arguments to the print statement
*/
public static void trace(Log log, String text, Object... args) {
public static void trace(Logger log, String text, Object... args) {
if (log.isTraceEnabled()) {
log.trace(String.format(text, args));
}
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileStatus;
Expand Down Expand Up @@ -53,8 +53,8 @@
public class SwiftFileSystemBaseTest extends Assert implements
SwiftTestConstants {

protected static final Log LOG =
LogFactory.getLog(SwiftFileSystemBaseTest.class);
protected static final Logger LOG =
LoggerFactory.getLogger(SwiftFileSystemBaseTest.class);
protected SwiftNativeFileSystem fs;
protected static SwiftNativeFileSystem lastFs;
protected byte[] data = SwiftTestUtils.dataset(getBlockSize() * 2, 0, 255);
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Test;

import java.net.URL;
Expand All @@ -28,8 +28,8 @@
* This test just debugs which log resources are being picked up
*/
public class TestLogResources implements SwiftTestConstants {
protected static final Log LOG =
LogFactory.getLog(TestLogResources.class);
protected static final Logger LOG =
LoggerFactory.getLogger(TestLogResources.class);

private void printf(String format, Object... args) {
String msg = String.format(format, args);
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.Path;
Expand All @@ -44,8 +44,8 @@
* to get confused.
*/
public class TestReadPastBuffer extends SwiftFileSystemBaseTest {
protected static final Log LOG =
LogFactory.getLog(TestReadPastBuffer.class);
protected static final Logger LOG =
LoggerFactory.getLogger(TestReadPastBuffer.class);
public static final int SWIFT_READ_BLOCKSIZE = 4096;
public static final int SEEK_FILE_LEN = SWIFT_READ_BLOCKSIZE * 2;

Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.Path;
Expand Down Expand Up @@ -48,8 +48,8 @@
* to get confused.
*/
public class TestSeek extends SwiftFileSystemBaseTest {
protected static final Log LOG =
LogFactory.getLog(TestSeek.class);
protected static final Logger LOG =
LoggerFactory.getLogger(TestSeek.class);
public static final int SMALL_SEEK_FILE_LEN = 256;

private Path testPath;
Expand Down
Expand Up @@ -19,8 +19,8 @@
package org.apache.hadoop.fs.swift;

import org.junit.Assert;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.ParentNotDirectoryException;
import org.apache.hadoop.fs.Path;
Expand All @@ -46,8 +46,8 @@
*/
public class TestSwiftFileSystemBasicOps extends SwiftFileSystemBaseTest {

private static final Log LOG =
LogFactory.getLog(TestSwiftFileSystemBasicOps.class);
private static final Logger LOG =
LoggerFactory.getLogger(TestSwiftFileSystemBasicOps.class);

@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testLsRoot() throws Throwable {
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.swift.util.SwiftTestUtils;
Expand All @@ -37,8 +37,8 @@
* Consider it "best effort"
*/
public class TestSwiftFileSystemConcurrency extends SwiftFileSystemBaseTest {
protected static final Log LOG =
LogFactory.getLog(TestSwiftFileSystemConcurrency.class);
protected static final Logger LOG =
LoggerFactory.getLogger(TestSwiftFileSystemConcurrency.class);
private Exception thread1Ex, thread2Ex;
public static final String TEST_RACE_CONDITION_ON_DELETE_DIR =
"/test/testraceconditionondirdeletetest";
Expand Down
Expand Up @@ -18,8 +18,8 @@

package org.apache.hadoop.fs.swift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystemContractBaseTest;
import org.apache.hadoop.fs.ParentNotDirectoryException;
Expand Down Expand Up @@ -47,8 +47,8 @@
*/
public class TestSwiftFileSystemContract
extends FileSystemContractBaseTest {
private static final Log LOG =
LogFactory.getLog(TestSwiftFileSystemContract.class);
private static final Logger LOG =
LoggerFactory.getLogger(TestSwiftFileSystemContract.class);

/**
* Override this if the filesystem is not case sensitive
Expand Down

0 comments on commit 29233c3

Please sign in to comment.