xunch 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/lib/xunch.rb +25 -0
 - data/lib/xunch/cache/cache.rb +88 -0
 - data/lib/xunch/cache/cache_builder.rb +68 -0
 - data/lib/xunch/cache/field_object_cache.rb +120 -0
 - data/lib/xunch/cache/list_field_object_cache.rb +63 -0
 - data/lib/xunch/cache/list_object_cache.rb +59 -0
 - data/lib/xunch/cache/object_cache.rb +63 -0
 - data/lib/xunch/codec/codec.rb +31 -0
 - data/lib/xunch/codec/hash_codec.rb +98 -0
 - data/lib/xunch/codec/json_codec.rb +81 -0
 - data/lib/xunch/shard/redis.rb +270 -0
 - data/lib/xunch/shard/shard_info.rb +37 -0
 - data/lib/xunch/shard/shard_redis.rb +267 -0
 - data/lib/xunch/shard/sharded.rb +50 -0
 - data/lib/xunch/utils/exceptions.rb +11 -0
 - data/lib/xunch/utils/nginx_cache_helper.rb +52 -0
 - data/lib/xunch/utils/rb_tree.rb +634 -0
 - data/lib/xunch/utils/rb_tree_node.rb +67 -0
 - data/lib/xunch/utils/types.rb +8 -0
 - data/lib/xunch/utils/utils.rb +24 -0
 - data/test/benchmark_test.rb +68 -0
 - data/test/cache_builder_test.rb +28 -0
 - data/test/cache_object.rb +120 -0
 - data/test/consistency_hash_test.rb +31 -0
 - data/test/field_object_cache_test.rb +430 -0
 - data/test/hash_codec_test.rb +57 -0
 - data/test/json_codec_test.rb +57 -0
 - data/test/list_field_object_cache_test.rb +211 -0
 - data/test/list_object_cache_test.rb +211 -0
 - data/test/nginx_cache_helper_test.rb +45 -0
 - data/test/object_cache_test.rb +322 -0
 - data/test/rb_tree_test.rb +48 -0
 - data/test/redis_benchmark_test.rb +54 -0
 - data/test/redis_test.rb +58 -0
 - data/test/running_test.rb +212 -0
 - data/test/test.rb +176 -0
 - data/test/track_record_origin.rb +58 -0
 - metadata +125 -0
 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,125 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: xunch
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Ted Wang
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-11-19 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: redis
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: 3.0.5
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: 3.0.5
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: murmurhash
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: 0.0.1
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - ~>
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: 0.0.1
         
     | 
| 
      
 41 
     | 
    
         
            +
            description: cache client
         
     | 
| 
      
 42 
     | 
    
         
            +
            email: ted@ximalaya.com
         
     | 
| 
      
 43 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 44 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 45 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 46 
     | 
    
         
            +
            files:
         
     | 
| 
      
 47 
     | 
    
         
            +
            - lib/xunch/shard/sharded.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - lib/xunch/shard/redis.rb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - lib/xunch/shard/shard_info.rb
         
     | 
| 
      
 50 
     | 
    
         
            +
            - lib/xunch/shard/shard_redis.rb
         
     | 
| 
      
 51 
     | 
    
         
            +
            - lib/xunch/cache/cache_builder.rb
         
     | 
| 
      
 52 
     | 
    
         
            +
            - lib/xunch/cache/list_field_object_cache.rb
         
     | 
| 
      
 53 
     | 
    
         
            +
            - lib/xunch/cache/list_object_cache.rb
         
     | 
| 
      
 54 
     | 
    
         
            +
            - lib/xunch/cache/object_cache.rb
         
     | 
| 
      
 55 
     | 
    
         
            +
            - lib/xunch/cache/cache.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - lib/xunch/cache/field_object_cache.rb
         
     | 
| 
      
 57 
     | 
    
         
            +
            - lib/xunch/utils/rb_tree.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - lib/xunch/utils/utils.rb
         
     | 
| 
      
 59 
     | 
    
         
            +
            - lib/xunch/utils/types.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
            - lib/xunch/utils/nginx_cache_helper.rb
         
     | 
| 
      
 61 
     | 
    
         
            +
            - lib/xunch/utils/exceptions.rb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - lib/xunch/utils/rb_tree_node.rb
         
     | 
| 
      
 63 
     | 
    
         
            +
            - lib/xunch/codec/codec.rb
         
     | 
| 
      
 64 
     | 
    
         
            +
            - lib/xunch/codec/hash_codec.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
            - lib/xunch/codec/json_codec.rb
         
     | 
| 
      
 66 
     | 
    
         
            +
            - lib/xunch.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
            - test/json_codec_test.rb
         
     | 
| 
      
 68 
     | 
    
         
            +
            - test/redis_benchmark_test.rb
         
     | 
| 
      
 69 
     | 
    
         
            +
            - test/cache_builder_test.rb
         
     | 
| 
      
 70 
     | 
    
         
            +
            - test/consistency_hash_test.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - test/rb_tree_test.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
            - test/list_field_object_cache_test.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
            - test/cache_object.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - test/benchmark_test.rb
         
     | 
| 
      
 75 
     | 
    
         
            +
            - test/test.rb
         
     | 
| 
      
 76 
     | 
    
         
            +
            - test/hash_codec_test.rb
         
     | 
| 
      
 77 
     | 
    
         
            +
            - test/nginx_cache_helper_test.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
            - test/running_test.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
            - test/object_cache_test.rb
         
     | 
| 
      
 80 
     | 
    
         
            +
            - test/list_object_cache_test.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
            - test/redis_test.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - test/field_object_cache_test.rb
         
     | 
| 
      
 83 
     | 
    
         
            +
            - test/track_record_origin.rb
         
     | 
| 
      
 84 
     | 
    
         
            +
            homepage: http://www.ximalaya.com
         
     | 
| 
      
 85 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 86 
     | 
    
         
            +
            - MIT2.0
         
     | 
| 
      
 87 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 88 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 89 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 90 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 91 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 92 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
              - - '>='
         
     | 
| 
      
 95 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 97 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 98 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 99 
     | 
    
         
            +
              - - '>='
         
     | 
| 
      
 100 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 101 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 102 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 103 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 104 
     | 
    
         
            +
            rubygems_version: 2.0.3
         
     | 
| 
      
 105 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 106 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 107 
     | 
    
         
            +
            summary: A distribute cache client library based on redis.
         
     | 
| 
      
 108 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 109 
     | 
    
         
            +
            - test/json_codec_test.rb
         
     | 
| 
      
 110 
     | 
    
         
            +
            - test/redis_benchmark_test.rb
         
     | 
| 
      
 111 
     | 
    
         
            +
            - test/cache_builder_test.rb
         
     | 
| 
      
 112 
     | 
    
         
            +
            - test/consistency_hash_test.rb
         
     | 
| 
      
 113 
     | 
    
         
            +
            - test/rb_tree_test.rb
         
     | 
| 
      
 114 
     | 
    
         
            +
            - test/list_field_object_cache_test.rb
         
     | 
| 
      
 115 
     | 
    
         
            +
            - test/cache_object.rb
         
     | 
| 
      
 116 
     | 
    
         
            +
            - test/benchmark_test.rb
         
     | 
| 
      
 117 
     | 
    
         
            +
            - test/test.rb
         
     | 
| 
      
 118 
     | 
    
         
            +
            - test/hash_codec_test.rb
         
     | 
| 
      
 119 
     | 
    
         
            +
            - test/nginx_cache_helper_test.rb
         
     | 
| 
      
 120 
     | 
    
         
            +
            - test/running_test.rb
         
     | 
| 
      
 121 
     | 
    
         
            +
            - test/object_cache_test.rb
         
     | 
| 
      
 122 
     | 
    
         
            +
            - test/list_object_cache_test.rb
         
     | 
| 
      
 123 
     | 
    
         
            +
            - test/redis_test.rb
         
     | 
| 
      
 124 
     | 
    
         
            +
            - test/field_object_cache_test.rb
         
     | 
| 
      
 125 
     | 
    
         
            +
            - test/track_record_origin.rb
         
     |