jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1585459 - in /jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext: S3Constants.java Utils.java
Date Mon, 07 Apr 2014 11:51:53 GMT
Author: chetanm
Date: Mon Apr  7 11:51:53 2014
New Revision: 1585459

URL: http://svn.apache.org/r1585459
Log:
JCR-3754 - [jackrabbit-aws-ext] Add retry logic to S3 asynchronous failed upload

Applying patch from Shashank.
-- Define property names as constant

Modified:
    jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
    jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java

Modified: jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java?rev=1585459&r1=1585458&r2=1585459&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
(original)
+++ jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
Mon Apr  7 11:51:53 2014
@@ -31,6 +31,26 @@ public final class S3Constants {
      * Amazon aws secret key.
      */
     public static final String SECRET_KEY = "secretKey";
+    
+    /**
+     * Amazon S3 Http connection timeout.
+     */
+    public static final String S3_CONN_TIMEOUT = "connectionTimeout";
+    
+    /**
+     * Amazon S3  socket timeout.
+     */
+    public static final String S3_SOCK_TIMEOUT = "socketTimeout";
+    
+    /**
+     * Amazon S3  maximum connections to be used.
+     */
+    public static final String S3_MAX_CONNS = "maxConnections";
+    
+    /**
+     * Amazon S3  maximum retries.
+     */
+    public static final String S3_MAX_ERR_RETRY = "maxErrorRetry";
 
     /**
      * Amazon aws S3 bucket.

Modified: jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java?rev=1585459&r1=1585458&r2=1585459&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
(original)
+++ jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
Mon Apr  7 11:51:53 2014
@@ -62,10 +62,10 @@ public final class Utils {
         AWSCredentials credentials = new BasicAWSCredentials(
             prop.getProperty(S3Constants.ACCESS_KEY),
             prop.getProperty(S3Constants.SECRET_KEY));
-        int connectionTimeOut = Integer.parseInt(prop.getProperty("connectionTimeout"));
-        int socketTimeOut = Integer.parseInt(prop.getProperty("socketTimeout"));
-        int maxConnections = Integer.parseInt(prop.getProperty("maxConnections"));
-        int maxErrorRetry = Integer.parseInt(prop.getProperty("maxErrorRetry"));
+        int connectionTimeOut = Integer.parseInt(prop.getProperty(S3Constants.S3_CONN_TIMEOUT));
+        int socketTimeOut = Integer.parseInt(prop.getProperty(S3Constants.S3_SOCK_TIMEOUT));
+        int maxConnections = Integer.parseInt(prop.getProperty(S3Constants.S3_MAX_CONNS));
+        int maxErrorRetry = Integer.parseInt(prop.getProperty(S3Constants.S3_MAX_ERR_RETRY));
         ClientConfiguration cc = new ClientConfiguration();
         cc.setConnectionTimeout(connectionTimeOut);
         cc.setSocketTimeout(socketTimeOut);



Mime
View raw message