Comments (17)
I'm not opposed to this, but since its not a priority for us, all I can contribute is design help/review. If you'd like to tackle it I can help sort out a design.
from cassandra.
If you want to give me commit access, I'd be happy to work on an API + tests with your suggestions.
from cassandra.
I'd prefer to use github's fork and pull model for development.
from cassandra.
Based on the commit log and this issue being open, it doesn't seem this has been added. Are you still planning to look into this Mike? If not perhaps I can make an attempt myself.
from cassandra.
I spent an hour or two on it but it was a fairly large API change and I doubt I will have time to on it more. Feel free to work on it.
from cassandra.
Pull request sent for:
http://github.com/siggy/cassandra/commit/439ce611a1c6d15574b47780bd34d174b124dc9b
API backwards compatibility is preserved. However, enabling the new 'timestamp' option will alter the data structure returned.
>> twitter.get(:Statuses, "1")
=> #<OrderedHash {"text"=>"Nom nom nom nom nom.", "user_id"=>"5"}>
>> twitter.get(:Statuses, "1", :timestamp => true)
=> #<OrderedHash {"text"=>{"timestamp"=>1273096932561890, "value"=>"Nom nom nom nom nom."}, "user_id"=>{"timestamp"=>1273096932561890, "value"=>"5"}}>
Comments/suggestions?
from cassandra.
Nice!
Only thing I can think of would be an option to convert those timestamps to actual Ruby objects, rather than just raw integers. I guess if all you want to do is compare timestamps, it's not necessary.
from cassandra.
@mperham -
I assume you're talking about converting the timestamps to Time objects...
In cassandra, "timestamp" means "long that represents something like time" and not everyone uses it the same way, so I say we should just expose it as an int.
from cassandra.
It is probably okay to consistently cast Timestamps in our client. People who use multiple clients will probably know what they're doing.
If you're going to use the deep hash response API, timestamp and value should be symbols.
Would it make sense to subclass String for the column names, and decorate it with an additional timestamp accessor? That way backwards compatibility could be preserved. Or maybe an explicit column struct would be better.
from cassandra.
Maybe we should extend OrderdHash with at timestamps method, so that you can do
twitter.get(:Statuses, "1").timestamps[:text] =>1273096932561890
from cassandra.
+1 to extending OrderedHash with a timestamps method rather than using the nested hash.
from cassandra.
+1 from me also. If this isn't being worked on by anyone, I am happy to give it a go over the next fortnight
from cassandra.
Looks like this is dead?
from cassandra.
I no longer need this functionality. I'll defer to others.
from cassandra.
Yeah, sorry. I looked in to adding it (seemed pretty easy), but quickly realised I had no real need for it.
from cassandra.
Pull request sent for:
http://github.com/siggy/cassandra/commit/87276cf3c44e89a1e1a5d3d8c3d064da85f2db47
OrderedHash::timestamps is itself a hash (unordered for RUBY_VERSION < 1.9):
>> twitter.get(:Statuses, "1").timestamps
=> {"text"=>1282724889876849, "user_id"=>1282724889876849}
>> twitter.get(:Statuses, "2").timestamps
=> {"reply_to_id"=>1282724889881382, "text"=>1282724889881382, "user_id"=>1282724889881382}
from cassandra.
merged siggy's work. boom!
from cassandra.
Related Issues (20)
- cassandra.insert can't handle UTF-8 characters HOT 7
- Best practice for determining the number of columns for a given row key? HOT 6
- Support for cassandra 2.0 HOT 9
- Twitter Cassandra Thrift Client Failover HOT 5
- cassandra.insert cannot handle booleans HOT 1
- CQLSH Version Issue HOT 1
- client.get :start :finish options don't get implemented HOT 2
- multi_get returns another hash in addition to the hash of key=>value pairs HOT 1
- get_range applies different order than used to add key-value pairs. HOT 7
- partitioner for range queries HOT 6
- Bug: rename_column_family does not rename HOT 2
- Feature: Logging HOT 1
- CQL 3 Support ? HOT 1
- Allow dropping of keyspaces HOT 1
- CassandraThrift::InvalidRequestException HOT 1
- Improve Docs HOT 2
- Cassandra#cluster appears to leak threads on failure to connect HOT 2
- Cassandra-rb and Ruby-driver gems conflict HOT 6
- cassandra-rb peformance issues with C* 2.1 HOT 2
- Hey
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cassandra.