/// <summary>
        /// Writes the policy.
        /// </summary>
        public static void WritePolicy(IBinaryRawWriter writer, IExpiryPolicy plc)
        {
            Debug.Assert(plc != null);
            Debug.Assert(writer != null);

            writer.WriteLong(ConvertDuration(plc.GetExpiryForCreate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForUpdate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForAccess()));
        }
        /// <summary>
        /// Writes the policy.
        /// </summary>
        public static void WritePolicy(IBinaryRawWriter writer, IExpiryPolicy plc)
        {
            Debug.Assert(plc != null);
            Debug.Assert(writer != null);

            writer.WriteLong(ConvertDuration(plc.GetExpiryForCreate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForUpdate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForAccess()));
        }
Beispiel #3
0
        /** <inheritDoc /> */
        public ICache <TK, TV> WithExpiryPolicy(IExpiryPolicy plc)
        {
            IgniteArgumentCheck.NotNull(plc, "plc");

            long create = ConvertDuration(plc.GetExpiryForCreate());
            long update = ConvertDuration(plc.GetExpiryForUpdate());
            long access = ConvertDuration(plc.GetExpiryForAccess());

            IUnmanagedTarget cache0 = UU.CacheWithExpiryPolicy(Target, create, update, access);

            return(new CacheImpl <TK, TV>(_ignite, cache0, Marshaller, _flagSkipStore, _flagKeepBinary, _flagAsync, _flagNoRetries));
        }
Beispiel #4
0
        /** <inheritDoc /> */
        public ICache <TK, TV> WithExpiryPolicy(IExpiryPolicy plc)
        {
            IgniteArgumentCheck.NotNull(plc, "plc");

            long create = ConvertDuration(plc.GetExpiryForCreate());
            long update = ConvertDuration(plc.GetExpiryForUpdate());
            long access = ConvertDuration(plc.GetExpiryForAccess());

            IUnmanagedTarget cache0 = DoOutOpObject((int)CacheOp.WithExpiryPolicy, w =>
            {
                w.WriteLong(create);
                w.WriteLong(update);
                w.WriteLong(access);
            });

            return(new CacheImpl <TK, TV>(_ignite, cache0, Marshaller, _flagSkipStore, _flagKeepBinary, _flagNoRetries));
        }