jackye1995 commented on a change in pull request #3376:
URL: https://github.com/apache/iceberg/pull/3376#discussion_r743059370



##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {

Review comment:
       we have util classes like `DynConstructors` for this purpose you can 
use, which can simplify the code a lot, see 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/CatalogUtil.java#L166-L195
 as an example.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    String[] classAndMethod = factory.split("#", 2);
+    if (classAndMethod.length != 2) {
+      throw new IllegalArgumentException(String.format("invalid property 
%s=%s",
+          EcsClientProperties.ECS_CLIENT_FACTORY, factory));
+    }
+
+    Class<?> clazz;
+    try {
+      clazz = Class.forName(classAndMethod[0], true, 
Thread.currentThread().getContextClassLoader());
+    } catch (ClassNotFoundException e) {
+      throw new IllegalArgumentException(
+          String.format("invalid property %s=%s", 
EcsClientProperties.ECS_CLIENT_FACTORY, factory),
+          e);
+    }
+
+    S3Client client;
+    try {
+      client = (S3Client) MethodHandles.lookup()
+          .findStatic(clazz, classAndMethod[1], 
MethodType.methodType(S3Client.class, Map.class))
+          .invoke(properties);
+    } catch (Throwable e) {
+      throw new IllegalArgumentException(
+          String.format("invalid property %s=%s that throw exception", 
EcsClientProperties.ECS_CLIENT_FACTORY, factory),
+          e);
+    }
+
+    if (client == null) {
+      throw new IllegalArgumentException(String.format(
+          "invalid property %s=%s that return null client",
+          EcsClientProperties.ECS_CLIENT_FACTORY, factory));
+    }
+
+    return Optional.of(client);
+  }
+
+  /**
+   * Get built-in ECS S3 client.
+   */
+  static S3Client createDefault(Map<String, String> properties) {
+    S3Config config = new 
S3Config(URI.create(properties.get(EcsClientProperties.ENDPOINT)));
+
+    config.withIdentity(properties.get(EcsClientProperties.ACCESS_KEY_ID))

Review comment:
       I think you have to check these properties are non-null?

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);

Review comment:
       nit: LOG instead of log

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");
+  }
+
+  @VisibleForTesting
+  Map<String, String> getProperties() {

Review comment:
       nit: prefers methods to have no `get`

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsOutputFile.java
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.io.PositionOutputStream;
+
+public class EcsOutputFile implements OutputFile {
+
+  private final S3Client client;
+  private final String location;
+  private final EcsURI uri;
+
+  public EcsOutputFile(S3Client client, String location) {
+    this.client = client;
+    this.location = location;
+    this.uri = EcsURI.create(location);
+  }
+
+  /**
+   * Check object existence and then create a {@link PositionOutputStream}
+   *
+   * @return Output stream of object
+   */
+  @Override
+  public PositionOutputStream create() {
+    if (!toInputFile().exists()) {

Review comment:
       to follow the pattern with other input and output files, have a 
`BaseEcsFile` with method `exists()`, so `InputFile` gets the method by 
extending it, and you can directly check exists in output file without 
converting the file back to an input file.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");
+  }
+
+  @VisibleForTesting
+  Map<String, String> getProperties() {
+    return properties;
+  }
+
+  @VisibleForTesting
+  S3Client getClient() {

Review comment:
       nit: prefers methods to have no get

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void generalTest() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 1 byte
+      output.write('1');
+      // write 3 bytes
+      output.write("123".getBytes());
+      // write 7 bytes, totally 11 bytes > local buffer limit (10)
+      output.write("1234567".getBytes());
+      // write 11 bytes, flush remain 7 bytes and new 11 bytes
+      output.write("12345678901".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("object content", "1" + "123" + "1234567" + "12345678901",

Review comment:
       nit: prefers more concrete assert message, like "Must write all the 
object content"

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void generalTest() throws IOException {

Review comment:
       nit: prefers test method names to be `testXXX`, also prefers more 
specific test names like `testBaiscEcsAppendOutputStreamWrite`. This helps when 
other people to understand the content of failed tests. Could you change all 
the names in tests? Thanks!!

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");

Review comment:
       logging message too generic, does not seem necessary. Could you remove 
it or make it more informational?

##########
File path: 
dell/src/main/java/org/apache/iceberg/dell/EcsSeekableInputStream.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Client;
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+
+/**
+ * A {@link SeekableInputStream} impl that warp {@link 
S3Client#readObjectStream(String, String, Range)}

Review comment:
       nit: no abbreviation, `implementation` instead of `impl`.

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {

Review comment:
       nit: prefers tests classes named with `TestXXX` (I also need to change 
it for the AWS module...)

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsURI.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.net.URI;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+
+/**
+ * An immutable record class of ECS location
+ */
+public class EcsURI {

Review comment:
       does this need to be public? We made `S3URI` not public because we don't 
want people to take a dependency on it. An "official" URI parser class should 
be provided by the SDK itself, like in your case the EMC client SDK.

##########
File path: build.gradle
##########
@@ -566,6 +566,23 @@ project(':iceberg-nessie') {
   }
 }
 
+project(':iceberg-dell') {
+  dependencies {
+    implementation project(':iceberg-core')
+    implementation project(':iceberg-common')
+    implementation project(path: ':iceberg-bundled-guava', configuration: 
'shadow')
+    implementation 'com.emc.ecs:object-client-bundle'

Review comment:
       For Aliyun and AWS, we both followed the pattern that service 
dependencies are expressed as `compileOnly`: 
https://github.com/apache/iceberg/blob/master/build.gradle#L280.
   
   This allows us to bundle all the Iceberg dependencies to a runtime jar for 
Spark, Flink and Hive without any 3rd party dependencies, and if you need to 
run EMC ECS, then you add you service jar in addition to the Iceberg runtime 
jar in your own environment.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.iceberg.common.DynConstructors;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    DynConstructors.Ctor<EcsClientFactory> ctor;
+    try {
+      ctor = 
DynConstructors.builder(EcsClientFactory.class).impl(factory).buildChecked();
+    } catch (NoSuchMethodException e) {
+      throw new IllegalArgumentException(String.format(
+          "Cannot find EcsClientFactory implementation %s: %s", factory, 
e.getMessage()), e);
+    }
+
+    EcsClientFactory clientFactory;
+    try {
+      clientFactory = ctor.newInstance();
+    } catch (ClassCastException e) {
+      throw new IllegalArgumentException(
+          String.format("Cannot initialize Catalog, %s does not implement 
EcsClientFactory.", factory), e);

Review comment:
       nit: Cannot initialize EcsClientFactory

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.iceberg.common.DynConstructors;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    DynConstructors.Ctor<EcsClientFactory> ctor;
+    try {
+      ctor = 
DynConstructors.builder(EcsClientFactory.class).impl(factory).buildChecked();
+    } catch (NoSuchMethodException e) {
+      throw new IllegalArgumentException(String.format(
+          "Cannot find EcsClientFactory implementation %s: %s", factory, 
e.getMessage()), e);
+    }
+
+    EcsClientFactory clientFactory;
+    try {
+      clientFactory = ctor.newInstance();
+    } catch (ClassCastException e) {
+      throw new IllegalArgumentException(
+          String.format("Cannot initialize Catalog, %s does not implement 
EcsClientFactory.", factory), e);
+    }
+
+    S3Client client = clientFactory.createS3Client(properties);
+
+    if (client == null) {
+      throw new IllegalArgumentException(String.format(
+          "Invalid EcsClientFactory %s that return null client",
+          factory));
+    }
+
+    return Optional.of(client);
+  }
+
+  /**
+   * Get built-in ECS S3 client.
+   */
+  static S3Client createDefault(Map<String, String> properties) {
+    Preconditions.checkNotNull(properties.get(EcsClientProperties.ENDPOINT),
+        "Endpoint(%s) cannot be null", EcsClientProperties.ENDPOINT);

Review comment:
       nit: space before `(`: Endpoint (%s) cannot be null. Same for the 2 
messages below.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientProperties.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+/**
+ * Property constants of catalog
+ */
+public interface EcsClientProperties {

Review comment:
       Just wondering, if you want to make this class name more generic, like 
`EmcProperties` or `DellProperties`, in case you want to introduce other stuffs 
in the future.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {

Review comment:
       I think we follow the pattern of (1) directly serialize an object like 
`client` as a function, example: 
https://github.com/apache/iceberg/blob/master/aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java#L42-L45.
 (2) if absolutely necessary, directly overwrite serialization private methods 
instead of using `Externalize`, example: 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/hadoop/SerializableConfiguration.java#L39-L48.
 Is it possible for you to use the same pattern here?

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {

Review comment:
       Took a look at the javadoc for `Externalizable`, it seems to be a valid 
usage here, so I will leave it as is for now and let other reviewers decide.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsURI.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.net.URI;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+
+/**
+ * An immutable record class of ECS location
+ */
+class EcsURI {
+
+  private static final Set<String> VALID_SCHEME = ImmutableSet.of("ecs", "s3", 
"s3a", "s3n");
+
+  static EcsURI create(String location) {
+    URI uri = URI.create(location);
+    if (!VALID_SCHEME.contains(uri.getScheme().toLowerCase())) {

Review comment:
       can directly use ` ValidationException.check`

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsAppendOutputStream.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestEcsAppendOutputStream {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testBaseObjectWrite() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 1 byte
+      output.write('1');
+      // write 3 bytes
+      output.write("123".getBytes());
+      // write 7 bytes, totally 11 bytes > local buffer limit (10)
+      output.write("1234567".getBytes());
+      // write 11 bytes, flush remain 7 bytes and new 11 bytes
+      output.write("12345678901".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("Must write all the object content", "1" + "123" + 
"1234567" + "12345678901",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+  }
+
+  @Test
+  public void testRewrite() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 7 bytes
+      output.write("7654321".getBytes());
+    }
+
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 14 bytes
+      output.write("1234567".getBytes());
+      output.write("1234567".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("object content", "1234567" + "1234567",

Review comment:
       nit: use more concrete assert message

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
+public class TestEcsFile {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testFileReadAndWrite() throws IOException {
+    String objectName = "test";
+    String location = new EcsURI(rule.getBucket(), objectName).toString();
+    EcsInputFile inputFile = new EcsInputFile(rule.getClient(), location);
+    EcsOutputFile outpufFile = new EcsOutputFile(rule.getClient(), location);
+
+    // absent
+    assertFalse("File is absent", inputFile.exists());
+    assertEquals("File length is 0 if absent", 0, inputFile.getLength());
+
+    // write and read
+    try (PositionOutputStream output = outpufFile.create()) {
+      output.write("1234567890".getBytes());
+    }
+
+    assertTrue("File is present", inputFile.exists());
+    assertEquals("File length is 10", 10, inputFile.getLength());
+    try (SeekableInputStream input = inputFile.newStream()) {
+      assertEquals("File content is expected", "1234567890",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+
+    // rewrite file
+    try (PositionOutputStream output = outpufFile.createOrOverwrite()) {
+      output.write("987654321".getBytes());
+    }
+
+    assertEquals("New file length is 9", 9, inputFile.getLength());
+    try (SeekableInputStream input = inputFile.newStream()) {
+      assertEquals("New file content is overwrite old content", "987654321",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+
+    // write checker
+    assertThrows("If file exists, throw exception", 
AlreadyExistsException.class, outpufFile::create);

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java
 and also check for error message if possible.

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
`Assert.assertXXX`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
`Assert.assertXXX`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
+public class TestEcsFile {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testFileReadAndWrite() throws IOException {

Review comment:
       this test looks quite long and is testing multiple cases, could you 
break it down to separate tests? We would like to prevent one test case 
covering the other one.

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+public class TestEcsFileIO {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.manualCreateBucket();
+
+  @Test
+  public void externalizable() {

Review comment:
       nit: `testEcsFileIOSerializationRoundTrip`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+public class TestEcsFileIO {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.manualCreateBucket();
+
+  @Test
+  public void externalizable() {
+    try (EcsFileIO instance1 = new EcsFileIO()) {
+      Map<String, String> input = new 
LinkedHashMap<>(rule.getClientProperties());

Review comment:
       why LinkedHashMap? does order matters for the input keys? Can we use 
things like `ImmutableMap`?

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsSeekableInputStream.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.request.PutObjectRequest;
+import java.io.IOException;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+public class TestEcsSeekableInputStream {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testSeekPosRead() throws IOException {

Review comment:
       similar comment, could you break it down to separate tests?

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsSeekableInputStream.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.request.PutObjectRequest;
+import java.io.IOException;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertArrayEquals;

Review comment:
       
   
   prefer to not import static methods from Assert, and directly use 
Assert.assertXXX
   

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsURI.java
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import org.apache.iceberg.exceptions.ValidationException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
Assert.assertXXX
   

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsURI.java
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import org.apache.iceberg.exceptions.ValidationException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+
+public class TestEcsURI {
+
+  @Test
+  public void testCreate() {
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket"));
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket/"));
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket//"));
+    assertEquals(
+        new EcsURI("bucket", "a"),
+        EcsURI.create("ecs://bucket//a"));
+    assertEquals(
+        new EcsURI("bucket", "a/b"),
+        EcsURI.create("ecs://bucket/a/b"));
+    assertEquals(
+        new EcsURI("bucket", "a//b"),
+        EcsURI.create("ecs://bucket/a//b"));
+    assertEquals(
+        new EcsURI("bucket", "a//b"),
+        EcsURI.create("ecs://bucket//a//b"));
+  }
+
+  @Test
+  public void testInvalidLocation() {
+    assertThrows(

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java
 and also check for error message if possible.

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/mock/TestExceptionCode.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell.mock;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Exception;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Verify the error codes between real client and mock client.
+ */
+public class TestExceptionCode {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testExceptionCode() {
+    String object = "test";
+    assertS3Exception("Append absent object", 404, "NoSuchKey",
+        () -> rule.getClient().appendObject(rule.getBucket(), object, 
"abc".getBytes()));
+    assertS3Exception("Get object", 404, "NoSuchKey",
+        () -> rule.getClient().readObjectStream(rule.getBucket(), object, 
Range.fromOffset(0)));
+  }
+
+  public void assertS3Exception(String message, int httpCode, String 
errorCode, Runnable task) {

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/mock/TestExceptionCode.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell.mock;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Exception;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Verify the error codes between real client and mock client.
+ */
+public class TestExceptionCode {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testExceptionCode() {
+    String object = "test";
+    assertS3Exception("Append absent object", 404, "NoSuchKey",
+        () -> rule.getClient().appendObject(rule.getBucket(), object, 
"abc".getBytes()));
+    assertS3Exception("Get object", 404, "NoSuchKey",
+        () -> rule.getClient().readObjectStream(rule.getBucket(), object, 
Range.fromOffset(0)));
+  }
+
+  public void assertS3Exception(String message, int httpCode, String 
errorCode, Runnable task) {
+    try {
+      task.run();
+      fail(message + ", expect s3 exception");

Review comment:
       I think here you mean `"Expect s3 exception for " + message`?

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {

Review comment:
       we have util classes like `DynConstructors` for this purpose you can 
use, which can simplify the code a lot, see 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/CatalogUtil.java#L166-L195
 as an example.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    String[] classAndMethod = factory.split("#", 2);
+    if (classAndMethod.length != 2) {
+      throw new IllegalArgumentException(String.format("invalid property 
%s=%s",
+          EcsClientProperties.ECS_CLIENT_FACTORY, factory));
+    }
+
+    Class<?> clazz;
+    try {
+      clazz = Class.forName(classAndMethod[0], true, 
Thread.currentThread().getContextClassLoader());
+    } catch (ClassNotFoundException e) {
+      throw new IllegalArgumentException(
+          String.format("invalid property %s=%s", 
EcsClientProperties.ECS_CLIENT_FACTORY, factory),
+          e);
+    }
+
+    S3Client client;
+    try {
+      client = (S3Client) MethodHandles.lookup()
+          .findStatic(clazz, classAndMethod[1], 
MethodType.methodType(S3Client.class, Map.class))
+          .invoke(properties);
+    } catch (Throwable e) {
+      throw new IllegalArgumentException(
+          String.format("invalid property %s=%s that throw exception", 
EcsClientProperties.ECS_CLIENT_FACTORY, factory),
+          e);
+    }
+
+    if (client == null) {
+      throw new IllegalArgumentException(String.format(
+          "invalid property %s=%s that return null client",
+          EcsClientProperties.ECS_CLIENT_FACTORY, factory));
+    }
+
+    return Optional.of(client);
+  }
+
+  /**
+   * Get built-in ECS S3 client.
+   */
+  static S3Client createDefault(Map<String, String> properties) {
+    S3Config config = new 
S3Config(URI.create(properties.get(EcsClientProperties.ENDPOINT)));
+
+    config.withIdentity(properties.get(EcsClientProperties.ACCESS_KEY_ID))

Review comment:
       I think you have to check these properties are non-null?

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);

Review comment:
       nit: LOG instead of log

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");
+  }
+
+  @VisibleForTesting
+  Map<String, String> getProperties() {

Review comment:
       nit: prefers methods to have no `get`

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsOutputFile.java
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.io.PositionOutputStream;
+
+public class EcsOutputFile implements OutputFile {
+
+  private final S3Client client;
+  private final String location;
+  private final EcsURI uri;
+
+  public EcsOutputFile(S3Client client, String location) {
+    this.client = client;
+    this.location = location;
+    this.uri = EcsURI.create(location);
+  }
+
+  /**
+   * Check object existence and then create a {@link PositionOutputStream}
+   *
+   * @return Output stream of object
+   */
+  @Override
+  public PositionOutputStream create() {
+    if (!toInputFile().exists()) {

Review comment:
       to follow the pattern with other input and output files, have a 
`BaseEcsFile` with method `exists()`, so `InputFile` gets the method by 
extending it, and you can directly check exists in output file without 
converting the file back to an input file.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");
+  }
+
+  @VisibleForTesting
+  Map<String, String> getProperties() {
+    return properties;
+  }
+
+  @VisibleForTesting
+  S3Client getClient() {

Review comment:
       nit: prefers methods to have no get

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void generalTest() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 1 byte
+      output.write('1');
+      // write 3 bytes
+      output.write("123".getBytes());
+      // write 7 bytes, totally 11 bytes > local buffer limit (10)
+      output.write("1234567".getBytes());
+      // write 11 bytes, flush remain 7 bytes and new 11 bytes
+      output.write("12345678901".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("object content", "1" + "123" + "1234567" + "12345678901",

Review comment:
       nit: prefers more concrete assert message, like "Must write all the 
object content"

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void generalTest() throws IOException {

Review comment:
       nit: prefers test method names to be `testXXX`, also prefers more 
specific test names like `testBaiscEcsAppendOutputStreamWrite`. This helps when 
other people to understand the content of failed tests. Could you change all 
the names in tests? Thanks!!

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {
+
+  private static final Logger log = LoggerFactory.getLogger(EcsFileIO.class);
+
+  /**
+   * Saved properties for {@link java.io.Serializable}
+   */
+  private Map<String, String> properties;
+  private S3Client client;
+
+  /**
+   * Blank constructor
+   */
+  public EcsFileIO() {
+  }
+
+  @Override
+  public void initialize(Map<String, String> inputProperties) {
+    this.properties = ImmutableMap.copyOf(inputProperties);
+    this.client = EcsClientFactory.create(inputProperties);
+  }
+
+  @Override
+  public InputFile newInputFile(String path) {
+    return new EcsInputFile(client, path);
+  }
+
+  @Override
+  public OutputFile newOutputFile(String path) {
+    return new EcsOutputFile(client, path);
+  }
+
+  @Override
+  public void deleteFile(String path) {
+    EcsURI uri = EcsURI.create(path);
+    client.deleteObject(uri.getBucket(), uri.getName());
+  }
+
+  @Override
+  public void writeExternal(ObjectOutput out) throws IOException {
+    out.writeObject(properties);
+  }
+
+  @Override
+  public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+    @SuppressWarnings("unchecked")
+    Map<String, String> inputProperties = (Map<String, String>) 
in.readObject();
+    initialize(inputProperties);
+  }
+
+  @Override
+  public void close() {
+    client.destroy();
+    log.info("FileIO closed");

Review comment:
       logging message too generic, does not seem necessary. Could you remove 
it or make it more informational?

##########
File path: 
dell/src/main/java/org/apache/iceberg/dell/EcsSeekableInputStream.java
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Client;
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+
+/**
+ * A {@link SeekableInputStream} impl that warp {@link 
S3Client#readObjectStream(String, String, Range)}

Review comment:
       nit: no abbreviation, `implementation` instead of `impl`.

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/EcsAppendOutputStreamTest.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class EcsAppendOutputStreamTest {

Review comment:
       nit: prefers tests classes named with `TestXXX` (I also need to change 
it for the AWS module...)

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsURI.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.net.URI;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+
+/**
+ * An immutable record class of ECS location
+ */
+public class EcsURI {

Review comment:
       does this need to be public? We made `S3URI` not public because we don't 
want people to take a dependency on it. An "official" URI parser class should 
be provided by the SDK itself, like in your case the EMC client SDK.

##########
File path: build.gradle
##########
@@ -566,6 +566,23 @@ project(':iceberg-nessie') {
   }
 }
 
+project(':iceberg-dell') {
+  dependencies {
+    implementation project(':iceberg-core')
+    implementation project(':iceberg-common')
+    implementation project(path: ':iceberg-bundled-guava', configuration: 
'shadow')
+    implementation 'com.emc.ecs:object-client-bundle'

Review comment:
       For Aliyun and AWS, we both followed the pattern that service 
dependencies are expressed as `compileOnly`: 
https://github.com/apache/iceberg/blob/master/build.gradle#L280.
   
   This allows us to bundle all the Iceberg dependencies to a runtime jar for 
Spark, Flink and Hive without any 3rd party dependencies, and if you need to 
run EMC ECS, then you add you service jar in addition to the Iceberg runtime 
jar in your own environment.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.iceberg.common.DynConstructors;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    DynConstructors.Ctor<EcsClientFactory> ctor;
+    try {
+      ctor = 
DynConstructors.builder(EcsClientFactory.class).impl(factory).buildChecked();
+    } catch (NoSuchMethodException e) {
+      throw new IllegalArgumentException(String.format(
+          "Cannot find EcsClientFactory implementation %s: %s", factory, 
e.getMessage()), e);
+    }
+
+    EcsClientFactory clientFactory;
+    try {
+      clientFactory = ctor.newInstance();
+    } catch (ClassCastException e) {
+      throw new IllegalArgumentException(
+          String.format("Cannot initialize Catalog, %s does not implement 
EcsClientFactory.", factory), e);

Review comment:
       nit: Cannot initialize EcsClientFactory

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientFactory.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import com.emc.object.s3.S3Config;
+import com.emc.object.s3.jersey.S3JerseyClient;
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.iceberg.common.DynConstructors;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+
+public interface EcsClientFactory {
+
+  /**
+   * Create the ECS S3 Client from properties
+   */
+  static S3Client create(Map<String, String> properties) {
+    return createWithFactory(properties).orElseGet(() -> 
createDefault(properties));
+  }
+
+  /**
+   * Try to create the ECS S3 client from factory method.
+   */
+  static Optional<S3Client> createWithFactory(Map<String, String> properties) {
+    String factory = properties.get(EcsClientProperties.ECS_CLIENT_FACTORY);
+    if (factory == null || factory.isEmpty()) {
+      return Optional.empty();
+    }
+
+    DynConstructors.Ctor<EcsClientFactory> ctor;
+    try {
+      ctor = 
DynConstructors.builder(EcsClientFactory.class).impl(factory).buildChecked();
+    } catch (NoSuchMethodException e) {
+      throw new IllegalArgumentException(String.format(
+          "Cannot find EcsClientFactory implementation %s: %s", factory, 
e.getMessage()), e);
+    }
+
+    EcsClientFactory clientFactory;
+    try {
+      clientFactory = ctor.newInstance();
+    } catch (ClassCastException e) {
+      throw new IllegalArgumentException(
+          String.format("Cannot initialize Catalog, %s does not implement 
EcsClientFactory.", factory), e);
+    }
+
+    S3Client client = clientFactory.createS3Client(properties);
+
+    if (client == null) {
+      throw new IllegalArgumentException(String.format(
+          "Invalid EcsClientFactory %s that return null client",
+          factory));
+    }
+
+    return Optional.of(client);
+  }
+
+  /**
+   * Get built-in ECS S3 client.
+   */
+  static S3Client createDefault(Map<String, String> properties) {
+    Preconditions.checkNotNull(properties.get(EcsClientProperties.ENDPOINT),
+        "Endpoint(%s) cannot be null", EcsClientProperties.ENDPOINT);

Review comment:
       nit: space before `(`: Endpoint (%s) cannot be null. Same for the 2 
messages below.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsClientProperties.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+/**
+ * Property constants of catalog
+ */
+public interface EcsClientProperties {

Review comment:
       Just wondering, if you want to make this class name more generic, like 
`EmcProperties` or `DellProperties`, in case you want to introduce other stuffs 
in the future.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {

Review comment:
       I think we follow the pattern of (1) directly serialize an object like 
`client` as a function, example: 
https://github.com/apache/iceberg/blob/master/aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java#L42-L45.
 (2) if absolutely necessary, directly overwrite serialization private methods 
instead of using `Externalize`, example: 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/hadoop/SerializableConfiguration.java#L39-L48.
 Is it possible for you to use the same pattern here?

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsFileIO.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.S3Client;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import 
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link java.io.Externalizable} FileIO of ECS S3 object client.
+ */
+public class EcsFileIO implements FileIO, Externalizable, AutoCloseable {

Review comment:
       Took a look at the javadoc for `Externalizable`, it seems to be a valid 
usage here, so I will leave it as is for now and let other reviewers decide.

##########
File path: dell/src/main/java/org/apache/iceberg/dell/EcsURI.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.net.URI;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
+
+/**
+ * An immutable record class of ECS location
+ */
+class EcsURI {
+
+  private static final Set<String> VALID_SCHEME = ImmutableSet.of("ecs", "s3", 
"s3a", "s3n");
+
+  static EcsURI create(String location) {
+    URI uri = URI.create(location);
+    if (!VALID_SCHEME.contains(uri.getScheme().toLowerCase())) {

Review comment:
       can directly use ` ValidationException.check`

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsAppendOutputStream.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.Range;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestEcsAppendOutputStream {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testBaseObjectWrite() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 1 byte
+      output.write('1');
+      // write 3 bytes
+      output.write("123".getBytes());
+      // write 7 bytes, totally 11 bytes > local buffer limit (10)
+      output.write("1234567".getBytes());
+      // write 11 bytes, flush remain 7 bytes and new 11 bytes
+      output.write("12345678901".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("Must write all the object content", "1" + "123" + 
"1234567" + "12345678901",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+  }
+
+  @Test
+  public void testRewrite() throws IOException {
+    String objectName = "test";
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 7 bytes
+      output.write("7654321".getBytes());
+    }
+
+    try (EcsAppendOutputStream output = 
EcsAppendOutputStream.createWithBufferSize(
+        rule.getClient(),
+        new EcsURI(rule.getBucket(), objectName),
+        10)) {
+      // write 14 bytes
+      output.write("1234567".getBytes());
+      output.write("1234567".getBytes());
+    }
+
+    try (InputStream input = 
rule.getClient().readObjectStream(rule.getBucket(), objectName,
+        Range.fromOffset(0))) {
+      assertEquals("object content", "1234567" + "1234567",

Review comment:
       nit: use more concrete assert message

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
+public class TestEcsFile {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testFileReadAndWrite() throws IOException {
+    String objectName = "test";
+    String location = new EcsURI(rule.getBucket(), objectName).toString();
+    EcsInputFile inputFile = new EcsInputFile(rule.getClient(), location);
+    EcsOutputFile outpufFile = new EcsOutputFile(rule.getClient(), location);
+
+    // absent
+    assertFalse("File is absent", inputFile.exists());
+    assertEquals("File length is 0 if absent", 0, inputFile.getLength());
+
+    // write and read
+    try (PositionOutputStream output = outpufFile.create()) {
+      output.write("1234567890".getBytes());
+    }
+
+    assertTrue("File is present", inputFile.exists());
+    assertEquals("File length is 10", 10, inputFile.getLength());
+    try (SeekableInputStream input = inputFile.newStream()) {
+      assertEquals("File content is expected", "1234567890",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+
+    // rewrite file
+    try (PositionOutputStream output = outpufFile.createOrOverwrite()) {
+      output.write("987654321".getBytes());
+    }
+
+    assertEquals("New file length is 9", 9, inputFile.getLength());
+    try (SeekableInputStream input = inputFile.newStream()) {
+      assertEquals("New file content is overwrite old content", "987654321",
+          new String(ByteStreams.toByteArray(input), StandardCharsets.UTF_8));
+    }
+
+    // write checker
+    assertThrows("If file exists, throw exception", 
AlreadyExistsException.class, outpufFile::create);

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java
 and also check for error message if possible.

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
`Assert.assertXXX`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
`Assert.assertXXX`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFile.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+
+public class TestEcsFile {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testFileReadAndWrite() throws IOException {

Review comment:
       this test looks quite long and is testing multiple cases, could you 
break it down to separate tests? We would like to prevent one test case 
covering the other one.

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+public class TestEcsFileIO {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.manualCreateBucket();
+
+  @Test
+  public void externalizable() {

Review comment:
       nit: `testEcsFileIOSerializationRoundTrip`

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsFileIO.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.apache.iceberg.util.SerializationUtil;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+public class TestEcsFileIO {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.manualCreateBucket();
+
+  @Test
+  public void externalizable() {
+    try (EcsFileIO instance1 = new EcsFileIO()) {
+      Map<String, String> input = new 
LinkedHashMap<>(rule.getClientProperties());

Review comment:
       why LinkedHashMap? does order matters for the input keys? Can we use 
things like `ImmutableMap`?

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsSeekableInputStream.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.request.PutObjectRequest;
+import java.io.IOException;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+public class TestEcsSeekableInputStream {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testSeekPosRead() throws IOException {

Review comment:
       similar comment, could you break it down to separate tests?

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/TestEcsSeekableInputStream.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import com.emc.object.s3.request.PutObjectRequest;
+import java.io.IOException;
+import org.apache.iceberg.dell.mock.EcsS3MockRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertArrayEquals;

Review comment:
       
   
   prefer to not import static methods from Assert, and directly use 
Assert.assertXXX
   

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsURI.java
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import org.apache.iceberg.exceptions.ValidationException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;

Review comment:
       prefer to not import static methods from Assert, and directly use 
Assert.assertXXX
   

##########
File path: dell/src/test/java/org/apache/iceberg/dell/TestEcsURI.java
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell;
+
+import org.apache.iceberg.exceptions.ValidationException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+
+public class TestEcsURI {
+
+  @Test
+  public void testCreate() {
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket"));
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket/"));
+    assertEquals(
+        new EcsURI("bucket", ""),
+        EcsURI.create("ecs://bucket//"));
+    assertEquals(
+        new EcsURI("bucket", "a"),
+        EcsURI.create("ecs://bucket//a"));
+    assertEquals(
+        new EcsURI("bucket", "a/b"),
+        EcsURI.create("ecs://bucket/a/b"));
+    assertEquals(
+        new EcsURI("bucket", "a//b"),
+        EcsURI.create("ecs://bucket/a//b"));
+    assertEquals(
+        new EcsURI("bucket", "a//b"),
+        EcsURI.create("ecs://bucket//a//b"));
+  }
+
+  @Test
+  public void testInvalidLocation() {
+    assertThrows(

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java
 and also check for error message if possible.

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/mock/TestExceptionCode.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell.mock;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Exception;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Verify the error codes between real client and mock client.
+ */
+public class TestExceptionCode {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testExceptionCode() {
+    String object = "test";
+    assertS3Exception("Append absent object", 404, "NoSuchKey",
+        () -> rule.getClient().appendObject(rule.getBucket(), object, 
"abc".getBytes()));
+    assertS3Exception("Get object", 404, "NoSuchKey",
+        () -> rule.getClient().readObjectStream(rule.getBucket(), object, 
Range.fromOffset(0)));
+  }
+
+  public void assertS3Exception(String message, int httpCode, String 
errorCode, Runnable task) {

Review comment:
       prefer to use 
https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/AssertHelpers.java

##########
File path: 
dell/src/test/java/org/apache/iceberg/dell/mock/TestExceptionCode.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.dell.mock;
+
+import com.emc.object.Range;
+import com.emc.object.s3.S3Exception;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Verify the error codes between real client and mock client.
+ */
+public class TestExceptionCode {
+
+  @Rule
+  public EcsS3MockRule rule = EcsS3MockRule.create();
+
+  @Test
+  public void testExceptionCode() {
+    String object = "test";
+    assertS3Exception("Append absent object", 404, "NoSuchKey",
+        () -> rule.getClient().appendObject(rule.getBucket(), object, 
"abc".getBytes()));
+    assertS3Exception("Get object", 404, "NoSuchKey",
+        () -> rule.getClient().readObjectStream(rule.getBucket(), object, 
Range.fromOffset(0)));
+  }
+
+  public void assertS3Exception(String message, int httpCode, String 
errorCode, Runnable task) {
+    try {
+      task.run();
+      fail(message + ", expect s3 exception");

Review comment:
       I think here you mean `"Expect s3 exception for " + message`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to