Bump to release version of Accumulo 2.0.1
diff --git a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/GlobalIndexUidCombiner.java b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/GlobalIndexUidCombiner.java
index 4702521..98a434e 100644
--- a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/GlobalIndexUidCombiner.java
+++ b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/GlobalIndexUidCombiner.java
@@ -21,6 +21,7 @@
import java.util.Iterator;
import java.util.Map;
+import org.apache.accumulo.core.client.lexicoder.Encoder;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
@@ -37,17 +38,18 @@
public class GlobalIndexUidCombiner extends TypedValueCombiner<Uid.List> {
public static final Encoder<Uid.List> UID_LIST_ENCODER = new UidListEncoder();
public static final int MAX = 20;
-
+
@Override
- public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
+ public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
+ IteratorEnvironment env) throws IOException {
super.init(source, options, env);
setEncoder(UID_LIST_ENCODER);
}
-
+
@Override
public Uid.List typedReduce(Key key, Iterator<Uid.List> iter) {
Uid.List.Builder builder = Uid.List.newBuilder();
- HashSet<String> uids = new HashSet<String>();
+ HashSet<String> uids = new HashSet<>();
boolean seenIgnore = false;
long count = 0;
while (iter.hasNext()) {
@@ -73,13 +75,13 @@
}
return builder.build();
}
-
+
public static class UidListEncoder implements Encoder<Uid.List> {
@Override
public byte[] encode(Uid.List v) {
return v.toByteArray();
}
-
+
@Override
public Uid.List decode(byte[] b) {
if (b.length == 0)
diff --git a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/TextIndexCombiner.java b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/TextIndexCombiner.java
index 85f3e1e..6e28206 100644
--- a/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/TextIndexCombiner.java
+++ b/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/TextIndexCombiner.java
@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map;
+import org.apache.accumulo.core.client.lexicoder.Encoder;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
@@ -37,23 +38,24 @@
*
*/
public class TextIndexCombiner extends TypedValueCombiner<TermWeight.Info> {
- public static final Encoder<TermWeight.Info> TERMWEIGHT_INFO_ENCODER = new TermWeightInfoEncoder();
-
+ public static final Encoder<TermWeight.Info> TERMWEIGHT_INFO_ENCODER =
+ new TermWeightInfoEncoder();
+
@Override
public TermWeight.Info typedReduce(Key key, Iterator<TermWeight.Info> iter) {
TermWeight.Info.Builder builder = TermWeight.Info.newBuilder();
- List<Integer> offsets = new ArrayList<Integer>();
+ List<Integer> offsets = new ArrayList<>();
float normalizedTermFrequency = 0f;
-
+
while (iter.hasNext()) {
TermWeight.Info info = iter.next();
if (null == info)
continue;
-
+
// Add each offset into the list maintaining sorted order
for (int offset : info.getWordOffsetList()) {
int pos = Collections.binarySearch(offsets, offset);
-
+
if (pos < 0) {
// Undo the transform on the insertion point
offsets.add((-1 * pos) - 1, offset);
@@ -61,33 +63,34 @@
offsets.add(pos, offset);
}
}
-
+
if (info.getNormalizedTermFrequency() > 0) {
normalizedTermFrequency += info.getNormalizedTermFrequency();
}
}
-
+
// Keep the sorted order we tried to maintain
- for (int i = 0; i < offsets.size(); ++i) {
- builder.addWordOffset(offsets.get(i));
+ for (Integer offset : offsets) {
+ builder.addWordOffset(offset);
}
-
+
builder.setNormalizedTermFrequency(normalizedTermFrequency);
return builder.build();
}
-
+
@Override
- public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
+ public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
+ IteratorEnvironment env) throws IOException {
super.init(source, options, env);
setEncoder(TERMWEIGHT_INFO_ENCODER);
}
-
+
public static class TermWeightInfoEncoder implements Encoder<TermWeight.Info> {
@Override
public byte[] encode(TermWeight.Info v) {
return v.toByteArray();
}
-
+
@Override
public TermWeight.Info decode(byte[] b) {
if (b.length == 0)
@@ -95,7 +98,8 @@
try {
return TermWeight.Info.parseFrom(b);
} catch (InvalidProtocolBufferException e) {
- throw new ValueFormatException("Value passed to aggregator was not of type TermWeight.Info");
+ throw new ValueFormatException(
+ "Value passed to aggregator was not of type TermWeight.Info");
}
}
}
diff --git a/pom.xml b/pom.xml
index d6dc6b4..f132844 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,12 +40,14 @@
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <version.accumulo>2.0.0-alpha-2</version.accumulo>
+ <version.accumulo>2.0.1</version.accumulo>
<version.collections>3.2.2</version.collections>
<version.commons-codec>1.5</version.commons-codec>
<version.commons-configuration>1.10</version.commons-configuration>
+ <version.commons-configuration2>2.5</version.commons-configuration2>
<version.commons-jexl>2.0.1</version.commons-jexl>
<version.commons-lang>2.4</version.commons-lang>
+ <version.commons-lang3>3.9</version.commons-lang3>
<version.ejb-spec-api>1.0.1.Final</version.ejb-spec-api>
<version.guava>29.0-jre</version.guava>
<version.hadoop>3.1.1</version.hadoop>
@@ -58,7 +60,7 @@
<version.lucene>7.1.0</version.lucene>
<version.lucene-analyzers>4.0.0</version.lucene-analyzers>
<version.minlog>1.2</version.minlog>
- <version.protobuf>2.5.0</version.protobuf>
+ <version.protobuf>3.19.4</version.protobuf>
<version.thrift>0.12.0</version.thrift>
<version.zookeeper>3.4.14</version.zookeeper>
</properties>
@@ -173,6 +175,11 @@
<version>${version.commons-codec}</version>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-configuration2</artifactId>
+ <version>${version.commons-configuration2}</version>
+ </dependency>
+ <dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>${version.commons-configuration}</version>
@@ -183,6 +190,11 @@
<version>${version.commons-lang}</version>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${version.commons-lang3}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-core</artifactId>
<version>${version.accumulo}</version>
@@ -230,6 +242,16 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_annotations</artifactId>
+ <version>2.3.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.checkerframework</groupId>
+ <artifactId>checker-qual</artifactId>
+ <version>2.11.1</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
diff --git a/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/DefaultIteratorEnvironment.java b/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/DefaultIteratorEnvironment.java
index f83de46..b0881f1 100644
--- a/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/DefaultIteratorEnvironment.java
+++ b/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/DefaultIteratorEnvironment.java
@@ -28,7 +28,6 @@
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.system.MapFileIterator;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
@@ -43,9 +42,9 @@
@Override
public SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName)
throws IOException {
- Configuration conf = CachedConfiguration.getInstance();
+ Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
- return new MapFileIterator(this.conf, fs, mapFileName, conf);
+ return new MapFileIterator(fs, mapFileName, conf);
}
@Override