HADOOP-13239 Deprecate s3:// in branch-2

This commit is contained in:
Steve Loughran 2016-06-29 13:16:10 +01:00
parent 4a57c03f30
commit f4f0c5074d
30 changed files with 47 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.classification.InterfaceStability;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public class Block { public class Block {
private long id; private long id;

View File

@ -33,6 +33,7 @@ import org.apache.hadoop.fs.Path;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public interface FileSystemStore { public interface FileSystemStore {
void initialize(URI uri, Configuration conf) throws IOException; void initialize(URI uri, Configuration conf) throws IOException;

View File

@ -35,6 +35,7 @@ import org.apache.hadoop.io.IOUtils;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public class INode { public class INode {
enum FileType { enum FileType {

View File

@ -50,6 +50,7 @@ import org.jets3t.service.security.AWSCredentials;
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
class Jets3tFileSystemStore implements FileSystemStore { class Jets3tFileSystemStore implements FileSystemStore {
private static final String FILE_SYSTEM_NAME = "fs"; private static final String FILE_SYSTEM_NAME = "fs";

View File

@ -52,6 +52,7 @@ import org.jets3t.service.security.AWSCredentials;
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public class MigrationTool extends Configured implements Tool { public class MigrationTool extends Configured implements Tool {
private S3Service s3Service; private S3Service s3Service;

View File

@ -33,6 +33,7 @@ import org.apache.hadoop.fs.s3native.S3xLoginHelper;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public class S3Credentials { public class S3Credentials {
private String accessKey; private String accessKey;

View File

@ -28,6 +28,7 @@ import org.apache.hadoop.classification.InterfaceStability;
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Stable @InterfaceStability.Stable
@Deprecated
public class S3Exception extends IOException { public class S3Exception extends IOException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -38,6 +38,7 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.ParentNotDirectoryException; import org.apache.hadoop.fs.ParentNotDirectoryException;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.s3a.S3AFileSystem;
import org.apache.hadoop.fs.s3native.NativeS3FileSystem; import org.apache.hadoop.fs.s3native.NativeS3FileSystem;
import org.apache.hadoop.fs.s3native.S3xLoginHelper; import org.apache.hadoop.fs.s3native.S3xLoginHelper;
import org.apache.hadoop.io.retry.RetryPolicies; import org.apache.hadoop.io.retry.RetryPolicies;
@ -50,11 +51,15 @@ import org.apache.hadoop.util.Progressable;
* <a href="http://aws.amazon.com/s3">Amazon S3</a>. * <a href="http://aws.amazon.com/s3">Amazon S3</a>.
* *
* @see NativeS3FileSystem * @see NativeS3FileSystem
* @deprecated Use {@link NativeS3FileSystem} and {@link S3AFileSystem} instead.
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Stable @InterfaceStability.Stable
@Deprecated
public class S3FileSystem extends FileSystem { public class S3FileSystem extends FileSystem {
private static boolean hasWarnedDeprecation = false;
private URI uri; private URI uri;
private FileSystemStore store; private FileSystemStore store;
@ -62,13 +67,26 @@ public class S3FileSystem extends FileSystem {
private Path workingDir; private Path workingDir;
public S3FileSystem() { public S3FileSystem() {
warnDeprecation();
// set store in initialize() // set store in initialize()
} }
public S3FileSystem(FileSystemStore store) { public S3FileSystem(FileSystemStore store) {
warnDeprecation();
this.store = store; this.store = store;
} }
/**
* This is to warn the first time in a JVM that an S3FileSystem is created.
*/
private static synchronized void warnDeprecation() {
if (!hasWarnedDeprecation) {
System.err.println("S3FileSystem is deprecated and will be removed in " +
"future releases. Use NativeS3FileSystem or S3AFileSystem instead.");
hasWarnedDeprecation = true;
}
}
/** /**
* Return the protocol scheme for the FileSystem. * Return the protocol scheme for the FileSystem.
* *

View File

@ -29,6 +29,7 @@ import org.apache.hadoop.fs.CommonConfigurationKeys;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
public class S3FileSystemConfigKeys extends CommonConfigurationKeys { public class S3FileSystemConfigKeys extends CommonConfigurationKeys {
public static final String S3_BLOCK_SIZE_KEY = "s3.blocksize"; public static final String S3_BLOCK_SIZE_KEY = "s3.blocksize";
public static final long S3_BLOCK_SIZE_DEFAULT = 64*1024*1024; public static final long S3_BLOCK_SIZE_DEFAULT = 64*1024*1024;

View File

@ -27,6 +27,7 @@ import org.apache.hadoop.classification.InterfaceStability;
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Stable @InterfaceStability.Stable
@Deprecated
public class S3FileSystemException extends IOException { public class S3FileSystemException extends IOException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -34,6 +34,7 @@ import org.apache.hadoop.fs.FileSystem;
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
class S3InputStream extends FSInputStream { class S3InputStream extends FSInputStream {
private FileSystemStore store; private FileSystemStore store;

View File

@ -37,6 +37,7 @@ import org.apache.hadoop.util.Progressable;
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Unstable @InterfaceStability.Unstable
@Deprecated
class S3OutputStream extends OutputStream { class S3OutputStream extends OutputStream {
private Configuration conf; private Configuration conf;

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.classification.InterfaceStability;
*/ */
@InterfaceAudience.Public @InterfaceAudience.Public
@InterfaceStability.Stable @InterfaceStability.Stable
@Deprecated
public class VersionMismatchException extends S3FileSystemException { public class VersionMismatchException extends S3FileSystemException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -25,6 +25,7 @@ import org.apache.hadoop.fs.contract.AbstractBondedFSContract;
/** /**
* The contract of S3: only enabled if the test bucket is provided. * The contract of S3: only enabled if the test bucket is provided.
*/ */
@Deprecated
public class S3Contract extends AbstractBondedFSContract { public class S3Contract extends AbstractBondedFSContract {
public static final String CONTRACT_XML = "contract/s3.xml"; public static final String CONTRACT_XML = "contract/s3.xml";

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.fs.contract.AbstractContractCreateTest;
import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.contract.ContractTestUtils; import org.apache.hadoop.fs.contract.ContractTestUtils;
@Deprecated
public class TestS3ContractCreate extends AbstractContractCreateTest { public class TestS3ContractCreate extends AbstractContractCreateTest {
@Override @Override

View File

@ -22,6 +22,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.contract.AbstractContractDeleteTest; import org.apache.hadoop.fs.contract.AbstractContractDeleteTest;
import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.AbstractFSContract;
@Deprecated
public class TestS3ContractDelete extends AbstractContractDeleteTest { public class TestS3ContractDelete extends AbstractContractDeleteTest {
@Override @Override

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.fs.contract.AbstractContractMkdirTest;
import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.contract.ContractTestUtils; import org.apache.hadoop.fs.contract.ContractTestUtils;
@Deprecated
public class TestS3ContractMkdir extends AbstractContractMkdirTest { public class TestS3ContractMkdir extends AbstractContractMkdirTest {
@Override @Override

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.fs.contract.AbstractContractOpenTest;
import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.contract.ContractTestUtils; import org.apache.hadoop.fs.contract.ContractTestUtils;
@Deprecated
public class TestS3ContractOpen extends AbstractContractOpenTest { public class TestS3ContractOpen extends AbstractContractOpenTest {
@Override @Override

View File

@ -22,6 +22,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.contract.AbstractContractRenameTest; import org.apache.hadoop.fs.contract.AbstractContractRenameTest;
import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.AbstractFSContract;
@Deprecated
public class TestS3ContractRename extends AbstractContractRenameTest { public class TestS3ContractRename extends AbstractContractRenameTest {
@Override @Override

View File

@ -28,6 +28,7 @@ import org.junit.Test;
/** /**
* root dir operations against an S3 bucket * root dir operations against an S3 bucket
*/ */
@Deprecated
public class TestS3ContractRootDir extends AbstractContractRootDirectoryTest { public class TestS3ContractRootDir extends AbstractContractRootDirectoryTest {
@Override @Override

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@Deprecated
public class TestS3ContractSeek extends AbstractContractSeekTest { public class TestS3ContractSeek extends AbstractContractSeekTest {
@Override @Override

View File

@ -41,6 +41,7 @@ import org.apache.hadoop.fs.s3.INode.FileType;
* A stub implementation of {@link FileSystemStore} for testing * A stub implementation of {@link FileSystemStore} for testing
* {@link S3FileSystem} without actually connecting to S3. * {@link S3FileSystem} without actually connecting to S3.
*/ */
@Deprecated
public class InMemoryFileSystemStore implements FileSystemStore { public class InMemoryFileSystemStore implements FileSystemStore {
private Configuration conf; private Configuration conf;

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.fs.s3;
import java.io.IOException; import java.io.IOException;
@Deprecated
public class Jets3tS3FileSystemContractTest public class Jets3tS3FileSystemContractTest
extends S3FileSystemContractBaseTest { extends S3FileSystemContractBaseTest {

View File

@ -26,6 +26,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystemContractBaseTest; import org.apache.hadoop.fs.FileSystemContractBaseTest;
import org.junit.internal.AssumptionViolatedException; import org.junit.internal.AssumptionViolatedException;
@Deprecated
public abstract class S3FileSystemContractBaseTest public abstract class S3FileSystemContractBaseTest
extends FileSystemContractBaseTest { extends FileSystemContractBaseTest {

View File

@ -25,6 +25,7 @@ import org.apache.hadoop.fs.s3.InMemoryFileSystemStore;
* A helper implementation of {@link S3FileSystem} * A helper implementation of {@link S3FileSystem}
* without actually connecting to S3 for unit testing. * without actually connecting to S3 for unit testing.
*/ */
@Deprecated
public class S3InMemoryFileSystem extends S3FileSystem { public class S3InMemoryFileSystem extends S3FileSystem {
public S3InMemoryFileSystem() { public S3InMemoryFileSystem() {
super(new InMemoryFileSystemStore()); super(new InMemoryFileSystemStore());

View File

@ -25,6 +25,7 @@ import junit.framework.TestCase;
import org.apache.hadoop.fs.s3.INode.FileType; import org.apache.hadoop.fs.s3.INode.FileType;
@Deprecated
public class TestINode extends TestCase { public class TestINode extends TestCase {
public void testSerializeFileWithSingleBlock() throws IOException { public void testSerializeFileWithSingleBlock() throws IOException {

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.fs.s3;
import java.io.IOException; import java.io.IOException;
@Deprecated
public class TestInMemoryS3FileSystemContract public class TestInMemoryS3FileSystemContract
extends S3FileSystemContractBaseTest { extends S3FileSystemContractBaseTest {

View File

@ -36,6 +36,7 @@ import org.junit.rules.TestName;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@Deprecated
public class TestS3Credentials { public class TestS3Credentials {
public static final Log LOG = LogFactory.getLog(TestS3Credentials.class); public static final Log LOG = LogFactory.getLog(TestS3Credentials.class);

View File

@ -25,6 +25,7 @@ import junit.framework.TestCase;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
@Deprecated
public class TestS3FileSystem extends TestCase { public class TestS3FileSystem extends TestCase {
public static final URI EXPECTED = URI.create("s3://c"); public static final URI EXPECTED = URI.create("s3://c");

View File

@ -28,6 +28,7 @@ import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
@Deprecated
public class TestS3InMemoryFileSystem extends TestCase { public class TestS3InMemoryFileSystem extends TestCase {
private static final String TEST_PATH = "s3://test/data.txt"; private static final String TEST_PATH = "s3://test/data.txt";