You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2011/12/23 17:29:32 UTC
svn commit: r1222734 - in /incubator/accumulo/trunk/contrib/accumulo_sample:
ingest/src/main/java/ingest/ ingest/src/test/java/aggregator/
query/src/main/java/iterator/ query/src/main/java/logic/
query/src/main/java/parser/
Author: ecn
Date: Fri Dec 23 16:29:32 2011
New Revision: 1222734
URL: http://svn.apache.org/viewvc?rev=1222734&view=rev
Log:
ACCUMULO-230 removed many trivial warnings
Modified:
incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaConfiguration.java
incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaIngester.java
incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/test/java/aggregator/GlobalIndexUidAggregatorTest.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AbstractEvaluatingIterator.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AndIterator.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/BooleanLogicTreeNode.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/OptimizedQueryIterator.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/UniqFieldNameValueIterator.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/logic/AbstractQueryLogic.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/FieldIndexQueryReWriter.java
incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/RangeCalculator.java
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaConfiguration.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaConfiguration.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaConfiguration.java Fri Dec 23 16:29:32 2011
@@ -18,6 +18,11 @@ package ingest;
import java.io.IOException;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
@@ -25,12 +30,6 @@ import org.apache.hadoop.util.Reflection
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.SimpleAnalyzer;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.ZooKeeperInstance;
-
public class WikipediaConfiguration {
public final static String INSTANCE_NAME = "wikipedia.accumulo.instance_name";
public final static String USER = "wikipedia.accumulo.user";
@@ -100,7 +99,7 @@ public class WikipediaConfiguration {
}
public static Connector getConnector(Configuration conf) throws AccumuloException, AccumuloSecurityException {
- return new Connector(getInstance(conf), getUser(conf), getPassword(conf));
+ return getInstance(conf).getConnector(getUser(conf), getPassword(conf));
}
public static Instance getInstance(Configuration conf) {
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaIngester.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaIngester.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaIngester.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/main/java/ingest/WikipediaIngester.java Fri Dec 23 16:29:32 2011
@@ -26,6 +26,18 @@ import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.TableExistsException;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.admin.TableOperations;
+import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
+import org.apache.accumulo.core.iterators.aggregation.NumSummation;
+import org.apache.accumulo.core.iterators.aggregation.conf.AggregatorConfiguration;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
@@ -40,19 +52,8 @@ import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import reader.AggregatingRecordReader;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
-import org.apache.accumulo.core.iterators.aggregation.NumSummation;
-import org.apache.accumulo.core.iterators.aggregation.conf.AggregatorConfiguration;
+@SuppressWarnings("deprecation")
public class WikipediaIngester extends Configured implements Tool {
public final static String INGEST_LANGUAGE = "wikipedia.ingest_language";
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/test/java/aggregator/GlobalIndexUidAggregatorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/test/java/aggregator/GlobalIndexUidAggregatorTest.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/test/java/aggregator/GlobalIndexUidAggregatorTest.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/ingest/src/test/java/aggregator/GlobalIndexUidAggregatorTest.java Fri Dec 23 16:29:32 2011
@@ -21,11 +21,14 @@ import java.util.List;
import java.util.UUID;
import junit.framework.TestCase;
-import protobuf.Uid;
-import protobuf.Uid.List.Builder;
+
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.aggregation.Aggregator;
+import protobuf.Uid;
+import protobuf.Uid.List.Builder;
+
+@SuppressWarnings("deprecation")
public class GlobalIndexUidAggregatorTest extends TestCase {
Aggregator agg = new GlobalIndexUidAggregator();
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AbstractEvaluatingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AbstractEvaluatingIterator.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AbstractEvaluatingIterator.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AbstractEvaluatingIterator.java Fri Dec 23 16:29:32 2011
@@ -188,7 +188,7 @@ public abstract class AbstractEvaluating
}
}
} else {
- log.info("Iterator.hasTop() == false");
+ log.debug("Iterator.hasTop() == false");
}
} while (returnValue == null && iterator.hasTop());
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AndIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AndIterator.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AndIterator.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/AndIterator.java Fri Dec 23 16:29:32 2011
@@ -551,7 +551,6 @@ public class AndIterator implements Sort
}
boolean cursorChanged = true;
- int numSeeks = 0;
while (cursorChanged) {
// seek all of the sources to at least the highest seen column qualifier in the current row
cursorChanged = false;
@@ -560,7 +559,6 @@ public class AndIterator implements Sort
topKey = null;
return;
}
- numSeeks++;
if (seekOneSource(ts)) {
cursorChanged = true;
break;
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/BooleanLogicTreeNode.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/BooleanLogicTreeNode.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/BooleanLogicTreeNode.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/BooleanLogicTreeNode.java Fri Dec 23 16:29:32 2011
@@ -464,7 +464,7 @@ public class BooleanLogicTreeNode extend
}
public Key getMinUniqueID() {
- Iterator iter = uids.iterator();
+ Iterator<Key> iter = uids.iterator();
Key min = null;
while (iter.hasNext()) {
Key t = (Key) iter.next();
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/OptimizedQueryIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/OptimizedQueryIterator.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/OptimizedQueryIterator.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/OptimizedQueryIterator.java Fri Dec 23 16:29:32 2011
@@ -44,7 +44,6 @@ public class OptimizedQueryIterator impl
private Key key = null;
private Value value = null;
private boolean eventSpecificRange = false;
- private long seekTime = 0;
public IteratorOptions describeOptions() {
Map<String,String> options = new HashMap<String,String>();
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/UniqFieldNameValueIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/UniqFieldNameValueIterator.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/UniqFieldNameValueIterator.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/iterator/UniqFieldNameValueIterator.java Fri Dec 23 16:29:32 2011
@@ -29,7 +29,6 @@ import org.apache.accumulo.core.data.Val
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.WrappingIterator;
-import org.apache.commons.jexl2.Expression;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@@ -48,13 +47,9 @@ public class UniqFieldNameValueIterator
private Range overallRange = null;
private Range currentSubRange;
private Text fieldName = null;
- private String fieldNameString = null;
private Text fieldValueLowerBound = null;
private Text fieldValueUpperBound = null;
- private String operator = null;
- private Expression expr = null;
private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
- private static final String NULL_BYTE = "\0";
private static final String ONE_BYTE = "\1";
private boolean multiRow = false;
private boolean seekInclusive = false;
@@ -69,7 +64,6 @@ public class UniqFieldNameValueIterator
// ------------- Constructors
public UniqFieldNameValueIterator(Text fName, Text fValLower, Text fValUpper) {
this.fieldName = fName;
- this.fieldNameString = fieldName.toString();
this.fieldValueLowerBound = fValLower;
this.fieldValueUpperBound = fValUpper;
keyParser = createDefaultKeyParser();
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/logic/AbstractQueryLogic.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/logic/AbstractQueryLogic.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/logic/AbstractQueryLogic.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/logic/AbstractQueryLogic.java Fri Dec 23 16:29:32 2011
@@ -599,7 +599,6 @@ public abstract class AbstractQueryLogic
// TODO: Should we cache indexed term information or does that not make sense since we are always loading data
queryGlobalIndex.start();
IndexRanges termIndexInfo;
- Set<String> indexedColumns;
try {
// If fields is null or zero, then it's probably the case that the user entered a value
// to search for with no fields. Check for the value in index.
@@ -629,8 +628,6 @@ public abstract class AbstractQueryLogic
log.debug("Rewrote query for non-fielded single term query: " + queryString + " to " + buf.toString());
}
queryString = buf.toString();
- // We also need to set the set of indexed terms since we found these in the index.
- indexedColumns = union.getFieldNamesAndValues().keySet();
} else {
throw new RuntimeException("Unexpected IndexRanges implementation");
}
@@ -651,7 +648,6 @@ public abstract class AbstractQueryLogic
// foo is a placeholder and is ignored.
termIndexInfo.add("foo", r);
}
- indexedColumns = termIndexInfo.getFieldNamesAndValues().keySet();
}
} catch (TableNotFoundException e) {
log.error(this.getIndexTableName() + "not found", e);
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/FieldIndexQueryReWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/FieldIndexQueryReWriter.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/FieldIndexQueryReWriter.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/FieldIndexQueryReWriter.java Fri Dec 23 16:29:32 2011
@@ -95,7 +95,7 @@ public class FieldIndexQueryReWriter {
* @throws Exception
*/
public String removeNonIndexedTermsAndInvalidRanges(String query, Map<String,String> options) throws ParseException, Exception {
- Multimap indexedTerms = parseIndexedTerms(options);
+ Multimap<String,String> indexedTerms = parseIndexedTerms(options);
RewriterTreeNode node = parseJexlQuery(query);
if (log.isDebugEnabled()) {
log.debug("Tree: " + node.getContents());
@@ -123,7 +123,7 @@ public class FieldIndexQueryReWriter {
if (log.isDebugEnabled()) {
log.debug("applyNormalizedTerms, query: " + query);
}
- Multimap normalizedTerms = parseIndexedTerms(options);
+ Multimap<String,String> normalizedTerms = parseIndexedTerms(options);
RewriterTreeNode node = parseJexlQuery(query);
if (log.isDebugEnabled()) {
log.debug("applyNormalizedTerms, Tree: " + node.getContents());
@@ -387,7 +387,7 @@ public class FieldIndexQueryReWriter {
return returnNode;
}
- private RewriterTreeNode removeNonIndexedTerms(RewriterTreeNode root, Multimap indexedTerms) throws Exception {
+ private RewriterTreeNode removeNonIndexedTerms(RewriterTreeNode root, Multimap<String,String> indexedTerms) throws Exception {
// public void removeNonIndexedTerms(BooleanLogicTreeNodeJexl myroot, String indexedTerms) throws Exception {
if (indexedTerms.isEmpty()) {
throw new Exception("removeNonIndexedTerms, indexed Terms empty");
@@ -451,7 +451,7 @@ public class FieldIndexQueryReWriter {
return root;
}
- private RewriterTreeNode orNormalizedTerms(RewriterTreeNode myroot, Multimap indexedTerms) throws Exception {
+ private RewriterTreeNode orNormalizedTerms(RewriterTreeNode myroot, Multimap<String,String> indexedTerms) throws Exception {
// we have multimap of FieldName to multiple FieldValues
if (indexedTerms.isEmpty()) {
throw new Exception("indexed Terms empty");
@@ -532,7 +532,7 @@ public class FieldIndexQueryReWriter {
* If there is an HEAD-AND[x,OR[b,AND[range]]], and you remove the range, this turns the tree into HEAD-AND[X,OR[B]] which becomes HEAD-AND[X,B] which will
* miss entries, so you need to cut out the entire OR at this point and let the positive side of the AND pick it up.
*/
- private RewriterTreeNode removeTreeConflicts(RewriterTreeNode root, Multimap indexedTerms) {
+ private RewriterTreeNode removeTreeConflicts(RewriterTreeNode root, Multimap<String,String> indexedTerms) {
if (log.isDebugEnabled()) {
log.debug("removeTreeConflicts");
}
@@ -869,8 +869,6 @@ public class FieldIndexQueryReWriter {
private Map<Text,RangeBounds> getBoundedRangeMap(RewriterTreeNode node) {
- boolean upper = false;
- boolean lower = false;
if (node.getType() == ParserTreeConstants.JJTANDNODE || node.getType() == ParserTreeConstants.JJTORNODE) {
Enumeration<?> children = node.children();
Map<Text,RangeBounds> rangeMap = new HashMap<Text,RangeBounds>();
Modified: incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/RangeCalculator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/RangeCalculator.java?rev=1222734&r1=1222733&r2=1222734&view=diff
==============================================================================
--- incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/RangeCalculator.java (original)
+++ incubator/accumulo/trunk/contrib/accumulo_sample/query/src/main/java/parser/RangeCalculator.java Fri Dec 23 16:29:32 2011
@@ -28,6 +28,13 @@ import java.util.TreeSet;
import logic.AbstractQueryLogic;
import normalizer.Normalizer;
+import org.apache.accumulo.core.client.BatchScanner;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
import org.apache.commons.jexl2.parser.ASTAndNode;
import org.apache.commons.jexl2.parser.ASTEQNode;
import org.apache.commons.jexl2.parser.ASTERNode;
@@ -50,13 +57,6 @@ import org.apache.log4j.Logger;
import protobuf.Uid;
import util.TextUtil;
-import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -597,7 +597,6 @@ public class RangeCalculator extends Que
bs.fetchColumnFamily(new Text(specificFieldName));
}
- long indexEntries = 0;
for (Entry<Key,Value> entry : bs) {
if (log.isDebugEnabled()) {
log.debug("Index entry: " + entry.getKey().toString());
@@ -658,7 +657,6 @@ public class RangeCalculator extends Que
results.get(new MapKey(fieldName, fieldValue)).add(new Range(shard));
else
results.get(override).add(new Range(shard));
- indexEntries++;
} else {
// We should have UUIDs, create event ranges
for (String uuid : uidList.getUIDList()) {
@@ -671,7 +669,6 @@ public class RangeCalculator extends Que
results.get(new MapKey(fieldName, fieldValue)).add(eventRange);
else
results.get(override).add(eventRange);
- indexEntries++;
}
}
}