HADOOP-15274. Move hadoop-openstack to slf4j

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
fang zhenyi 2018-03-01 15:08:21 -08:00 committed by Akira Ajisaka
parent 96e8f260ab
commit 29233c3c4a
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
19 changed files with 79 additions and 73 deletions

View File

@ -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;
@ -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

View File

@ -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;
@ -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";

View File

@ -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;
@ -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
@ -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()) {

View File

@ -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;
@ -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

View File

@ -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;
@ -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;
@ -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());
}
}
}

View File

@ -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;
@ -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}

View File

@ -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;
@ -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;

View File

@ -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;
@ -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";

View File

@ -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;
@ -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));
}
@ -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);
}
@ -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));
}

View File

@ -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;
@ -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);

View File

@ -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;
@ -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);

View File

@ -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;
@ -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;

View File

@ -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;
@ -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;

View File

@ -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;
@ -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 {

View File

@ -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;
@ -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";

View File

@ -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;
@ -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

View File

@ -17,8 +17,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.Path;
import org.apache.hadoop.fs.swift.http.RestClientBindings;
import org.apache.hadoop.fs.swift.http.SwiftRestClient;
@ -36,7 +36,8 @@
* Unit tests for SwiftObjectPath class.
*/
public class TestSwiftObjectPath implements SwiftTestConstants {
private static final Log LOG = LogFactory.getLog(TestSwiftObjectPath.class);
private static final Logger LOG =
LoggerFactory.getLogger(TestSwiftObjectPath.class);
/**
* What an endpoint looks like. This is derived from a (valid)

View File

@ -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.Path;
import org.apache.hadoop.fs.swift.SwiftTestConstants;
@ -39,8 +39,8 @@
import java.net.URI;
public class TestSwiftRestClient implements SwiftTestConstants {
private static final Log LOG =
LogFactory.getLog(TestSwiftRestClient.class);
private static final Logger LOG =
LoggerFactory.getLogger(TestSwiftRestClient.class);
private Configuration conf;
private boolean runTests;
@ -110,7 +110,7 @@ public void testPutAndDelete() throws Throwable {
//expected
}
for (DurationStats stats: client.getOperationStatistics()) {
LOG.info(stats);
LOG.info(stats.toString());
}
}

View File

@ -18,8 +18,8 @@
package org.apache.hadoop.fs.swift.scale;
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.Path;
import org.apache.hadoop.fs.swift.util.Duration;
@ -29,7 +29,8 @@
public class TestWriteManySmallFiles extends SwiftScaleTestBase {
public static final Log LOG = LogFactory.getLog(TestWriteManySmallFiles.class);
public static final Logger LOG =
LoggerFactory.getLogger(TestWriteManySmallFiles.class);
@Test(timeout = SWIFT_BULK_IO_TEST_TIMEOUT)
public void testScaledWriteThenRead() throws Throwable {