You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2019/02/28 00:09:06 UTC

[accumulo] branch master updated: Fix build in latest Eclipse

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

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 394b34d  Fix build in latest Eclipse
394b34d is described below

commit 394b34d350de168ce1052e78d03556a70e6d6cf0
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Wed Feb 27 19:07:05 2019 -0500

    Fix build in latest Eclipse
    
    Apply workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=541772
    This ensures hadoop-client-runtime is available on the compile time
    class path when building inside of an Eclipse m2e environment.
    
    Also fix trivial warnings, remove redundant type arguments, and convert
    an anonymous inner class to a lambda.
---
 core/pom.xml                                             | 16 ++++++++++++++++
 .../accumulo/core/client/mapred/InputFormatBase.java     |  1 +
 .../accumulo/core/client/mapreduce/InputFormatBase.java  |  1 +
 server/base/pom.xml                                      | 16 ++++++++++++++++
 .../apache/accumulo/tserver/log/SortedLogRecovery.java   | 10 ++--------
 .../apache/accumulo/test/functional/PermissionsIT.java   |  1 -
 6 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index ff059f6..dd934c6 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -349,5 +349,21 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <!-- workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=541772 -->
+      <id>m2e</id>
+      <activation>
+        <property>
+          <name>m2e.version</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-client-runtime</artifactId>
+          <scope>compile</scope>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
index 4b328e0..ae2a2fb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
@@ -382,6 +382,7 @@ public abstract class InputFormatBase<K,V> extends AbstractInputFormat<K,V> {
   protected abstract static class RecordReaderBase<K,V> extends AbstractRecordReader<K,V> {
 
     @Override
+    @Deprecated
     protected List<IteratorSetting> jobIterators(JobConf job, String tableName) {
       return getIterators(job);
     }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
index 983d4a6..1f568a8 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
@@ -381,6 +381,7 @@ public abstract class InputFormatBase<K,V> extends AbstractInputFormat<K,V> {
   protected abstract static class RecordReaderBase<K,V> extends AbstractRecordReader<K,V> {
 
     @Override
+    @Deprecated
     protected List<IteratorSetting> contextIterators(TaskAttemptContext context, String tableName) {
       return getIterators(context);
     }
diff --git a/server/base/pom.xml b/server/base/pom.xml
index 7c0cbba..205130a 100644
--- a/server/base/pom.xml
+++ b/server/base/pom.xml
@@ -149,5 +149,21 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <!-- workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=541772 -->
+      <id>m2e</id>
+      <activation>
+        <property>
+          <name>m2e.version</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-client-runtime</artifactId>
+          <scope>compile</scope>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
index f86b835..fc393f8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
@@ -28,7 +28,6 @@ import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -157,15 +156,10 @@ public class SortedLogRecovery {
     }
 
     if (logsThatDefineTablet.isEmpty()) {
-      return new AbstractMap.SimpleEntry<Integer,List<Path>>(-1, Collections.<Path> emptyList());
+      return new AbstractMap.SimpleEntry<>(-1, Collections.<Path> emptyList());
     } else {
       return Collections.max(logsThatDefineTablet.entrySet(),
-          new Comparator<Entry<Integer,List<Path>>>() {
-            @Override
-            public int compare(Entry<Integer,List<Path>> o1, Entry<Integer,List<Path>> o2) {
-              return Integer.compare(o1.getKey(), o2.getKey());
-            }
-          });
+          (o1, o2) -> Integer.compare(o1.getKey(), o2.getKey()));
     }
   }
 
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
index 2447525..eefff65 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -624,7 +624,6 @@ public class PermissionsIT extends AccumuloClusterHarness {
 
   private void testMissingTablePermission(AccumuloClient test_user_client, TablePermission perm,
       String tableName) throws Exception {
-    BatchWriter writer;
     Mutation m;
     log.debug("Confirming that the lack of the {} permission properly restricts the user", perm);