瀏覽代碼

HADOOP-882. Upgrade to jets3t vesion 0.5, used by the S3 FileSystem. Contributed by Michael Stack.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@505488 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 年之前
父節點
當前提交
177cbed9f3
共有 5 個文件被更改,包括 21 次插入2 次删除
  1. 3 0
      CHANGES.txt
  2. 16 0
      conf/hadoop-default.xml
  3. 二進制
      lib/jets3t-0.5.0.jar
  4. 二進制
      lib/jets3t.jar
  5. 2 2
      src/java/org/apache/hadoop/fs/s3/Jets3tFileSystemStore.java

+ 3 - 0
CHANGES.txt

@@ -23,6 +23,9 @@ Trunk (unreleased changes)
     The set is no longer reset with each block, but rather is now
     The set is no longer reset with each block, but rather is now
     maintained for the life of an open file.  (Raghu Angadi via cutting)
     maintained for the life of an open file.  (Raghu Angadi via cutting)
 
 
+ 7. HADOOP-882.  Upgrade to jets3t version 0.5, used by the S3
+    FileSystem.  This version supports retries.  (Michael Stack via cutting)
+
 
 
 Branch 0.11 - unreleased
 Branch 0.11 - unreleased
 
 

+ 16 - 0
conf/hadoop-default.xml

@@ -355,6 +355,22 @@ creations/deletions), or "all".</description>
   </description>
   </description>
 </property>
 </property>
 
 
+<property>
+  <name>fs.s3.block.size</name>
+  <value>1048576</value>
+  <description>
+        Block size to use writing S3.  Note, the default block size for jets3t,
+        the library at the base of the S3 filesystem, is less.  Its 131072.
+        If S3 is having a bad day requiring retries, if the retry is at some
+        point after the end of jets3t RepeatableInputStream buffer and end of
+        the S3 block, the transfer will fail. To change the jets3t block size,
+        add a jets3t.properties file to $HADOOP_HOME/conf so it can be found
+        on the CLASSPATH and amend the 's3service.stream-retry-buffer-size'
+        property. See http://jets3t.s3.amazonaws.com/toolkit/configuration.html
+        for more on jets3t configurables.
+  </description>
+</property>
+
 <!-- map/reduce properties -->
 <!-- map/reduce properties -->
 
 
 <property>
 <property>

二進制
lib/jets3t-0.5.0.jar


二進制
lib/jets3t.jar


+ 2 - 2
src/java/org/apache/hadoop/fs/s3/Jets3tFileSystemStore.java

@@ -133,7 +133,7 @@ class Jets3tFileSystemStore implements FileSystemStore {
       S3Object object = s3Service.getObject(bucket, key);
       S3Object object = s3Service.getObject(bucket, key);
       return object.getDataInputStream();
       return object.getDataInputStream();
     } catch (S3ServiceException e) {
     } catch (S3ServiceException e) {
-      if (e.getErrorCode().equals("NoSuchKey")) {
+      if (e.getS3ErrorCode().equals("NoSuchKey")) {
         return null;
         return null;
       }
       }
       if (e.getCause() instanceof IOException) {
       if (e.getCause() instanceof IOException) {
@@ -149,7 +149,7 @@ class Jets3tFileSystemStore implements FileSystemStore {
           null, byteRangeStart, null);
           null, byteRangeStart, null);
       return object.getDataInputStream();
       return object.getDataInputStream();
     } catch (S3ServiceException e) {
     } catch (S3ServiceException e) {
-      if (e.getErrorCode().equals("NoSuchKey")) {
+      if (e.getS3ErrorCode().equals("NoSuchKey")) {
         return null;
         return null;
       }
       }
       if (e.getCause() instanceof IOException) {
       if (e.getCause() instanceof IOException) {