Re: simple vs complex cells

2018-01-23 Thread Minh Do
Preetika,

If I am not missing anything, the Cells.reconcile(Cell c1, Cell c2,
int nowInSec)
method is used for both simple and complex cases to
reconcile cells.  It looks like it does take in timestamp into
consideration.  In the complex case, the prepared code needs to lay out
the iterators of cells first before the reconciliation.



On Tue, Jan 23, 2018 at 8:03 PM, Tyagi, Preetika <preetika.ty...@intel.com>
wrote:

> I agree. But this method is probably calculating the deletion time to
> determine the removal strategy for this complex column.
> However, when someone tries to read this complex column and there are
> multiple copies of it in more than one sstables, how the read request will
> determine which complex data is the latest and should be returned to the
> user?
>
> Preetika
>
> -Original Message-
> From: Minh Do [mailto:m...@netflix.com.INVALID]
> Sent: Tuesday, January 23, 2018 5:24 PM
> To: dev@cassandra.apache.org
> Subject: Re: simple vs complex cells
>
> Based on C* 3.x code base, I believe a complex column consists of many
> cells and each cell has its own timestamp.
>
> Then, there is a method to compute the maxTimestamp for a complex column:
>
>
> public long maxTimestamp()
> {
> long timestamp = complexDeletion.markedForDeleteAt();
> for (Cell cell : this)
> timestamp = Math.max(timestamp, cell.timestamp());
> return timestamp;
> }
>
>
> On Tue, Jan 23, 2018 at 4:22 PM, Tyagi, Preetika <preetika.ty...@intel.com
> >
> wrote:
>
> > Hi all,
> >
> > I'm trying to understand the behavior of simple and complex columns in
> > Cassandra.
> > I was looking at UnfilteredSerializer.java, serializeRowBody() checks
> > for a timestamp flag and then only it writes it. In case of
> > writeComplexColumn(), there is no timestamp being written. Also, as
> > per my understanding, a complex column contains several simple columns
> > each of which may or may not have a timestamp associated.
> >
> > My question is if there is no mandatory timestamp for either simple or
> > complex columns, how the data will be merged at the time of  read
> > request based on the timestamp given that there can be more than one
> > copy of the same data in sstables?
> >
> > Also, is it allowed in cql queries to update one or more simple
> > columns within a complex columns? Or the entire complex is updated
> > whenever there is a update query?
> >
> > Thanks,
> > Preetika
> >
> >
>


RE: simple vs complex cells

2018-01-23 Thread Tyagi, Preetika
I agree. But this method is probably calculating the deletion time to determine 
the removal strategy for this complex column.
However, when someone tries to read this complex column and there are multiple 
copies of it in more than one sstables, how the read request will determine 
which complex data is the latest and should be returned to the user?

Preetika

-Original Message-
From: Minh Do [mailto:m...@netflix.com.INVALID] 
Sent: Tuesday, January 23, 2018 5:24 PM
To: dev@cassandra.apache.org
Subject: Re: simple vs complex cells

Based on C* 3.x code base, I believe a complex column consists of many cells 
and each cell has its own timestamp.

Then, there is a method to compute the maxTimestamp for a complex column:


public long maxTimestamp()
{
long timestamp = complexDeletion.markedForDeleteAt();
for (Cell cell : this)
timestamp = Math.max(timestamp, cell.timestamp());
return timestamp;
}


On Tue, Jan 23, 2018 at 4:22 PM, Tyagi, Preetika <preetika.ty...@intel.com>
wrote:

> Hi all,
>
> I'm trying to understand the behavior of simple and complex columns in 
> Cassandra.
> I was looking at UnfilteredSerializer.java, serializeRowBody() checks 
> for a timestamp flag and then only it writes it. In case of 
> writeComplexColumn(), there is no timestamp being written. Also, as 
> per my understanding, a complex column contains several simple columns 
> each of which may or may not have a timestamp associated.
>
> My question is if there is no mandatory timestamp for either simple or 
> complex columns, how the data will be merged at the time of  read 
> request based on the timestamp given that there can be more than one 
> copy of the same data in sstables?
>
> Also, is it allowed in cql queries to update one or more simple 
> columns within a complex columns? Or the entire complex is updated 
> whenever there is a update query?
>
> Thanks,
> Preetika
>
>


Re: simple vs complex cells

2018-01-23 Thread Minh Do
Based on C* 3.x code base, I believe a complex column consists of many
cells and each cell has its own timestamp.

Then, there is a method to compute the maxTimestamp for a complex column:


public long maxTimestamp()
{
long timestamp = complexDeletion.markedForDeleteAt();
for (Cell cell : this)
timestamp = Math.max(timestamp, cell.timestamp());
return timestamp;
}


On Tue, Jan 23, 2018 at 4:22 PM, Tyagi, Preetika 
wrote:

> Hi all,
>
> I'm trying to understand the behavior of simple and complex columns in
> Cassandra.
> I was looking at UnfilteredSerializer.java, serializeRowBody() checks for
> a timestamp flag and then only it writes it. In case of
> writeComplexColumn(), there is no timestamp being written. Also, as per my
> understanding, a complex column contains several simple columns each of
> which may or may not have a timestamp associated.
>
> My question is if there is no mandatory timestamp for either simple or
> complex columns, how the data will be merged at the time of  read request
> based on the timestamp given that there can be more than one copy of the
> same data in sstables?
>
> Also, is it allowed in cql queries to update one or more simple columns
> within a complex columns? Or the entire complex is updated whenever there
> is a update query?
>
> Thanks,
> Preetika
>
>