flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject git commit: FLUME-1638. LoadBalancingRpcClient depends on com.google.common.collect.Maps.
Date Wed, 17 Oct 2012 21:35:07 GMT
Updated Branches:
  refs/heads/flume-1.4 9ad20d39e -> 218f2400c


FLUME-1638. LoadBalancingRpcClient depends on com.google.common.collect.Maps.

(Hari Shreedharan via Mike Percy)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/218f2400
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/218f2400
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/218f2400

Branch: refs/heads/flume-1.4
Commit: 218f2400c8a75ffaa98aee9289420034242b1aea
Parents: 9ad20d3
Author: Mike Percy <mpercy@apache.org>
Authored: Wed Oct 17 14:30:03 2012 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Wed Oct 17 14:34:54 2012 -0700

----------------------------------------------------------------------
 flume-ng-sdk/pom.xml                               |   13 --------
 .../java/org/apache/flume/util/OrderSelector.java  |   11 ++++---
 .../flume/api/TestLoadBalancingRpcClient.java      |   23 ++++++++-------
 3 files changed, 18 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/218f2400/flume-ng-sdk/pom.xml
----------------------------------------------------------------------
diff --git a/flume-ng-sdk/pom.xml b/flume-ng-sdk/pom.xml
index 64141e6..1deab7e 100644
--- a/flume-ng-sdk/pom.xml
+++ b/flume-ng-sdk/pom.xml
@@ -100,18 +100,5 @@ limitations under the License.
       <artifactId>avro-ipc</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>servlet-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/flume/blob/218f2400/flume-ng-sdk/src/main/java/org/apache/flume/util/OrderSelector.java
----------------------------------------------------------------------
diff --git a/flume-ng-sdk/src/main/java/org/apache/flume/util/OrderSelector.java b/flume-ng-sdk/src/main/java/org/apache/flume/util/OrderSelector.java
index d01916f..e869930 100644
--- a/flume-ng-sdk/src/main/java/org/apache/flume/util/OrderSelector.java
+++ b/flume-ng-sdk/src/main/java/org/apache/flume/util/OrderSelector.java
@@ -17,9 +17,9 @@
  */
 package org.apache.flume.util;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -41,7 +41,8 @@ public abstract class OrderSelector<T> {
   private static final int EXP_BACKOFF_COUNTER_LIMIT = 16;
   private static final long CONSIDER_SEQUENTIAL_RANGE = 2000l;
   private static final long MAX_TIMEOUT = 30000l;
-  private final Map<T, FailureState> stateMap = Maps.newLinkedHashMap();
+  private final Map<T, FailureState> stateMap =
+          new LinkedHashMap<T, FailureState>();
   private long maxTimeout = MAX_TIMEOUT;
   private final boolean shouldBackOff;
 
@@ -69,7 +70,7 @@ public abstract class OrderSelector<T> {
    * @return - list of objects to be ordered.
    */
   public List<T> getObjects() {
-    return Lists.newArrayList(stateMap.keySet());
+    return new ArrayList<T>(stateMap.keySet());
   }
 
   /**
@@ -120,7 +121,7 @@ public abstract class OrderSelector<T> {
   protected List<Integer> getIndexList() {
     long now = System.currentTimeMillis();
 
-    List<Integer> indexList = Lists.newArrayList();
+    List<Integer> indexList = new ArrayList<Integer>();
 
     int i = 0;
     for (T obj : stateMap.keySet()) {

http://git-wip-us.apache.org/repos/asf/flume/blob/218f2400/flume-ng-sdk/src/test/java/org/apache/flume/api/TestLoadBalancingRpcClient.java
----------------------------------------------------------------------
diff --git a/flume-ng-sdk/src/test/java/org/apache/flume/api/TestLoadBalancingRpcClient.java
b/flume-ng-sdk/src/test/java/org/apache/flume/api/TestLoadBalancingRpcClient.java
index deb4b1f..49a69bf 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/api/TestLoadBalancingRpcClient.java
+++ b/flume-ng-sdk/src/test/java/org/apache/flume/api/TestLoadBalancingRpcClient.java
@@ -18,8 +18,6 @@
  */
 package org.apache.flume.api;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -35,7 +33,6 @@ import org.apache.flume.FlumeException;
 import org.apache.flume.api.RpcTestUtils.LoadBalancedAvroHandler;
 import org.apache.flume.api.RpcTestUtils.OKAvroHandler;
 import org.apache.flume.event.EventBuilder;
-import org.apache.flume.source.avro.Status;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -389,8 +386,9 @@ public class TestLoadBalancingRpcClient {
   @Test
   public void testRandomBackoff() throws Exception {
     Properties p = new Properties();
-    List<LoadBalancedAvroHandler> hosts = Lists.newArrayList();
-    List<Server> servers = Lists.newArrayList();
+    List<LoadBalancedAvroHandler> hosts =
+            new ArrayList<LoadBalancedAvroHandler>();
+    List<Server> servers = new ArrayList<Server>();
     StringBuilder hostList = new StringBuilder("");
     for(int i = 0; i < 3;i++){
       LoadBalancedAvroHandler s = new LoadBalancedAvroHandler();
@@ -443,8 +441,9 @@ public class TestLoadBalancingRpcClient {
   @Test
   public void testRoundRobinBackoffInitialFailure() throws EventDeliveryException {
     Properties p = new Properties();
-    List<LoadBalancedAvroHandler> hosts = Lists.newArrayList();
-    List<Server> servers = Lists.newArrayList();
+    List<LoadBalancedAvroHandler> hosts =
+            new ArrayList<LoadBalancedAvroHandler>();
+    List<Server> servers = new ArrayList<Server>();
     StringBuilder hostList = new StringBuilder("");
     for (int i = 0; i < 3; i++) {
       LoadBalancedAvroHandler s = new LoadBalancedAvroHandler();
@@ -485,8 +484,9 @@ public class TestLoadBalancingRpcClient {
   @Test
   public void testRoundRobinBackoffIncreasingBackoffs() throws Exception {
     Properties p = new Properties();
-    List<LoadBalancedAvroHandler> hosts = Lists.newArrayList();
-    List<Server> servers = Lists.newArrayList();
+    List<LoadBalancedAvroHandler> hosts =
+            new ArrayList<LoadBalancedAvroHandler>();
+    List<Server> servers = new ArrayList<Server>();
     StringBuilder hostList = new StringBuilder("");
     for (int i = 0; i < 3; i++) {
       LoadBalancedAvroHandler s = new LoadBalancedAvroHandler();
@@ -541,8 +541,9 @@ public class TestLoadBalancingRpcClient {
   @Test
   public void testRoundRobinBackoffFailureRecovery() throws EventDeliveryException, InterruptedException
{
     Properties p = new Properties();
-    List<LoadBalancedAvroHandler> hosts = Lists.newArrayList();
-    List<Server> servers = Lists.newArrayList();
+    List<LoadBalancedAvroHandler> hosts =
+            new ArrayList<LoadBalancedAvroHandler>();
+    List<Server> servers = new ArrayList<Server>();
     StringBuilder hostList = new StringBuilder("");
     for (int i = 0; i < 3; i++) {
       LoadBalancedAvroHandler s = new LoadBalancedAvroHandler();


Mime
View raw message