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 @@
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
@Deprecated
public class Block {
private long id;

View File

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

View File

@ -35,6 +35,7 @@
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
@Deprecated
public class INode {
enum FileType {

View File

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

View File

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

View File

@ -33,6 +33,7 @@
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
@Deprecated
public class S3Credentials {
private String accessKey;

View File

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

View File

@ -38,6 +38,7 @@
import org.apache.hadoop.fs.ParentNotDirectoryException;
import org.apache.hadoop.fs.Path;
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.S3xLoginHelper;
import org.apache.hadoop.io.retry.RetryPolicies;
@ -50,11 +51,15 @@
* <a href="http://aws.amazon.com/s3">Amazon S3</a>.
*
* @see NativeS3FileSystem
* @deprecated Use {@link NativeS3FileSystem} and {@link S3AFileSystem} instead.
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
@Deprecated
public class S3FileSystem extends FileSystem {
private static boolean hasWarnedDeprecation = false;
private URI uri;
private FileSystemStore store;
@ -62,13 +67,26 @@ public class S3FileSystem extends FileSystem {
private Path workingDir;
public S3FileSystem() {
warnDeprecation();
// set store in initialize()
}
public S3FileSystem(FileSystemStore store) {
warnDeprecation();
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.
*

View File

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

View File

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

View File

@ -34,6 +34,7 @@
@InterfaceAudience.Private
@InterfaceStability.Unstable
@Deprecated
class S3InputStream extends FSInputStream {
private FileSystemStore store;

View File

@ -37,6 +37,7 @@
@InterfaceAudience.Private
@InterfaceStability.Unstable
@Deprecated
class S3OutputStream extends OutputStream {
private Configuration conf;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,6 +20,7 @@
import java.io.IOException;
@Deprecated
public class Jets3tS3FileSystemContractTest
extends S3FileSystemContractBaseTest {

View File

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

View File

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

View File

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

View File

@ -20,6 +20,7 @@
import java.io.IOException;
@Deprecated
public class TestInMemoryS3FileSystemContract
extends S3FileSystemContractBaseTest {

View File

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

View File

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

View File

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