Exemple #1
0
        public static EvictionHint ReadEvcHint(CompactReader reader)
        {
            EvictionHintType expHint = EvictionHintType.Parent;

            expHint = (EvictionHintType)reader.ReadInt16();
            EvictionHint tmpObj = null;

            switch (expHint)
            {
            case EvictionHintType.NULL:
                return(null);

            case EvictionHintType.Parent:
                tmpObj = (EvictionHint)reader.ReadObject();
                return((EvictionHint)tmpObj);

            case EvictionHintType.PriorityEvictionHint:
                PriorityEvictionHint peh = new PriorityEvictionHint();
                ((ICompactSerializable)peh).Deserialize(reader);
                return((EvictionHint)peh);

            default:
                break;
            }
            return(null);
        }
Exemple #2
0
        /// <summary>
        /// Lê um dica de despejo que está serializada no leitor informado.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static EvictionHint ReadEvcHint(CompactReader reader)
        {
            EvictionHintType parent = EvictionHintType.Parent;

            parent = (EvictionHintType)reader.ReadInt16();
            switch (parent)
            {
            case EvictionHintType.NULL:
                return(null);

            case EvictionHintType.Parent:
                return((EvictionHint)reader.ReadObject());

            case EvictionHintType.CounterHint:
                CounterHint hint2 = new CounterHint();
                ((ICompactSerializable)hint2).Deserialize(reader);
                return(hint2);

            case EvictionHintType.TimestampHint:
                TimestampHint hint4 = new TimestampHint();
                ((ICompactSerializable)hint4).Deserialize(reader);
                return(hint4);

            case EvictionHintType.PriorityEvictionHint:
                PriorityEvictionHint hint3 = new PriorityEvictionHint();
                ((ICompactSerializable)hint3).Deserialize(reader);
                return(hint3);
            }
            return(null);
        }
Exemple #3
0
        //#endregion

        public static EvictionHint ReadEvcHint(CompactReader reader, PoolManager poolManager)
        {
            EvictionHintType expHint = EvictionHintType.Parent;

            expHint = (EvictionHintType)reader.ReadInt16();
            EvictionHint tmpObj = null;

            switch (expHint)
            {
            case EvictionHintType.NULL:
                return(null);

            case EvictionHintType.Parent:
                tmpObj = (EvictionHint)reader.ReadObject();
                return(tmpObj);

            case EvictionHintType.CounterHint:
                var ch = CounterHint.Create(poolManager);
                ((ICompactSerializable)ch).Deserialize(reader);
                return(ch);

            case EvictionHintType.PriorityEvictionHint:
                var peh = PriorityEvictionHint.Create(poolManager);
                ((ICompactSerializable)peh).Deserialize(reader);
                return(peh);

            case EvictionHintType.TimestampHint:
                var tsh = TimestampHint.Create(poolManager);
                ((ICompactSerializable)tsh).Deserialize(reader);
                return(tsh);

            default:
                break;
            }
            return(null);
        }
Exemple #4
0
 public override void ResetLeasable()
 {
     _hintType = default(EvictionHintType);
 }
Exemple #5
0
 public void Deserialize(CompactReader reader)
 {
     _hintType = (EvictionHintType)reader.ReadInt16();
 }
Exemple #6
0
 public void Deserialize(CompactReader reader)
 {
     _hintType = (EvictionHintType)reader.ReadInt16();
 }