NIFI-271

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/e6274827
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/e6274827
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/e6274827

Branch: refs/heads/develop
Commit: e627482734ab701bd0ccc5b5f389340df8ed90f4
Parents: 525ce7f
Author: joewitt <joew...@apache.org>
Authored: Tue Apr 28 00:35:56 2015 -0400
Committer: joewitt <joew...@apache.org>
Committed: Tue Apr 28 00:35:56 2015 -0400

----------------------------------------------------------------------
 .../org/apache/nifi/processors/GeoEnrichIP.java | 14 +++----
 .../nifi/processors/maxmind/DatabaseReader.java | 40 +++++++-------------
 2 files changed, 20 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e6274827/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
 
b/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
index 1ecb221..b766878 100644
--- 
a/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
+++ 
b/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/GeoEnrichIP.java
@@ -189,17 +189,17 @@ public class GeoEnrichIP extends AbstractProcessor {
         final Map<String, String> attrs = new HashMap<>();
         attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.lookup.micros").toString(), 
String.valueOf(stopWatch.getDuration(TimeUnit.MICROSECONDS)));
         attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.city").toString(), 
response.getCity().getName());
-        
+
         final Double latitude = response.getLocation().getLatitude();
-        if ( latitude != null ) {
-               attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.latitude").toString(), 
latitude.toString());
+        if (latitude != null) {
+            attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.latitude").toString(), 
latitude.toString());
         }
-        
+
         final Double longitude = response.getLocation().getLongitude();
-        if ( longitude != null ) {
-               attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.longitude").toString(), 
longitude.toString());
+        if (longitude != null) {
+            attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.longitude").toString(), 
longitude.toString());
         }
-        
+
         int i = 0;
         for (final Subdivision subd : response.getSubdivisions()) {
             attrs.put(new 
StringBuilder(ipAttributeName).append(".geo.subdivision.").append(i).toString(),
 subd.getName());

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e6274827/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
 
b/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
index f1d26bf..fb84daf 100644
--- 
a/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
+++ 
b/nifi/nifi-nar-bundles/nifi-geo-bundle/nifi-geo-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java
@@ -43,17 +43,13 @@ import com.maxmind.geoip2.model.IspResponse;
 
 /**
  * <p>
- * This class was copied from
- * 
https://raw.githubusercontent.com/maxmind/GeoIP2-java/master/src/main/java/com/maxmind/geoip2/DatabaseReader.java
- * It is written by Maxmind and it is available under Apache Software License 
V2
+ * This class was copied from 
https://raw.githubusercontent.com/maxmind/GeoIP2-java/master/src/main/java/com/maxmind/geoip2/DatabaseReader.java
 It is written by Maxmind and it is available under
+ * Apache Software License V2
  *
- * The modification we're making to the code below is to stop using exceptions
- * for mainline flow control. Specifically we don't want to throw an exception
- * simply because an address was not found.
+ * The modification we're making to the code below is to stop using exceptions 
for mainline flow control. Specifically we don't want to throw an exception 
simply because an address was not found.
  * </p>
  *
- * Instances of this class provide a reader for the GeoIP2 database format. IP
- * addresses can be looked up using the <code>get</code> method.
+ * Instances of this class provide a reader for the GeoIP2 database format. IP 
addresses can be looked up using the <code>get</code> method.
  */
 public class DatabaseReader implements GeoIp2Provider, Closeable {
 
@@ -84,12 +80,10 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
 
     /**
      * <p>
-     * Constructs a Builder for the DatabaseReader. The file passed to it must
-     * be a valid GeoIP2 database file.
+     * Constructs a Builder for the DatabaseReader. The file passed to it must 
be a valid GeoIP2 database file.
      * </p>
      * <p>
-     * <code>Builder</code> creates instances of <code>DatabaseReader</code>
-     * from values set by the methods.
+     * <code>Builder</code> creates instances of <code>DatabaseReader</code> 
from values set by the methods.
      * </p>
      * <p>
      * Only the values set in the <code>Builder</code> constructor are 
required.
@@ -120,8 +114,7 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
         }
 
         /**
-         * @param val List of locale codes to use in name property from most
-         * preferred to least preferred.
+         * @param val List of locale codes to use in name property from most 
preferred to least preferred.
          * @return Builder object
          */
         public Builder locales(List<String> val) {
@@ -132,9 +125,7 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
         /**
          * @param val The file mode used to open the GeoIP2 database
          * @return Builder object
-         * @throws java.lang.IllegalArgumentException if you initialized the
-         * Builder with a URL, which uses {@link FileMode#MEMORY}, but you
-         * provided a different FileMode to this method.
+         * @throws java.lang.IllegalArgumentException if you initialized the 
Builder with a URL, which uses {@link FileMode#MEMORY}, but you provided a 
different FileMode to this method.
          */
         public Builder fileMode(FileMode val) {
             if (this.stream != null && !FileMode.MEMORY.equals(val)) {
@@ -146,8 +137,7 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
         }
 
         /**
-         * @return an instance of <code>DatabaseReader</code> created from the
-         * fields set on this builder.
+         * @return an instance of <code>DatabaseReader</code> created from the 
fields set on this builder.
          * @throws IOException if there is an error reading the database
          */
         public DatabaseReader build() throws IOException {
@@ -157,10 +147,8 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
 
     /**
      * @param ipAddress IPv4 or IPv6 address to lookup.
-     * @return An object of type T with the data for the IP address or null if 
no
-     * information could be found for the given IP address
-     * @throws IOException if there is an error opening or reading from the
-     * file.
+     * @return An object of type T with the data for the IP address or null if 
no information could be found for the given IP address
+     * @throws IOException if there is an error opening or reading from the 
file.
      */
     private <T> T get(InetAddress ipAddress, Class<T> cls, boolean hasTraits,
             String type) throws IOException, AddressNotFoundException {
@@ -200,10 +188,8 @@ public class DatabaseReader implements GeoIp2Provider, 
Closeable {
      * </p>
      * <p>
      * If you are using <code>FileMode.MEMORY_MAPPED</code>, this will
-     * <em>not</em> unmap the underlying file due to a limitation in Java's
-     * <code>MappedByteBuffer</code>. It will however set the reference to the
-     * buffer to <code>null</code>, allowing the garbage collector to collect
-     * it.
+     * <em>not</em> unmap the underlying file due to a limitation in Java's 
<code>MappedByteBuffer</code>. It will however set the reference to the buffer 
to <code>null</code>, allowing the garbage
+     * collector to collect it.
      * </p>
      *
      * @throws IOException if an I/O error occurs.

Reply via email to