add missing @Override and @Deprecated annotations

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1065304 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-01-30 15:10:15 +00:00
parent 6569aa5da3
commit d1a5ca1460
357 changed files with 1322 additions and 9 deletions

View File

@ -82,14 +82,17 @@ public class InstantiatedDocsAndPositionsEnum extends DocsAndPositionsEnum {
return currentDoc.getTermPositions().length;
}
@Override
public int nextPosition() {
return currentDoc.getTermPositions()[++posUpto];
}
@Override
public boolean hasPayload() {
return currentDoc.getPayloads()[posUpto] != null;
}
@Override
public BytesRef getPayload() {
payload.bytes = currentDoc.getPayloads()[posUpto];
payload.length = payload.bytes.length;

View File

@ -64,6 +64,7 @@ public class WindowsDirectory extends FSDirectory {
super(path, null);
}
@Override
public IndexInput openInput(String name, int bufferSize) throws IOException {
ensureOpen();
return new WindowsIndexInput(new File(getDirectory(), name), Math.max(bufferSize, DEFAULT_BUFFERSIZE));
@ -82,14 +83,17 @@ public class WindowsDirectory extends FSDirectory {
isOpen = true;
}
@Override
protected void readInternal(byte[] b, int offset, int length) throws IOException {
if (WindowsDirectory.read(fd, b, offset, length, getFilePointer()) != length)
throw new IOException("Read past EOF");
}
@Override
protected void seekInternal(long pos) throws IOException {
}
@Override
public synchronized void close() throws IOException {
// NOTE: we synchronize and track "isOpen" because Lucene sometimes closes IIs twice!
if (!isClone && isOpen) {
@ -98,6 +102,7 @@ public class WindowsDirectory extends FSDirectory {
}
}
@Override
public long length() {
return length;
}

View File

@ -84,6 +84,7 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
@Override
public boolean incrementToken() throws IOException {
if (inPhrase) {
inPhrase = false;
@ -108,6 +109,7 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
public static final class QPTestAnalyzer extends Analyzer {
/** Filters MockTokenizer with StopFilter. */
@Override
public final TokenStream tokenStream(String fieldName, Reader reader) {
return new QPTestFilter(new MockTokenizer(reader, MockTokenizer.SIMPLE, true));
}
@ -115,6 +117,7 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
private int originalMaxClauses;
@Override
public void setUp() throws Exception {
super.setUp();
originalMaxClauses = BooleanQuery.getMaxClauseCount();
@ -627,6 +630,7 @@ public class TestPrecedenceQueryParser extends LuceneTestCase {
}
@Override
public void tearDown() {
BooleanQuery.setMaxClauseCount(originalMaxClauses);
}

View File

@ -194,6 +194,7 @@ final class FreqProxTermsWriterPerField extends TermsHashConsumerPerField implem
return new FreqProxPostingsArray(size);
}
@Override
void copyTo(ParallelPostingsArray toArray, int numToCopy) {
assert toArray instanceof FreqProxPostingsArray;
FreqProxPostingsArray to = (FreqProxPostingsArray) toArray;

View File

@ -383,6 +383,7 @@ public class MultiReader extends IndexReader implements Cloneable {
return subReaders;
}
@Override
public ReaderContext getTopReaderContext() {
return topLevelContext;
}

View File

@ -204,6 +204,7 @@ final class PerFieldCodecWrapper extends Codec {
}
}
@Override
public FieldsProducer fieldsProducer(SegmentReadState state)
throws IOException {
return new FieldsReader(state.dir, state.fieldInfos, state.segmentInfo,

View File

@ -281,6 +281,7 @@ final class TermVectorsTermsWriterPerField extends TermsHashConsumerPerField {
int[] lastOffsets; // Last offset we saw
int[] lastPositions; // Last position where this term occurred
@Override
ParallelPostingsArray newInstance(int size) {
return new TermVectorsPostingsArray(size);
}

View File

@ -646,6 +646,7 @@ public class BlockTermsReader extends FieldsProducer {
return SeekStatus.FOUND;
}
@Override
public long ord() {
if (!doOrd) {
throw new UnsupportedOperationException();

View File

@ -58,6 +58,7 @@ extends SegmentTermDocs {
this.proxStreamOrig = proxStream; // the proxStream will be cloned lazily when nextPosition() is called for the first time
}
@Override
final void seek(TermInfo ti, Term term) throws IOException {
super.seek(ti, term);
if (ti != null)
@ -69,6 +70,7 @@ extends SegmentTermDocs {
needToLoadPayload = false;
}
@Override
public final void close() throws IOException {
super.close();
if (proxStream != null) proxStream.close();
@ -100,11 +102,13 @@ extends SegmentTermDocs {
return delta;
}
@Override
protected final void skippingDoc() throws IOException {
// we remember to skip a document lazily
lazySkipProxCount += freq;
}
@Override
public final boolean next() throws IOException {
// we remember to skip the remaining positions of the current
// document lazily
@ -118,12 +122,14 @@ extends SegmentTermDocs {
return false;
}
@Override
public final int read(final int[] docs, final int[] freqs) {
throw new UnsupportedOperationException("TermPositions does not support processing multiple documents in one call. Use TermDocs instead.");
}
/** Called by super.skipTo(). */
@Override
protected void skipProx(long proxPointer, int payloadLength) throws IOException {
// we save the pointer, we might have to skip there lazily
lazySkipPointer = proxPointer;

View File

@ -67,15 +67,18 @@ public final class TermInfosReader {
this.term = t;
}
@Override
public boolean equals(Object other) {
CloneableTerm t = (CloneableTerm) other;
return this.term.equals(t.term);
}
@Override
public int hashCode() {
return term.hashCode();
}
@Override
public Object clone() {
return new CloneableTerm(term);
}

View File

@ -48,6 +48,7 @@ public abstract class IntIndexInput implements Closeable {
public abstract void set(Index other);
@Override
public abstract Object clone();
}

View File

@ -160,6 +160,7 @@ public class SepPostingsReaderImpl extends PostingsReaderBase {
return other;
}
@Override
public void copyFrom(TermState _other) {
super.copyFrom(_other);
SepTermState other = (SepTermState) _other;

View File

@ -129,6 +129,7 @@ class SimpleTextFieldsReader extends FieldsProducer {
fstEnum = new BytesRefFSTEnum<PairOutputs.Pair<Long,PairOutputs.Pair<Long,Long>>>(fst);
}
@Override
public SeekStatus seek(BytesRef text, boolean useCache /* ignored */) throws IOException {
//System.out.println("seek to text=" + text.utf8ToString());

View File

@ -99,12 +99,14 @@ public class StandardPostingsReader extends PostingsReaderBase {
ByteArrayDataInput bytesReader;
byte[] bytes;
@Override
public Object clone() {
StandardTermState other = new StandardTermState();
other.copyFrom(this);
return other;
}
@Override
public void copyFrom(TermState _other) {
super.copyFrom(_other);
StandardTermState other = (StandardTermState) _other;
@ -118,6 +120,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
// (rare!), they will be re-read from disk.
}
@Override
public String toString() {
return super.toString() + " freqFP=" + freqOffset + " proxFP=" + proxOffset + " skipOffset=" + skipOffset;
}
@ -569,6 +572,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
return doc;
}
@Override
public int nextPosition() throws IOException {
if (lazyProxPointer != -1) {
@ -597,10 +601,12 @@ public class StandardPostingsReader extends PostingsReaderBase {
/** Returns the payload at this position, or null if no
* payload was indexed. */
@Override
public BytesRef getPayload() throws IOException {
throw new IOException("No payloads exist for this field!");
}
@Override
public boolean hasPayload() {
return false;
}
@ -765,6 +771,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
return doc;
}
@Override
public int nextPosition() throws IOException {
if (lazyProxPointer != -1) {
@ -825,6 +832,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
/** Returns the payload at this position, or null if no
* payload was indexed. */
@Override
public BytesRef getPayload() throws IOException {
assert lazyProxPointer == -1;
assert posPendingCount < freq;
@ -842,6 +850,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
return payload;
}
@Override
public boolean hasPayload() {
return payloadPending && payloadLength > 0;
}

View File

@ -261,6 +261,7 @@ public final class FuzzyTermsEnum extends TermsEnum {
return actualEnum.docsAndPositions(skipDocs, reuse);
}
@Override
public void seek(BytesRef term, TermState state) throws IOException {
actualEnum.seek(term, state);
}

View File

@ -31,16 +31,20 @@ public class TotalHitCountCollector extends Collector {
return totalHits;
}
@Override
public void setScorer(Scorer scorer) {
}
@Override
public void collect(int doc) {
totalHits++;
}
@Override
public void setNextReader(AtomicReaderContext context) {
}
@Override
public boolean acceptsDocsOutOfOrder() {
return true;
}

View File

@ -58,6 +58,7 @@ public abstract class EntryCreator<T> implements Serializable
// This can be removed
//------------------------------------------------------------------------
@Override
public boolean equals(Object obj) {
if( obj instanceof EntryCreator ) {
return getCacheKey().equals( ((EntryCreator)obj).getCacheKey() );

View File

@ -52,6 +52,7 @@ public final class MultiValueSource extends ValueSource {
return other.getValues(context);
}
@Override
public DocValues getValues(ReaderContext context) throws IOException {
if (context.isAtomic) {
return getValues((AtomicReaderContext) context);

View File

@ -219,6 +219,7 @@ public class PayloadNearQuery extends SpanNearQuery {
return true;
}
@Override
public float score() throws IOException {
return super.score()

View File

@ -72,6 +72,7 @@ public class SpanNearPayloadCheckQuery extends SpanPositionCheckQuery {
return AcceptStatus.NO;
}
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
buffer.append("spanPayCheck(");

View File

@ -74,6 +74,7 @@ public class SpanPayloadCheckQuery extends SpanPositionCheckQuery{
return AcceptStatus.YES;
}
@Override
public String toString(String field) {
StringBuilder buffer = new StringBuilder();
buffer.append("spanPayCheck(");

View File

@ -209,6 +209,7 @@ public final class BytesRef implements Comparable<BytesRef>, Externalizable {
}
/** Returns hex encoded bytes, eg [0x6c 0x75 0x63 0x65 0x6e 0x65] */
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append('[');

View File

@ -45,6 +45,7 @@ import java.util.Map;
final public class DoubleBarrelLRUCache<K extends DoubleBarrelLRUCache.CloneableKey,V> {
public static abstract class CloneableKey {
@Override
abstract public Object clone();
}

View File

@ -123,6 +123,7 @@ public final class IntsRef implements Comparable<IntsRef> {
}
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append('[');

View File

@ -47,6 +47,7 @@ public final class ReaderUtil {
this.readerIndex = readerIndex;
}
@Override
public String toString() {
return "slice start=" + start + " length=" + length + " readerIndex=" + readerIndex;
}

View File

@ -483,10 +483,12 @@ final public class BasicOperations {
starts.count = 0;
}
@Override
public boolean equals(Object other) {
return ((PointTransitions) other).point == point;
}
@Override
public int hashCode() {
return point;
}
@ -563,6 +565,7 @@ final public class BasicOperations {
find(1+t.max).ends.add(t);
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
for(int i=0;i<count;i++) {

View File

@ -159,10 +159,12 @@ final class SortedIntSet {
return new FrozenIntSet(c, hashCode, state);
}
@Override
public int hashCode() {
return hashCode;
}
@Override
public boolean equals(Object _other) {
if (_other == null) {
return false;
@ -186,6 +188,7 @@ final class SortedIntSet {
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder().append('[');
for(int i=0;i<upto;i++) {
@ -215,10 +218,12 @@ final class SortedIntSet {
this.hashCode = 683+num;
}
@Override
public int hashCode() {
return hashCode;
}
@Override
public boolean equals(Object _other) {
if (_other == null) {
return false;
@ -256,6 +261,7 @@ final class SortedIntSet {
return false;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder().append('[');
for(int i=0;i<values.length;i++) {

View File

@ -105,6 +105,7 @@ final class UTF32ToUTF8 {
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
for(int i=0;i<len;i++) {

View File

@ -55,6 +55,7 @@ public class PairOutputs<A,B> extends Outputs<PairOutputs.Pair<A,B>> {
}
}
@Override
public int hashCode() {
return output1.hashCode() + output2.hashCode();
}

View File

@ -214,6 +214,7 @@ class Packed32 extends PackedInts.ReaderImpl implements PackedInts.Mutable {
Arrays.fill(blocks, 0);
}
@Override
public String toString() {
return "Packed32(bitsPerValue=" + bitsPerValue + ", maxPos=" + maxPos
+ ", elements.length=" + blocks.length + ")";

View File

@ -199,6 +199,7 @@ class Packed64 extends PackedInts.ReaderImpl implements PackedInts.Mutable {
| ((value << shifts[base + 2]) & writeMasks[base+2]);
}
@Override
public String toString() {
return "Packed64(bitsPerValue=" + bitsPerValue + ", size="
+ size() + ", maxPos=" + maxPos

View File

@ -106,6 +106,7 @@ class PackedWriter extends PackedInts.Writer {
}
}
@Override
public String toString() {
return "PackedWriter(written " + written + "/" + valueCount + " with "
+ bitsPerValue + " bits/value)";

View File

@ -35,34 +35,45 @@ public class TestAssertions extends LuceneTestCase {
}
static class TestAnalyzer1 extends Analyzer {
@Override
public final TokenStream tokenStream(String s, Reader r) { return null; }
@Override
public final TokenStream reusableTokenStream(String s, Reader r) { return null; }
}
static final class TestAnalyzer2 extends Analyzer {
@Override
public TokenStream tokenStream(String s, Reader r) { return null; }
@Override
public TokenStream reusableTokenStream(String s, Reader r) { return null; }
}
static class TestAnalyzer3 extends Analyzer {
@Override
public TokenStream tokenStream(String s, Reader r) { return null; }
@Override
public TokenStream reusableTokenStream(String s, Reader r) { return null; }
}
static class TestAnalyzer4 extends Analyzer {
@Override
public final TokenStream tokenStream(String s, Reader r) { return null; }
@Override
public TokenStream reusableTokenStream(String s, Reader r) { return null; }
}
static class TestTokenStream1 extends TokenStream {
@Override
public final boolean incrementToken() { return false; }
}
static final class TestTokenStream2 extends TokenStream {
@Override
public boolean incrementToken() { return false; }
}
static class TestTokenStream3 extends TokenStream {
@Override
public boolean incrementToken() { return false; }
}

View File

@ -63,6 +63,7 @@ public class TestExternalCodecs extends LuceneTestCase {
return t2.length-t1.length;
}
@Override
public boolean equals(Object other) {
return this == other;
}
@ -344,6 +345,7 @@ public class TestExternalCodecs extends LuceneTestCase {
return ramField.termToDocs.get(current).totalTermFreq;
}
@Override
public DocsEnum docs(Bits skipDocs, DocsEnum reuse) {
return new RAMDocsEnum(ramField.termToDocs.get(current), skipDocs);
}

View File

@ -227,6 +227,7 @@ public class TestCharTermAttributeImpl extends LuceneTestCase {
public char charAt(int i) { return longTestString.charAt(i); }
public int length() { return longTestString.length(); }
public CharSequence subSequence(int start, int end) { return longTestString.subSequence(start, end); }
@Override
public String toString() { return longTestString; }
});
assertEquals("4567890123456"+longTestString, t.toString());

View File

@ -36,6 +36,7 @@ public class TestDocsAndPositions extends LuceneTestCase {
private String fieldName;
private boolean usePayload;
@Override
public void setUp() throws Exception {
super.setUp();
fieldName = "field" + random.nextInt();

View File

@ -38,9 +38,11 @@ public class TestFilterIndexReader extends LuceneTestCase {
TestFields(Fields in) {
super(in);
}
@Override
public FieldsEnum iterator() throws IOException {
return new TestFieldsEnum(super.iterator());
}
@Override
public Terms terms(String field) throws IOException {
return new TestTerms(super.terms(field));
}
@ -51,6 +53,7 @@ public class TestFilterIndexReader extends LuceneTestCase {
super(in);
}
@Override
public TermsEnum iterator() throws IOException {
return new TestTermsEnum(super.iterator());
}
@ -61,6 +64,7 @@ public class TestFilterIndexReader extends LuceneTestCase {
super(in);
}
@Override
public TermsEnum terms() throws IOException {
return new TestTermsEnum(super.terms());
}

View File

@ -971,6 +971,7 @@ public class TestIndexWriterReader extends LuceneTestCase {
setMaxBufferedDocs(2).
setReaderPooling(true).
setMergedSegmentWarmer(new IndexWriter.IndexReaderWarmer() {
@Override
public void warm(IndexReader r) throws IOException {
IndexSearcher s = new IndexSearcher(r);
TopDocs hits = s.search(new TermQuery(new Term("foo", "bar")), 10);

View File

@ -53,6 +53,7 @@ public class TestMultiLevelSkipList extends LuceneTestCase {
super(random, delegate);
}
@Override
public IndexInput openInput(String fileName) throws IOException {
IndexInput in = super.openInput(fileName);
if (fileName.endsWith(".frq"))
@ -61,6 +62,7 @@ public class TestMultiLevelSkipList extends LuceneTestCase {
}
}
@Override
@Before
public void setUp() throws Exception {
super.setUp();

View File

@ -257,6 +257,7 @@ public class TestPerSegmentDeletes extends LuceneTestCase {
@Override
public void close() {}
@Override
public MergeSpecification findMerges(SegmentInfos segmentInfos)
throws CorruptIndexException, IOException {
MergeSpecification ms = new MergeSpecification();

View File

@ -40,6 +40,7 @@ public class TestAutomatonQuery extends LuceneTestCase {
private final String FN = "field";
@Override
public void setUp() throws Exception {
super.setUp();
directory = newDirectory();
@ -65,6 +66,7 @@ public class TestAutomatonQuery extends LuceneTestCase {
writer.close();
}
@Override
public void tearDown() throws Exception {
searcher.close();
reader.close();

View File

@ -41,6 +41,7 @@ public class TestAutomatonQueryUnicode extends LuceneTestCase {
private final String FN = "field";
@Override
public void setUp() throws Exception {
super.setUp();
directory = newDirectory();
@ -85,6 +86,7 @@ public class TestAutomatonQueryUnicode extends LuceneTestCase {
writer.close();
}
@Override
public void tearDown() throws Exception {
searcher.close();
reader.close();

View File

@ -42,6 +42,7 @@ public class TestRegexpQuery extends LuceneTestCase {
private Directory directory;
private final String FN = "field";
@Override
public void setUp() throws Exception {
super.setUp();
directory = newDirectory();
@ -56,6 +57,7 @@ public class TestRegexpQuery extends LuceneTestCase {
searcher = new IndexSearcher(reader);
}
@Override
public void tearDown() throws Exception {
searcher.close();
reader.close();

View File

@ -54,6 +54,7 @@ public class TestEntryCreators extends LuceneTestCase {
this.parser = parser;
values = new Number[NUM_DOCS];
}
@Override
public String toString()
{
return field;

View File

@ -30,6 +30,7 @@ public class LuceneJUnitDividingSelector extends BaseExtendSelector {
/** Current part to accept. */
private int part;
@Override
public void setParameters(Parameter[] pParameters) {
super.setParameters(pParameters);
for (int j = 0; j < pParameters.length; j++) {
@ -46,6 +47,7 @@ public class LuceneJUnitDividingSelector extends BaseExtendSelector {
}
}
@Override
public void verifySettings() {
super.verifySettings();
if (divisor <= 0 || part <= 0) {
@ -56,6 +58,7 @@ public class LuceneJUnitDividingSelector extends BaseExtendSelector {
}
}
@Override
public boolean isSelected(File dir, String name, File path) {
counter = counter % divisor + 1;
return counter == part;

View File

@ -40,6 +40,7 @@ public class TestBytesRefHash extends LuceneTestCase {
/**
*/
@Override
@Before
public void setUp() throws Exception {
super.setUp();

View File

@ -145,14 +145,17 @@ public class TestDoubleBarrelLRUCache extends LuceneTestCase {
this.value = value;
}
@Override
public boolean equals(Object other) {
return this.value.equals(((CloneableObject) other).value);
}
@Override
public int hashCode() {
return value.hashCode();
}
@Override
public Object clone() {
return new CloneableObject(value);
}
@ -165,14 +168,17 @@ public class TestDoubleBarrelLRUCache extends LuceneTestCase {
this.value = value;
}
@Override
public boolean equals(Object other) {
return this.value.equals(((CloneableInteger) other).value);
}
@Override
public int hashCode() {
return value.hashCode();
}
@Override
public Object clone() {
return new CloneableInteger(value);
}

View File

@ -31,6 +31,7 @@ public class TestRecyclingByteBlockAllocator extends LuceneTestCase {
/**
*/
@Override
@Before
public void setUp() throws Exception {
super.setUp();

View File

@ -59,11 +59,13 @@ public class TestFSTs extends LuceneTestCase {
private MockDirectoryWrapper dir;
@Override
public void setUp() throws IOException {
dir = newDirectory();
dir.setPreventDoubleWrite(false);
}
@Override
public void tearDown() throws IOException {
dir.close();
}

View File

@ -673,6 +673,7 @@ public class HTMLStripCharFilter extends BaseCharFilter {
@Override
public int read() throws IOException {
// TODO: Do we ever want to preserve CDATA sections?
// where do we have to worry about them?
@ -741,6 +742,7 @@ public class HTMLStripCharFilter extends BaseCharFilter {
}
@Override
public int read(char cbuf[], int off, int len) throws IOException {
int i=0;
for (i=0; i<len; i++) {
@ -755,6 +757,7 @@ public class HTMLStripCharFilter extends BaseCharFilter {
return i;
}
@Override
public void close() throws IOException {
input.close();
}

View File

@ -116,6 +116,7 @@ public final class CommonGramsFilter extends TokenFilter {
* eliminate the middle bigram "of-the"and save a disk seek and a whole set of
* position lookups.
*/
@Override
public boolean incrementToken() throws IOException {
// get the next piece of input
if (savedState != null) {

View File

@ -62,6 +62,7 @@ public final class CommonGramsQueryFilter extends TokenFilter {
/**
* {@inheritDoc}
*/
@Override
public void reset() throws IOException {
super.reset();
previous = null;
@ -76,6 +77,7 @@ public final class CommonGramsQueryFilter extends TokenFilter {
* <li>output:"the-rain", "rain-in" ,"in-spain", "falls", "mainly"
* </ul>
*/
@Override
public boolean incrementToken() throws IOException {
while (input.incrementToken()) {
State current = captureState();

View File

@ -32,6 +32,7 @@ public class PersianCharFilter extends CharFilter {
super(in);
}
@Override
public int read(char[] cbuf, int off, int len) throws IOException {
final int charsRead = super.read(cbuf, off, len);
if (charsRead > 0) {

View File

@ -113,6 +113,7 @@ public class PatternReplaceCharFilter extends BaseCharFilter {
}
}
@Override
public int read() throws IOException {
while( prepareReplaceBlock() ){
return replaceBlockBuffer.charAt( replaceBlockBufferOffset++ );
@ -120,6 +121,7 @@ public class PatternReplaceCharFilter extends BaseCharFilter {
return -1;
}
@Override
public int read(char[] cbuf, int off, int len) throws IOException {
char[] tmp = new char[len];
int l = input.read(tmp, 0, len);

View File

@ -78,6 +78,7 @@ public class SynonymMap {
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("<");
if (synonyms!=null) {

View File

@ -47,6 +47,7 @@ public class TestRemoveDuplicatesTokenFilter extends BaseTokenStreamTestCase {
CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
PositionIncrementAttribute posIncAtt = addAttribute(PositionIncrementAttribute.class);
@Override
public boolean incrementToken() {
if (toks.hasNext()) {
clearAttributes();

View File

@ -87,6 +87,7 @@ public class TestTrimFilter extends BaseTokenStreamTestCase {
this(tokens.toArray(new Token[tokens.size()]));
}
@Override
public boolean incrementToken() throws IOException {
if (index >= tokens.length)
return false;

View File

@ -213,6 +213,7 @@ public class TestWordDelimiterFilter extends BaseTokenStreamTestCase {
/* analyzer that uses whitespace + wdf */
Analyzer a = new Analyzer() {
@Override
public TokenStream tokenStream(String field, Reader reader) {
return new WordDelimiterFilter(
new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader),
@ -239,6 +240,7 @@ public class TestWordDelimiterFilter extends BaseTokenStreamTestCase {
/* analyzer that will consume tokens with large position increments */
Analyzer a2 = new Analyzer() {
@Override
public TokenStream tokenStream(String field, Reader reader) {
return new WordDelimiterFilter(
new LargePosIncTokenFilter(
@ -271,6 +273,7 @@ public class TestWordDelimiterFilter extends BaseTokenStreamTestCase {
new int[] { 1, 11, 1 });
Analyzer a3 = new Analyzer() {
@Override
public TokenStream tokenStream(String field, Reader reader) {
StopFilter filter = new StopFilter(TEST_VERSION_CURRENT,
new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader), StandardAnalyzer.STOP_WORDS_SET);

View File

@ -395,6 +395,7 @@ public class TestSynonymFilter extends BaseTokenStreamTestCase {
this(tokens.toArray(new Token[tokens.size()]));
}
@Override
public boolean incrementToken() throws IOException {
if (index >= tokens.length)
return false;

View File

@ -77,6 +77,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
private String idFieldName;
@Override
@Deprecated
public Object cluster(Query query, DocList docList, SolrQueryRequest sreq) {
SolrIndexSearcher searcher = sreq.getSearcher();
@ -90,6 +91,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
}
}
@Override
public Object cluster(Query query, SolrDocumentList solrDocList,
Map<SolrDocument, Integer> docIds, SolrQueryRequest sreq) {
try {

View File

@ -69,6 +69,7 @@ public class LuceneLanguageModelFactory extends DefaultLanguageModelFactory {
/**
* Provide an {@link IStemmer} implementation for a given language.
*/
@Override
protected IStemmer createStemmer(LanguageCode language) {
switch (language) {
case ARABIC:

View File

@ -25,11 +25,13 @@ import org.apache.solr.search.DocSet;
*
**/
public class MockDocumentClusteringEngine extends DocumentClusteringEngine {
@Override
public NamedList cluster(DocSet docs, SolrParams solrParams) {
NamedList result = new NamedList();
return result;
}
@Override
public NamedList cluster(SolrParams solrParams) {
NamedList result = new NamedList();
return result;

View File

@ -51,6 +51,7 @@ public class MailEntityProcessor extends EntityProcessorBase {
public SearchTerm getCustomSearch(Folder folder);
}
@Override
public void init(Context context) {
super.init(context);
// set attributes using XXX getXXXFromContext(attribute, defualtValue);
@ -95,6 +96,7 @@ public class MailEntityProcessor extends EntityProcessorBase {
logConfig();
}
@Override
public Map<String, Object> nextRow() {
Message mail;
Map<String, Object> row = null;

View File

@ -92,6 +92,7 @@ public class TikaEntityProcessor extends EntityProcessorBase {
done = false;
}
@Override
public Map<String, Object> nextRow() {
if(done) return null;
Map<String, Object> row = new HashMap<String, Object>();

View File

@ -191,18 +191,22 @@ public class TestMailEntityProcessor extends AbstractDataImportHandlerTestCase {
super(null, ".", null);
}
@Override
public boolean upload(SolrInputDocument doc) {
return docs.add(doc);
}
@Override
public void log(int event, String name, Object row) {
// Do nothing
}
@Override
public void doDeleteAll() {
deleteAllCalled = Boolean.TRUE;
}
@Override
public void commit(boolean b) {
commitCalled = Boolean.TRUE;
}

View File

@ -39,10 +39,12 @@ public class BinContentStreamDataSource extends DataSource<InputStream> {
private InputStream in;
@Override
public void init(Context context, Properties initProps) {
this.context = (ContextImpl) context;
}
@Override
public InputStream getData(String query) {
contentStream = context.getDocBuilder().requestParameters.contentStream;
if (contentStream == null)
@ -55,6 +57,7 @@ public class BinContentStreamDataSource extends DataSource<InputStream> {
}
}
@Override
public void close() {
if (contentStream != null) {
try {

View File

@ -43,10 +43,12 @@ import java.util.Properties;
public class BinFileDataSource extends DataSource<InputStream>{
protected String basePath;
@Override
public void init(Context context, Properties initProps) {
basePath = initProps.getProperty(FileDataSource.BASE_PATH);
}
@Override
public InputStream getData(String query) {
File f = FileDataSource.getFile(basePath,query);
try {
@ -57,6 +59,7 @@ public class BinFileDataSource extends DataSource<InputStream>{
}
}
@Override
public void close() {
}

View File

@ -49,6 +49,7 @@ public class BinURLDataSource extends DataSource<InputStream>{
public BinURLDataSource() { }
@Override
public void init(Context context, Properties initProps) {
this.context = context;
this.initProps = initProps;
@ -72,6 +73,7 @@ public class BinURLDataSource extends DataSource<InputStream>{
}
}
@Override
public InputStream getData(String query) {
URL url = null;
try {
@ -89,6 +91,7 @@ public class BinURLDataSource extends DataSource<InputStream>{
}
}
@Override
public void close() { }
private String getInitPropWithReplacements(String propertyName) {

View File

@ -38,6 +38,7 @@ import java.util.Map;
public class CachedSqlEntityProcessor extends SqlEntityProcessor {
private boolean isFirst;
@Override
@SuppressWarnings("unchecked")
public void init(Context context) {
super.init(context);
@ -45,6 +46,7 @@ public class CachedSqlEntityProcessor extends SqlEntityProcessor {
isFirst = true;
}
@Override
public Map<String, Object> nextRow() {
if (dataSourceRowCache != null)
return getFromRowCacheTransformed();
@ -60,6 +62,7 @@ public class CachedSqlEntityProcessor extends SqlEntityProcessor {
}
@Override
protected List<Map<String, Object>> getAllNonCachedRows() {
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
String q = getQuery();

View File

@ -37,6 +37,7 @@ import java.util.Map;
* @since solr 1.4
*/
public class ClobTransformer extends Transformer {
@Override
public Object transformRow(Map<String, Object> aRow, Context context) {
for (Map<String, String> map : context.getAllEntityFields()) {
if (!TRUE.equals(map.get(CLOB))) continue;

View File

@ -39,10 +39,12 @@ public class ContentStreamDataSource extends DataSource<Reader> {
private ContentStream contentStream;
private Reader reader;
@Override
public void init(Context context, Properties initProps) {
this.context = (ContextImpl) context;
}
@Override
public Reader getData(String query) {
contentStream = context.getDocBuilder().requestParameters.contentStream;
if (contentStream == null)
@ -55,6 +57,7 @@ public class ContentStreamDataSource extends DataSource<Reader> {
}
}
@Override
public void close() {
if (contentStream != null) {
try {

View File

@ -71,22 +71,27 @@ public class ContextImpl extends Context {
parent = parentContext;
}
@Override
public String getEntityAttribute(String name) {
return entity == null ? null : entity.allAttributes.get(name);
}
@Override
public String getResolvedEntityAttribute(String name) {
return entity == null ? null : resolver.replaceTokens(entity.allAttributes.get(name));
}
@Override
public List<Map<String, String>> getAllEntityFields() {
return entity == null ? Collections.EMPTY_LIST : entity.allFieldsList;
}
@Override
public VariableResolver getVariableResolver() {
return resolver;
}
@Override
public DataSource getDataSource() {
if (ds != null) return ds;
if(entity == null) return null;
@ -101,26 +106,32 @@ public class ContextImpl extends Context {
return entity.dataSrc;
}
@Override
public DataSource getDataSource(String name) {
return dataImporter.getDataSourceInstance(entity, name, this);
}
@Override
public boolean isRootEntity() {
return entity.isDocRoot;
}
@Override
public String currentProcess() {
return currProcess;
}
@Override
public Map<String, Object> getRequestParameters() {
return requestParams;
}
@Override
public EntityProcessor getEntityProcessor() {
return entity == null ? null : entity.processor;
}
@Override
public void setSessionAttribute(String name, Object val, String scope) {
if(name == null) return;
if (Context.SCOPE_ENTITY.equals(scope)) {
@ -148,6 +159,7 @@ public class ContextImpl extends Context {
else entitySession.put(name, val);
}
@Override
public Object getSessionAttribute(String name, String scope) {
if (Context.SCOPE_ENTITY.equals(scope)) {
if (entitySession == null)
@ -166,6 +178,7 @@ public class ContextImpl extends Context {
return null;
}
@Override
public Context getParentContext() {
return parent;
}
@ -187,15 +200,18 @@ public class ContextImpl extends Context {
}
@Override
public SolrCore getSolrCore() {
return dataImporter == null ? null : dataImporter.getCore();
}
@Override
public Map<String, Object> getStats() {
return docBuilder != null ? docBuilder.importStatistics.getStatsSnapshot() : Collections.<String, Object>emptyMap();
}
@Override
public String getScript() {
if(dataImporter != null) {
DataConfig.Script script = dataImporter.getConfig().script;
@ -204,6 +220,7 @@ public class ContextImpl extends Context {
return null;
}
@Override
public String getScriptLanguage() {
if (dataImporter != null) {
DataConfig.Script script = dataImporter.getConfig().script;
@ -212,12 +229,14 @@ public class ContextImpl extends Context {
return null;
}
@Override
public void deleteDoc(String id) {
if(docBuilder != null){
docBuilder.writer.deleteDoc(id);
}
}
@Override
public void deleteDocByQuery(String query) {
if(docBuilder != null){
docBuilder.writer.deleteByQuery(query);
@ -227,10 +246,12 @@ public class ContextImpl extends Context {
DocBuilder getDocBuilder(){
return docBuilder;
}
@Override
public Object resolve(String var) {
return resolver.resolve(var);
}
@Override
public String replaceTokens(String template) {
return resolver.replaceTokens(template);
}

View File

@ -214,6 +214,7 @@ public class DataConfig {
public Map<String, String> allAttributes = new HashMap<String, String>() {
@Override
public String put(String key, String value) {
if (super.containsKey(key))
return super.get(key);

View File

@ -423,6 +423,7 @@ public class DataImporter {
}
static final ThreadLocal<AtomicLong> QUERY_COUNT = new ThreadLocal<AtomicLong>() {
@Override
protected AtomicLong initialValue() {
return new AtomicLong();
}

View File

@ -45,6 +45,7 @@ public class DateFormatTransformer extends Transformer {
private static final Logger LOG = LoggerFactory
.getLogger(DateFormatTransformer.class);
@Override
@SuppressWarnings("unchecked")
public Object transformRow(Map<String, Object> aRow, Context context) {

View File

@ -60,6 +60,7 @@ class DebugLogger {
output = new NamedList();
debugStack = new Stack<DebugInfo>() {
@Override
public DebugInfo pop() {
if (size() == 1)
throw new DataImportHandlerException(
@ -169,14 +170,17 @@ class DebugLogger {
DataSource wrapDs(final DataSource ds) {
return new DataSource() {
@Override
public void init(Context context, Properties initProps) {
ds.init(context, initProps);
}
@Override
public void close() {
ds.close();
}
@Override
public Object getData(String query) {
writer.log(SolrWriter.ENTITY_META, "query", query);
long start = System.currentTimeMillis();
@ -203,6 +207,7 @@ class DebugLogger {
Transformer wrapTransformer(final Transformer t) {
return new Transformer() {
@Override
public Object transformRow(Map<String, Object> row, Context context) {
writer.log(SolrWriter.PRE_TRANSFORMER_ROW, null, row);
String tName = getTransformerName(t);

View File

@ -139,6 +139,7 @@ public class DocBuilder {
document = dataImporter.getConfig().document;
final AtomicLong startTime = new AtomicLong(System.currentTimeMillis());
statusMessages.put(TIME_ELAPSED, new Object() {
@Override
public String toString() {
return getTimeElapsedSince(startTime.get());
}

View File

@ -49,6 +49,7 @@ public class EntityProcessorBase extends EntityProcessor {
protected String onError = ABORT;
@Override
public void init(Context context) {
rowIterator = null;
this.context = context;
@ -86,14 +87,17 @@ public class EntityProcessorBase extends EntityProcessor {
}
}
@Override
public Map<String, Object> nextModifiedRowKey() {
return null;
}
@Override
public Map<String, Object> nextDeletedRowKey() {
return null;
}
@Override
public Map<String, Object> nextModifiedParentRowKey() {
return null;
}
@ -105,11 +109,13 @@ public class EntityProcessorBase extends EntityProcessor {
* @return a row where the key is the name of the field and value can be any Object or a Collection of objects. Return
* null to signal end of rows
*/
@Override
public Map<String, Object> nextRow() {
return null;// do not do anything
}
@Override
public void destroy() {
/*no op*/
}

View File

@ -54,6 +54,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
this.docBuilder = docBuilder;
}
@Override
public void init(Context context) {
rowcache = null;
this.context = context;
@ -79,6 +80,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
String[] transArr = transClasses.split(",");
transformers = new ArrayList<Transformer>() {
@Override
public boolean add(Transformer transformer) {
if (docBuilder != null && docBuilder.verboseDebug) {
transformer = docBuilder.writer.getDebugLogger().wrapTransformer(transformer);
@ -135,6 +137,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
o = clazz.newInstance();
}
@Override
public Object transformRow(Map<String, Object> aRow, Context context) {
try {
return meth.invoke(o, aRow);
@ -223,6 +226,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
&& Boolean.parseBoolean(oMap.get("$stopTransform").toString());
}
@Override
public Map<String, Object> nextRow() {
if (rowcache != null) {
return getFromRowCache();
@ -252,6 +256,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
}
}
@Override
public Map<String, Object> nextModifiedRowKey() {
Map<String, Object> row = delegate.nextModifiedRowKey();
row = applyTransformer(row);
@ -259,6 +264,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
return row;
}
@Override
public Map<String, Object> nextDeletedRowKey() {
Map<String, Object> row = delegate.nextDeletedRowKey();
row = applyTransformer(row);
@ -266,10 +272,12 @@ public class EntityProcessorWrapper extends EntityProcessor {
return row;
}
@Override
public Map<String, Object> nextModifiedParentRowKey() {
return delegate.nextModifiedParentRowKey();
}
@Override
public void destroy() {
delegate.destroy();
}

View File

@ -66,6 +66,7 @@ public class EvaluatorBag {
*/
public static Evaluator getSqlEscapingEvaluator() {
return new Evaluator() {
@Override
public String evaluate(String expression, Context context) {
List l = parseParams(expression, context.getVariableResolver());
if (l.size() != 1) {
@ -90,6 +91,7 @@ public class EvaluatorBag {
*/
public static Evaluator getSolrQueryEscapingEvaluator() {
return new Evaluator() {
@Override
public String evaluate(String expression, Context context) {
List l = parseParams(expression, context.getVariableResolver());
if (l.size() != 1) {
@ -109,6 +111,7 @@ public class EvaluatorBag {
*/
public static Evaluator getUrlEvaluator() {
return new Evaluator() {
@Override
public String evaluate(String expression, Context context) {
List l = parseParams(expression, context.getVariableResolver());
if (l.size() != 1) {
@ -138,6 +141,7 @@ public class EvaluatorBag {
*/
public static Evaluator getDateFormatEvaluator() {
return new Evaluator() {
@Override
public String evaluate(String expression, Context context) {
List l = parseParams(expression, context.getVariableResolver());
if (l.size() != 2) {
@ -288,6 +292,7 @@ public class EvaluatorBag {
}
@Override
public String toString() {
Object o = vr.resolve(varName);
return o == null ? null : o.toString();

View File

@ -52,6 +52,7 @@ public class FieldReaderDataSource extends DataSource<Reader> {
private String encoding;
private EntityProcessorWrapper entityProcessor;
@Override
public void init(Context context, Properties initProps) {
dataField = context.getEntityAttribute("dataField");
encoding = context.getEntityAttribute("encoding");
@ -59,6 +60,7 @@ public class FieldReaderDataSource extends DataSource<Reader> {
/*no op*/
}
@Override
public Reader getData(String query) {
Object o = entityProcessor.getVariableResolver().resolve(dataField);
if (o == null) {
@ -111,6 +113,7 @@ public class FieldReaderDataSource extends DataSource<Reader> {
}
}
@Override
public void close() {
}

View File

@ -52,12 +52,14 @@ public class FieldStreamDataSource extends DataSource<InputStream> {
protected String dataField;
private EntityProcessorWrapper wrapper;
@Override
public void init(Context context, Properties initProps) {
dataField = context.getEntityAttribute("dataField");
wrapper = (EntityProcessorWrapper) context.getEntityProcessor();
/*no op*/
}
@Override
public InputStream getData(String query) {
Object o = wrapper.getVariableResolver().resolve(dataField);
if (o == null) {
@ -90,6 +92,7 @@ public class FieldStreamDataSource extends DataSource<InputStream> {
}
@Override
public void close() {
}
}

View File

@ -59,6 +59,7 @@ public class FileDataSource extends DataSource<Reader> {
private static final Logger LOG = LoggerFactory.getLogger(FileDataSource.class);
@Override
public void init(Context context, Properties initProps) {
basePath = initProps.getProperty(BASE_PATH);
if (initProps.get(URLDataSource.ENCODING) != null)
@ -79,6 +80,7 @@ public class FileDataSource extends DataSource<Reader> {
* returned Reader</b>
* </p>
*/
@Override
public Reader getData(String query) {
File f = getFile(basePath,query);
try {
@ -130,6 +132,7 @@ public class FileDataSource extends DataSource<Reader> {
}
}
@Override
public void close() {
}

View File

@ -106,6 +106,7 @@ public class FileListEntityProcessor extends EntityProcessorBase {
private Pattern fileNamePattern, excludesPattern;
@Override
public void init(Context context) {
super.init(context);
fileName = context.getEntityAttribute(FILE_NAME);
@ -195,6 +196,7 @@ public class FileListEntityProcessor extends EntityProcessorBase {
return Long.parseLong(sizeStr);
}
@Override
public Map<String, Object> nextRow() {
if (rowIterator != null)
return getNext();

View File

@ -54,6 +54,7 @@ public class JdbcDataSource extends
private int maxRows = 0;
@Override
public void init(Context context, Properties initProps) {
Object o = initProps.get(CONVERT_TYPE);
if (o != null)
@ -204,6 +205,7 @@ public class JdbcDataSource extends
}
}
@Override
public Iterator<Map<String, Object>> getData(String query) {
ResultSetIterator r = new ResultSetIterator(query);
return r.getIterator();
@ -370,6 +372,7 @@ public class JdbcDataSource extends
}
}
@Override
protected void finalize() throws Throwable {
try {
if(!isClosed){
@ -383,6 +386,7 @@ public class JdbcDataSource extends
private boolean isClosed = false;
@Override
public void close() {
try {
closeConnection();

View File

@ -64,6 +64,7 @@ public class LineEntityProcessor extends EntityProcessorBase {
/**
* Parses each of the entity attributes.
*/
@Override
public void init(Context context) {
super.init(context);
String s;
@ -97,6 +98,7 @@ public class LineEntityProcessor extends EntityProcessorBase {
* from the url. However transformers can be used to create as
* many other fields as required.
*/
@Override
public Map<String, Object> nextRow() {
if (reader == null) {
reader = new BufferedReader((Reader) context.getDataSource().getData(url));

View File

@ -35,6 +35,7 @@ import java.util.Map;
public class LogTransformer extends Transformer {
Logger LOG = LoggerFactory.getLogger(LogTransformer.class);
@Override
public Object transformRow(Map<String, Object> row, Context ctx) {
String expr = ctx.getEntityAttribute(LOG_TEMPLATE);
String level = ctx.replaceTokens(ctx.getEntityAttribute(LOG_LEVEL));

View File

@ -45,13 +45,16 @@ public class MockDataSource extends
cache.clear();
}
@Override
public void init(Context context, Properties initProps) {
}
@Override
public Iterator<Map<String, Object>> getData(String query) {
return cache.get(query);
}
@Override
public void close() {
cache.clear();

View File

@ -49,6 +49,7 @@ public class NumberFormatTransformer extends Transformer {
private static final Pattern localeRegex = Pattern.compile("^([a-z]{2})-([A-Z]{2})$");
@Override
@SuppressWarnings("unchecked")
public Object transformRow(Map<String, Object> row, Context context) {
for (Map<String, String> fld : context.getAllEntityFields()) {

View File

@ -40,11 +40,13 @@ public class PlainTextEntityProcessor extends EntityProcessorBase {
private static final Logger LOG = LoggerFactory.getLogger(PlainTextEntityProcessor.class);
private boolean ended = false;
@Override
public void init(Context context) {
super.init(context);
ended = false;
}
@Override
public Map<String, Object> nextRow() {
if (ended) return null;
DataSource<Reader> ds = context.getDataSource();

View File

@ -43,6 +43,7 @@ import java.util.regex.Pattern;
public class RegexTransformer extends Transformer {
private static final Logger LOG = LoggerFactory.getLogger(RegexTransformer.class);
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> transformRow(Map<String, Object> row,
Context ctx) {

View File

@ -47,6 +47,7 @@ public class ScriptTransformer extends Transformer {
private String functionName;
@Override
public Object transformRow(Map<String, Object> row, Context context) {
try {
if (engine == null)

View File

@ -46,6 +46,7 @@ public class SqlEntityProcessor extends EntityProcessorBase {
protected DataSource<Iterator<Map<String, Object>>> dataSource;
@Override
@SuppressWarnings("unchecked")
public void init(Context context) {
super.init(context);
@ -65,6 +66,7 @@ public class SqlEntityProcessor extends EntityProcessorBase {
}
}
@Override
public Map<String, Object> nextRow() {
if (rowIterator == null) {
String q = getQuery();
@ -73,6 +75,7 @@ public class SqlEntityProcessor extends EntityProcessorBase {
return getNext();
}
@Override
public Map<String, Object> nextModifiedRowKey() {
if (rowIterator == null) {
String deltaQuery = context.getEntityAttribute(DELTA_QUERY);
@ -83,6 +86,7 @@ public class SqlEntityProcessor extends EntityProcessorBase {
return getNext();
}
@Override
public Map<String, Object> nextDeletedRowKey() {
if (rowIterator == null) {
String deletedPkQuery = context.getEntityAttribute(DEL_PK_QUERY);
@ -93,6 +97,7 @@ public class SqlEntityProcessor extends EntityProcessorBase {
return getNext();
}
@Override
public Map<String, Object> nextModifiedParentRowKey() {
if (rowIterator == null) {
String parentDeltaQuery = context.getEntityAttribute(PARENT_DELTA_QUERY);

View File

@ -51,6 +51,7 @@ public class TemplateTransformer extends Transformer {
private static final Logger LOG = LoggerFactory.getLogger(TemplateTransformer.class);
private Map<String ,List<String>> templateVsVars = new HashMap<String, List<String>>();
@Override
@SuppressWarnings("unchecked")
public Object transformRow(Map<String, Object> row, Context context) {

View File

@ -56,6 +56,7 @@ public class URLDataSource extends DataSource<Reader> {
public URLDataSource() {
}
@Override
public void init(Context context, Properties initProps) {
this.context = context;
this.initProps = initProps;
@ -81,6 +82,7 @@ public class URLDataSource extends DataSource<Reader> {
}
}
@Override
public Reader getData(String query) {
URL url = null;
try {
@ -114,6 +116,7 @@ public class URLDataSource extends DataSource<Reader> {
}
}
@Override
public void close() {
}

View File

@ -91,10 +91,12 @@ public class VariableResolverImpl extends VariableResolver {
container.remove(name);
}
@Override
public String replaceTokens(String template) {
return templateString.replaceTokens(template, this);
}
@Override
@SuppressWarnings("unchecked")
public Object resolve(String name) {
if (name == null)

View File

@ -80,6 +80,7 @@ public class XPathEntityProcessor extends EntityProcessorBase {
protected Thread publisherThread;
@Override
@SuppressWarnings("unchecked")
public void init(Context context) {
super.init(context);
@ -171,6 +172,7 @@ public class XPathEntityProcessor extends EntityProcessorBase {
}
@Override
public Map<String, Object> nextRow() {
Map<String, Object> result;
@ -398,6 +400,7 @@ public class XPathEntityProcessor extends EntityProcessorBase {
final AtomicBoolean isEnd = new AtomicBoolean(false);
final AtomicBoolean throwExp = new AtomicBoolean(true);
publisherThread = new Thread() {
@Override
public void run() {
try {
xpathReader.streamRecords(data, new XPathRecordReader.Handler() {

View File

@ -197,89 +197,110 @@ public abstract class AbstractDataImportHandlerTestCase extends
this.root = root;
}
@Override
public String getEntityAttribute(String name) {
return entityAttrs == null ? delegate.getEntityAttribute(name) : entityAttrs.get(name);
}
@Override
public String getResolvedEntityAttribute(String name) {
return entityAttrs == null ? delegate.getResolvedEntityAttribute(name) :
delegate.getVariableResolver().replaceTokens(entityAttrs.get(name));
}
@Override
public List<Map<String, String>> getAllEntityFields() {
return entityFields == null ? delegate.getAllEntityFields()
: entityFields;
}
@Override
public VariableResolver getVariableResolver() {
return delegate.getVariableResolver();
}
@Override
public DataSource getDataSource() {
return delegate.getDataSource();
}
@Override
public boolean isRootEntity() {
return root;
}
@Override
public String currentProcess() {
return delegate.currentProcess();
}
@Override
public Map<String, Object> getRequestParameters() {
return delegate.getRequestParameters();
}
@Override
public EntityProcessor getEntityProcessor() {
return null;
}
@Override
public void setSessionAttribute(String name, Object val, String scope) {
delegate.setSessionAttribute(name, val, scope);
}
@Override
public Object getSessionAttribute(String name, String scope) {
return delegate.getSessionAttribute(name, scope);
}
@Override
public Context getParentContext() {
return delegate.getParentContext();
}
@Override
public DataSource getDataSource(String name) {
return delegate.getDataSource(name);
}
@Override
public SolrCore getSolrCore() {
return delegate.getSolrCore();
}
@Override
public Map<String, Object> getStats() {
return delegate.getStats();
}
@Override
public String getScript() {
return script == null ? delegate.getScript() : script;
}
@Override
public String getScriptLanguage() {
return scriptlang == null ? delegate.getScriptLanguage() : scriptlang;
}
@Override
public void deleteDoc(String id) {
}
@Override
public void deleteDocByQuery(String query) {
}
@Override
public Object resolve(String var) {
return delegate.resolve(var);
}
@Override
public String replaceTokens(String template) {
return delegate.replaceTokens(template);
}
@ -318,31 +339,37 @@ public abstract class AbstractDataImportHandlerTestCase extends
reset();
}
@Override
public void finish() throws IOException {
finishCalled = true;
super.finish();
}
@Override
public void processAdd(AddUpdateCommand cmd) throws IOException {
processAddCalled = true;
super.processAdd(cmd);
}
@Override
public void processCommit(CommitUpdateCommand cmd) throws IOException {
processCommitCalled = true;
super.processCommit(cmd);
}
@Override
public void processDelete(DeleteUpdateCommand cmd) throws IOException {
processDeleteCalled = true;
super.processDelete(cmd);
}
@Override
public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException {
mergeIndexesCalled = true;
super.processMergeIndexes(cmd);
}
@Override
public void processRollback(RollbackUpdateCommand cmd) throws IOException {
rollbackCalled = true;
super.processRollback(cmd);

View File

@ -158,6 +158,7 @@ public class TestCachedSqlEntityProcessor extends AbstractDataImportHandlerTestC
public static class DoubleTransformer extends Transformer {
@Override
public Object transformRow(Map<String, Object> row, Context context) {
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
rows.add(row);
@ -169,6 +170,7 @@ public class TestCachedSqlEntityProcessor extends AbstractDataImportHandlerTestC
public static class UppercaseTransformer extends Transformer {
@Override
public Object transformRow(Map<String, Object> row, Context context) {
for (Map.Entry<String, Object> entry : row.entrySet()) {
Object val = entry.getValue();

View File

@ -43,6 +43,7 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
SolrInstance instance = null;
JettySolrRunner jetty;
@Override
@Before
public void setUp() throws Exception {
super.setUp();
@ -51,6 +52,7 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
jetty = createJetty(instance);
}
@Override
@After
public void tearDown() throws Exception {
jetty.stop();

Some files were not shown because too many files have changed in this diff Show More