aliyun-tablestore-nodejs-sdk
Version:
TableStore SDK for JavaScript
1,136 lines (1,052 loc) • 2.74 MB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.main = (function() {
/**
* Namespace main.
* @exports main
* @namespace
*/
var main = {};
main.proto = (function() {
/**
* Namespace proto.
* @memberof main
* @namespace
*/
var proto = {};
proto.Error = (function() {
/**
* Properties of an Error.
* @memberof main.proto
* @interface IError
* @property {string} code Error code
* @property {string|null} [message] Error message
*/
/**
* Constructs a new Error.
* @memberof main.proto
* @classdesc Represents an Error.
* @implements IError
* @constructor
* @param {main.proto.IError=} [properties] Properties to set
*/
function Error(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Error code.
* @member {string} code
* @memberof main.proto.Error
* @instance
*/
Error.prototype.code = "";
/**
* Error message.
* @member {string} message
* @memberof main.proto.Error
* @instance
*/
Error.prototype.message = "";
/**
* Creates a new Error instance using the specified properties.
* @function create
* @memberof main.proto.Error
* @static
* @param {main.proto.IError=} [properties] Properties to set
* @returns {main.proto.Error} Error instance
*/
Error.create = function create(properties) {
return new Error(properties);
};
/**
* Encodes the specified Error message. Does not implicitly {@link main.proto.Error.verify|verify} messages.
* @function encode
* @memberof main.proto.Error
* @static
* @param {main.proto.IError} message Error message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Error.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 2 =*/10).string(message.code);
if (message.message != null && Object.hasOwnProperty.call(message, "message"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
return writer;
};
/**
* Encodes the specified Error message, length delimited. Does not implicitly {@link main.proto.Error.verify|verify} messages.
* @function encodeDelimited
* @memberof main.proto.Error
* @static
* @param {main.proto.IError} message Error message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Error.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Error message from the specified reader or buffer.
* @function decode
* @memberof main.proto.Error
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {main.proto.Error} Error
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Error.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.main.proto.Error();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.code = reader.string();
break;
case 2:
message.message = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("code"))
throw $util.ProtocolError("missing required 'code'", { instance: message });
return message;
};
/**
* Decodes an Error message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof main.proto.Error
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {main.proto.Error} Error
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Error.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Error message.
* @function verify
* @memberof main.proto.Error
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Error.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isString(message.code))
return "code: string expected";
if (message.message != null && message.hasOwnProperty("message"))
if (!$util.isString(message.message))
return "message: string expected";
return null;
};
/**
* Creates an Error message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof main.proto.Error
* @static
* @param {Object.<string,*>} object Plain object
* @returns {main.proto.Error} Error
*/
Error.fromObject = function fromObject(object) {
if (object instanceof $root.main.proto.Error)
return object;
var message = new $root.main.proto.Error();
if (object.code != null)
message.code = String(object.code);
if (object.message != null)
message.message = String(object.message);
return message;
};
/**
* Creates a plain object from an Error message. Also converts values to other types if specified.
* @function toObject
* @memberof main.proto.Error
* @static
* @param {main.proto.Error} message Error
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Error.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.code = "";
object.message = "";
}
if (message.code != null && message.hasOwnProperty("code"))
object.code = message.code;
if (message.message != null && message.hasOwnProperty("message"))
object.message = message.message;
return object;
};
/**
* Converts this Error to JSON.
* @function toJSON
* @memberof main.proto.Error
* @instance
* @returns {Object.<string,*>} JSON object
*/
Error.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return Error;
})();
/**
* PrimaryKeyType enum.
* @name main.proto.PrimaryKeyType
* @enum {number}
* @property {number} INTEGER=1 INTEGER value
* @property {number} STRING=2 STRING value
* @property {number} BINARY=3 BINARY value
*/
proto.PrimaryKeyType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "INTEGER"] = 1;
values[valuesById[2] = "STRING"] = 2;
values[valuesById[3] = "BINARY"] = 3;
return values;
})();
/**
* DefinedColumnType enum.
* @name main.proto.DefinedColumnType
* @enum {number}
* @property {number} DCT_INTEGER=1 DCT_INTEGER value
* @property {number} DCT_DOUBLE=2 DCT_DOUBLE value
* @property {number} DCT_BOOLEAN=3 DCT_BOOLEAN value
* @property {number} DCT_STRING=4 DCT_STRING value
* @property {number} DCT_BLOB=7 DCT_BLOB value
*/
proto.DefinedColumnType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "DCT_INTEGER"] = 1;
values[valuesById[2] = "DCT_DOUBLE"] = 2;
values[valuesById[3] = "DCT_BOOLEAN"] = 3;
values[valuesById[4] = "DCT_STRING"] = 4;
values[valuesById[7] = "DCT_BLOB"] = 7;
return values;
})();
/**
* PrimaryKeyOption enum.
* @name main.proto.PrimaryKeyOption
* @enum {number}
* @property {number} AUTO_INCREMENT=1 AUTO_INCREMENT value
*/
proto.PrimaryKeyOption = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "AUTO_INCREMENT"] = 1;
return values;
})();
proto.PrimaryKeySchema = (function() {
/**
* Properties of a PrimaryKeySchema.
* @memberof main.proto
* @interface IPrimaryKeySchema
* @property {string} name PrimaryKeySchema name
* @property {main.proto.PrimaryKeyType} type PrimaryKeySchema type
* @property {main.proto.PrimaryKeyOption|null} [option] PrimaryKeySchema option
*/
/**
* Constructs a new PrimaryKeySchema.
* @memberof main.proto
* @classdesc Represents a PrimaryKeySchema.
* @implements IPrimaryKeySchema
* @constructor
* @param {main.proto.IPrimaryKeySchema=} [properties] Properties to set
*/
function PrimaryKeySchema(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* PrimaryKeySchema name.
* @member {string} name
* @memberof main.proto.PrimaryKeySchema
* @instance
*/
PrimaryKeySchema.prototype.name = "";
/**
* PrimaryKeySchema type.
* @member {main.proto.PrimaryKeyType} type
* @memberof main.proto.PrimaryKeySchema
* @instance
*/
PrimaryKeySchema.prototype.type = 1;
/**
* PrimaryKeySchema option.
* @member {main.proto.PrimaryKeyOption} option
* @memberof main.proto.PrimaryKeySchema
* @instance
*/
PrimaryKeySchema.prototype.option = 1;
/**
* Creates a new PrimaryKeySchema instance using the specified properties.
* @function create
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {main.proto.IPrimaryKeySchema=} [properties] Properties to set
* @returns {main.proto.PrimaryKeySchema} PrimaryKeySchema instance
*/
PrimaryKeySchema.create = function create(properties) {
return new PrimaryKeySchema(properties);
};
/**
* Encodes the specified PrimaryKeySchema message. Does not implicitly {@link main.proto.PrimaryKeySchema.verify|verify} messages.
* @function encode
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {main.proto.IPrimaryKeySchema} message PrimaryKeySchema message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PrimaryKeySchema.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
if (message.option != null && Object.hasOwnProperty.call(message, "option"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option);
return writer;
};
/**
* Encodes the specified PrimaryKeySchema message, length delimited. Does not implicitly {@link main.proto.PrimaryKeySchema.verify|verify} messages.
* @function encodeDelimited
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {main.proto.IPrimaryKeySchema} message PrimaryKeySchema message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PrimaryKeySchema.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a PrimaryKeySchema message from the specified reader or buffer.
* @function decode
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {main.proto.PrimaryKeySchema} PrimaryKeySchema
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PrimaryKeySchema.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.main.proto.PrimaryKeySchema();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message.type = reader.int32();
break;
case 3:
message.option = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("name"))
throw $util.ProtocolError("missing required 'name'", { instance: message });
if (!message.hasOwnProperty("type"))
throw $util.ProtocolError("missing required 'type'", { instance: message });
return message;
};
/**
* Decodes a PrimaryKeySchema message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {main.proto.PrimaryKeySchema} PrimaryKeySchema
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PrimaryKeySchema.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a PrimaryKeySchema message.
* @function verify
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
PrimaryKeySchema.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isString(message.name))
return "name: string expected";
switch (message.type) {
default:
return "type: enum value expected";
case 1:
case 2:
case 3:
break;
}
if (message.option != null && message.hasOwnProperty("option"))
switch (message.option) {
default:
return "option: enum value expected";
case 1:
break;
}
return null;
};
/**
* Creates a PrimaryKeySchema message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {Object.<string,*>} object Plain object
* @returns {main.proto.PrimaryKeySchema} PrimaryKeySchema
*/
PrimaryKeySchema.fromObject = function fromObject(object) {
if (object instanceof $root.main.proto.PrimaryKeySchema)
return object;
var message = new $root.main.proto.PrimaryKeySchema();
if (object.name != null)
message.name = String(object.name);
switch (object.type) {
case "INTEGER":
case 1:
message.type = 1;
break;
case "STRING":
case 2:
message.type = 2;
break;
case "BINARY":
case 3:
message.type = 3;
break;
}
switch (object.option) {
case "AUTO_INCREMENT":
case 1:
message.option = 1;
break;
}
return message;
};
/**
* Creates a plain object from a PrimaryKeySchema message. Also converts values to other types if specified.
* @function toObject
* @memberof main.proto.PrimaryKeySchema
* @static
* @param {main.proto.PrimaryKeySchema} message PrimaryKeySchema
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
PrimaryKeySchema.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.type = options.enums === String ? "INTEGER" : 1;
object.option = options.enums === String ? "AUTO_INCREMENT" : 1;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.main.proto.PrimaryKeyType[message.type] : message.type;
if (message.option != null && message.hasOwnProperty("option"))
object.option = options.enums === String ? $root.main.proto.PrimaryKeyOption[message.option] : message.option;
return object;
};
/**
* Converts this PrimaryKeySchema to JSON.
* @function toJSON
* @memberof main.proto.PrimaryKeySchema
* @instance
* @returns {Object.<string,*>} JSON object
*/
PrimaryKeySchema.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return PrimaryKeySchema;
})();
proto.DefinedColumnSchema = (function() {
/**
* Properties of a DefinedColumnSchema.
* @memberof main.proto
* @interface IDefinedColumnSchema
* @property {string} name DefinedColumnSchema name
* @property {main.proto.DefinedColumnType} type DefinedColumnSchema type
*/
/**
* Constructs a new DefinedColumnSchema.
* @memberof main.proto
* @classdesc Represents a DefinedColumnSchema.
* @implements IDefinedColumnSchema
* @constructor
* @param {main.proto.IDefinedColumnSchema=} [properties] Properties to set
*/
function DefinedColumnSchema(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* DefinedColumnSchema name.
* @member {string} name
* @memberof main.proto.DefinedColumnSchema
* @instance
*/
DefinedColumnSchema.prototype.name = "";
/**
* DefinedColumnSchema type.
* @member {main.proto.DefinedColumnType} type
* @memberof main.proto.DefinedColumnSchema
* @instance
*/
DefinedColumnSchema.prototype.type = 1;
/**
* Creates a new DefinedColumnSchema instance using the specified properties.
* @function create
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {main.proto.IDefinedColumnSchema=} [properties] Properties to set
* @returns {main.proto.DefinedColumnSchema} DefinedColumnSchema instance
*/
DefinedColumnSchema.create = function create(properties) {
return new DefinedColumnSchema(properties);
};
/**
* Encodes the specified DefinedColumnSchema message. Does not implicitly {@link main.proto.DefinedColumnSchema.verify|verify} messages.
* @function encode
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {main.proto.IDefinedColumnSchema} message DefinedColumnSchema message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DefinedColumnSchema.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
return writer;
};
/**
* Encodes the specified DefinedColumnSchema message, length delimited. Does not implicitly {@link main.proto.DefinedColumnSchema.verify|verify} messages.
* @function encodeDelimited
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {main.proto.IDefinedColumnSchema} message DefinedColumnSchema message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DefinedColumnSchema.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a DefinedColumnSchema message from the specified reader or buffer.
* @function decode
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {main.proto.DefinedColumnSchema} DefinedColumnSchema
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DefinedColumnSchema.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.main.proto.DefinedColumnSchema();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 2:
message.type = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("name"))
throw $util.ProtocolError("missing required 'name'", { instance: message });
if (!message.hasOwnProperty("type"))
throw $util.ProtocolError("missing required 'type'", { instance: message });
return message;
};
/**
* Decodes a DefinedColumnSchema message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {main.proto.DefinedColumnSchema} DefinedColumnSchema
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DefinedColumnSchema.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a DefinedColumnSchema message.
* @function verify
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
DefinedColumnSchema.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!$util.isString(message.name))
return "name: string expected";
switch (message.type) {
default:
return "type: enum value expected";
case 1:
case 2:
case 3:
case 4:
case 7:
break;
}
return null;
};
/**
* Creates a DefinedColumnSchema message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {Object.<string,*>} object Plain object
* @returns {main.proto.DefinedColumnSchema} DefinedColumnSchema
*/
DefinedColumnSchema.fromObject = function fromObject(object) {
if (object instanceof $root.main.proto.DefinedColumnSchema)
return object;
var message = new $root.main.proto.DefinedColumnSchema();
if (object.name != null)
message.name = String(object.name);
switch (object.type) {
case "DCT_INTEGER":
case 1:
message.type = 1;
break;
case "DCT_DOUBLE":
case 2:
message.type = 2;
break;
case "DCT_BOOLEAN":
case 3:
message.type = 3;
break;
case "DCT_STRING":
case 4:
message.type = 4;
break;
case "DCT_BLOB":
case 7:
message.type = 7;
break;
}
return message;
};
/**
* Creates a plain object from a DefinedColumnSchema message. Also converts values to other types if specified.
* @function toObject
* @memberof main.proto.DefinedColumnSchema
* @static
* @param {main.proto.DefinedColumnSchema} message DefinedColumnSchema
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
DefinedColumnSchema.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.name = "";
object.type = options.enums === String ? "DCT_INTEGER" : 1;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.type != null && message.hasOwnProperty("type"))
object.type = options.enums === String ? $root.main.proto.DefinedColumnType[message.type] : message.type;
return object;
};
/**
* Converts this DefinedColumnSchema to JSON.
* @function toJSON
* @memberof main.proto.DefinedColumnSchema
* @instance
* @returns {Object.<string,*>} JSON object
*/
DefinedColumnSchema.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return DefinedColumnSchema;
})();
proto.PartitionRange = (function() {
/**
* Properties of a PartitionRange.
* @memberof main.proto
* @interface IPartitionRange
* @property {Uint8Array} begin PartitionRange begin
* @property {Uint8Array} end PartitionRange end
*/
/**
* Constructs a new PartitionRange.
* @memberof main.proto
* @classdesc Represents a PartitionRange.
* @implements IPartitionRange
* @constructor
* @param {main.proto.IPartitionRange=} [properties] Properties to set
*/
function PartitionRange(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* PartitionRange begin.
* @member {Uint8Array} begin
* @memberof main.proto.PartitionRange
* @instance
*/
PartitionRange.prototype.begin = $util.newBuffer([]);
/**
* PartitionRange end.
* @member {Uint8Array} end
* @memberof main.proto.PartitionRange
* @instance
*/
PartitionRange.prototype.end = $util.newBuffer([]);
/**
* Creates a new PartitionRange instance using the specified properties.
* @function create
* @memberof main.proto.PartitionRange
* @static
* @param {main.proto.IPartitionRange=} [properties] Properties to set
* @returns {main.proto.PartitionRange} PartitionRange instance
*/
PartitionRange.create = function create(properties) {
return new PartitionRange(properties);
};
/**
* Encodes the specified PartitionRange message. Does not implicitly {@link main.proto.PartitionRange.verify|verify} messages.
* @function encode
* @memberof main.proto.PartitionRange
* @static
* @param {main.proto.IPartitionRange} message PartitionRange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PartitionRange.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.begin);
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.end);
return writer;
};
/**
* Encodes the specified PartitionRange message, length delimited. Does not implicitly {@link main.proto.PartitionRange.verify|verify} messages.
* @function encodeDelimited
* @memberof main.proto.PartitionRange
* @static
* @param {main.proto.IPartitionRange} message PartitionRange message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PartitionRange.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a PartitionRange message from the specified reader or buffer.
* @function decode
* @memberof main.proto.PartitionRange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {main.proto.PartitionRange} PartitionRange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PartitionRange.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.main.proto.PartitionRange();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.begin = reader.bytes();
break;
case 2:
message.end = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
if (!message.hasOwnProperty("begin"))
throw $util.ProtocolError("missing required 'begin'", { instance: message });
if (!message.hasOwnProperty("end"))
throw $util.ProtocolError("missing required 'end'", { instance: message });
return message;
};
/**
* Decodes a PartitionRange message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof main.proto.PartitionRange
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {main.proto.PartitionRange} PartitionRange
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PartitionRange.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a PartitionRange message.
* @function verify
* @memberof main.proto.PartitionRange
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
PartitionRange.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (!(message.begin && typeof message.begin.length === "number" || $util.isString(message.begin)))
return "begin: buffer expected";
if (!(message.end && typeof message.end.length === "number" || $util.isString(message.end)))
return "end: buffer expected";
return null;
};
/**
* Creates a PartitionRange message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof main.proto.PartitionRange
* @static
* @param {Object.<string,*>} object Plain object
* @returns {main.proto.PartitionRange} PartitionRange
*/
PartitionRange.fromObject = function fromObject(object) {
if (object instanceof $root.main.proto.PartitionRange)
return object;
var message = new $root.main.proto.PartitionRange();
if (object.begin != null)
if (typeof object.begin === "string")
$util.base64.decode(object.begin, message.begin = $util.newBuffer($util.base64.length(object.begin)), 0);
else if (object.begin.length)
message.begin = object.begin;
if (object.end != null)
if (typeof object.end === "string")
$util.base64.decode(object.end, message.end = $util.newBuffer($util.base64.length(object.end)), 0);
else if (object.end.length)
message.end = object.end;
return message;
};
/**
* Creates a plain object from a PartitionRange message. Also converts values to other types if specified.
* @function toObject
* @memberof main.proto.PartitionRange
* @static
* @param {main.proto.PartitionRange} message PartitionRange
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
PartitionRange.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if (options.bytes === String)
object.begin = "";
else {
object.begin = [];
if (options.bytes !== Array)
object.begin = $util.newBuffer(object.begin);
}
if (options.bytes === String)
object.end = "";
else {
object.end = [];
if (options.bytes !== Array)
object.end = $util.newBuffer(object.end);
}
}
if (message.begin != null && message.hasOwnProperty("begin"))
object.begin = options.bytes === String ? $util.base64.encode(message.begin, 0, message.begin.length) : options.bytes === Array ? Array.prototype.slice.call(message.begin) : message.begin;
if (message.end != null && message.hasOwnProperty("end"))
object.end = options.bytes === String ? $util.base64.encode(message.end, 0, message.end.length) : options.bytes === Array ? Array.prototype.slice.call(message.end) : message.end;
return object;
};
/**
* Converts this PartitionRange to JSON.
* @function toJSON
* @memberof main.proto.PartitionRange
* @instance
* @returns {Object.<string,*>} JSON object
*/
PartitionRange.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return PartitionRange;
})();
/**
* BloomFilterType enum.
* @name main.proto.BloomFilterType
* @enum {number}
* @property {number} NONE=1 NONE value
* @property {number} CELL=2 CELL value
* @property {number} ROW=3 ROW value
*/
proto.BloomFilterType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "NONE"] = 1;
values[valuesById[2] = "CELL"] = 2;
values[valuesById[3] = "ROW"] = 3;
return values;
})();
/**
* DataBlockType enum.
* @name main.proto.DataBlockType
* @enum {number}
* @property {number} DBT_PLAIN_BUFFER=0 DBT_PLAIN_BUFFER value
* @property {number} DBT_SIMPLE_ROW_MATRIX=1 DBT_SIMPLE_ROW_MATRIX value
*/
proto.DataBlockType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "DBT_PLAIN_BUFFER"] = 0;
values[valuesById[1] = "DBT_SIMPLE_ROW_MATRIX"] = 1;
return values;
})();
/**
* CompressType enum.
* @name main.proto.CompressType
* @enum {number}
* @property {number} CPT_NONE=0 CPT_NONE value
*/
proto.CompressType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "CPT_NONE"] = 0;
return values;
})();
proto.TableOptions = (function() {
/**
* Properties of a TableOptions.
* @memberof main.proto
* @interface ITableOptions
* @property {number|null} [timeToLive] TableOptions timeToLive
* @property {number|null} [maxVersions] TableOptions maxVersions
* @property {main.proto.BloomFilterType|null} [bloomFilterType] TableOptions bloomFilterType
* @property {number|null} [blockSize] TableOptions blockSize
* @property {number|Long|null} [deviationCellVersionInSec] TableOptions deviationCellVersionInSec
* @property {boolean|null} [allowUpdate] TableOptions allowUpdate
*/
/**
* Constructs a new TableOptions.
* @memberof main.proto
* @classdesc Represents a TableOptions.
* @implements ITableOptions
* @constructor
* @param {main.proto.ITableOptions=} [properties] Properties to set
*/
function TableOptions(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* TableOptions timeToLive.
* @member {number} timeToLive
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.timeToLive = 0;
/**
* TableOptions maxVersions.
* @member {number} maxVersions
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.maxVersions = 0;
/**
* TableOptions bloomFilterType.
* @member {main.proto.BloomFilterType} bloomFilterType
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.bloomFilterType = 1;
/**
* TableOptions blockSize.
* @member {number} blockSize
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.blockSize = 0;
/**
* TableOptions deviationCellVersionInSec.
* @member {number|Long} deviationCellVersionInSec
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.deviationCellVersionInSec = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* TableOptions allowUpdate.
* @member {boolean} allowUpdate
* @memberof main.proto.TableOptions
* @instance
*/
TableOptions.prototype.allowUpdate = false;
/**
* Creates a new TableOptions instance using the specified properties.
* @function create
* @memberof main.proto.TableOptions
* @static
* @para