/// <summary>
 /// Decrement the reference count of the given <see cref="DocValuesProducer"/>
 /// generations.
 /// </summary>
 internal void DecRef(IList <long?> dvProducersGens)
 {
     lock (this)
     {
         Exception t = null;
         foreach (long?gen in dvProducersGens)
         {
             RefCount <DocValuesProducer> dvp = genDVProducers[gen];
             if (Debugging.AssertsEnabled)
             {
                 Debugging.Assert(dvp != null, "gen={0}", gen);
             }
             try
             {
                 dvp.DecRef();
             }
             catch (Exception th) when(th.IsThrowable())
             {
                 if (t != null)
                 {
                     t = th;
                 }
             }
         }
         if (t != null)
         {
             IOUtils.ReThrow(t);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Decrement the reference count of the given <see cref="DocValuesProducer"/>
 /// generations.
 /// </summary>
 internal void DecRef(IList <long?> dvProducersGens)
 {
     lock (this)
     {
         Exception t = null;
         foreach (long?gen in dvProducersGens)
         {
             RefCount <DocValuesProducer> dvp = genDVProducers[gen];
             Debug.Assert(dvp != null, "gen=" + gen);
             try
             {
                 dvp.DecRef();
             }
             catch (Exception th)
             {
                 if (t != null)
                 {
                     t = th;
                 }
             }
         }
         if (t != null)
         {
             IOUtils.ReThrow(t);
         }
     }
 }
        private void  DecRef(System.String fileName)
        {
            RefCount rc = GetRefCount(fileName);

            if (infoStream != null && VERBOSE_REF_COUNTS)
            {
                Message("  DecRef \"" + fileName + "\": pre-decr count is " + rc.count);
            }
            if (0 == rc.DecRef())
            {
                // This file is no longer referenced by any past
                // commit points nor by the in-memory SegmentInfos:
                DeleteFile(fileName);
                refCounts.Remove(fileName);
            }
        }
        internal void DecRef(string fileName)
        {
            Debug.Assert(IsLocked);
            RefCount rc = GetRefCount(fileName);

            if (infoStream.IsEnabled("IFD"))
            {
                if (VERBOSE_REF_COUNTS)
                {
                    infoStream.Message("IFD", "  DecRef \"" + fileName + "\": pre-decr count is " + rc.count);
                }
            }
            if (0 == rc.DecRef())
            {
                // this file is no longer referenced by any past
                // commit points nor by the in-memory SegmentInfos:
                DeleteFile(fileName);
                refCounts.Remove(fileName);
            }
        }