public DocumentsWriterPerThread(Directory directory, DocumentsWriter parent, FieldInfos.Builder fieldInfos, IndexingChain indexingChain) { this.directoryOrig = directory; this.directory = new TrackingDirectoryWrapper(directory); this.parent = parent; this.fieldInfos = fieldInfos; this.writer = parent.indexWriter; this.infoStream = parent.infoStream; this.codec = parent.codec; this.docState = new DocState(this, infoStream); this.docState.similarity = parent.indexWriter.getConfig().getSimilarity(); bytesUsed = Counter.newCounter(); byteBlockAllocator = new DirectTrackingAllocator(bytesUsed); pendingDeletes = new BufferedDeletes(); intBlockAllocator = new IntBlockAllocator(bytesUsed); initialize(); // this should be the last call in the ctor // it really sucks that we need to pull this within the ctor and pass this ref to the chain! consumer = indexingChain.getChain(this); }
public BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) { this.fieldInfo = fieldInfo; this.pool = new ByteBlockPool(new DirectTrackingAllocator(iwBytesUsed)); this.lengths = new AppendingLongBuffer(); }