6

Can the column names ordered by astyanax be received?

 3 years ago
source link: https://www.codesd.com/item/can-the-column-names-ordered-by-astyanax-be-received.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Can the column names ordered by astyanax be received?

advertisements

Using com.netflix.astyanax, I add entries for a given row as follows:

final ColumnListMutation<String> columnList = m.withRow(columnFamily, key);
columnList.putEmptyColumn(columnName);

Later I retrieve all my columns with:

  final OperationResult<ColumnList<String>> operationResult = keyspace
          .prepareQuery(columnFamily).getKey(key).execute();
  operationResult.getResult().getColumnNames();

The following correctly return all the columns I have added but the columns are not ordered accordingly to when they were entered in the database. Since each column has a timestamp associated to it, there ought to be a way to do exactly this but I don't see it. Is there?

Note: If there isn't, I can always change the code above to:

columnList.putColumn(ip,new Date());

and then retrieve the column values, order them accordingly, but that seems cumbersome, inefficient, and silly since each column already has a timestamp.


I know from PlayOrm that if you do column Slices, it returns those in order. In fact, playorm uses that do enable S-SQL in partitions and basically batches the column slicing which comes back in order or reverse order depending on how requested. You may want to do a column slice from 0 to MAXLONG.

I am not sure about getting the row though. I haven't tried that.

oh, and PlayOrm is just a mapping layer on top of astyanax though not really relational and more noSql'ish really as demonstrated by it's patterns pages

http://buffalosw.com/wiki/Patterns-Page/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK