Skip to content

Commit

Permalink
Merge pull request #112 from rakyll/protobuf
Browse files Browse the repository at this point in the history
datastore: Protobuf switch
  • Loading branch information
Burcu Dogan committed Aug 18, 2014
2 parents 362b6a8 + 0ebe9f3 commit 12ad6d4
Show file tree
Hide file tree
Showing 15 changed files with 1,062 additions and 293 deletions.
1 change: 0 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"esnext": true,
Expand Down
2 changes: 0 additions & 2 deletions lib/common/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

/*jshint camelcase:false */

'use strict';

var fs = require('fs');
Expand Down
7 changes: 5 additions & 2 deletions lib/datastore/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
var conn = require('../common/connection.js');
var entity = require('./entity.js');
var Transaction = require('./transaction.js');
var pb = require('./pb.js');
var Query = require('./query.js');
var util = require('../common/util.js');

Expand Down Expand Up @@ -108,12 +109,14 @@ Dataset.prototype.allocateIds = function(incompleteKey, n, callback) {
incompleteKeys.push(entity.keyToKeyProto(incompleteKey));
}
this.transaction.makeReq(
'allocateIds', { keys: incompleteKeys }, function(err, resp) {
'allocateIds',
new pb.AllocateIdsRequest({ key: incompleteKeys }),
pb.AllocateIdsResponse, function(err, resp) {
if (err) {
return callback(err);
}
var keys = [];
resp.keys.forEach(function(k) {
(resp.key || []).forEach(function(k) {
keys.push(entity.keyFromKeyProto(k));
});
callback(null ,keys);
Expand Down
Loading

0 comments on commit 12ad6d4

Please sign in to comment.