소스 검색

Integration of TOS: Add TosKeys and constants.

lijinglun 9 달 전
부모
커밋
941ebcb880

+ 12 - 0
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/conf/TosKeys.java

@@ -21,6 +21,9 @@ package org.apache.hadoop.fs.tosfs.conf;
 import org.apache.hadoop.fs.tosfs.object.ChecksumType;
 import org.apache.hadoop.fs.tosfs.object.tos.TOSErrorCodes;
 
+import java.util.Collections;
+import java.util.List;
+
 public class TosKeys {
 
   /**
@@ -65,6 +68,15 @@ public class TosKeys {
   public static final ArgumentKey FS_TOS_BUCKET_SESSION_TOKEN =
       new ArgumentKey("fs.tos.bucket.%s.session-token");
 
+  // Credential
+  /**
+   * Default credentials provider chain that looks for credentials in this order:
+   * SimpleCredentialsProvider,EnvironmentCredentialsProvider,IAMInstanceCredentialsProvider.
+   */
+  public static final String FS_TOS_CREDENTIALS_PROVIDER = "fs.tos.credentials.provider";
+  public static final String FS_TOS_CREDENTIALS_PROVIDER_DEFAULT =
+      "org.apache.hadoop.fs.tosfs.object.tos.auth.DefaultCredentialsProviderChain";
+
   /**
    * User customized credential provider classes, separate provider class name with comma if there
    * are multiple providers.

+ 2 - 0
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/Constants.java

@@ -22,6 +22,8 @@ public class Constants {
   private Constants() {
   }
 
+  public static final String PROTON = "Proton";
+
   // Magic checksum means doesn't support checksum, if the file type is dir or the filesystem/object
   // storage doesn't implement checksum algorithm will use magic checksum as the file checksum.
   public static final byte[] MAGIC_CHECKSUM = new byte[] { 'M' };

+ 28 - 0
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/ObjectConstants.java

@@ -0,0 +1,28 @@
+/*
+ * 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.hadoop.fs.tosfs.object;
+
+public class ObjectConstants {
+  public static final int MIN_PART_SIZE = 5 * 1024 * 1024;
+  public static final int MAX_PART_COUNT = 10000;
+
+  private ObjectConstants() {
+  }
+}
+