You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "satyajit.mandal.barclays.com via user" <us...@ignite.apache.org> on 2023/07/04 11:00:34 UTC

Expiry Policies Ignite cache

Hi  Pavel,

What  does  this  code  mean  as  per  example.  My  requirement  is  that cache  should  expire  based  on  ModifiedTime but  this  below  example  is  not clear?  I  need  cache  to get  expired  lets  say  if  modified  time  is  > 5 days how  that can  be achieved.

https://ignite.apache.org/docs/latest/configuring-caches/expiry-policies




class ExpiryPolicyFactoryImpl : IFactory<IExpiryPolicy>
{
    public IExpiryPolicy CreateInstance()
    {
        return new ExpiryPolicy(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100),
            TimeSpan.FromMilliseconds(100));
    }
}

public static void Example()
{
    var cfg = new CacheConfiguration
    {
        Name = "cache_name",
        ExpiryPolicyFactory = new ExpiryPolicyFactoryImpl()
    };


Regards
Satyajit

Barclays Execution Services Limited registered in England. Registered No. 1767980. Registered office: 1 Churchill Place, London, E14 5HP

Barclays Execution Services Limited provides support and administrative services across Barclays group. Barclays Execution Services Limited is an appointed representative of Barclays Bank UK plc, Barclays Bank plc and Clydesdale Financial Services Limited. Barclays Bank UK plc and Barclays Bank plc are authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. Clydesdale Financial Services Limited is authorised and regulated by the Financial Conduct Authority.

This email and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this email in error, please notify the sender and immediately delete it and any attachments from your system. Do not copy, use, disclose or otherwise act on any part of this email or its attachments.

Internet communications are not guaranteed to be secure or virus-free. The Barclays group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any internet communications by any third party, or from the transmission of any viruses. Replies to this email may be monitored by the Barclays group for operational or business reasons.

Any opinion or other information in this email or its attachments that does not relate to the business of the Barclays group is personal to the sender and is not given or endorsed by the Barclays group.

Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays.

RE: Expiry Policies Ignite cache

Posted by "satyajit.mandal.barclays.com via user" <us...@ignite.apache.org>.
Hi  Stephen,

Could  you  please confirm if  this  is right way for setting  expiry policy  of  Modified time >  5 days  ?


Regards
Satyajit

From: Mandal, Satyajit: IT (PUN)
Sent: Tuesday, July 4, 2023 4:48 PM
To: Pavel Tupitsyn <pt...@apache.org>; user@ignite.apache.org
Subject: RE: Expiry Policies Ignite cache

Hi  Pavel,

Is  this  the  right  syntax for  cache expiry for Modifiiedtime >  5 days ?

  public class CacheExpiryPolicyFactoryImpl : IFactory<IExpiryPolicy>
    {
        public IExpiryPolicy CreateInstance()
        {
            return new ExpiryPolicy(null, TimeSpan.FromDays(5),
              null);
        }
    }

Regards
Satyajit

From: Mandal, Satyajit: IT (PUN)
Sent: Tuesday, July 4, 2023 4:31 PM
To: Pavel Tupitsyn <pt...@apache.org>>; user@ignite.apache.org<ma...@ignite.apache.org>
Subject: Expiry Policies Ignite cache

Hi  Pavel,

What  does  this  code  mean  as  per  example.  My  requirement  is  that cache  should  expire  based  on  ModifiedTime but  this  below  example  is  not clear?  I  need  cache  to get  expired  lets  say  if  modified  time  is  > 5 days how  that can  be achieved.

https://ignite.apache.org/docs/latest/configuring-caches/expiry-policies




class ExpiryPolicyFactoryImpl : IFactory<IExpiryPolicy>
{
    public IExpiryPolicy CreateInstance()
    {
        return new ExpiryPolicy(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100),
            TimeSpan.FromMilliseconds(100));
    }
}

public static void Example()
{
    var cfg = new CacheConfiguration
    {
        Name = "cache_name",
        ExpiryPolicyFactory = new ExpiryPolicyFactoryImpl()
    };


Regards
Satyajit

Barclays Execution Services Limited registered in England. Registered No. 1767980. Registered office: 1 Churchill Place, London, E14 5HP

Barclays Execution Services Limited provides support and administrative services across Barclays group. Barclays Execution Services Limited is an appointed representative of Barclays Bank UK plc, Barclays Bank plc and Clydesdale Financial Services Limited. Barclays Bank UK plc and Barclays Bank plc are authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. Clydesdale Financial Services Limited is authorised and regulated by the Financial Conduct Authority.

This email and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this email in error, please notify the sender and immediately delete it and any attachments from your system. Do not copy, use, disclose or otherwise act on any part of this email or its attachments.

Internet communications are not guaranteed to be secure or virus-free. The Barclays group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any internet communications by any third party, or from the transmission of any viruses. Replies to this email may be monitored by the Barclays group for operational or business reasons.

Any opinion or other information in this email or its attachments that does not relate to the business of the Barclays group is personal to the sender and is not given or endorsed by the Barclays group.

Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays.

RE: Expiry Policies Ignite cache

Posted by "satyajit.mandal.barclays.com via user" <us...@ignite.apache.org>.
Hi  Pavel,

Is  this  the  right  syntax for  cache expiry for Modifiiedtime >  5 days ?

  public class CacheExpiryPolicyFactoryImpl : IFactory<IExpiryPolicy>
    {
        public IExpiryPolicy CreateInstance()
        {
            return new ExpiryPolicy(null, TimeSpan.FromDays(5),
              null);
        }
    }

Regards
Satyajit

From: Mandal, Satyajit: IT (PUN)
Sent: Tuesday, July 4, 2023 4:31 PM
To: Pavel Tupitsyn <pt...@apache.org>; user@ignite.apache.org
Subject: Expiry Policies Ignite cache

Hi  Pavel,

What  does  this  code  mean  as  per  example.  My  requirement  is  that cache  should  expire  based  on  ModifiedTime but  this  below  example  is  not clear?  I  need  cache  to get  expired  lets  say  if  modified  time  is  > 5 days how  that can  be achieved.

https://ignite.apache.org/docs/latest/configuring-caches/expiry-policies




class ExpiryPolicyFactoryImpl : IFactory<IExpiryPolicy>
{
    public IExpiryPolicy CreateInstance()
    {
        return new ExpiryPolicy(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100),
            TimeSpan.FromMilliseconds(100));
    }
}

public static void Example()
{
    var cfg = new CacheConfiguration
    {
        Name = "cache_name",
        ExpiryPolicyFactory = new ExpiryPolicyFactoryImpl()
    };


Regards
Satyajit

Barclays Execution Services Limited registered in England. Registered No. 1767980. Registered office: 1 Churchill Place, London, E14 5HP

Barclays Execution Services Limited provides support and administrative services across Barclays group. Barclays Execution Services Limited is an appointed representative of Barclays Bank UK plc, Barclays Bank plc and Clydesdale Financial Services Limited. Barclays Bank UK plc and Barclays Bank plc are authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. Clydesdale Financial Services Limited is authorised and regulated by the Financial Conduct Authority.

This email and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this email in error, please notify the sender and immediately delete it and any attachments from your system. Do not copy, use, disclose or otherwise act on any part of this email or its attachments.

Internet communications are not guaranteed to be secure or virus-free. The Barclays group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any internet communications by any third party, or from the transmission of any viruses. Replies to this email may be monitored by the Barclays group for operational or business reasons.

Any opinion or other information in this email or its attachments that does not relate to the business of the Barclays group is personal to the sender and is not given or endorsed by the Barclays group.

Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays.