Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 911561050F for ; Tue, 6 Jan 2015 15:36:00 +0000 (UTC) Received: (qmail 99694 invoked by uid 500); 6 Jan 2015 15:35:57 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 99659 invoked by uid 500); 6 Jan 2015 15:35:57 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 99649 invoked by uid 99); 6 Jan 2015 15:35:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 15:35:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [74.125.82.176] (HELO mail-we0-f176.google.com) (74.125.82.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 15:35:32 +0000 Received: by mail-we0-f176.google.com with SMTP id w61so9823233wes.7 for ; Tue, 06 Jan 2015 07:34:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=XflHhVQxTSjXOeB8Lwj78bMZe49bVTC/iFl3bdG8ZkI=; b=dBjy7lqEPRmGFa6a2yvmmxIcRN28qDNx3SrVYLWaCcgVjSqyQjfKlg/A0rb1q4DFLw mTb3eaQyRprtXGMu4ADVT/9ZHxAwdPjcj56EjJmpbzCWMqttfWDH9cdpNUUhlka15kEC h9BIEZb2xrBuBmdp64z49xaz4tpyOo2dpHmzXf1qIwasB6xiK6ii9fnzCEdI8LcdLVLw tH35EK3TEQdUkV4RwHaBYF5Jz5ijd8JM4NrbZFahgofu6Yw60IVE1ZlZbp30jLxKgtmg SEa2hbJIjEiFhWM7Nd3FSjW7Dqc8cSFZou4yrRxoVWZZPG+Lq1GQ5rkJpTHSZldvDLDU bH/g== X-Gm-Message-State: ALoCoQmAiaEypMQlzceHyyjOtPMJhDDQ0hEEwZCnZwsCok9EJr7q+4PwsLrplq2oByzQ/yV9JdIs MIME-Version: 1.0 X-Received: by 10.180.103.6 with SMTP id fs6mr37184491wib.11.1420558464582; Tue, 06 Jan 2015 07:34:24 -0800 (PST) Received: by 10.27.128.212 with HTTP; Tue, 6 Jan 2015 07:34:24 -0800 (PST) X-Originating-IP: [73.55.186.150] In-Reply-To: <20150106082839.9D52EC34F21@webmail.sinamail.sina.com.cn> References: <20150106082839.9D52EC34F21@webmail.sinamail.sina.com.cn> Date: Tue, 6 Jan 2015 09:34:24 -0600 Message-ID: Subject: Re: Is it possible to implement a interface to replace a row in cassandra using cassandra.thrift? From: Ryan Svihla To: user@cassandra.apache.org, yhqruc@sina.com Content-Type: multipart/alternative; boundary=f46d0434bfc2aa219f050bfd8a96 X-Virus-Checked: Checked by ClamAV on apache.org --f46d0434bfc2aa219f050bfd8a96 Content-Type: text/plain; charset=UTF-8 replies inline On Tue, Jan 6, 2015 at 2:28 AM, wrote: > Hi, all: > > I use cassandra.thrift to implement a replace row interface in this > way: > > First use batch_mutate to delete that row, then use batch_mutate to > insert a new row. > > I always find that after call this interface, the row is not exist. > > > Then I doubt that it is the problem caused by the deletion, because > the deleteion has a timestamp set by the client. > > Maybe the time is not so sync between the client and cassandra server > (1 or more seconds diff). > It's a distributed database so time synchronization really really matters so use NTP, however if you're using client side timestamps on both the insert and the delete it's not going to matter for that use case > > > How to solve this?? Is it possible to implement a interface to > replace a row in cassandra.???\ > yeah all updates are this way. Inserts are actually "UPSERTS" and you can go ahead and do two updates instead of insert, delete, update. > > > Thanks. > > -- Thanks, Ryan Svihla --f46d0434bfc2aa219f050bfd8a96 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
replies inline

On Tue, Jan 6, 2015 at 2:28 AM, <yhqruc@sina.com> wrote:

Hi, all:

=C2=A0=C2=A0= =C2=A0 I use cassandra.thrift to implement a replace row interface in this = way:

=C2=A0 =C2=A0 First use batch_mutate to delete that row, then us= e batch_mutate to insert a new row.

=C2=A0=C2=A0=C2=A0 I always find = that after call this interface, the row is not exist.


=C2= =A0=C2=A0=C2=A0 Then I doubt that it is the problem caused by the deletion,= because the deleteion has a timestamp set by the client.

=C2=A0=C2= =A0=C2=A0 Maybe the time is not so sync between the client and cassandra se= rver (1 or more seconds diff).


It's= a distributed database so time synchronization really really matters so us= e NTP, however if you're using client side timestamps on both the inser= t and the delete it's not going to matter for that use case



=C2=A0=C2=A0=C2=A0 How to= solve this?? Is it possible to implement a=C2=A0 interface to replace a ro= w in cassandra.???\


yeah all updates ar= e this way. Inserts are actually "UPSERTS" and you can go ahead a= nd do two updates instead of insert, delete, update.=C2=A0



Thanks.




--

Thanks,

Ryan = Svihla

--f46d0434bfc2aa219f050bfd8a96--