/// <exception cref="System.Exception"></exception>
        public virtual bool TryLock(K key, long timeout, TimeUnit timeunit, long leaseTime, TimeUnit leaseUnit)
        {
            ThrowExceptionIfNull(key);

            var keyData = ToData(key);
            var request = MultiMapTryLockCodec.EncodeRequest(GetName(), keyData, ThreadUtil.GetThreadId(), leaseUnit.ToMillis(leaseTime),
                                                             timeunit.ToMillis(timeout));

            return(Invoke(request, keyData, m => MultiMapTryLockCodec.DecodeResponse(m).response));
        }
        /// <exception cref="System.Exception"></exception>
        public virtual bool TryLock(TKey key, long timeout, TimeUnit timeunit, long leaseTime, TimeUnit leaseUnit)
        {
            ValidationUtil.ThrowExceptionIfNull(key);

            var keyData = ToData(key);
            var request = MultiMapTryLockCodec.EncodeRequest(Name, keyData, ThreadUtil.GetThreadId(),
                                                             leaseUnit.ToMillis(leaseTime),
                                                             timeunit.ToMillis(timeout), _lockReferenceIdGenerator.GetNextReferenceId());

            return(Invoke(request, keyData, m => MultiMapTryLockCodec.DecodeResponse(m).Response));
        }