Giter VIP home page Giter VIP logo

cassandra_object's Issues

Cassandra 0.6 + Cassandra object

Have found that cassandra_object is compatible with cassandra 0.7.6 gem. I have used cassandra_object and cassandra 0.7.6 gem, rails3 beta 3, ruby 1.9.1. At the moment I just get
NameError: uninitialized constant CassandraObject::Base error
although this gems are written in Gemfile.
(CassandraObject class is visible, but CassandraObject::Base is not)

Error using latest git snapshot of Rails 3

With Gemfile:
gem "rails", '3.0.0.beta'
gem "cassandra_object", :git => "git://github.com/NZKoz/cassandra_object.git"
This works:
IRB> User.new(:nick => 'Tuxie')
#<User:0x4b271f0 @changed_attributes={"nick"=>nil}, @key=nil, @new_record=true, @attributes={"nick"=>"Tuxie"}, @schema_version=0>

But with Gemfile:
gem "rails", :git => "git://github.com/rails/rails.git"
gem "cassandra_object", :git => "git://github.com/NZKoz/cassandra_object.git"
This happens:
IRB> User.new(:nick => 'Tuxie')
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
from /home/tuxie/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activemodel/lib/active_model/dirty.rb:125:in attribute_changed?' from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/dirty.rb:19:inwrite_attribute'
from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/attributes.rb:89:in attribute=' from /home/tuxie/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activemodel/lib/active_model/attribute_methods.rb:262:insend'
from /home/tuxie/.bundle/ruby/1.8/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activemodel/lib/active_model/attribute_methods.rb:262:in nick=' from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/attributes.rb:74:insend'
from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/attributes.rb:74:in attributes=' from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/attributes.rb:73:ineach'
from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/attributes.rb:73:in attributes=' from /home/tuxie/.bundle/ruby/1.8/bundler/gems/cassandra_object-13c3c2c8949e63e16c17dc38b03522e12e5a8476-master/lib/cassandra_object/base.rb:98:ininitialize'
from (irb):1:in `new'
from (irb):1

Update Readme

The readme installation is a bit out of date. Could this be updated?

NameError: uninitialized constant ActiveSupport::Callbacks

I'm trying to get the latest version integrated into our app (plus another changeset on my branch) and I'm getting this:

CassandraStatus
NameError: uninitialized constant ActiveSupport::Callbacks
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in load_missing_constant' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing_not_from_s3_library'
from /Users/ryan/code/twitter/vendor/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in const_missing' from /Users/ryan/code/twitter/vendor/gems/cassandra_object/lib/cassandra_object/legacy_callbacks.rb:4 from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in new_constants_in' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire'
from /Users/ryan/code/twitter/vendor/gems/cassandra_object/lib/cassandra_object/base.rb:8
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in require' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in require' from /Users/ryan/code/twitter/vendor/gems/cassandra_object/lib/cassandra_object.rb:28 from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in new_constants_in' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire'
from /Users/ryan/code/twitter/app/models/cassandra_status.rb:1
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:203:in load_without_new_constant_marking' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:203:inload_file'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in new_constants_in' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:202:inload_file'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:94:in require_or_load' from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:248:inload_missing_constant'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in const_missing_not_from_s3_library' from /Users/ryan/code/twitter/vendor/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:inconst_missing'
from /Users/ryan/code/twitter/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:465:in `const_missing'
from (irb):2>>

cassandra_object indexing

In the first example there is index :date_of_birth string. How will this influence Cassandra database? What additional queries will I be able to make?

Full text search

Is there some ability to use full text search with Cassandra object?

UUID issue

Seems like cassandra gem has no Cassandra::UUID class. I replaced it with SimpleUUID::UUID and I could require cassandra and cassandra_object without errors. But then when I created class inherited from CassandraObject::Base and tried to create new user instance with some parameters: User.new(:first_name => "name"), I got error:

irb(main):020:0> User.new(:first_name => "name")
NoMethodError: undefined method 'encode' for nil:NilClass
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:14:in `check_value!'
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:62:in `write_attribute'
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/dirty.rb:23:in `write_attribute'
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:89:in `attribute='
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.0.0.beta3/lib/active_model/attribute_methods.rb:273:in `first_name='
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:74:in `block in attributes='
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:73:in `each'
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/attributes.rb:73:in `attributes='
from /home/ras/Programming/NoSQL/cassandra_object/lib/cassandra_object/base.rb:98:in `initialize'
from (irb):20:in `new'
from (irb):20
from /usr/local/bin/irb:12:in '<main>'

although :first_name attribute was set in User class.
I was using ruby 1.9.1, rails3 beta3, cassandra 0.8.2 gem, cassandra 0.6.

[PATCH] Correcting get_range in "all" querying

Running the newest Cassandra Beta (0.6 Beta 3) in combination with the HEAD of the Cassandra Ruby Library, querying for "all" objects returns "nil" objects.

Currently, the get_range() function returns on ore more columns wrapped into "CassandraThrift::KeySlice" objects. The current implementation expects the columns keys as return values.

The added patch fixes this problem by "getting" the key from the retrieved object. For compatibility with older versions, maybe check the version of the libraries and act appropriately (as type checking is too costly)?

http://gist.github.com/340381

BooleanType for Attributes

I was wondering why attributes can't be of type :boolean. I was looking in 'lib/types.rb' and found a BooleanType but it wasn't registered in 'lib/type_registration.rb'. Was this intentional?

Thanks!

Filters issue

If I am planning to use Cassandra, but in my application I have different kinds of filters - by status, by project, by user and so on. As I know - cassandra_object (as well as Cassandra itself) has no support of :conditions statement. The only way to avoid this problem is to write indexes of all this information just as you put some new values. Can anybody suggest some best practices about storing such information?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.