From user-return-26866-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon Aug 19 07:00:51 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id DE357180665 for ; Mon, 19 Aug 2019 09:00:50 +0200 (CEST) Received: (qmail 26416 invoked by uid 500); 19 Aug 2019 07:00:49 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 26406 invoked by uid 99); 19 Aug 2019 07:00:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2019 07:00:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2596DC13A7 for ; Mon, 19 Aug 2019 07:00:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.801 X-Spam-Level: * X-Spam-Status: No, score=1.801 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id UkTg8hg2en7y for ; Mon, 19 Aug 2019 07:00:44 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.173; helo=mail-lj1-f173.google.com; envelope-from=wrongite@gmail.com; receiver= Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id F1322BC7A9 for ; Mon, 19 Aug 2019 07:00:43 +0000 (UTC) Received: by mail-lj1-f173.google.com with SMTP id l1so687390lji.12 for ; Mon, 19 Aug 2019 00:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=TmACnioGLWJj3OPX4Fl/KqnX3pf+HW+wNAq/WjuW1eo=; b=hSZVD5bDTMrFcSTqVBvejPNQc7COa+yEjkyK+gXSxhQvQt+XBa2hBkUCaV1HX3pblb 78Cqip0SEUAr5ZQHBpZDjLEcXQrfusIldEbA8SQEvnpLpuDfRwo+6MndYyYqxEZIvNmj YJgEB4ZfGicNhZ0ygmFri6b22XTV7JOMcQeVnFb20gERg2kY6qSvMNP7wRKlLIEHVvfJ Knn6bvExFSMessod9p4dNXHb3x8p5Ed9a+gs/rsgeimtS6TUVIe2WjLFeOEIuoNW06EC dN6MdhYb3vOxtxu7ATTfYI8l0QxiqWvKyAOjFKsvCHPlRwO2hhGAlrlv91SlOKt83yjI kQ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=TmACnioGLWJj3OPX4Fl/KqnX3pf+HW+wNAq/WjuW1eo=; b=ooP/JPPNSCiNV6yAeUASLs/HfcpA27e8JMtBI/aK7bWnGXHBEPi0JWO4uM1CeBa6eP 44oV5bKPCsmlaJG6HLHIeNLNNz/7/uNshYjDhW0ajWGbwK6MVoFxKdJIF1YmN3IzFPgj 73N0XHTRMtpf4ImXqPUA7kVDZuBR5I+DGdtZ/0ovn35fJtISyD4DPX3CdIa0EHrCFS/v OUBB8bCy0s6YNDrETMpkJ0LfSdw3t20XWiMEO5dssrG9KGX0wb2+2Hasrb09UUF8nkON cndRk0t42pkTF5txkOQrzGafXGxbVatyKBh4N8dfABuKkmjfGmkhv2IYn9YV8iRJpQ71 /CIg== X-Gm-Message-State: APjAAAU+XZOf5RGHMURgpHuFc/c21udyEyDKVqv5XHXswEJmQe1ix8OC YBFwmDs9i0ToxYOPAiILboNu5UHFytnwhhaImwr1d0wND8M= X-Google-Smtp-Source: APXvYqysGPR5VUnaXxAKgL+rsoY9TfGe7YWPOeBjzNtpqELlFiY1ORsWLs+ihrkymt98TK21O0fDqO3qeYImeTv9xrw= X-Received: by 2002:a2e:5c5:: with SMTP id 188mr11970935ljf.166.1566198042093; Mon, 19 Aug 2019 00:00:42 -0700 (PDT) MIME-Version: 1.0 References: <7aaa5bdb95e34dc983e5ee3785116b6f@tudor.com> In-Reply-To: <7aaa5bdb95e34dc983e5ee3785116b6f@tudor.com> From: nattapon Date: Mon, 19 Aug 2019 14:00:05 +0700 Message-ID: Subject: Re: Does IgniteCache.containsKey lock the key in a Transaction? To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="000000000000f26f9f059072e561" --000000000000f26f9f059072e561 Content-Type: text/plain; charset="UTF-8" Hi Yohan, There is IgniteCache.lock(key) method described in https://apacheignite.readme.io/docs/distributed-locks . Is it suited your requirement? IgniteCache cache = ignite.cache("myCache"); // Create a lock for the given key Lock lock = cache.lock("keyLock"); try { // Acquire the lock lock.lock(); cache.put("Hello", 11); cache.put("World", 22); } finally { // Release the lock lock.unlock(); } Regards, Nattapon On Fri, Aug 16, 2019 at 5:23 PM Yohan Fernando wrote: > Hi All, Does IgniteCache.containsKey() lock the key in a Transaction > similar to IgniteCache.get() ? Basically I want a lightweight call to lock > the key without having to Serialize objects from each node within a > Transaction. > > > > > > _________________________________________________________ > > This email, its contents, and any attachments transmitted with it are > intended only for the addressee(s) and may be confidential and legally > privileged. We do not waive any confidentiality by misdelivery. If you have > received this email in error, please notify the sender immediately and > delete it. You should not copy it, forward it or otherwise use the > contents, attachments or information in any way. Any liability for viruses > is excluded to the fullest extent permitted by law. > > Tudor Capital Europe LLP (TCE) is authorised and regulated by The > Financial Conduct Authority (the FCA). TCE is registered as a limited > liability partnership in England and Wales No: OC340673 with its registered > office at 10 New Burlington Street, London, W1S 3BE, United Kingdom > --000000000000f26f9f059072e561 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Yohan,

There is IgniteCache.lock(key= ) method described in=C2=A0https://apacheignite.readme.io/docs/distributed-locks= =C2=A0. Is it suited your requirement?

IgniteCache&l= t;String, Integer> cache =3D ignite.cache("myCache");

/= / Create a lock for the given key
Lock lock =3D cache.lock("keyLock= ");
try {
=C2=A0 =C2=A0 // Acquire the lock
=C2=A0 =C2=A0 loc= k.lock();
=C2=A0
=C2=A0 =C2=A0 cache.put("Hello", 11);
= =C2=A0 =C2=A0 cache.put("World", 22);
}
finally {
=C2=A0= =C2=A0 // Release the lock
=C2=A0 =C2=A0 lock.unlock();
}
<= /div>

Regards,
Nattapon

On Fri, Aug 16, 2= 019 at 5:23 PM Yohan Fernando <Yohan.Fernando@tudor.com> wrote:

Hi All, Does=C2=A0 IgniteCache.containsKey() lock th= e key in a Transaction similar to IgniteCache.get() ? Basically I want a li= ghtweight call to lock the key without having to Serialize objects from eac= h node within a Transaction.

=C2=A0

=C2=A0

_________________________________________________________

This email, its contents, and any attachments transmitted with it are in= tended only for the addressee(s) and may be confidential and legally privil= eged. We do not waive any confidentiality by misdelivery. If you have recei= ved this email in error, please notify the sender immediately and delete it. You should not copy it, forwa= rd it or otherwise use the contents, attachments or information in any way.= Any liability for viruses is excluded to the fullest extent permitted by l= aw.

Tudor Capital Europe LLP (TCE) is authorised and regulated by The Financ= ial Conduct Authority (the FCA). TCE is registered as a limited liability p= artnership in England and Wales No: OC340673 with its registered office at = 10 New Burlington Street, London, W1S 3BE, United Kingdom

--000000000000f26f9f059072e561--