/** * Decrement the reference count of the given {@link DocValuesProducer} * generations. */ synchronized void decRef(List<Long> dvProducersGens) throws IOException { IOUtils.applyToAll(dvProducersGens, gen -> { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); assert dvp != null : "gen=" + gen; dvp.decRef(); }); } }
/** Returns the {@link DocValuesProducer} for the given generation. */ synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, Directory dir, FieldInfos infos) throws IOException { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); if (dvp == null) { dvp = newDocValuesProducer(si, dir, gen, infos); assert dvp != null; genDVProducers.put(gen, dvp); } else { dvp.incRef(); } return dvp.get(); }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** Returns the {@link DocValuesProducer} for the given generation. */ synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, Directory dir, FieldInfos infos) throws IOException { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); if (dvp == null) { dvp = newDocValuesProducer(si, dir, gen, infos); assert dvp != null; genDVProducers.put(gen, dvp); } else { dvp.incRef(); } return dvp.get(); }
/** * Decrement the reference count of the given {@link DocValuesProducer} * generations. */ synchronized void decRef(List<Long> dvProducersGens) throws IOException { IOUtils.applyToAll(dvProducersGens, gen -> { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); assert dvp != null : "gen=" + gen; dvp.decRef(); }); } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** Returns the {@link DocValuesProducer} for the given generation. */ synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, Directory dir, FieldInfos infos) throws IOException { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); if (dvp == null) { dvp = newDocValuesProducer(si, dir, gen, infos); assert dvp != null; genDVProducers.put(gen, dvp); } else { dvp.incRef(); } return dvp.get(); }
/** * Decrement the reference count of the given {@link DocValuesProducer} * generations. */ synchronized void decRef(List<Long> dvProducersGens) throws IOException { Throwable t = null; for (Long gen : dvProducersGens) { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); assert dvp != null : "gen=" + gen; try { dvp.decRef(); } catch (Throwable th) { if (t != null) { t = th; } } } if (t != null) { IOUtils.reThrow(t); } } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** Returns the {@link DocValuesProducer} for the given generation. */ synchronized DocValuesProducer getDocValuesProducer(long gen, SegmentCommitInfo si, Directory dir, FieldInfos infos) throws IOException { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); if (dvp == null) { dvp = newDocValuesProducer(si, dir, gen, infos); assert dvp != null; genDVProducers.put(gen, dvp); } else { dvp.incRef(); } return dvp.get(); }
/** * Decrement the reference count of the given {@link DocValuesProducer} * generations. */ synchronized void decRef(List<Long> dvProducersGens) throws IOException { Throwable t = null; for (Long gen : dvProducersGens) { RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); assert dvp != null : "gen=" + gen; try { dvp.decRef(); } catch (Throwable th) { if (t != null) { t = th; } } } if (t != null) { IOUtils.reThrow(t); } } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }