cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cassandra-node.apache-extras....@codespot.com
Subject [cassandra-node] 12 new revisions pushed by gdusbabek@gmail.com on 2012-09-24 20:43 GMT
Date Mon, 24 Sep 2012 20:43:50 GMT
12 new revisions:

Revision: 3a3225d144bd
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:11:29 2012
Log:      Decode ReversedType comparators correctly.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=3a3225d144bd

Revision: 3cf1dc7c298e
Author:   Tomaz Muraus <tomaz@tomaz.me>
Date:     Fri Jul 13 22:49:18 2012
Log:      Fix test script.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=3cf1dc7c298e

Revision: 6d6a6c2d9e91
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:50:56 2012
Log:      Test to verify parameterized ReversedType is decoded.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6d6a6c2d9e91

Revision: 6804f09bd4d3
Author:   Tomaz Muraus <tomaz@tomaz.me>
Date:     Tue Jul 24 13:46:45 2012
Log:      Fix typo in the readme.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6804f09bd4d3

Revision: 5bc82d2af4d3
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:38:23 2012
Log:      Merge pull request #23 from  
studybreak/parameterized-comparators...
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=5bc82d2af4d3

Revision: d71f681f9610
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:11:29 2012
Log:      Decode ReversedType comparators correctly.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=d71f681f9610

Revision: 6c3e0be3b335
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:50:56 2012
Log:      Test to verify parameterized ReversedType is decoded.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6c3e0be3b335

Revision: c7fd19a2732a
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 10:10:28 2012
Log:      fix typo
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=c7fd19a2732a

Revision: 875a5546852c
Author:   gdusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 11:06:28 2012
Log:      test case that uses a simple reversed comparator.
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=875a5546852c

Revision: 2702e65467ef
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:39:56 2012
Log:      fix merge conflict
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=2702e65467ef

Revision: e459d494fb9b
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:41:46 2012
Log:      add Allan Carroll to contributors
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=e459d494fb9b

Revision: 6fd7b538efcc
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:42:59 2012
Log:      updated CHANGES
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6fd7b538efcc

==============================================================================
Revision: 3a3225d144bd
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:11:29 2012
Log:      Decode ReversedType comparators correctly.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=3a3225d144bd

Modified:
  /lib/decoder.js

=======================================
--- /lib/decoder.js	Mon Jan 30 10:16:45 2012
+++ /lib/decoder.js	Thu Mar  8 14:11:29 2012
@@ -89,6 +89,13 @@
     
//DynamicCompositeType: 'org.apache.cassandra.db.marshal.DynamicCompositeType',
  };

+// Cassandra support paramaterized comparators.
+// https://issues.apache.org/jira/browse/CASSANDRA-2355
+// This is a list of regexes for finding the underlying type to decode.
+var ParameterizedTypes = [
+  /^org.apache.cassandra.db.marshal.ReversedType\(([^)]+)\)$/
+];
+
  // source: https://github.com/joyent/node/blob/master/lib/buffer_ieee754.js
  // license: LICENSE_buffer_ieee754.txt
  function readIEEE754(buffer, offset, isBE, mLen, nBytes) {
@@ -214,6 +221,16 @@
        className = this.validators.defaultValidator;
      }
    }
+
+  // Decode paramaterized class names, e.g. ReversedType
+  for (var i = 0, len=ParameterizedTypes.length; i < len; i++) {
+    var match = className.match(ParameterizedTypes[i]);
+    if (match) {
+      className = match[1];
+      break;
+    }
+  }
+
    if (!className) {
      className = AbstractTypes.BytesType;
    }

==============================================================================
Revision: 3cf1dc7c298e
Author:   Tomaz Muraus <tomaz@tomaz.me>
Date:     Fri Jul 13 22:49:18 2012
Log:      Fix test script.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=3cf1dc7c298e

Modified:
  /scripts/test.sh

=======================================
--- /scripts/test.sh	Sat May 12 18:15:18 2012
+++ /scripts/test.sh	Fri Jul 13 22:49:18 2012
@@ -1,7 +1,7 @@
  if [ $TRAVIS ]; then
    dependencies=""
  else
-  dependencies="tests/dependencies.json"
+  dependencies="--dependencies test/dependencies.json"
  fi

  if [ ! $TEST_FILES ]; then

==============================================================================
Revision: 6d6a6c2d9e91
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:50:56 2012
Log:      Test to verify parameterized ReversedType is decoded.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6d6a6c2d9e91

Modified:
  /test/test_decoder.js

=======================================
--- /test/test_decoder.js	Mon Jan 30 10:16:45 2012
+++ /test/test_decoder.js	Thu Mar  8 14:50:56 2012
@@ -20,6 +20,7 @@
  var bytesToBigLong = require('../lib/decoder').bytesToBigLong;
  var bytesToNum = require('../lib/decoder').bytesToNum;
  var bufferToString = require('../lib/decoder').bufferToString;
+var Decoder = require('../lib/decoder').Decoder;
  var UUID = require('../lib/uuid');

  function makeBuffer(string) {
@@ -255,3 +256,15 @@
    assert.strictEqual('00336699ccff', buf.toString('hex'));
    test.finish();
  };
+
+exports.testParamaterizedTypes = function (test, assert) {
+  var decoder = new Decoder({
+          key: 'org.apache.cassandra.db.marshal.UTF8Type',
+           
comparator: 'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.UTF8Type)',
+          defaultValidator: 'org.apache.cassandra.db.marshal.UTF8Type'
+  });
+  var bytes = new Buffer([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57,  
0x6f, 0x72, 0x6c, 0x64, 0x21]);
+  var str = decoder.decode(bytes, 'comparator');
+  assert.strictEqual(str, 'Hello, World!');
+  test.finish();
+};

==============================================================================
Revision: 6804f09bd4d3
Author:   Tomaz Muraus <tomaz@tomaz.me>
Date:     Tue Jul 24 13:46:45 2012
Log:      Fix typo in the readme.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6804f09bd4d3

Modified:
  /README.md

=======================================
--- /README.md	Sat May 19 20:26:02 2012
+++ /README.md	Tue Jul 24 13:46:45 2012
@@ -38,7 +38,7 @@
        } else {
          // assume ksDef contains a full description of the keyspace (uses  
the thrift structure).
        }
-    }
+    });

  ### Create a keyspace
      sys.addKeyspace(ksDef, function(err) {

==============================================================================
Revision: 5bc82d2af4d3
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:38:23 2012
Log:      Merge pull request #23 from studybreak/parameterized-comparators

Decode parameterized comparator ReversedType()
http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=5bc82d2af4d3

Modified:
  /lib/decoder.js
  /test/test_decoder.js

=======================================
--- /lib/decoder.js	Wed May 16 14:04:36 2012
+++ /lib/decoder.js	Mon Sep 24 13:38:23 2012
@@ -95,6 +95,13 @@
     
//DynamicCompositeType: 'org.apache.cassandra.db.marshal.DynamicCompositeType',
  };

+// Cassandra support paramaterized comparators.
+// https://issues.apache.org/jira/browse/CASSANDRA-2355
+// This is a list of regexes for finding the underlying type to decode.
+var ParameterizedTypes = [
+  /^org.apache.cassandra.db.marshal.ReversedType\(([^)]+)\)$/
+];
+
  // source: https://github.com/joyent/node/blob/master/lib/buffer_ieee754.js
  // license: LICENSE_buffer_ieee754.txt
  function readIEEE754(buffer, offset, isBE, mLen, nBytes) {
@@ -223,6 +230,16 @@
        className = this.validators.defaultValidator;
      }
    }
+
+  // Decode paramaterized class names, e.g. ReversedType
+  for (var i = 0, len=ParameterizedTypes.length; i < len; i++) {
+    var match = className.match(ParameterizedTypes[i]);
+    if (match) {
+      className = match[1];
+      break;
+    }
+  }
+
    if (!className) {
      className = AbstractTypes.BytesType;
    }
=======================================
--- /test/test_decoder.js	Sat Feb 25 19:22:27 2012
+++ /test/test_decoder.js	Mon Sep 24 13:38:23 2012
@@ -20,6 +20,7 @@
  var bytesToBigLong = require('../lib/decoder').bytesToBigLong;
  var bytesToNum = require('../lib/decoder').bytesToNum;
  var bufferToString = require('../lib/decoder').bufferToString;
+var Decoder = require('../lib/decoder').Decoder;
  var UUID = require('../lib/uuid');

  function makeBuffer(string) {
@@ -260,3 +261,15 @@
    assert.strictEqual('00336699ccff', buf.toString('hex'));
    test.finish();
  };
+
+exports.testParamaterizedTypes = function (test, assert) {
+  var decoder = new Decoder({
+          key: 'org.apache.cassandra.db.marshal.UTF8Type',
+           
comparator: 'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.UTF8Type)',
+          defaultValidator: 'org.apache.cassandra.db.marshal.UTF8Type'
+  });
+  var bytes = new Buffer([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57,  
0x6f, 0x72, 0x6c, 0x64, 0x21]);
+  var str = decoder.decode(bytes, 'comparator');
+  assert.strictEqual(str, 'Hello, World!');
+  test.finish();
+};

==============================================================================
Revision: d71f681f9610
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:11:29 2012
Log:      Decode ReversedType comparators correctly.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=d71f681f9610

Modified:
  /lib/decoder.js

=======================================
--- /lib/decoder.js	Wed May 16 14:04:36 2012
+++ /lib/decoder.js	Thu Mar  8 14:11:29 2012
@@ -95,6 +95,13 @@
     
//DynamicCompositeType: 'org.apache.cassandra.db.marshal.DynamicCompositeType',
  };

+// Cassandra support paramaterized comparators.
+// https://issues.apache.org/jira/browse/CASSANDRA-2355
+// This is a list of regexes for finding the underlying type to decode.
+var ParameterizedTypes = [
+  /^org.apache.cassandra.db.marshal.ReversedType\(([^)]+)\)$/
+];
+
  // source: https://github.com/joyent/node/blob/master/lib/buffer_ieee754.js
  // license: LICENSE_buffer_ieee754.txt
  function readIEEE754(buffer, offset, isBE, mLen, nBytes) {
@@ -223,6 +230,16 @@
        className = this.validators.defaultValidator;
      }
    }
+
+  // Decode paramaterized class names, e.g. ReversedType
+  for (var i = 0, len=ParameterizedTypes.length; i < len; i++) {
+    var match = className.match(ParameterizedTypes[i]);
+    if (match) {
+      className = match[1];
+      break;
+    }
+  }
+
    if (!className) {
      className = AbstractTypes.BytesType;
    }

==============================================================================
Revision: 6c3e0be3b335
Author:   Allan Carroll <allanca@gmail.com>
Date:     Thu Mar  8 14:50:56 2012
Log:      Test to verify parameterized ReversedType is decoded.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6c3e0be3b335

Modified:
  /test/test_decoder.js

=======================================
--- /test/test_decoder.js	Sat Feb 25 19:22:27 2012
+++ /test/test_decoder.js	Thu Mar  8 14:50:56 2012
@@ -20,6 +20,7 @@
  var bytesToBigLong = require('../lib/decoder').bytesToBigLong;
  var bytesToNum = require('../lib/decoder').bytesToNum;
  var bufferToString = require('../lib/decoder').bufferToString;
+var Decoder = require('../lib/decoder').Decoder;
  var UUID = require('../lib/uuid');

  function makeBuffer(string) {
@@ -260,3 +261,15 @@
    assert.strictEqual('00336699ccff', buf.toString('hex'));
    test.finish();
  };
+
+exports.testParamaterizedTypes = function (test, assert) {
+  var decoder = new Decoder({
+          key: 'org.apache.cassandra.db.marshal.UTF8Type',
+           
comparator: 'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.UTF8Type)',
+          defaultValidator: 'org.apache.cassandra.db.marshal.UTF8Type'
+  });
+  var bytes = new Buffer([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57,  
0x6f, 0x72, 0x6c, 0x64, 0x21]);
+  var str = decoder.decode(bytes, 'comparator');
+  assert.strictEqual(str, 'Hello, World!');
+  test.finish();
+};

==============================================================================
Revision: c7fd19a2732a
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 10:10:28 2012
Log:      fix typo

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=c7fd19a2732a

Modified:
  /lib/decoder.js

=======================================
--- /lib/decoder.js	Thu Mar  8 14:11:29 2012
+++ /lib/decoder.js	Mon Sep 24 10:10:28 2012
@@ -231,7 +231,7 @@
      }
    }

-  // Decode paramaterized class names, e.g. ReversedType
+  // Decode parameterized class names, e.g. ReversedType
    for (var i = 0, len=ParameterizedTypes.length; i < len; i++) {
      var match = className.match(ParameterizedTypes[i]);
      if (match) {

==============================================================================
Revision: 875a5546852c
Author:   gdusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 11:06:28 2012
Log:      test case that uses a simple reversed comparator.

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=875a5546852c

Modified:
  /test/test_driver.js

=======================================
--- /test/test_driver.js	Thu May 31 15:55:32 2012
+++ /test/test_driver.js	Mon Sep 24 11:06:28 2012
@@ -129,7 +129,11 @@
                                ]});
        var cfCounter = new CfDef({keyspace: ksName, name: 'CfCounter',  
column_type: 'Standard', comparator_type: 'AsciiType',  
default_validation_class: 'CounterColumnType',  
key_validation_class: 'AsciiType'});
        var super1 = new CfDef({keyspace: ksName, name: 'Super1',  
column_type: 'Super', comparator_type: 'UTF8Type',  
subcomparator_type: 'UTF8Type'});
-      var keyspace1 = new KsDef({name: ksName,  
strategy_class: 'org.apache.cassandra.locator.SimpleStrategy',  
strategy_options: {'replication_factor': '1'}, cf_defs: [standard1, super1,  
cfInt, cfUtf8, cfLong, cfBytes, cfBoolean, cfDate, cfUuid, cfUgly,  
cfCounter]});
+      var cfReversed = new CfDef({keyspace: ksName, name: 'CfReversed1',  
column_type: 'Standard', comparator_type: 'UTF8Type(reversed=true)',  
default_validation_class: 'UTF8Type', key_validation_class: 'UTF8Type'});
+      var keyspace1 = new KsDef({name: ksName,
+                                  
strategy_class: 'org.apache.cassandra.locator.SimpleStrategy',
+                                 strategy_options:  
{'replication_factor': '1'},
+                                 cf_defs: [standard1, super1, cfInt,  
cfUtf8, cfLong, cfBytes, cfBoolean, cfDate, cfUuid, cfUgly, cfCounter,  
cfReversed]});
        sys.addKeyspace(keyspace1, function(addErr) {
          console.log(addErr);
          close();
@@ -819,6 +823,40 @@
    });
  };

+exports.testReversedString = function(test, assert) {
+  connect(function(err, con) {
+    if (err) {
+      assert.ok(false);
+      test.finish();
+    } else {
+      var updParms = ['a', 'foo', 'c', 'zoo', 'b', 'boo', 'rev_key_0'];
+      var selParms = ['rev_key_0'];
+      con.execute('update CfReversed1 set ?=?, ?=?, ?=? where key=?',  
updParms, function (updErr) {
+        if (updErr) {
+          con.close();
+          assert.ok(false);
+          test.finish();
+        } else {
+          con.execute('select * from CfReversed1 where key=?', selParms,  
function(selErr, rows) {
+            con.close();
+            if (selErr) {
+              assert.ok(false);
+            } else {
+              // verify sort is reversed.
+              assert.strictEqual(rows.length, 1);
+              var cols = rows[0].cols;
+              assert.strictEqual(cols[0].name, 'c');
+              assert.strictEqual(cols[1].name, 'b');
+              assert.strictEqual(cols[2].name, 'a');
+            }
+            test.finish();
+          });
+        }
+      });
+    }
+  });
+};
+
  // this test only works an order-preserving partitioner.
  // it also uses an event-based approach to doing things.
  //exports.ZDISABLED_testMultipleRows = function(test, assert) {

==============================================================================
Revision: 2702e65467ef
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:39:56 2012
Log:      fix merge conflict

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=2702e65467ef



==============================================================================
Revision: e459d494fb9b
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:41:46 2012
Log:      add Allan Carroll to contributors

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=e459d494fb9b

Modified:
  /package.json

=======================================
--- /package.json	Fri Jun  1 08:38:00 2012
+++ /package.json	Mon Sep 24 13:41:46 2012
@@ -5,7 +5,8 @@
      "Gary Dusbabek <gdusbabek@gmail.com>",
      "Toma┼ż Muraus <tomaz@tomaz.me>",
      "Patrick Negri <patrick@iugu.com.br>",
-    "Christoph Tavan <dev@tavan.de>"
+    "Christoph Tavan <dev@tavan.de>",
+    "Allan Carroll <allanca@gmail.com>"
    ],
    "name": "cassandra-client",
    "description": "Node.js CQL driver for Apache Cassandra",

==============================================================================
Revision: 6fd7b538efcc
Author:   Gary Dusbabek <gdusbabek@gmail.com>
Date:     Mon Sep 24 13:42:59 2012
Log:      updated CHANGES

http://code.google.com/a/apache-extras.org/p/cassandra-node/source/detail?r=6fd7b538efcc

Modified:
  /CHANGES

=======================================
--- /CHANGES	Fri Jun  1 08:38:00 2012
+++ /CHANGES	Mon Sep 24 13:42:59 2012
@@ -1,3 +1,7 @@
+DEV
+
+- support for parmeterized types (patch contributed by Allan Carroll  
<allanca@gmail.com>)
+
  Changes with cassandra-client in 0.9.3:

  - Improve serialization and deserialization support for the following  
types: Number, Date, Boolean.
Mime
View raw message