vertical-db
Version:
levelDB distributed,BigTable model.
430 lines (416 loc) • 11.1 kB
JavaScript
//
// Autogenerated by Thrift Compiler (0.10.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;
var ttypes = module.exports = {};
var DataKey = module.exports.DataKey = function(args) {
this.row_key = null;
this.column_key = null;
this.timestamp = null;
this.table = null;
if (args) {
if (args.row_key !== undefined && args.row_key !== null) {
this.row_key = args.row_key;
}
if (args.column_key !== undefined && args.column_key !== null) {
this.column_key = args.column_key;
}
if (args.timestamp !== undefined && args.timestamp !== null) {
this.timestamp = args.timestamp;
}
if (args.table !== undefined && args.table !== null) {
this.table = args.table;
}
}
};
DataKey.prototype = {};
DataKey.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.row_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.column_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.timestamp = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.table = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
DataKey.prototype.write = function(output) {
output.writeStructBegin('DataKey');
if (this.row_key !== null && this.row_key !== undefined) {
output.writeFieldBegin('row_key', Thrift.Type.STRING, 1);
output.writeString(this.row_key);
output.writeFieldEnd();
}
if (this.column_key !== null && this.column_key !== undefined) {
output.writeFieldBegin('column_key', Thrift.Type.STRING, 2);
output.writeString(this.column_key);
output.writeFieldEnd();
}
if (this.timestamp !== null && this.timestamp !== undefined) {
output.writeFieldBegin('timestamp', Thrift.Type.STRING, 3);
output.writeString(this.timestamp);
output.writeFieldEnd();
}
if (this.table !== null && this.table !== undefined) {
output.writeFieldBegin('table', Thrift.Type.STRING, 4);
output.writeString(this.table);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var DataKeyGen = module.exports.DataKeyGen = function(args) {
this.row_key = null;
this.column_key = null;
this.timestamp = null;
this.table = null;
if (args) {
if (args.row_key !== undefined && args.row_key !== null) {
this.row_key = args.row_key;
}
if (args.column_key !== undefined && args.column_key !== null) {
this.column_key = args.column_key;
}
if (args.timestamp !== undefined && args.timestamp !== null) {
this.timestamp = args.timestamp;
}
if (args.table !== undefined && args.table !== null) {
this.table = args.table;
}
}
};
DataKeyGen.prototype = {};
DataKeyGen.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.row_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.column_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.timestamp = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.table = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
DataKeyGen.prototype.write = function(output) {
output.writeStructBegin('DataKeyGen');
if (this.row_key !== null && this.row_key !== undefined) {
output.writeFieldBegin('row_key', Thrift.Type.STRING, 1);
output.writeString(this.row_key);
output.writeFieldEnd();
}
if (this.column_key !== null && this.column_key !== undefined) {
output.writeFieldBegin('column_key', Thrift.Type.STRING, 2);
output.writeString(this.column_key);
output.writeFieldEnd();
}
if (this.timestamp !== null && this.timestamp !== undefined) {
output.writeFieldBegin('timestamp', Thrift.Type.STRING, 3);
output.writeString(this.timestamp);
output.writeFieldEnd();
}
if (this.table !== null && this.table !== undefined) {
output.writeFieldBegin('table', Thrift.Type.STRING, 4);
output.writeString(this.table);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var DataColumnKey = module.exports.DataColumnKey = function(args) {
this.row_key = null;
this.column_key = null;
this.table = null;
if (args) {
if (args.row_key !== undefined && args.row_key !== null) {
this.row_key = args.row_key;
}
if (args.column_key !== undefined && args.column_key !== null) {
this.column_key = args.column_key;
}
if (args.table !== undefined && args.table !== null) {
this.table = args.table;
}
}
};
DataColumnKey.prototype = {};
DataColumnKey.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.row_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.column_key = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.table = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
DataColumnKey.prototype.write = function(output) {
output.writeStructBegin('DataColumnKey');
if (this.row_key !== null && this.row_key !== undefined) {
output.writeFieldBegin('row_key', Thrift.Type.STRING, 1);
output.writeString(this.row_key);
output.writeFieldEnd();
}
if (this.column_key !== null && this.column_key !== undefined) {
output.writeFieldBegin('column_key', Thrift.Type.STRING, 2);
output.writeString(this.column_key);
output.writeFieldEnd();
}
if (this.table !== null && this.table !== undefined) {
output.writeFieldBegin('table', Thrift.Type.STRING, 3);
output.writeString(this.table);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var DataColumnOption = module.exports.DataColumnOption = function(args) {
this.limit = null;
this.reverse = null;
this.fillCache = null;
if (args) {
if (args.limit !== undefined && args.limit !== null) {
this.limit = args.limit;
}
if (args.reverse !== undefined && args.reverse !== null) {
this.reverse = args.reverse;
}
if (args.fillCache !== undefined && args.fillCache !== null) {
this.fillCache = args.fillCache;
}
}
};
DataColumnOption.prototype = {};
DataColumnOption.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.limit = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.reverse = input.readBool();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.BOOL) {
this.fillCache = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
DataColumnOption.prototype.write = function(output) {
output.writeStructBegin('DataColumnOption');
if (this.limit !== null && this.limit !== undefined) {
output.writeFieldBegin('limit', Thrift.Type.I32, 1);
output.writeI32(this.limit);
output.writeFieldEnd();
}
if (this.reverse !== null && this.reverse !== undefined) {
output.writeFieldBegin('reverse', Thrift.Type.BOOL, 2);
output.writeBool(this.reverse);
output.writeFieldEnd();
}
if (this.fillCache !== null && this.fillCache !== undefined) {
output.writeFieldBegin('fillCache', Thrift.Type.BOOL, 3);
output.writeBool(this.fillCache);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var VerticalError = module.exports.VerticalError = function(args) {
Thrift.TException.call(this, "VerticalError");
this.name = "VerticalError";
this.message = null;
if (args) {
if (args.message !== undefined && args.message !== null) {
this.message = args.message;
}
}
};
Thrift.inherits(VerticalError, Thrift.TException);
VerticalError.prototype.name = 'VerticalError';
VerticalError.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
VerticalError.prototype.write = function(output) {
output.writeStructBegin('VerticalError');
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};