Esempio n. 1
0
 @Override
 public long lookupTerm(BytesRef key) {
   assertThread("Sorted set doc values", creationThread);
   assert key.isValid();
   long result = in.lookupTerm(key);
   assert result < valueCount;
   assert key.isValid();
   return result;
 }
Esempio n. 2
0
 @Override
 public BytesRef binaryValue() {
   assertThread("Sorted doc values", creationThread);
   final BytesRef result = in.binaryValue();
   assert result.isValid();
   return result;
 }
Esempio n. 3
0
 @Override
 public TermsEnum intersect(CompiledAutomaton automaton, BytesRef bytes) throws IOException {
   TermsEnum termsEnum = in.intersect(automaton, bytes);
   assert termsEnum != null;
   assert bytes == null || bytes.isValid();
   return new AssertingTermsEnum(termsEnum);
 }
Esempio n. 4
0
 @Override
 public void seekExact(BytesRef term, TermState state) throws IOException {
   assertThread("Terms enums", creationThread);
   assert term.isValid();
   in.seekExact(term, state);
   this.state = State.POSITIONED;
 }
Esempio n. 5
0
 @Override
 public BytesRef lookupOrd(long ord) {
   assertThread("Sorted set doc values", creationThread);
   assert ord >= 0 && ord < valueCount;
   final BytesRef result = in.lookupOrd(ord);
   assert result.isValid();
   return result;
 }
Esempio n. 6
0
 @Override
 public BytesRef term() throws IOException {
   assertThread("Terms enums", creationThread);
   assert state == State.POSITIONED : "term() called on unpositioned TermsEnum";
   BytesRef ret = super.term();
   assert ret == null || ret.isValid();
   return ret;
 }
Esempio n. 7
0
 @Override
 public SeekStatus seekCeil(BytesRef term) throws IOException {
   assertThread("Terms enums", creationThread);
   assert term.isValid();
   SeekStatus result = super.seekCeil(term);
   if (result == SeekStatus.END) {
     state = State.UNPOSITIONED;
   } else {
     state = State.POSITIONED;
   }
   return result;
 }
Esempio n. 8
0
 // TODO: we should separately track if we are 'at the end' ?
 // someone should not call next() after it returns null!!!!
 @Override
 public BytesRef next() throws IOException {
   assertThread("Terms enums", creationThread);
   assert state == State.INITIAL || state == State.POSITIONED
       : "next() called on unpositioned TermsEnum";
   BytesRef result = super.next();
   if (result == null) {
     state = State.UNPOSITIONED;
   } else {
     assert result.isValid();
     state = State.POSITIONED;
   }
   return result;
 }
Esempio n. 9
0
 @Override
 public boolean seekExact(BytesRef text) throws IOException {
   assertThread("Terms enums", creationThread);
   assert text.isValid();
   boolean result;
   if (delegateOverridesSeekExact) {
     result = in.seekExact(text);
   } else {
     result = super.seekExact(text);
   }
   if (result) {
     state = State.POSITIONED;
   } else {
     state = State.UNPOSITIONED;
   }
   return result;
 }
Esempio n. 10
0
 @Override
 public BytesRef getMax() throws IOException {
   BytesRef v = in.getMax();
   assert v == null || v.isValid();
   return v;
 }