Exemplo n.º 1
0
  private void freeMem() {
    if (isShutDown) {
      return;
    }
    isShutDown = true;

    if (this.index != null) {
      INT_BUFFER.free(this.index);
    }

    if (this.indexshort != null) {
      SHORT_BUFFER.free(this.indexshort);
    }

    if (this.indexbyte != null) {
      BYTE_BUFFER.free(this.indexbyte);
    }

    if (this.termValueLong != null) {
      LONG_BUFFER.free(this.termValueLong);
    }
    if (this.termValueDouble != null) {
      DOUBLE_BUFFER.free(this.termValueDouble);
    }
  }
Exemplo n.º 2
0
 public void setFinalIndex(int nullTerm, int finalTerm) {
   this.nullTermNum = nullTerm;
   int size = this.index.getSize();
   if (finalTerm < Byte.MAX_VALUE) {
     this.indexDatatype = UnInvertedFieldUtils.TypeIndex.d_byte;
     this.indexbyte = BYTE_BUFFER.calloc(size, BigReUsedBuffer.BYTE_CREATE, (byte) nullTerm);
     for (int i = 0; i < size; i++) {
       int t = this.index.get(i);
       if (t >= 0) {
         this.indexbyte.set(i, (byte) t);
       }
     }
     INT_BUFFER.free(this.index);
     this.index = null;
   } else if (finalTerm < Short.MAX_VALUE) {
     this.indexDatatype = UnInvertedFieldUtils.TypeIndex.d_short;
     this.indexshort = SHORT_BUFFER.calloc(size, BigReUsedBuffer.SHORT_CREATE, (short) nullTerm);
     for (int i = 0; i < size; i++) {
       int t = this.index.get(i);
       if (t >= 0) {
         this.indexshort.set(i, (short) t);
       }
     }
     INT_BUFFER.free(this.index);
     this.index = null;
   } else {
     this.indexDatatype = UnInvertedFieldUtils.TypeIndex.d_int;
     ;
     for (int i = 0; i < size; i++) {
       int t = this.index.get(i);
       if (t < 0) {
         this.index.set(i, nullTerm);
       }
     }
   }
 }