public BytesRefHash(ByteBlockPool pool, int capacity, BytesStartArray bytesStartArray) {hashSize = capacity;hashHalfSize = hashSize >> 1;hashMask = hashSize - 1;this.pool = pool;ids = new int[hashSize];Arrays.fill(ids, -1);this.bytesStartArray = bytesStartArray;bytesStart = bytesStartArray.init();bytesUsed = bytesStartArray.bytesUsed() == null? Counter.newCounter() : bytesStartArray.bytesUsed();bytesUsed.addAndGet(hashSize * Integer.BYTES);}
public BytesRefHash(ByteBlockPool pool, int capacity, BytesStartArray bytesStartArray){hashSize = capacity;hashHalfSize = hashSize >> 1;hashMask = hashSize - 1;this.pool = pool;ids = new int[hashSize];Arrays.Fill(ids, -1);this.bytesStartArray = bytesStartArray;bytesStart = bytesStartArray.Init();bytesUsed = bytesStartArray.BytesUsed() == null ? Counter.NewCounter() : bytesStartArray.BytesUsed();bytesUsed.AddAndGet(hashSize * RamUsageEstimator.NUM_BYTES_INT32);}