chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r778484 - in /hadoop/chukwa/trunk: CHANGES.txt src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
Date Mon, 25 May 2009 19:50:10 GMT
Author: asrabkin
Date: Mon May 25 19:50:10 2009
New Revision: 778484

URL: http://svn.apache.org/viewvc?rev=778484&view=rev
Log:
CHUKWA-142. Remove add(Chunk) from SeqFileWriter. (contributed by Jerome Boulon)

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=778484&r1=778483&r2=778484&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Mon May 25 19:50:10 2009
@@ -10,6 +10,8 @@
 
   IMPROVEMENTS
 
+    CHUKWA-142. Remove add(Chunk) from SeqFileWriter.  (Jerome Boulon via asrabkin)
+
     CHUKWA-82.  Added min,max,average to HICC Charting widget. (Terence Kwan via Eric Yang)
 
     CHUKWA-219. Improved usability of host selector, and updated caching for host list. (Eric
Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java?rev=778484&r1=778483&r2=778484&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/writer/SeqFileWriter.java
Mon May 25 19:50:10 2009
@@ -238,7 +238,6 @@
     log.debug("finished rotate()");
   }
 
-  // TODO merge the 2 add functions
   @Override
   public void add(List<Chunk> chunks) throws WriterException {
     if (chunks != null) {
@@ -302,64 +301,6 @@
 
   }
 
-  public void add(Chunk chunk) throws WriterException {
-
-    if (chunk != null) {
-      try {
-        ChukwaArchiveKey archiveKey = new ChukwaArchiveKey();
-
-        // FIXME compute this once an hour
-        synchronized (calendar) {
-          calendar.setTimeInMillis(System.currentTimeMillis());
-          calendar.set(Calendar.MINUTE, 0);
-          calendar.set(Calendar.SECOND, 0);
-          calendar.set(Calendar.MILLISECOND, 0);
-
-          archiveKey.setTimePartition(calendar.getTimeInMillis());
-        }
-
-        archiveKey.setDataType(chunk.getDataType());
-        archiveKey.setStreamName(chunk.getTags() + "/" + chunk.getSource()
-            + "/" + chunk.getStreamName());
-        archiveKey.setSeqId(chunk.getSeqID());
-
-        ClientAck localClientAck = null;
-        synchronized (lock) {
-          localClientAck = SeqFileWriter.clientAck;
-          log.info("[" + Thread.currentThread().getName()
-              + "] Client >>>>>>>>>>>> Current Ack object
===>>>>"
-              + localClientAck.toString());
-          seqFileWriter.append(archiveKey, chunk);
-
-          // compute size for stats
-          dataSize += chunk.getData().length;
-        }
-        localClientAck.wait4Ack();
-
-        if (localClientAck.getStatus() != ClientAck.OK) {
-          log
-              .warn("Exception after notyfyAll on the lock - Thread:"
-                  + Thread.currentThread().getName(), localClientAck
-                  .getException());
-          throw new WriterException(localClientAck.getException());
-        } else {
-          // sucess
-          writeChunkRetries = initWriteChunkRetries;
-        }
-      } catch (IOException e) {
-        writeChunkRetries--;
-        log.error("Could not save the chunk. ", e);
-
-        if (writeChunkRetries < 0) {
-          log
-              .fatal("Too many IOException when trying to write a chunk, Collector is going
to exit!");
-          DaemonWatcher.bailout(-1);
-        }
-        throw new WriterException(e);
-      }
-    }
-  }
-
   public void close() {
     synchronized (lock) {
       if (timer != null)



Mime
View raw message