Пример #1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            FlushInfo other = (FlushInfo)obj;

            if (EstimatedSegmentSize != other.EstimatedSegmentSize)
            {
                return(false);
            }
            if (NumDocs != other.NumDocs)
            {
                return(false);
            }
            return(true);
        }
Пример #2
0
 private IOContext(bool readOnce)
 {
     this.Context   = Context_e.READ;
     this.MergeInfo = null;
     this.ReadOnce  = readOnce;
     this.FlushInfo = null;
 }
Пример #3
0
 /// <summary>
 /// this constructor is used to initialize a <seealso cref="IOContext"/> instance with a new value for the readOnce variable. </summary>
 /// <param name="ctxt"> <seealso cref="IOContext"/> object whose information is used to create the new instance except the readOnce variable. </param>
 /// <param name="readOnce"> The new <seealso cref="IOContext"/> object will use this value for readOnce.  </param>
 public IOContext(IOContext ctxt, bool readOnce)
 {
     this.Context   = ctxt.Context;
     this.MergeInfo = ctxt.MergeInfo;
     this.FlushInfo = ctxt.FlushInfo;
     this.ReadOnce  = readOnce;
 }
Пример #4
0
 /// <summary>
 /// this constructor is used to initialize a <seealso cref="IOContext"/> instance with a new value for the readOnce variable. </summary>
 /// <param name="ctxt"> <seealso cref="IOContext"/> object whose information is used to create the new instance except the readOnce variable. </param>
 /// <param name="readOnce"> The new <seealso cref="IOContext"/> object will use this value for readOnce.  </param>
 public IOContext(IOContext ctxt, bool readOnce)
 {
     this.Context = ctxt.Context;
     this.MergeInfo = ctxt.MergeInfo;
     this.FlushInfo = ctxt.FlushInfo;
     this.ReadOnce = readOnce;
 }
Пример #5
0
 private IOContext(bool readOnce)
 {
     this.Context = Context_e.READ;
     this.MergeInfo = null;
     this.ReadOnce = readOnce;
     this.FlushInfo = null;
 }
Пример #6
0
 public IOContext(FlushInfo flushInfo)
 {
     Debug.Assert(flushInfo != null);
     this.Context   = Context_e.FLUSH;
     this.MergeInfo = null;
     this.ReadOnce  = false;
     this.FlushInfo = flushInfo;
 }
Пример #7
0
 public IOContext(FlushInfo flushInfo)
 {
     if (Debugging.AssertsEnabled) Debugging.Assert(flushInfo != null);
     this.Context = UsageContext.FLUSH;
     this.MergeInfo = null;
     this.ReadOnce = false;
     this.FlushInfo = flushInfo;
 }
Пример #8
0
 public IOContext(FlushInfo flushInfo)
 {
     Debug.Assert(flushInfo != null);
     this.Context = UsageContext.FLUSH;
     this.MergeInfo = null;
     this.ReadOnce = false;
     this.FlushInfo = flushInfo;
 }
Пример #9
0
 private IOContext(Context_e context, MergeInfo mergeInfo)
 {
     Debug.Assert(context != Context_e.MERGE || mergeInfo != null, "MergeInfo must not be null if context is MERGE");
     Debug.Assert(context != Context_e.FLUSH, "Use IOContext(FlushInfo) to create a FLUSH IOContext");
     this.Context   = context;
     this.ReadOnce  = false;
     this.MergeInfo = mergeInfo;
     this.FlushInfo = null;
 }
Пример #10
0
 public override int GetHashCode()
 {
     const int prime = 31;
     int result = 1;
     result = prime * result + /*((Context is null) ? 0 :*/ Context.GetHashCode()/*)*/; // LUCENENET NOTE: Enum can never be null in .NET
     result = prime * result + ((FlushInfo is null) ? 0 : FlushInfo.GetHashCode());
     result = prime * result + ((MergeInfo is null) ? 0 : MergeInfo.GetHashCode());
     result = prime * result + (ReadOnce ? 1231 : 1237);
     return result;
 }
Пример #11
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            IOContext other = (IOContext)obj;

            if (Context != other.Context)
            {
                return(false);
            }
            if (FlushInfo == null)
            {
                if (other.FlushInfo != null)
                {
                    return(false);
                }
            }
            else if (!FlushInfo.Equals(other.FlushInfo))
            {
                return(false);
            }
            if (MergeInfo == null)
            {
                if (other.MergeInfo != null)
                {
                    return(false);
                }
            }
            else if (!MergeInfo.Equals(other.MergeInfo))
            {
                return(false);
            }
            if (ReadOnce != other.ReadOnce)
            {
                return(false);
            }
            return(true);
        }
Пример #12
0
 private IOContext(UsageContext? context, MergeInfo mergeInfo)
 {
     Debug.Assert(context != UsageContext.MERGE || mergeInfo != null, "MergeInfo must not be null if context is MERGE");
     Debug.Assert(context != UsageContext.FLUSH, "Use IOContext(FlushInfo) to create a FLUSH IOContext");
     this.Context = context;
     this.ReadOnce = false;
     this.MergeInfo = mergeInfo;
     this.FlushInfo = null;
 }