chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r892567 - in /hadoop/chukwa/trunk: ./ src/java/org/apache/hadoop/chukwa/datacollection/writer/
Date Sun, 20 Dec 2009 06:08:36 GMT
Author: asrabkin
Date: Sun Dec 20 06:08:35 2009
New Revision: 892567

URL: http://svn.apache.org/viewvc?rev=892567&view=rev
Log:
CHUKWA-432. PipelineableWriter becomes an abstract class.

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/Dedup.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/PipelineableWriter.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=892567&r1=892566&r2=892567&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Sun Dec 20 06:08:35 2009
@@ -18,6 +18,8 @@
  
    IMPROVEMENTS
 
+    CHUKWA-432. PipelineableWriter becomes an abstract class. (asrabkin)
+
     CHUKWA-429. Update HDFS heatmap color with rainbow colors. (Eric Yang)
 
     CHUKWA-418. Standardize logging. Mark adaptor IDs. (asrabkin)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/Dedup.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/Dedup.java?rev=892567&r1=892566&r2=892567&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/Dedup.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/Dedup.java
Sun Dec 20 06:08:35 2009
@@ -25,8 +25,12 @@
 import java.util.Queue;
 import org.apache.hadoop.chukwa.Chunk;
 import org.apache.hadoop.conf.Configuration;
-
-public class Dedup implements PipelineableWriter {
+/**
+ * Uses a fixed size cache to check for and filter out duplicate chunks.
+ * Duplicate detection uses chunk metadata, not content.
+ *
+ */
+public class Dedup extends PipelineableWriter {
 
   static final class DedupKey {
     String name;
@@ -92,12 +96,7 @@
   }
 
   FixedSizeCache<DedupKey> cache;
-  ChukwaWriter next;
 
-  @Override
-  public void setNextStage(ChukwaWriter next) {
-    this.next = next;
-  }
 
   @Override
   public CommitStatus add(List<Chunk> chunks) throws WriterException {

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/PipelineableWriter.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/PipelineableWriter.java?rev=892567&r1=892566&r2=892567&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/PipelineableWriter.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/PipelineableWriter.java
Sun Dec 20 06:08:35 2009
@@ -18,7 +18,22 @@
 
 package org.apache.hadoop.chukwa.datacollection.writer;
 
+import java.util.List;
+import org.apache.hadoop.chukwa.Chunk;
 
-public interface PipelineableWriter extends ChukwaWriter {
-  public void setNextStage(ChukwaWriter next);
+
+public abstract class PipelineableWriter implements ChukwaWriter {
+  ChukwaWriter next;
+  public void setNextStage(ChukwaWriter next) {
+    this.next = next;
+  }
+  
+  public CommitStatus add(List<Chunk> chunks) throws WriterException {
+    if (next != null)
+      return next.add(chunks); //pass data through
+    else
+      return ChukwaWriter.COMMIT_OK;
+  }
+  
+  
 }

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java?rev=892567&r1=892566&r2=892567&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java
Sun Dec 20 06:08:35 2009
@@ -57,7 +57,7 @@
  *  Option chukwaCollector.tee.keepalive controls using TCP keepalive. Defaults to true.
  *  
  */
-public class SocketTeeWriter implements PipelineableWriter {
+public class SocketTeeWriter extends PipelineableWriter {
 
   public static final String WRITABLE = "WRITABLE";
   public static final String RAW = "RAW";
@@ -248,7 +248,7 @@
   public CommitStatus add(List<Chunk> chunks) throws WriterException {
     CommitStatus rv = ChukwaWriter.COMMIT_OK;
     if (next != null)
-	rv = next.add(chunks); //pass data through
+       rv = next.add(chunks); //pass data through
     synchronized(tees) {
       Iterator<Tee> loop = tees.iterator();
       while(loop.hasNext()) {



Mime
View raw message