Java 类org.apache.lucene.util.MutableBits 实例源码

项目:lams    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:lams    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:search    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRefBuilder scratch = new BytesRefBuilder();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    SimpleTextUtil.writeChecksum(out, scratch);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:search    文件:CrankyLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  if (random.nextInt(100) == 0) {
    throw new IOException("Fake IOException from LiveDocsFormat.writeLiveDocs()");
  }
  delegate.writeLiveDocs(bits, dir, info, newDelCount, context);
}
项目:search    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:search    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:NYBC    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentInfoPerCommit info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRef scratch = new BytesRef();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:NYBC    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentInfoPerCommit info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:NYBC    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentInfoPerCommit segmentInfo, FieldInfos fieldInfos,
                       BufferedDeletes segmentDeletes, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentDeletes = segmentDeletes != null && segmentDeletes.any() ? new FrozenBufferedDeletes(segmentDeletes, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:read-open-source-code    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:read-open-source-code    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRef scratch = new BytesRef();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:read-open-source-code    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:read-open-source-code    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:read-open-source-code    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRef scratch = new BytesRef();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:read-open-source-code    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:read-open-source-code    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:read-open-source-code    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRefBuilder scratch = new BytesRefBuilder();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    SimpleTextUtil.writeChecksum(out, scratch);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:read-open-source-code    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:Maskana-Gestor-de-Conocimiento    文件:SimpleTextLiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  BitSet set = ((SimpleTextBits) bits).bits;
  int size = bits.length();
  BytesRef scratch = new BytesRef();

  String fileName = IndexFileNames.fileNameFromGeneration(info.info.name, LIVEDOCS_EXTENSION, info.getNextDelGen());
  IndexOutput out = null;
  boolean success = false;
  try {
    out = dir.createOutput(fileName, context);
    SimpleTextUtil.write(out, SIZE);
    SimpleTextUtil.write(out, Integer.toString(size), scratch);
    SimpleTextUtil.writeNewline(out);

    for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) { 
      SimpleTextUtil.write(out, DOC);
      SimpleTextUtil.write(out, Integer.toString(i), scratch);
      SimpleTextUtil.writeNewline(out);
    }

    SimpleTextUtil.write(out, END);
    SimpleTextUtil.writeNewline(out);
    success = true;
  } finally {
    if (success) {
      IOUtils.close(out);
    } else {
      IOUtils.closeWhileHandlingException(out);
    }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:Lucene40LiveDocsFormat.java   
@Override
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException {
  String filename = IndexFileNames.fileNameFromGeneration(info.info.name, DELETES_EXTENSION, info.getNextDelGen());
  final BitVector liveDocs = (BitVector) bits;
  assert liveDocs.count() == info.info.getDocCount() - info.getDelCount() - newDelCount;
  assert liveDocs.length() == info.info.getDocCount();
  liveDocs.write(dir, filename, context);
}
项目:Maskana-Gestor-de-Conocimiento    文件:DocumentsWriterPerThread.java   
private FlushedSegment(SegmentCommitInfo segmentInfo, FieldInfos fieldInfos,
                       BufferedUpdates segmentUpdates, MutableBits liveDocs, int delCount) {
  this.segmentInfo = segmentInfo;
  this.fieldInfos = fieldInfos;
  this.segmentUpdates = segmentUpdates != null && segmentUpdates.any() ? new FrozenBufferedUpdates(segmentUpdates, true) : null;
  this.liveDocs = liveDocs;
  this.delCount = delCount;
}
项目:lams    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  BitVector bitVector = new BitVector(size);
  bitVector.invertAll();
  return bitVector;
}
项目:lams    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  final BitVector liveDocs = (BitVector) existing;
  return liveDocs.clone();
}
项目:lams    文件:LiveDocsFormat.java   
/** Creates a new MutableBits, with all bits set, for the specified size. */
public abstract MutableBits newLiveDocs(int size) throws IOException;
项目:lams    文件:LiveDocsFormat.java   
/** Creates a new mutablebits of the same bits set and size of existing. */
public abstract MutableBits newLiveDocs(Bits existing) throws IOException;
项目:search    文件:SimpleTextLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  return new SimpleTextMutableBits(size);
}
项目:search    文件:SimpleTextLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  final SimpleTextBits bits = (SimpleTextBits) existing;
  return new SimpleTextMutableBits((BitSet)bits.bits.clone(), bits.size);
}
项目:search    文件:CrankyLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  return delegate.newLiveDocs(size);
}
项目:search    文件:CrankyLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  return delegate.newLiveDocs(existing);
}
项目:search    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  BitVector bitVector = new BitVector(size);
  bitVector.invertAll();
  return bitVector;
}
项目:search    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  final BitVector liveDocs = (BitVector) existing;
  return liveDocs.clone();
}
项目:search    文件:LiveDocsFormat.java   
/** Creates a new MutableBits, with all bits set, for the specified size. */
public abstract MutableBits newLiveDocs(int size) throws IOException;
项目:search    文件:LiveDocsFormat.java   
/** Creates a new mutablebits of the same bits set and size of existing. */
public abstract MutableBits newLiveDocs(Bits existing) throws IOException;
项目:NYBC    文件:SimpleTextLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  return new SimpleTextMutableBits(size);
}
项目:NYBC    文件:SimpleTextLiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  final SimpleTextBits bits = (SimpleTextBits) existing;
  return new SimpleTextMutableBits((BitSet)bits.bits.clone(), bits.size);
}
项目:NYBC    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  BitVector bitVector = new BitVector(size);
  bitVector.invertAll();
  return bitVector;
}
项目:NYBC    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(Bits existing) throws IOException {
  final BitVector liveDocs = (BitVector) existing;
  return liveDocs.clone();
}
项目:NYBC    文件:LiveDocsFormat.java   
/** Creates a new MutableBits, with all bits set, for the specified size. */
public abstract MutableBits newLiveDocs(int size) throws IOException;
项目:NYBC    文件:LiveDocsFormat.java   
/** Creates a new mutablebits of the same bits set and size of existing. */
public abstract MutableBits newLiveDocs(Bits existing) throws IOException;
项目:read-open-source-code    文件:Lucene40LiveDocsFormat.java   
@Override
public MutableBits newLiveDocs(int size) throws IOException {
  BitVector bitVector = new BitVector(size);
  bitVector.invertAll();
  return bitVector;
}