Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj is 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);
        }
Ejemplo n.º 2
0
 public IOContext(FlushInfo flushInfo)
 {
     Debug.Assert(flushInfo != null);
     this.Context   = UsageContext.FLUSH;
     this.MergeInfo = null;
     this.ReadOnce  = false;
     this.FlushInfo = flushInfo;
 }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            const int prime  = 31;
            int       result = 1;

            result = prime * result + /*((Context == null) ? 0 :*/ Context.GetHashCode() /*)*/; // LUCENENET NOTE: Enum can never be null in .NET
            result = prime * result + ((FlushInfo == null) ? 0 : FlushInfo.GetHashCode());
            result = prime * result + ((MergeInfo == null) ? 0 : MergeInfo.GetHashCode());
            result = prime * result + (ReadOnce ? 1231 : 1237);
            return(result);
        }
Ejemplo n.º 4
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);
        }