[prev in list] [next in list] [prev in thread] [next in thread] 

List:       flume-commits
Subject:    svn commit: r1343918 - /incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apach
From:       hshreedharan () apache ! org
Date:       2012-05-29 18:57:01
Message-ID: 20120529185701.AD0732388847 () eris ! apache ! org
[Download RAW message or body]

Author: hshreedharan
Date: Tue May 29 18:57:01 2012
New Revision: 1343918

URL: http://svn.apache.org/viewvc?rev=1343918&view=rev
Log:
FLUME-1229: Replace nanoTime with currentTimeMillis as BucketWriter base suffix

Modified:
    incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java


Modified: incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
                
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink \
/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java?rev=1343918&r1=1343917&r2=1343918&view=diff
 ==============================================================================
--- incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java \
                (original)
+++ incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java \
Tue May 29 18:57:01 2012 @@ -1,3 +1,4 @@
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -48,7 +49,6 @@ class BucketWriter {
    * tossed away and we will create a new instance. Gurantee unique files
    * in this case.
    */
-  private static final AtomicLong fileExentionCounter = new \
AtomicLong(System.nanoTime());  private HDFSWriter writer;
   private FlumeFormatter formatter;
   private long eventCounter;
@@ -62,11 +62,14 @@ class BucketWriter {
   private CompressionType compType;
   private FileSystem fileSystem;
   private Context context;
+
   private volatile String filePath;
   private volatile String bucketPath;
   private volatile long batchCounter;
   private volatile boolean isOpen;
 
+  private final AtomicLong fileExtensionCounter;
+
   // clear the class counters
   private void resetCounters() {
     eventCounter = 0;
@@ -90,6 +93,7 @@ class BucketWriter {
     formatter = fmt;
     isOpen = false;
 
+    fileExtensionCounter = new AtomicLong(System.currentTimeMillis());
     writer.configure(context);
   }
 
@@ -103,7 +107,7 @@ class BucketWriter {
       throw new IOException("Invalid file settings");
     }
 
-    long counter = fileExentionCounter.incrementAndGet();
+    long counter = fileExtensionCounter.incrementAndGet();
 
     Configuration config = new Configuration();
     // disable FileSystem JVM shutdown hook


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic