You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by cw...@apache.org on 2019/08/14 00:10:46 UTC

[incubator-druid] branch master updated: Bump commons-io from 2.5 to 2.6 (#8006)

This is an automated email from the ASF dual-hosted git repository.

cwylie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a3aa1c  Bump commons-io from 2.5 to 2.6 (#8006)
1a3aa1c is described below

commit 1a3aa1cfc0be1191ceb750d5c0d73449b852e9b2
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Wed Aug 14 02:10:37 2019 +0200

    Bump commons-io from 2.5 to 2.6 (#8006)
    
    * Bump commons-io from 2.5 to 2.6
    
    * Update licenses.yaml
    
    * Address comments
---
 core/src/main/java/org/apache/druid/data/input/Firehose.java   |  6 +++---
 .../apache/druid/data/input/impl/FileIteratingFirehose.java    | 10 +++++-----
 licenses.yaml                                                  |  2 +-
 pom.xml                                                        |  2 +-
 .../segment/realtime/firehose/CombiningFirehoseFactory.java    |  4 ++--
 .../segment/realtime/firehose/FixedCountFirehoseFactory.java   |  6 +++---
 .../druid/segment/realtime/firehose/PredicateFirehose.java     |  2 +-
 .../segment/realtime/firehose/TimedShutoffFirehoseFactory.java |  6 +++---
 .../org/apache/druid/segment/realtime/plumber/Plumbers.java    |  4 +++-
 9 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/core/src/main/java/org/apache/druid/data/input/Firehose.java b/core/src/main/java/org/apache/druid/data/input/Firehose.java
index f2951df..a1af12f 100644
--- a/core/src/main/java/org/apache/druid/data/input/Firehose.java
+++ b/core/src/main/java/org/apache/druid/data/input/Firehose.java
@@ -56,7 +56,7 @@ public interface Firehose extends Closeable
    *
    * @return true if and when there is another row available, false if the stream has dried up
    */
-  boolean hasMore();
+  boolean hasMore() throws IOException;
 
   /**
    * The next row available.  Should only be called if hasMore returns true.
@@ -65,7 +65,7 @@ public interface Firehose extends Closeable
    * @return The next row
    */
   @Nullable
-  InputRow nextRow();
+  InputRow nextRow() throws IOException;
 
   /**
    * Returns an InputRowPlusRaw object containing the InputRow plus the raw, unparsed data corresponding to the next row
@@ -75,7 +75,7 @@ public interface Firehose extends Closeable
    *
    * @return an InputRowPlusRaw which may contain any of: an InputRow, the raw data, or a ParseException
    */
-  default InputRowPlusRaw nextRowWithRaw()
+  default InputRowPlusRaw nextRowWithRaw() throws IOException
   {
     try {
       return InputRowPlusRaw.of(nextRow(), null);
diff --git a/core/src/main/java/org/apache/druid/data/input/impl/FileIteratingFirehose.java b/core/src/main/java/org/apache/druid/data/input/impl/FileIteratingFirehose.java
index 23224fb..2c2963c 100644
--- a/core/src/main/java/org/apache/druid/data/input/impl/FileIteratingFirehose.java
+++ b/core/src/main/java/org/apache/druid/data/input/impl/FileIteratingFirehose.java
@@ -62,7 +62,7 @@ public class FileIteratingFirehose implements Firehose
   }
 
   @Override
-  public boolean hasMore()
+  public boolean hasMore() throws IOException
   {
     while ((lineIterator == null || !lineIterator.hasNext()) && lineIterators.hasNext()) {
       lineIterator = getNextLineIterator();
@@ -73,7 +73,7 @@ public class FileIteratingFirehose implements Firehose
 
   @Nullable
   @Override
-  public InputRow nextRow()
+  public InputRow nextRow() throws IOException
   {
     if (!hasMore()) {
       throw new NoSuchElementException();
@@ -83,7 +83,7 @@ public class FileIteratingFirehose implements Firehose
   }
 
   @Override
-  public InputRowPlusRaw nextRowWithRaw()
+  public InputRowPlusRaw nextRowWithRaw() throws IOException
   {
     if (!hasMore()) {
       throw new NoSuchElementException();
@@ -98,7 +98,7 @@ public class FileIteratingFirehose implements Firehose
     }
   }
 
-  private LineIterator getNextLineIterator()
+  private LineIterator getNextLineIterator() throws IOException
   {
     if (lineIterator != null) {
       lineIterator.close();
@@ -119,7 +119,7 @@ public class FileIteratingFirehose implements Firehose
   public void close() throws IOException
   {
     try (Closeable ignore = closer;
-         Closeable ignore2 = lineIterator != null ? lineIterator::close : null) {
+         Closeable ignore2 = lineIterator) {
       // close both via try-with-resources
     }
   }
diff --git a/licenses.yaml b/licenses.yaml
index 48c0dee..a39f2ee 100644
--- a/licenses.yaml
+++ b/licenses.yaml
@@ -336,7 +336,7 @@ name: Apache Commons IO
 license_category: binary
 module: java-core
 license_name: Apache License version 2.0
-version: 2.5
+version: 2.6
 libraries:
   - commons-io: commons-io
 
diff --git a/pom.xml b/pom.xml
index 149c2c1..e245316 100644
--- a/pom.xml
+++ b/pom.xml
@@ -206,7 +206,7 @@
             <dependency>
                 <groupId>commons-io</groupId>
                 <artifactId>commons-io</artifactId>
-                <version>2.5</version>
+                <version>2.6</version>
             </dependency>
             <dependency>
                 <groupId>commons-logging</groupId>
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/CombiningFirehoseFactory.java b/server/src/main/java/org/apache/druid/segment/realtime/firehose/CombiningFirehoseFactory.java
index 1602d57..1b7931b 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/CombiningFirehoseFactory.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/firehose/CombiningFirehoseFactory.java
@@ -105,14 +105,14 @@ public class CombiningFirehoseFactory implements FirehoseFactory<InputRowParser>
     }
 
     @Override
-    public boolean hasMore()
+    public boolean hasMore() throws IOException
     {
       return currentFirehose.hasMore();
     }
 
     @Nullable
     @Override
-    public InputRow nextRow()
+    public InputRow nextRow() throws IOException
     {
       InputRow rv = currentFirehose.nextRow();
       if (!currentFirehose.hasMore()) {
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/FixedCountFirehoseFactory.java b/server/src/main/java/org/apache/druid/segment/realtime/firehose/FixedCountFirehoseFactory.java
index e8a7dca..14b9ed3 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/FixedCountFirehoseFactory.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/firehose/FixedCountFirehoseFactory.java
@@ -67,17 +67,17 @@ public class FixedCountFirehoseFactory implements FirehoseFactory
     return new Firehose()
     {
       private int i = 0;
-      private Firehose delegateFirehose = delegate.connect(parser, temporaryDirectory);
+      private final Firehose delegateFirehose = delegate.connect(parser, temporaryDirectory);
 
       @Override
-      public boolean hasMore()
+      public boolean hasMore() throws IOException
       {
         return i < count && delegateFirehose.hasMore();
       }
 
       @Nullable
       @Override
-      public InputRow nextRow()
+      public InputRow nextRow() throws IOException
       {
         Preconditions.checkArgument(i++ < count, "Max events limit reached.");
         return delegateFirehose.nextRow();
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/PredicateFirehose.java b/server/src/main/java/org/apache/druid/segment/realtime/firehose/PredicateFirehose.java
index 446efa3..aaecc02 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/PredicateFirehose.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/firehose/PredicateFirehose.java
@@ -50,7 +50,7 @@ public class PredicateFirehose implements Firehose
   }
 
   @Override
-  public boolean hasMore()
+  public boolean hasMore() throws IOException
   {
     if (savedInputRow != null) {
       return true;
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/TimedShutoffFirehoseFactory.java b/server/src/main/java/org/apache/druid/segment/realtime/firehose/TimedShutoffFirehoseFactory.java
index 2ace21c..3a636ce 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/TimedShutoffFirehoseFactory.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/firehose/TimedShutoffFirehoseFactory.java
@@ -107,20 +107,20 @@ public class TimedShutoffFirehoseFactory implements FirehoseFactory<InputRowPars
     }
 
     @Override
-    public boolean hasMore()
+    public boolean hasMore() throws IOException
     {
       return firehose.hasMore();
     }
 
     @Nullable
     @Override
-    public InputRow nextRow()
+    public InputRow nextRow() throws IOException
     {
       return firehose.nextRow();
     }
 
     @Override
-    public InputRowPlusRaw nextRowWithRaw()
+    public InputRowPlusRaw nextRowWithRaw() throws IOException
     {
       return firehose.nextRowWithRaw();
     }
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/plumber/Plumbers.java b/server/src/main/java/org/apache/druid/segment/realtime/plumber/Plumbers.java
index f0a88f8..57a239d 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/plumber/Plumbers.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/plumber/Plumbers.java
@@ -30,6 +30,8 @@ import org.apache.druid.segment.incremental.IncrementalIndexAddResult;
 import org.apache.druid.segment.incremental.IndexSizeExceededException;
 import org.apache.druid.segment.realtime.FireDepartmentMetrics;
 
+import java.io.IOException;
+
 public class Plumbers
 {
   private static final Logger log = new Logger(Plumbers.class);
@@ -45,7 +47,7 @@ public class Plumbers
       final Plumber plumber,
       final boolean reportParseExceptions,
       final FireDepartmentMetrics metrics
-  )
+  ) throws IOException
   {
     final InputRow inputRow;
     try {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org