flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arv...@apache.org
Subject svn commit: r1300411 - in /incubator/flume/trunk: ./ flume-ng-core/src/main/java/org/apache/flume/source/ flume-ng-core/src/test/java/org/apache/flume/source/ flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/ f...
Date Tue, 13 Mar 2012 23:38:08 GMT
Author: arvind
Date: Tue Mar 13 23:38:07 2012
New Revision: 1300411

URL: http://svn.apache.org/viewvc?rev=1300411&view=rev
Log:
FLUME-1028. Fix jenkins build after addition of submodule.

(Mike Percy via Arvind Prabhakar)

Modified:
    incubator/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
    incubator/flume/trunk/flume-ng-core/src/test/java/org/apache/flume/source/TestAvroSource.java
    incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java
    incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/test/java/org/apache/flume/source/avroLegacy/TestLegacyAvroSource.java
    incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java
    incubator/flume/trunk/pom.xml

Modified: incubator/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
(original)
+++ incubator/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java
Tue Mar 13 23:38:07 2012
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 
 import org.apache.avro.ipc.NettyServer;
 import org.apache.avro.ipc.Responder;
@@ -154,6 +153,19 @@ public class AvroSource extends Abstract
     return "AvroSource: { bindAddress:" + bindAddress + " port:" + port + " }";
   }
 
+  /**
+   * Helper function to convert a map of CharSequence to a map of String.
+   */
+  private static Map<String, String> toStringMap(
+      Map<CharSequence, CharSequence> charSeqMap) {
+    Map<String, String> stringMap =
+        new HashMap<String, String>();
+    for (Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
+      stringMap.put(entry.getKey().toString(), entry.getValue().toString());
+    }
+    return stringMap;
+  }
+
   @Override
   public Status append(AvroFlumeEvent avroEvent) {
     logger.debug("Received avro event:{}", avroEvent);
@@ -161,7 +173,7 @@ public class AvroSource extends Abstract
     counterGroup.incrementAndGet("rpc.received");
 
     Event event = EventBuilder.withBody(avroEvent.getBody().array(),
-        avroEvent.getHeaders());
+        toStringMap(avroEvent.getHeaders()));
 
     try {
       getChannelProcessor().processEvent(event);
@@ -182,7 +194,7 @@ public class AvroSource extends Abstract
 
     for (AvroFlumeEvent avroEvent : events) {
       Event event = EventBuilder.withBody(avroEvent.getBody().array(),
-          avroEvent.getHeaders());
+          toStringMap(avroEvent.getHeaders()));
       counterGroup.incrementAndGet("rpc.events");
 
       batch.add(event);

Modified: incubator/flume/trunk/flume-ng-core/src/test/java/org/apache/flume/source/TestAvroSource.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-core/src/test/java/org/apache/flume/source/TestAvroSource.java?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-core/src/test/java/org/apache/flume/source/TestAvroSource.java
(original)
+++ incubator/flume/trunk/flume-ng-core/src/test/java/org/apache/flume/source/TestAvroSource.java
Tue Mar 13 23:38:07 2012
@@ -145,7 +145,7 @@ public class TestAvroSource {
 
     AvroFlumeEvent avroEvent = new AvroFlumeEvent();
 
-    avroEvent.setHeaders(new HashMap<String, String>());
+    avroEvent.setHeaders(new HashMap<CharSequence, CharSequence>());
     avroEvent.setBody(ByteBuffer.wrap("Hello avro".getBytes()));
 
     Status status = client.append(avroEvent);

Modified: incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java
(original)
+++ incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java
Tue Mar 13 23:38:07 2012
@@ -131,7 +131,7 @@ public class AvroLegacySource extends Ab
     headers.put(TIMESTAMP, evt.getTimestamp().toString());
     headers.put(PRIORITY, evt.getPriority().toString());
     headers.put(NANOS, evt.getNanos().toString());
-    for (Entry<String, ByteBuffer> entry: evt.getFields().entrySet()) {
+    for (Entry<CharSequence, ByteBuffer> entry : evt.getFields().entrySet()) {
       headers.put(entry.getKey().toString(), entry.getValue().toString());
     }
     headers.put(OG_EVENT, "yes");

Modified: incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/test/java/org/apache/flume/source/avroLegacy/TestLegacyAvroSource.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/test/java/org/apache/flume/source/avroLegacy/TestLegacyAvroSource.java?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/test/java/org/apache/flume/source/avroLegacy/TestLegacyAvroSource.java
(original)
+++ incubator/flume/trunk/flume-ng-legacy-sources/flume-avro-source/src/test/java/org/apache/flume/source/avroLegacy/TestLegacyAvroSource.java
Tue Mar 13 23:38:07 2012
@@ -145,7 +145,7 @@ public class TestLegacyAvroSource {
 
     AvroFlumeOGEvent avroEvent =  AvroFlumeOGEvent.newBuilder().setHost("foo").
         setPriority(Priority.INFO).setNanos(0).setTimestamp(1).
-        setFields(new HashMap<String, ByteBuffer> ()).
+        setFields(new HashMap<CharSequence, ByteBuffer> ()).
         setBody(ByteBuffer.wrap("foo".getBytes())).build();
 
     client.append(avroEvent);

Modified: incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java
(original)
+++ incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/NettyAvroRpcClient.java
Tue Mar 13 23:38:07 2012
@@ -157,7 +157,7 @@ public class NettyAvroRpcClient implemen
     try {
       AvroFlumeEvent avroEvent = new AvroFlumeEvent();
       avroEvent.setBody(ByteBuffer.wrap(event.getBody()));
-      avroEvent.setHeaders(event.getHeaders());
+      avroEvent.setHeaders(toCharSeqMap(event.getHeaders()));
       avroClient.append(avroEvent, callFuture);
     } catch (IOException ex) {
       throw new EventDeliveryException("RPC request IO exception. " +
@@ -196,7 +196,7 @@ public class NettyAvroRpcClient implemen
         Event event = iter.next();
         AvroFlumeEvent avroEvent = new AvroFlumeEvent();
         avroEvent.setBody(ByteBuffer.wrap(event.getBody()));
-        avroEvent.setHeaders(event.getHeaders());
+        avroEvent.setHeaders(toCharSeqMap(event.getHeaders()));
         avroEvents.add(avroEvent);
       }
 
@@ -279,6 +279,19 @@ public class NettyAvroRpcClient implemen
     }
   }
 
+  /**
+   * Helper function to convert a map of String to a map of CharSequence.
+   */
+  private static Map<CharSequence, CharSequence> toCharSeqMap(
+      Map<String, String> stringMap) {
+    Map<CharSequence, CharSequence> charSeqMap =
+        new HashMap<CharSequence, CharSequence>();
+    for (Map.Entry<String, String> entry : stringMap.entrySet()) {
+      charSeqMap.put(entry.getKey(), entry.getValue());
+    }
+    return charSeqMap;
+  }
+
   @Override
   public boolean isActive() {
     stateLock.lock();

Modified: incubator/flume/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/pom.xml?rev=1300411&r1=1300410&r2=1300411&view=diff
==============================================================================
--- incubator/flume/trunk/pom.xml (original)
+++ incubator/flume/trunk/pom.xml Tue Mar 13 23:38:07 2012
@@ -437,10 +437,12 @@ limitations under the License.
         <plugin>
           <groupId>org.apache.avro</groupId>
           <artifactId>avro-maven-plugin</artifactId>
+          <!--
           <configuration>
             <stringType>String</stringType>
           </configuration>
-          <version>1.6.2</version>
+          -->
+          <version>1.6.1</version>
         </plugin>
 
         <plugin>
@@ -535,19 +537,19 @@ limitations under the License.
       <dependency>
         <groupId>org.apache.avro</groupId>
         <artifactId>avro</artifactId>
-        <version>1.6.2</version>
+        <version>1.6.1</version>
       </dependency>
 
       <dependency>
         <groupId>org.apache.avro</groupId>
         <artifactId>avro-compiler</artifactId>
-        <version>1.6.2</version>
+        <version>1.6.1</version>
       </dependency>
 
       <dependency>
         <groupId>org.apache.avro</groupId>
         <artifactId>avro-ipc</artifactId>
-        <version>1.6.2</version>
+        <version>1.6.1</version>
       </dependency>
 
       <dependency>



Mime
View raw message